From 0d9416d3bfa659808fbb987bc8bc21dcba1f6f80 Mon Sep 17 00:00:00 2001 From: Peter Kasting Date: Mon, 26 Jul 2021 20:56:20 -0700 Subject: [PATCH 001/195] Fix some instances of -Wunreachable-code-aggressive. Bug: chromium:1066980 Change-Id: Ie95754402ce30bbd4bfcfc0c0150f07d2e3008f6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3055796 Reviewed-by: Nelson Billing --- src/tools/linux/md2core/minidump-2-core.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 38d6d2bf0..7549d3ad9 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -154,11 +154,9 @@ SetupOptions(int argc, const char* argv[], Options* options) { case 'h': Usage(argc, argv); exit(0); - break; case '?': Usage(argc, argv); exit(1); - break; case 'f': options->use_filename = true; From 4f5b814790301e7b8252535e0732bee11f4bb801 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 3 Aug 2021 14:26:38 -0700 Subject: [PATCH 002/195] Add INLINE and INLINE_ORIGIN records to symbol file. The size of symbol file for chrome binary increased from 577 MB to 1205 MB. There are 7,453,748 INLINE records and 1,268,493 INLINE_ORIGIN records. Bug: 1190878 Change-Id: I802ec1b4574c14f74ff80d0f69daf3c81085778a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2915828 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 339 +++++++++++++++++--- src/common/dwarf_cu_to_module.h | 9 +- src/common/dwarf_cu_to_module_unittest.cc | 16 +- src/common/dwarf_line_to_module.cc | 4 +- src/common/dwarf_line_to_module.h | 13 +- src/common/dwarf_line_to_module_unittest.cc | 57 ++-- src/common/linux/dump_symbols.cc | 9 +- src/common/mac/dump_syms.cc | 13 +- src/common/module.cc | 66 +++- src/common/module.h | 63 ++++ src/tools/linux/dump_syms/dump_syms.cc | 8 +- 11 files changed, 511 insertions(+), 86 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index d129fba4f..e3bd9414b 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -58,6 +59,7 @@ using std::map; using std::pair; using std::sort; using std::vector; +using std::unique_ptr; // Data provided by a DWARF specification DIE. // @@ -98,6 +100,71 @@ struct AbstractOrigin { typedef map AbstractOriginByOffset; +using InlineOriginByOffset = map; + +class InlineOriginMap { + public: + Module::InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, + const string& name) { + uint64_t specification_offset = references_[offset]; + if (inline_origins_.find(specification_offset) != inline_origins_.end()) { + if (inline_origins_[specification_offset]->name == "") { + inline_origins_[specification_offset]->name = name; + } + return inline_origins_[specification_offset]; + } + inline_origins_[specification_offset] = new Module::InlineOrigin(name); + return inline_origins_[specification_offset]; + } + + // offset is the offset of a DW_TAG_subprogram. specification_offset is the + // value of its DW_AT_specification or equals to offset if DW_AT_specification + // doesn't exist in that DIE. + void SetReference(uint64_t offset, uint64_t specification_offset) { + // If we haven't seen this doesn't exist in reference map, always add it. + if (references_.find(offset) == references_.end()) { + references_[offset] = specification_offset; + return; + } + // If offset equals specification_offset and offset exists in references_, + // there is no need to update the references_ map. This early return is + // necessary because the call to erase in following if will remove the entry + // of specification_offset in inline_origins_. + // If specification_offset equals to references_[offset], it might be + // duplicate debug info. + if (offset == specification_offset || + specification_offset == references_[offset]) + return; + + // Fix up mapping in inline_origins_. + auto remove = inline_origins_.find(references_[offset]); + if (remove != inline_origins_.end()) { + inline_origins_[specification_offset] = remove->second; + inline_origins_.erase(remove); + } + references_[offset] = specification_offset; + } + + void AssignFilesToInlineOrigins(vector& inline_origin_offsets, + Module::File* file) { + for (uint64_t offset : inline_origin_offsets) + if (references_.find(offset) != references_.end()) { + auto origin = inline_origins_.find(references_[offset]); + if (origin != inline_origins_.end()) + origin->second->file = file; + } + } + + private: + // A map from a DW_TAG_subprogram's offset to the DW_TAG_subprogram. + InlineOriginByOffset inline_origins_; + + // A map from a DW_TAG_subprogram's offset to the offset of its specification + // or abstract origin subprogram. The set of values in this map should always + // be the same set of keys in inline_origins_. + map references_; +}; + // Data global to the DWARF-bearing file that is private to the // DWARF-to-Module process. struct DwarfCUToModule::FilePrivate { @@ -130,6 +197,8 @@ struct DwarfCUToModule::FilePrivate { // Keep a list of forward references from DW_AT_abstract_origin and // DW_AT_specification attributes so names can be fixed up. std::map forward_ref_die_to_func; + + InlineOriginMap inline_origin_map; }; DwarfCUToModule::FileContext::FileContext(const string& filename, @@ -272,6 +341,9 @@ struct DwarfCUToModule::CUContext { // A map of function pointers to the its forward specification DIE's offset. map spec_function_offsets; + + // From file index to vector of subprogram's offset in this CU. + map> inline_origins; }; // Information about the context of a particular DIE. This is for @@ -304,7 +376,8 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { offset_(offset), declaration_(false), specification_(NULL), - forward_ref_die_offset_(0) { } + abstract_origin_(NULL), + forward_ref_die_offset_(0), specification_offset_(0) { } // Derived classes' ProcessAttributeUnsigned can defer to this to // handle DW_AT_declaration, or simply not override it. @@ -356,11 +429,19 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { // Otherwise, this is NULL. Specification* specification_; + // If this DIE has a DW_AT_abstract_origin attribute, this is the + // AbstractOrigin structure for the DIE the attribute refers to. + // Otherwise, this is NULL. + const AbstractOrigin* abstract_origin_; + // If this DIE has a DW_AT_specification or DW_AT_abstract_origin and it is a // forward reference, no Specification will be available. Track the reference // to be fixed up when the DIE is parsed. uint64_t forward_ref_die_offset_; + // The root offset of Specification or abstract origin. + uint64_t specification_offset_; + // The value of the DW_AT_name attribute, or the empty string if the // DIE has no such attribute. string name_attribute_; @@ -412,6 +493,21 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( } else { cu_context_->reporter->UnknownSpecification(offset_, data); } + specification_offset_ = data; + break; + } + case DW_AT_abstract_origin: { + const AbstractOriginByOffset& origins = + cu_context_->file_context->file_private_->origins; + AbstractOriginByOffset::const_iterator origin = origins.find(data); + if (origin != origins.end()) { + abstract_origin_ = &(origin->second); + } else if (data > offset_) { + forward_ref_die_offset_ = data; + } else { + cu_context_->reporter->UnknownAbstractOrigin(offset_, data); + } + specification_offset_ = data; break; } default: break; @@ -519,6 +615,163 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { return return_value; } +static bool IsEmptyRange(const vector& ranges) { + uint64_t size = accumulate(ranges.cbegin(), ranges.cend(), 0, + [](uint64_t total, Module::Range entry) { + return total + entry.size; + } + ); + + return size == 0; +} + + +// A handler for DW_TAG_inlined_subroutine DIEs. +class DwarfCUToModule::InlineHandler : public GenericDIEHandler { + public: + InlineHandler(CUContext* cu_context, + DIEContext* parent_context, + uint64_t offset, + int inline_nest_level, + vector>& inlines) + : GenericDIEHandler(cu_context, parent_context, offset), + low_pc_(0), + high_pc_(0), + high_pc_form_(DW_FORM_addr), + ranges_form_(DW_FORM_sec_offset), + ranges_data_(0), + call_site_line_(0), + inline_nest_level_(inline_nest_level), + inlines_(inlines) {} + + void ProcessAttributeUnsigned(enum DwarfAttribute attr, + enum DwarfForm form, + uint64_t data); + DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); + bool EndAttributes(); + void Finish(); + + private: + // The fully-qualified name, as derived from name_attribute_, + // specification_, parent_context_. Computed in EndAttributes. + string name_; + uint64_t low_pc_; // DW_AT_low_pc + uint64_t high_pc_; // DW_AT_high_pc + DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. + DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx + uint64_t ranges_data_; // DW_AT_ranges + int call_site_line_; + int inline_nest_level_; + // A vector of inlines in the same nest level. It's owned by its parent + // function/inline. At Finish(), add this inline into the vector. + vector>& inlines_; + // A vector of child inlines. + vector> child_inlines_; +}; + +void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned( + enum DwarfAttribute attr, + enum DwarfForm form, + uint64_t data) { + switch (attr) { + case DW_AT_low_pc: + low_pc_ = data; + break; + case DW_AT_high_pc: + high_pc_form_ = form; + high_pc_ = data; + break; + case DW_AT_ranges: + ranges_data_ = data; + ranges_form_ = form; + break; + case DW_AT_call_line: + call_site_line_ = data; + break; + default: + GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); + break; + } +} + +DIEHandler* DwarfCUToModule::InlineHandler::FindChildHandler( + uint64_t offset, + enum DwarfTag tag) { + switch (tag) { + case DW_TAG_inlined_subroutine: + return new InlineHandler(cu_context_, new DIEContext(), offset, + inline_nest_level_ + 1, child_inlines_); + default: + return NULL; + } +} + +bool DwarfCUToModule::InlineHandler::EndAttributes() { + if (abstract_origin_) + name_ = abstract_origin_->name; + if (name_.empty()) { + // We haven't seen the abstract origin yet, which might appears later and we + // will fix the name after calling + // InlineOriginMap::GetOrCreateInlineOrigin with right name. + name_ = ""; + } + return true; +} + +void DwarfCUToModule::InlineHandler::Finish() { + vector ranges; + + if (low_pc_ && high_pc_) { + if (high_pc_form_ != DW_FORM_addr && + high_pc_form_ != DW_FORM_GNU_addr_index && + high_pc_form_ != DW_FORM_addrx && + high_pc_form_ != DW_FORM_addrx1 && + high_pc_form_ != DW_FORM_addrx2 && + high_pc_form_ != DW_FORM_addrx3 && + high_pc_form_ != DW_FORM_addrx4) { + high_pc_ += low_pc_; + } + + Module::Range range(low_pc_, high_pc_ - low_pc_); + ranges.push_back(range); + } else { + RangesHandler* ranges_handler = cu_context_->ranges_handler; + if (ranges_handler) { + RangeListReader::CURangesInfo cu_info; + if (cu_context_->AssembleRangeListInfo(&cu_info)) { + if (!ranges_handler->ReadRanges(ranges_form_, ranges_data_, + &cu_info, &ranges)) { + ranges.clear(); + cu_context_->reporter->MalformedRangeList(ranges_data_); + } + } else { + cu_context_->reporter->MissingRanges(); + } + } + } + + // Malformed DWARF may omit the name, but all Module::Functions must + // have names. + // If we have a forward reference to a DW_AT_specification or + // DW_AT_abstract_origin, then don't warn, the name will be fixed up + // later + if (name_.empty() && forward_ref_die_offset_ == 0) + cu_context_->reporter->UnnamedFunction(offset_); + + // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. + assert(specification_offset_ != 0); + + cu_context_->file_context->file_private_->inline_origin_map.SetReference( + specification_offset_, specification_offset_); + Module::InlineOrigin* origin = + cu_context_->file_context->file_private_->inline_origin_map + .GetOrCreateInlineOrigin(specification_offset_, name_); + unique_ptr in = std::make_unique( + origin, ranges, call_site_line_, inline_nest_level_, + std::move(child_inlines_)); + inlines_.push_back(std::move(in)); +} + // A handler class for DW_TAG_subprogram DIEs. class DwarfCUToModule::FuncHandler: public GenericDIEHandler { public: @@ -527,7 +780,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { : GenericDIEHandler(cu_context, parent_context, offset), low_pc_(0), high_pc_(0), high_pc_form_(DW_FORM_addr), ranges_form_(DW_FORM_sec_offset), ranges_data_(0), - abstract_origin_(NULL), inline_(false) { } + decl_file_data_(UINT64_MAX), inline_(false) { } void ProcessAttributeUnsigned(enum DwarfAttribute attr, enum DwarfForm form, @@ -535,10 +788,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { void ProcessAttributeSigned(enum DwarfAttribute attr, enum DwarfForm form, int64_t data); - void ProcessAttributeReference(enum DwarfAttribute attr, - enum DwarfForm form, - uint64_t data); - + DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); bool EndAttributes(); void Finish(); @@ -550,8 +800,10 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx uint64_t ranges_data_; // DW_AT_ranges - const AbstractOrigin* abstract_origin_; + // DW_AT_decl_file, value of UINT64_MAX means undefined. + uint64_t decl_file_data_; bool inline_; + vector> child_inlines_; }; void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( @@ -573,7 +825,9 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( ranges_data_ = data; ranges_form_ = form; break; - + case DW_AT_decl_file: + decl_file_data_ = data; + break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -595,27 +849,15 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeSigned( } } -void DwarfCUToModule::FuncHandler::ProcessAttributeReference( - enum DwarfAttribute attr, - enum DwarfForm form, - uint64_t data) { - switch (attr) { - case DW_AT_abstract_origin: { - const AbstractOriginByOffset& origins = - cu_context_->file_context->file_private_->origins; - AbstractOriginByOffset::const_iterator origin = origins.find(data); - if (origin != origins.end()) { - abstract_origin_ = &(origin->second); - } else if (data > offset_) { - forward_ref_die_offset_ = data; - } else { - cu_context_->reporter->UnknownAbstractOrigin(offset_, data); - } - break; - } +DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler( + uint64_t offset, + enum DwarfTag tag) { + switch (tag) { + case DW_TAG_inlined_subroutine: + return new InlineHandler(cu_context_, new DIEContext(), offset, 0, + child_inlines_); default: - GenericDIEHandler::ProcessAttributeReference(attr, form, data); - break; + return NULL; } } @@ -628,16 +870,6 @@ bool DwarfCUToModule::FuncHandler::EndAttributes() { return true; } -static bool IsEmptyRange(const vector& ranges) { - uint64_t size = accumulate(ranges.cbegin(), ranges.cend(), 0, - [](uint64_t total, Module::Range entry) { - return total + entry.size; - } - ); - - return size == 0; -} - void DwarfCUToModule::FuncHandler::Finish() { vector ranges; @@ -683,11 +915,12 @@ void DwarfCUToModule::FuncHandler::Finish() { } } + bool empty_range = IsEmptyRange(ranges); // Did we collect the information we need? Not all DWARF function // entries are non-empty (for example, inlined functions that were never // used), but all the ones we're interested in cover a non-empty range of // bytes. - if (!IsEmptyRange(ranges)) { + if (!empty_range) { low_pc_ = ranges.front().address; // Malformed DWARF may omit the name, but all Module::Functions must @@ -721,11 +954,27 @@ void DwarfCUToModule::FuncHandler::Finish() { cu_context_->spec_function_offsets[cu_context_->functions.back()] = forward_ref_die_offset_; } + + cu_context_->functions.back()->inlines.swap(child_inlines_); } } else if (inline_) { AbstractOrigin origin(name_); cu_context_->file_context->file_private_->origins[offset_] = origin; } + + // Only keep track of DW_TAG_subprogram which have the attributes we are + // interested. + if (!empty_range || inline_ || decl_file_data_ != UINT64_MAX) { + uint64_t offset = + specification_offset_ != 0 ? specification_offset_ : offset_; + cu_context_->file_context->file_private_->inline_origin_map.SetReference( + offset_, offset); + cu_context_->file_context->file_private_->inline_origin_map + .GetOrCreateInlineOrigin(offset_, + name_.empty() ? "" : name_); + if (decl_file_data_ != UINT64_MAX) + cu_context_->inline_origins[decl_file_data_].push_back(offset_); + } } // A handler for DIEs that contain functions and contribute a @@ -1041,7 +1290,7 @@ void DwarfCUToModule::ReadSourceLines(uint64_t offset) { line_section_start, line_section_length, string_section_start, string_section_length, line_string_section_start, line_string_section_length, - cu_context_->file_context->module_, &lines_); + cu_context_->file_context->module_, &lines_, &files_); } namespace { @@ -1300,6 +1549,14 @@ void DwarfCUToModule::AssignLinesToFunctions() { } } +void DwarfCUToModule::AssignFilesToInlines() { + for (auto iter : files_) { + cu_context_->file_context->file_private_->inline_origin_map + .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], + iter.second); + } +} + void DwarfCUToModule::Finish() { // Assembly language files have no function data, and that gives us // no place to store our line numbers (even though the GNU toolchain @@ -1318,6 +1575,8 @@ void DwarfCUToModule::Finish() { // Dole out lines to the appropriate functions. AssignLinesToFunctions(); + AssignFilesToInlines(); + // Add our functions, which now have source lines assigned to them, // to module_, and remove duplicate functions. for (Module::Function* func : *functions) diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index 1320ccc2c..99dcd8791 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -156,7 +156,8 @@ class DwarfCUToModule: public RootDIEHandler { uint64_t string_section_length, const uint8_t* line_string_section, uint64_t line_string_length, - Module* module, vector* lines) = 0; + Module* module, vector* lines, + map* files) = 0; }; // The interface DwarfCUToModule uses to report warnings. The member @@ -289,6 +290,7 @@ class DwarfCUToModule: public RootDIEHandler { struct Specification; class GenericDIEHandler; class FuncHandler; + class InlineHandler; class NamedScopeHandler; // A map from section offsets to specifications. @@ -309,6 +311,8 @@ class DwarfCUToModule: public RootDIEHandler { // lines belong to which functions, beyond their addresses.) void AssignLinesToFunctions(); + void AssignFilesToInlines(); + // The only reason cu_context_ and child_context_ are pointers is // that we want to keep their definitions private to // dwarf_cu_to_module.cc, instead of listing them all here. They are @@ -335,6 +339,9 @@ class DwarfCUToModule: public RootDIEHandler { // during parsing. Then, in Finish, we call AssignLinesToFunctions // to dole them out to the appropriate functions. vector lines_; + + // The map from file index to File* in this CU. + std::map files_; }; } // namespace google_breakpad diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index 2ce69d73c..cb943ae3f 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -67,12 +67,13 @@ using ::testing::ValuesIn; class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler { public: MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir)); - MOCK_METHOD8(ReadProgram, void(const uint8_t* program, uint64_t length, + MOCK_METHOD9(ReadProgram, void(const uint8_t* program, uint64_t length, const uint8_t* string_section, uint64_t string_section_length, const uint8_t* line_string_section, uint64_t line_string_section_length, - Module* module, vector* lines)); + Module* module, vector* lines, + std::map* files)); }; class MockWarningReporter: public DwarfCUToModule::WarningReporter { @@ -122,7 +123,8 @@ class CUFixtureBase { uint64_t string_section_length, const uint8_t* line_string_section, uint64_t line_string_section_length, - Module *module, vector* lines) { + Module *module, vector* lines, + std::map* files) { lines->insert(lines->end(), lines_->begin(), lines_->end()); } private: @@ -155,7 +157,7 @@ class CUFixtureBase { // By default, expect the line program reader not to be invoked. We // may override this in StartCU. EXPECT_CALL(line_reader_, StartCompilationUnit(_)).Times(0); - EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); + EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); // The handler will consult this section map to decide what to // pass to our line reader. @@ -341,7 +343,7 @@ void CUFixtureBase::StartCU() { EXPECT_CALL(line_reader_, ReadProgram(&dummy_line_program_[0], dummy_line_size_, _,_,_,_, - &module_, _)) + &module_, _,_)) .Times(AtMost(1)) .WillOnce(DoAll(Invoke(appender_), Return())); ASSERT_TRUE(root_handler_ @@ -1517,7 +1519,7 @@ TEST_F(Specifications, InterCU) { DwarfCUToModule::FileContext fc("dwarf-filename", &m, true); EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return()); MockLineToModuleHandler lr; - EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); + EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); // Kludge: satisfy reporter_'s expectation. reporter_.SetCUName("compilation-unit-name"); @@ -1576,7 +1578,7 @@ TEST_F(Specifications, UnhandledInterCU) { DwarfCUToModule::FileContext fc("dwarf-filename", &m, false); EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return()); MockLineToModuleHandler lr; - EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); + EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); // Kludge: satisfy reporter_'s expectation. reporter_.SetCUName("compilation-unit-name"); diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc index fe808c086..83bb8f155 100644 --- a/src/common/dwarf_line_to_module.cc +++ b/src/common/dwarf_line_to_module.cc @@ -100,7 +100,7 @@ void DwarfLineToModule::DefineFile(const string& name, int32_t file_num, // Find a Module::File object of the given name, and add it to the // file table. - files_[file_num] = module_->FindFile(full_name); + (*files_)[file_num] = module_->FindFile(full_name); } void DwarfLineToModule::AddLine(uint64_t address, uint64_t length, @@ -122,7 +122,7 @@ void DwarfLineToModule::AddLine(uint64_t address, uint64_t length, } // Find the source file being referred to. - Module::File *file = files_[file_num]; + Module::File *file = (*files_)[file_num]; if (!file) { if (!warned_bad_file_number_) { fprintf(stderr, "warning: DWARF line number data refers to " diff --git a/src/common/dwarf_line_to_module.h b/src/common/dwarf_line_to_module.h index 8e7a0b0dc..da2c5f0ec 100644 --- a/src/common/dwarf_line_to_module.h +++ b/src/common/dwarf_line_to_module.h @@ -120,16 +120,19 @@ class DwarfLineToModule: public LineInfoHandler { // end of the address space, we clip it. It's up to our client to // sort out which lines belong to which functions; we don't add them // to any particular function in MODULE ourselves. - DwarfLineToModule(Module *module, const string& compilation_dir, - vector* lines) + DwarfLineToModule(Module* module, + const string& compilation_dir, + vector* lines, + std::map* files) : module_(module), compilation_dir_(compilation_dir), lines_(lines), + files_(files), highest_file_number_(-1), omitted_line_end_(0), warned_bad_file_number_(false), warned_bad_directory_number_(false) { } - + ~DwarfLineToModule() { } void DefineDir(const string& name, uint32_t dir_num); @@ -167,12 +170,12 @@ class DwarfLineToModule: public LineInfoHandler { DirectoryTable directories_; // A table mapping file numbers to Module::File pointers. - FileTable files_; + FileTable* files_; // The highest file number we've seen so far, or -1 if we've seen // none. Used for dynamically defined file numbers. int32_t highest_file_number_; - + // This is the ending address of the last line we omitted, or zero if we // didn't omit the previous line. It is zero before we have received any // AddLine calls. diff --git a/src/common/dwarf_line_to_module_unittest.cc b/src/common/dwarf_line_to_module_unittest.cc index 90b6570d8..34cb02ed4 100644 --- a/src/common/dwarf_line_to_module_unittest.cc +++ b/src/common/dwarf_line_to_module_unittest.cc @@ -45,7 +45,8 @@ using google_breakpad::Module; TEST(SimpleModule, One) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("file1", 0x30bf0f27, 0, 0, 0); h.AddLine(0x6fd126fbf74f2680LL, 0x63c9a14cf556712bLL, 0x30bf0f27, @@ -66,7 +67,8 @@ TEST(SimpleModule, One) { TEST(SimpleModule, Many) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory1", 0x838299ab); h.DefineDir("directory2", 0xf85de023); @@ -126,7 +128,8 @@ TEST(SimpleModule, Many) { TEST(Filenames, Absolute) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory1", 1); h.DefineFile("/absolute", 1, 1, 0, 0); @@ -144,7 +147,8 @@ TEST(Filenames, Absolute) { TEST(Filenames, Relative) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory1", 1); h.DefineFile("relative", 1, 1, 0, 0); @@ -162,7 +166,8 @@ TEST(Filenames, Relative) { TEST(Filenames, StrangeFile) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory1", 1); h.DefineFile("", 1, 1, 0, 0); @@ -175,7 +180,8 @@ TEST(Filenames, StrangeFile) { TEST(Filenames, StrangeDirectory) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("", 1); h.DefineFile("file1", 1, 1, 0, 0); @@ -188,7 +194,8 @@ TEST(Filenames, StrangeDirectory) { TEST(Filenames, StrangeDirectoryAndFile) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("", 1); h.DefineFile("", 1, 1, 0, 0); @@ -203,7 +210,8 @@ TEST(Filenames, StrangeDirectoryAndFile) { TEST(Filenames, DirectoryZeroFileIsRelativeToCompilationDir) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "src/build", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "src/build", &lines, &cu_files); h.DefineDir("Dir", 1); h.DefineFile("File", 1, 0, 0, 0); @@ -219,7 +227,8 @@ TEST(Filenames, DirectoryZeroFileIsRelativeToCompilationDir) { TEST(Filenames, IncludeDirectoryRelativeToDirectoryZero) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "src/build", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "src/build", &lines, &cu_files); h.DefineDir("Dir", 1); h.DefineFile("File", 1, 1, 0, 0); @@ -235,7 +244,8 @@ TEST(Filenames, IncludeDirectoryRelativeToDirectoryZero) { TEST(Filenames, IncludeDirectoryAbsolute) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "src/build", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "src/build", &lines, &cu_files); h.DefineDir("/Dir", 1); h.DefineFile("File", 1, 1, 0, 0); @@ -251,7 +261,8 @@ TEST(Filenames, IncludeDirectoryAbsolute) { TEST(ModuleErrors, DirectoryZero) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory0", 0); // should be ignored h.DefineFile("relative", 1, 0, 0, 0); @@ -267,7 +278,8 @@ TEST(ModuleErrors, DirectoryZero) { TEST(ModuleErrors, BadFileNumber) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("relative", 1, 0, 0, 0); h.AddLine(1, 1, 2, 0, 0); // bad file number @@ -281,7 +293,8 @@ TEST(ModuleErrors, BadFileNumber) { TEST(ModuleErrors, BadDirectoryNumber) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineDir("directory1", 1); h.DefineFile("baddirnumber1", 1, 2, 0, 0); // bad directory number @@ -296,7 +309,8 @@ TEST(ModuleErrors, BadDirectoryNumber) { TEST(ModuleErrors, EmptyLine) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(1, 0, 1, 0, 0); @@ -309,7 +323,8 @@ TEST(ModuleErrors, EmptyLine) { TEST(ModuleErrors, BigLine) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(0xffffffffffffffffULL, 2, 1, 0, 0); @@ -326,7 +341,8 @@ TEST(ModuleErrors, BigLine) { TEST(Omitted, DroppedThenGood) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(0, 10, 1, 83816211, 0); // should be omitted @@ -339,7 +355,8 @@ TEST(Omitted, DroppedThenGood) { TEST(Omitted, GoodThenDropped) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(0x9dd6a372, 10, 1, 41454594, 0); // should be recorded @@ -352,7 +369,8 @@ TEST(Omitted, GoodThenDropped) { TEST(Omitted, Mix1) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(0x679ed72f, 10, 1, 58932642, 0); // should be recorded @@ -373,7 +391,8 @@ TEST(Omitted, Mix1) { TEST(Omitted, Mix2) { Module m("name", "os", "architecture", "id"); vector lines; - DwarfLineToModule h(&m, "/", &lines); + std::map cu_files; + DwarfLineToModule h(&m, "/", &lines, &cu_files); h.DefineFile("filename1", 1, 0, 0, 0); h.AddLine(0, 0xf2, 1, 58802211, 0); // should be omitted diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 5909d6ba1..92a260baf 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -260,13 +260,16 @@ class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler { void StartCompilationUnit(const string& compilation_dir) { compilation_dir_ = compilation_dir; } - void ReadProgram(const uint8_t* program, uint64_t length, + void ReadProgram(const uint8_t* program, + uint64_t length, const uint8_t* string_section, uint64_t string_section_length, const uint8_t* line_string_section, uint64_t line_string_section_length, - Module* module, std::vector* lines) { - DwarfLineToModule handler(module, compilation_dir_, lines); + Module* module, + std::vector* lines, + std::map* files) { + DwarfLineToModule handler(module, compilation_dir_, lines, files); google_breakpad::LineInfo parser(program, length, byte_reader_, string_section, string_section_length, line_string_section, diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index e30d8ea95..3592e4bb1 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -351,15 +351,18 @@ class DumpSymbols::DumperLineToModule: compilation_dir_ = compilation_dir; } - void ReadProgram(const uint8_t* program, uint64_t length, + void ReadProgram(const uint8_t* program, + uint64_t length, const uint8_t* string_section, uint64_t string_section_length, const uint8_t* line_string_section, uint64_t line_string_section_length, - Module* module, vector* lines) { - DwarfLineToModule handler(module, compilation_dir_, lines); - LineInfo parser(program, length, byte_reader_, - nullptr, 0, nullptr, 0, &handler); + Module* module, + vector* lines, + std::map* files) { + DwarfLineToModule handler(module, compilation_dir_, lines, files); + LineInfo parser(program, length, byte_reader_, nullptr, 0, + nullptr, 0, &handler); parser.Start(); } private: diff --git a/src/common/module.cc b/src/common/module.cc index 0ecf6ca6e..eccd01f09 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -38,14 +38,16 @@ #include #include +#include #include +#include #include namespace google_breakpad { using std::dec; using std::hex; - +using std::unique_ptr; Module::Module(const string& name, const string& os, const string& architecture, const string& id, @@ -214,6 +216,13 @@ void Module::AssignSourceIds() { line_it != func->lines.end(); ++line_it) line_it->file->source_id = 0; } + // Also mark all files cited by inline functions by setting each one's source + // id to zero. + for (InlineOrigin* origin : inline_origins_) + // There are some artificial inline functions which don't belong to + // any file. Those will have file id -1. + if (origin->file) + origin->file->source_id = 0; // Finally, assign source ids to those files that have been marked. // We could have just assigned source id numbers while traversing @@ -227,6 +236,33 @@ void Module::AssignSourceIds() { } } +static void InlineDFS( + vector>& inlines, + std::function&)> const& forEach) { + for (unique_ptr& in : inlines) { + forEach(in); + InlineDFS(in->child_inlines, forEach); + } +} + +void Module::CreateInlineOrigins() { + // Only add origins that have file and deduplicate origins with same name and + // file id by doing a DFS. + auto addInlineOrigins = [&](unique_ptr &in) { + auto it = inline_origins_.find(in->origin); + if (it == inline_origins_.end()) + inline_origins_.insert(in->origin); + else + in->origin = *it; + }; + for (Function* func : functions_) + InlineDFS(func->inlines, addInlineOrigins); + int next_id = 0; + for (InlineOrigin* origin: inline_origins_) { + origin->id = next_id++; + } +} + bool Module::ReportError() { fprintf(stderr, "error writing symbol file: %s\n", strerror(errno)); @@ -267,6 +303,8 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } if (symbol_data & SYMBOLS_AND_FILES) { + if (symbol_data & INLINES) + CreateInlineOrigins(); AssignSourceIds(); // Write out files. @@ -279,8 +317,17 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { return ReportError(); } } + // Write out inline origins. + if (symbol_data & INLINES) { + for (InlineOrigin* origin : inline_origins_) { + stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() + << " " << origin->name << "\n"; + if (!stream.good()) + return ReportError(); + } + } - // Write out functions and their lines. + // Write out functions and their inlines and lines. for (FunctionSet::const_iterator func_it = functions_.begin(); func_it != functions_.end(); ++func_it) { Function* func = *func_it; @@ -296,6 +343,21 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { if (!stream.good()) return ReportError(); + // Write out inlines. + if (symbol_data & INLINES) { + auto write_inline = [&](unique_ptr& in) { + stream << "INLINE "; + stream << in->inline_nest_level << " " << in->call_site_line << " " + << in->origin->id << hex; + for (const Range& r : in->ranges) + stream << " " << (r.address - load_address_) << " " << r.size; + stream << dec << "\n"; + }; + InlineDFS(func->inlines, write_inline); + if (!stream.good()) + return ReportError(); + } + while ((line_it != func->lines.end()) && (line_it->address >= range_it->address) && (line_it->address < (range_it->address + range_it->size))) { diff --git a/src/common/module.h b/src/common/module.h index f2fff4909..e8678914f 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -66,6 +67,8 @@ class Module { static constexpr uint64_t kMaxAddress = std::numeric_limits
::max(); struct File; struct Function; + struct InlineOrigin; + struct Inline; struct Line; struct Extern; @@ -120,6 +123,50 @@ class Module { // Source lines belonging to this function, sorted by increasing // address. vector lines; + + // Inlined call sites belonging to this functions. + vector> inlines; + }; + + struct InlineOrigin { + InlineOrigin(const string& name): id(-1), name(name), file(NULL) {} + + // A unique id for each InlineOrigin object. INLINE records use the id to + // refer to its INLINE_ORIGIN record. + int id; + + // The inlined function's name. + string name; + + File* file; + + int getFileID() const { return file ? file->source_id : -1; } + }; + + // A inlined call site. + struct Inline { + Inline(InlineOrigin* origin, + const vector& ranges, + int call_site_line, + int inline_nest_level, + vector> child_inlines) + : origin(origin), + ranges(ranges), + call_site_line(call_site_line), + inline_nest_level(inline_nest_level), + child_inlines(std::move(child_inlines)) {} + + InlineOrigin* origin; + + // The list of addresses and sizes. + vector ranges; + + int call_site_line; + + int inline_nest_level; + + // A list of inlines which are children of this inline. + vector> child_inlines; }; // A source line. @@ -179,6 +226,14 @@ class Module { } }; + struct InlineOriginCompare { + bool operator() (const InlineOrigin* lhs, const InlineOrigin* rhs) const { + if (lhs->getFileID() == rhs->getFileID()) + return lhs->name < rhs->name; + return lhs->getFileID() < rhs->getFileID(); + } + }; + struct ExternCompare { bool operator() (const Extern* lhs, const Extern* rhs) const { return lhs->address < rhs->address; @@ -275,6 +330,10 @@ class Module { // symbol file, at which point we omit any unused files. void AssignSourceIds(); + // This function should be called before AssignSourceIds() to get the set of + // valid InlineOrigins*. + void CreateInlineOrigins(); + // Call AssignSourceIds, and write this module to STREAM in the // breakpad symbol format. Return true if all goes well, or false if // an error occurs. This method writes out: @@ -334,6 +393,9 @@ class Module { // A set containing Function structures, sorted by address. typedef set FunctionSet; + // A set containing Function structures, sorted by address. + typedef set InlineOriginSet; + // A set containing Extern structures, sorted by address. typedef set ExternSet; @@ -342,6 +404,7 @@ class Module { // point to. FileByNameMap files_; // This module's source files. FunctionSet functions_; // This module's functions. + InlineOriginSet inline_origins_; // This module's inline origins. // The module owns all the call frame info entries that have been // added to it. diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index a562bffbf..b0f56e958 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -50,6 +50,7 @@ int usage(const char* self) { fprintf(stderr, "Options:\n"); fprintf(stderr, " -i: Output module header information only.\n"); fprintf(stderr, " -c Do not generate CFI section\n"); + fprintf(stderr, " -d Generate INLINE/INLINE_ORIGIN records\n"); fprintf(stderr, " -r Do not handle inter-compilation " "unit references\n"); fprintf(stderr, " -v Print all warnings to stderr\n"); @@ -64,6 +65,7 @@ int main(int argc, char** argv) { return usage(argv[0]); bool header_only = false; bool cfi = true; + bool handle_inlines = false; bool handle_inter_cu_refs = true; bool log_to_stderr = false; std::string obj_name; @@ -75,6 +77,8 @@ int main(int argc, char** argv) { header_only = true; } else if (strcmp("-c", argv[arg_index]) == 0) { cfi = false; + } else if (strcmp("-d", argv[arg_index]) == 0) { + handle_inlines = true; } else if (strcmp("-r", argv[arg_index]) == 0) { handle_inter_cu_refs = false; } else if (strcmp("-v", argv[arg_index]) == 0) { @@ -127,8 +131,8 @@ int main(int argc, char** argv) { return 1; } } else { - SymbolData symbol_data = - INLINES | (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; + SymbolData symbol_data = (handle_inlines ? INLINES : NO_DATA) | + (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs); if (!WriteSymbolFile(binary, obj_name, obj_os, debug_dirs, options, std::cout)) { From bc7ddae23425cee8999e4e8ed61f77a62f058cbf Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 9 Aug 2021 16:19:46 -0700 Subject: [PATCH 003/195] Don't count str_offsets_table header size before DWARF 5 The header is not present in earlier versions of split dwarf. Change-Id: I8fde233268230cea157b2b3276f3cf05190962f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3083253 Reviewed-by: Sterling Augustine --- src/common/dwarf/dwarf2reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 5850fb7cb..aa4ec2b67 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -457,7 +457,7 @@ void CompilationUnit::ProcessFormStringIndex( uint64_t dieoffset, enum DwarfAttribute attr, enum DwarfForm form, uint64_t str_index) { const size_t kStringOffsetsTableHeaderSize = - reader_->OffsetSize() == 8 ? 16 : 8; + header_.version >= 5 ? (reader_->OffsetSize() == 8 ? 16 : 8) : 0; const uint8_t* str_offsets_table_after_header = str_offsets_base_ ? str_offsets_buffer_ + str_offsets_base_ : str_offsets_buffer_ + kStringOffsetsTableHeaderSize; From 3c70e0145e5c9372ba290885a0c7a342e5ef5a6d Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 16 Aug 2021 11:51:57 -0700 Subject: [PATCH 004/195] mac: conditionally generate inlines Change-Id: I35d7a5e50537bd6f20bcb5a91d386ffee9325b18 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3098093 Reviewed-by: Joshua Peraza --- src/tools/mac/dump_syms/dump_syms_tool.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index df2f49f10..fcbb91695 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -52,7 +52,7 @@ using std::vector; struct Options { Options() : srcPath(), dsymPath(), arch(), header_only(false), - cfi(true), handle_inter_cu_refs(true) {} + cfi(true), handle_inter_cu_refs(true), handle_inlines(false) {} string srcPath; string dsymPath; @@ -60,6 +60,7 @@ struct Options { bool header_only; bool cfi; bool handle_inter_cu_refs; + bool handle_inlines; }; static bool StackFrameEntryComparator(const Module::StackFrameEntry* a, @@ -108,7 +109,8 @@ static void CopyCFIDataBetweenModules(Module* to_module, static bool Start(const Options& options) { SymbolData symbol_data = - INLINES | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; + (options.handle_inlines ? INLINES : NO_DATA) | + (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs); // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the @@ -202,6 +204,7 @@ static void Usage(int argc, const char *argv[]) { "Mach-o file\n"); fprintf(stderr, "\t-c: Do not generate CFI section\n"); fprintf(stderr, "\t-r: Do not handle inter-compilation unit references\n"); + fprintf(stderr, "\t-d: Generate INLINE and INLINE_ORIGIN records\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -236,6 +239,8 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { case 'r': options->handle_inter_cu_refs = false; break; + case 'd': + options->handle_inlines = true; case '?': case 'h': Usage(argc, argv); From 524a6249f0b4dc4e24d38a29a36e1c8ae611d28f Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 18 Aug 2021 09:53:25 -0400 Subject: [PATCH 005/195] mac dump_syms: fix -d option This is a follow-up to 3c70e0145e5c to make -d work. Bug: chromium:1190878,chromium:1238693 Change-Id: Ie0c6c663c98491462fca1aa992503037f19cefa9 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3103526 Reviewed-by: Joshua Peraza --- src/tools/mac/dump_syms/dump_syms_tool.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index fcbb91695..9ff5140bd 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -214,7 +214,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; signed char ch; - while ((ch = getopt(argc, (char * const*)argv, "ia:g:chr?")) != -1) { + while ((ch = getopt(argc, (char * const*)argv, "ia:g:crd?h")) != -1) { switch (ch) { case 'i': options->header_only = true; @@ -241,6 +241,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { break; case 'd': options->handle_inlines = true; + break; case '?': case 'h': Usage(argc, argv); From 4959def222d7e1ff2de0ed0280beb0ba3721c68e Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 19 Aug 2021 11:48:16 -0700 Subject: [PATCH 006/195] Remove usages of make_unique Building fails for some people because configure requires c++11 but make_unique is a c++14 feature. Change-Id: I23ce689fc92e9e90a95e7643ff29602f6b32ccbb Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3107784 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 6 +++--- src/processor/basic_source_line_resolver.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index e3bd9414b..c51514b75 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -766,9 +766,9 @@ void DwarfCUToModule::InlineHandler::Finish() { Module::InlineOrigin* origin = cu_context_->file_context->file_private_->inline_origin_map .GetOrCreateInlineOrigin(specification_offset_, name_); - unique_ptr in = std::make_unique( - origin, ranges, call_site_line_, inline_nest_level_, - std::move(child_inlines_)); + unique_ptr in( + new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, + std::move(child_inlines_))); inlines_.push_back(std::move(in)); } diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 5d4c76214..79ae9965a 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -258,7 +258,7 @@ int BasicSourceLineResolver::Module::ConstructInlineFrames( new_frame.trust = StackFrame::FRAME_TRUST_INLINE; // Must add frames before calling ConstructInlineFrames to get correct order. int current_idx = inlined_frames->size(); - inlined_frames->push_back(std::make_unique(new_frame)); + inlined_frames->push_back(unique_ptr(new StackFrame(new_frame))); int source_line = ConstructInlineFrames(&new_frame, address, in->child_inlines, inlined_frames); if (source_line != -1) { From 7933ec0a69bac134b7cee4b60a5dc80743b2b1a9 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 20 Aug 2021 16:00:30 -0700 Subject: [PATCH 007/195] Remove warning about unknown abstract origin Dwarf generated by Clang -g1 will not have DW_AT_inline attribute for some DW_TAG_subprograms even if they are inlined. This warning recently increased a lot (~ 3 million) due to DW_TAG_inlined_subroutine also complains about unknown abstract origin. It caused infra failure in building bots. Bug: 1241579 Change-Id: I9b5135925b71aa915760c140bcf73fc603bb77d3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3111782 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index c51514b75..dacc9cbe4 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -504,8 +504,6 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( abstract_origin_ = &(origin->second); } else if (data > offset_) { forward_ref_die_offset_ = data; - } else { - cu_context_->reporter->UnknownAbstractOrigin(offset_, data); } specification_offset_ = data; break; @@ -750,14 +748,6 @@ void DwarfCUToModule::InlineHandler::Finish() { } } - // Malformed DWARF may omit the name, but all Module::Functions must - // have names. - // If we have a forward reference to a DW_AT_specification or - // DW_AT_abstract_origin, then don't warn, the name will be fixed up - // later - if (name_.empty() && forward_ref_die_offset_ == 0) - cu_context_->reporter->UnnamedFunction(offset_); - // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. assert(specification_offset_ != 0); @@ -929,11 +919,6 @@ void DwarfCUToModule::FuncHandler::Finish() { if (!name_.empty()) { name = name_; } else { - // If we have a forward reference to a DW_AT_specification or - // DW_AT_abstract_origin, then don't warn, the name will be fixed up - // later - if (forward_ref_die_offset_ == 0) - cu_context_->reporter->UnnamedFunction(offset_); name = ""; } From 5645ad8275f7dfd9e75fe208b7bbdbed819e2adf Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 25 Aug 2021 21:20:02 -0700 Subject: [PATCH 008/195] Modernize MinidumpCrashpadInfo::Print(). Use range-based for-loops where appropriate. Change-Id: I2fffd270d434c90850e8151ee40e5adf0736ce55 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3120666 Reviewed-by: Joshua Peraza --- src/processor/minidump.cc | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index aab0e9fbb..9aef25ec6 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -4983,12 +4983,9 @@ void MinidumpCrashpadInfo::Print() { MDGUIDToString(crashpad_info_.report_id).c_str()); printf(" client_id = %s\n", MDGUIDToString(crashpad_info_.client_id).c_str()); - for (std::map::const_iterator iterator = - simple_annotations_.begin(); - iterator != simple_annotations_.end(); - ++iterator) { - printf(" simple_annotations[\"%s\"] = %s\n", - iterator->first.c_str(), iterator->second.c_str()); + for (const auto& annot : simple_annotations_) { + printf(" simple_annotations[\"%s\"] = %s\n", annot.first.c_str(), + annot.second.c_str()); } for (uint32_t module_index = 0; module_index < module_crashpad_info_links_.size(); @@ -4997,23 +4994,18 @@ void MinidumpCrashpadInfo::Print() { module_index, module_crashpad_info_links_[module_index]); printf(" module_list[%d].version = %d\n", module_index, module_crashpad_info_[module_index].version); - for (uint32_t annotation_index = 0; - annotation_index < - module_crashpad_info_list_annotations_[module_index].size(); + const auto& list_annots = + module_crashpad_info_list_annotations_[module_index]; + for (uint32_t annotation_index = 0; annotation_index < list_annots.size(); ++annotation_index) { - printf(" module_list[%d].list_annotations[%d] = %s\n", - module_index, - annotation_index, - module_crashpad_info_list_annotations_ - [module_index][annotation_index].c_str()); + printf(" module_list[%d].list_annotations[%d] = %s\n", module_index, + annotation_index, list_annots[annotation_index].c_str()); } - for (std::map::const_iterator iterator = - module_crashpad_info_simple_annotations_[module_index].begin(); - iterator != - module_crashpad_info_simple_annotations_[module_index].end(); - ++iterator) { + const auto& simple_annots = + module_crashpad_info_simple_annotations_[module_index]; + for (const auto& annot : simple_annots) { printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n", - module_index, iterator->first.c_str(), iterator->second.c_str()); + module_index, annot.first.c_str(), annot.second.c_str()); } } From e87bb1b3b480d1e44e6a742b8cc0a1698b98494e Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 31 Aug 2021 10:50:11 -0700 Subject: [PATCH 009/195] Make INLINE_ORIGIN positions not important in symbol file This allows INLINE_ORIGIN records appears in after FUNC records. Change-Id: I69b8b5948ed91453e15c7f4c3888dfbe38e7bc5c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3132381 Reviewed-by: Joshua Peraza --- src/processor/basic_source_line_resolver.cc | 19 +++++++++---------- .../source_line_resolver_base_types.h | 14 +++++--------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 79ae9965a..bbaa13318 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -246,12 +246,15 @@ int BasicSourceLineResolver::Module::ConstructInlineFrames( MemAddr inline_base; if (!inlines.RetrieveRange(address, &in, &inline_base, nullptr, nullptr)) return -1; + auto origin = inline_origins_.find(in->origin_id); + if (origin == inline_origins_.end()) + return -1; StackFrame new_frame = StackFrame(*frame); - new_frame.function_name = in->name; + new_frame.function_name = origin->second->name; // Use the starting adress of the inlined range as inlined function base. new_frame.function_base = new_frame.module->base_address() + inline_base; - auto it = files_.find(in->source_file_id); + auto it = files_.find(origin->second->source_file_id); if (it != files_.end()) new_frame.source_file_name = it->second; @@ -417,8 +420,8 @@ bool BasicSourceLineResolver::Module::ParseInlineOrigin( char* origin_name; if (SymbolParseHelper::ParseInlineOrigin(inline_origin_line, &origin_id, &source_file_id, &origin_name)) { - inline_origins_.insert(make_pair( - origin_id, new InlineOrigin(origin_id, source_file_id, origin_name))); + inline_origins_.insert( + make_pair(origin_id, new InlineOrigin(source_file_id, origin_name))); return true; } return false; @@ -432,12 +435,8 @@ BasicSourceLineResolver::Module::ParseInline(char* inline_line) { vector> ranges; if (SymbolParseHelper::ParseInline(inline_line, &inline_nest_level, &call_site_line, &origin_id, &ranges)) { - auto origin = inline_origins_.find(origin_id); - if (origin != inline_origins_.end()) { - return linked_ptr( - new Inline(inline_nest_level, call_site_line, origin->second->name, - origin->second->source_file_id, ranges)); - } + return linked_ptr( + new Inline(inline_nest_level, call_site_line, origin_id, ranges)); } return linked_ptr(); } diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 64cd86e09..3e3afd0ef 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -70,10 +70,9 @@ class SourceLineResolverBase::AutoFileCloser { }; struct SourceLineResolverBase::InlineOrigin { - InlineOrigin(int32_t origin_id, int32_t source_file_id, const string& name) - : origin_id(origin_id), source_file_id(source_file_id), name(name) {} + InlineOrigin(int32_t source_file_id, const string& name) + : source_file_id(source_file_id), name(name) {} - int32_t origin_id; int32_t source_file_id; string name; }; @@ -83,19 +82,16 @@ struct SourceLineResolverBase::Inline { using InlineRanges = std::vector>; Inline(int32_t inline_nest_level, int32_t call_site_line, - const string& name, - int32_t source_file_id, + int32_t origin_id, InlineRanges inline_ranges) : inline_nest_level(inline_nest_level), call_site_line(call_site_line), - name(name), - source_file_id(source_file_id), + origin_id(origin_id), inline_ranges(inline_ranges) {} int32_t inline_nest_level; int32_t call_site_line; - string name; - int32_t source_file_id; + int32_t origin_id; InlineRanges inline_ranges; RangeMap> child_inlines; }; From 4722484bf69875fcf1132023f997cba9fc7bed16 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 2 Sep 2021 22:11:00 -0700 Subject: [PATCH 010/195] Fix compiler errors found with -Wunreachable-code-aggressive. Break statements immediately following returns are unreachable. Bug: chromium:1246232 Change-Id: I0892a66617f7b27b5e317a7d9741f5fcd19249f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3140192 Reviewed-by: Robert Sesek --- src/processor/exploitability_linux.cc | 4 ---- src/processor/exploitability_win.cc | 1 - src/processor/minidump.cc | 1 - 3 files changed, 6 deletions(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 798056dfa..3ec39dd0a 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -212,7 +212,6 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { // Unsupported architecture. Note that ARM architectures are not // supported because objdump does not support ARM. return false; - break; } // Get memory region around instruction pointer and the number of bytes @@ -382,7 +381,6 @@ bool ExploitabilityLinux::CalculateAddress(const string& address_expression, // This should not occur since the same switch condition // should have terminated this method. return false; - break; } // Add or subtract constant from write address (if applicable). @@ -616,10 +614,8 @@ bool ExploitabilityLinux::BenignCrashTrigger( case MD_EXCEPTION_CODE_LIN_SIGSYS: case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED: return true; - break; default: return false; - break; } } diff --git a/src/processor/exploitability_win.cc b/src/processor/exploitability_win.cc index b74a74965..3c1f48953 100644 --- a/src/processor/exploitability_win.cc +++ b/src/processor/exploitability_win.cc @@ -193,7 +193,6 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() { default: BPLOG(INFO) << "Unrecognized access violation type."; return EXPLOITABILITY_ERR_PROCESSING; - break; } MinidumpMemoryRegion* instruction_region = 0; if (memory_available) { diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 9aef25ec6..11a5fc4c6 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1163,7 +1163,6 @@ bool MinidumpContext::Read(uint32_t expected_size) { BPLOG(INFO) << "MinidumpContext unknown context type " << HexString(cpu_type); return false; - break; } } SetContextFlags(context_flags); From 1e093103ca79d862884471e0d3351d976fe4b6f5 Mon Sep 17 00:00:00 2001 From: Brian Sheedy Date: Tue, 7 Sep 2021 13:45:56 -0700 Subject: [PATCH 011/195] Workaround Mac arch issue Temporarily works around an issue on Mac where the system version of NXGetLocalArchInfo is returning x86 information on x86_64 devices, which results in dump_syms failing on said devices. Instead, the Breakpad implementation of NXGetLocalArchInfo, which is meant for dump_syms_mac on Linux, will be used until the system version is fixed. Bug: 1242776 Change-Id: Id398338e580eb9c67c61f9f01670d2e7dbe86bea Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3143524 Reviewed-by: Joshua Peraza --- src/common/mac/arch_utilities.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index c0e4bac54..6d06e6bd0 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -130,7 +130,10 @@ const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type, } // namespace google_breakpad -#ifndef __APPLE__ +// TODO(crbug.com/1242776): The "#ifndef __APPLE__" should be here, but the +// system version of NXGetLocalArchInfo returns incorrect information on +// x86_64 machines (treating them as just x86), so use the Breakpad version +// all the time for now. namespace { enum Architecture { @@ -219,6 +222,8 @@ const NXArchInfo *NXGetLocalArchInfo(void) { return &kKnownArchitectures[arch]; } +#ifndef __APPLE__ + const NXArchInfo *NXGetArchInfoFromName(const char *name) { for (int arch = 0; arch < kNumArchitectures; ++arch) { if (!strcmp(name, kKnownArchitectures[arch].name)) { From 94c42088212898f28ee94ac8ddd850ebe8b19d5a Mon Sep 17 00:00:00 2001 From: Zyan Wu Date: Wed, 8 Sep 2021 17:45:07 +0800 Subject: [PATCH 012/195] fix: minidump-2-core doesn't work for new arm64 dumps The app will check if process_architecture is ARM64_OLD which is 0x8003 but newman is a new arch which is ARM64 (0x12) We can fix the issue by checking both values Test: "/google/src/cloud/zyanwu/latest/google3/blaze-bin/chrome/dongle/platform/tools/minidump --crash_report_id=49ed111b84c0736e --crash_server=crash --build_number=265669 --build_branch=1.56 --product=newman-user --eureka_root=/usr/local/google/home/zyanwu/eureka --symbol_cache_dir=/usr/local/google/home/zyanwu/android/debug/symbols --debug" can work and it can convert the minidump to core dump then load gdb. Bug: 199144156 Change-Id: I1590a5b617e55ae8347aad426ba5b636ff6dcdfb Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3146740 Reviewed-by: Sterling Augustine Reviewed-by: Nelson Billing --- src/tools/linux/md2core/minidump-2-core.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 7549d3ad9..7e351d16f 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -600,7 +600,8 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo, exit(1); } #elif defined(__aarch64__) - if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64_OLD) { + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64_OLD && + sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64) { fprintf(stderr, "This version of minidump-2-core only supports ARM (64bit).\n"); exit(1); From 30020c0d4706a76ea574225650062c6bdb3e67ac Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 16 Sep 2021 15:50:35 -0700 Subject: [PATCH 013/195] Use -d flag enable procecessing DW_TAG_inlined_subroutine This change makes sure dump_syms process DW_TAG_inlined_subroutine only when -d flag is given, which save memory and time when -d is not given. Before this, it always processes DW_TAG_inlined_subroutine and -d determines whether or not to emit INLINE records. Bug: chromium:1250351, chromium:1246974 Change-Id: I54725ba1e513cafe17268ca389ff8acc9c11b25e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166674 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2diehandler.h | 9 ++++--- src/common/dwarf_cu_to_module.cc | 37 ++++++++++++++++----------- src/common/dwarf_cu_to_module.h | 3 ++- src/common/linux/dump_symbols.cc | 6 +++-- src/common/mac/dump_syms.cc | 3 ++- src/common/module.cc | 39 +++++++++++++---------------- 6 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/common/dwarf/dwarf2diehandler.h b/src/common/dwarf/dwarf2diehandler.h index bd8008dd2..5e568eb85 100644 --- a/src/common/dwarf/dwarf2diehandler.h +++ b/src/common/dwarf/dwarf2diehandler.h @@ -258,10 +258,13 @@ class DIEHandler { // A subclass of DIEHandler, with additional kludges for handling the // compilation unit's root die. -class RootDIEHandler: public DIEHandler { +class RootDIEHandler : public DIEHandler { public: - RootDIEHandler() { } - virtual ~RootDIEHandler() { } + bool handle_inline; + + explicit RootDIEHandler(bool handle_inline = false) + : handle_inline(handle_inline) {} + virtual ~RootDIEHandler() {} // We pass the values reported via Dwarf2Handler::StartCompilationUnit // to this member function, and skip the entire compilation unit if it diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index dacc9cbe4..85be32204 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -766,11 +766,12 @@ void DwarfCUToModule::InlineHandler::Finish() { class DwarfCUToModule::FuncHandler: public GenericDIEHandler { public: FuncHandler(CUContext* cu_context, DIEContext* parent_context, - uint64_t offset) + uint64_t offset, bool handle_inline) : GenericDIEHandler(cu_context, parent_context, offset), low_pc_(0), high_pc_(0), high_pc_form_(DW_FORM_addr), ranges_form_(DW_FORM_sec_offset), ranges_data_(0), - decl_file_data_(UINT64_MAX), inline_(false) { } + decl_file_data_(UINT64_MAX), inline_(false), + handle_inline_(handle_inline) { } void ProcessAttributeUnsigned(enum DwarfAttribute attr, enum DwarfForm form, @@ -794,6 +795,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { uint64_t decl_file_data_; bool inline_; vector> child_inlines_; + bool handle_inline_; }; void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( @@ -844,8 +846,9 @@ DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler( enum DwarfTag tag) { switch (tag) { case DW_TAG_inlined_subroutine: - return new InlineHandler(cu_context_, new DIEContext(), offset, 0, - child_inlines_); + if (handle_inline_) + return new InlineHandler(cu_context_, new DIEContext(), offset, 0, + child_inlines_); default: return NULL; } @@ -949,7 +952,8 @@ void DwarfCUToModule::FuncHandler::Finish() { // Only keep track of DW_TAG_subprogram which have the attributes we are // interested. - if (!empty_range || inline_ || decl_file_data_ != UINT64_MAX) { + if (handle_inline_ && + (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; cu_context_->file_context->file_private_->inline_origin_map.SetReference( @@ -967,13 +971,14 @@ void DwarfCUToModule::FuncHandler::Finish() { class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler { public: NamedScopeHandler(CUContext* cu_context, DIEContext* parent_context, - uint64_t offset) + uint64_t offset, bool handle_inline) : GenericDIEHandler(cu_context, parent_context, offset) { } bool EndAttributes(); DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); private: DIEContext child_context_; // A context for our children. + bool handle_inline_; }; bool DwarfCUToModule::NamedScopeHandler::EndAttributes() { @@ -986,12 +991,14 @@ DIEHandler* DwarfCUToModule::NamedScopeHandler::FindChildHandler( enum DwarfTag tag) { switch (tag) { case DW_TAG_subprogram: - return new FuncHandler(cu_context_, &child_context_, offset); + return new FuncHandler(cu_context_, &child_context_, offset, + handle_inline_); case DW_TAG_namespace: case DW_TAG_class_type: case DW_TAG_structure_type: case DW_TAG_union_type: - return new NamedScopeHandler(cu_context_, &child_context_, offset); + return new NamedScopeHandler(cu_context_, &child_context_, offset, + handle_inline_); default: return NULL; } @@ -1101,12 +1108,13 @@ void DwarfCUToModule::WarningReporter::MissingRanges() { DwarfCUToModule::DwarfCUToModule(FileContext* file_context, LineToModuleHandler* line_reader, RangesHandler* ranges_handler, - WarningReporter* reporter) - : line_reader_(line_reader), + WarningReporter* reporter, + bool handle_inline) + : RootDIEHandler(handle_inline), + line_reader_(line_reader), cu_context_(new CUContext(file_context, reporter, ranges_handler)), child_context_(new DIEContext()), - has_source_line_info_(false) { -} + has_source_line_info_(false) {} DwarfCUToModule::~DwarfCUToModule() { } @@ -1183,14 +1191,15 @@ DIEHandler* DwarfCUToModule::FindChildHandler( enum DwarfTag tag) { switch (tag) { case DW_TAG_subprogram: - return new FuncHandler(cu_context_.get(), child_context_.get(), offset); + return new FuncHandler(cu_context_.get(), child_context_.get(), offset, + handle_inline); case DW_TAG_namespace: case DW_TAG_class_type: case DW_TAG_structure_type: case DW_TAG_union_type: case DW_TAG_module: return new NamedScopeHandler(cu_context_.get(), child_context_.get(), - offset); + offset, handle_inline); default: return NULL; } diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index 99dcd8791..2873101a9 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -258,7 +258,8 @@ class DwarfCUToModule: public RootDIEHandler { DwarfCUToModule(FileContext* file_context, LineToModuleHandler* line_reader, RangesHandler* ranges_handler, - WarningReporter* reporter); + WarningReporter* reporter, + bool handle_inline = false); ~DwarfCUToModule(); void ProcessAttributeSigned(enum DwarfAttribute attr, diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 92a260baf..ac53ea286 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -287,6 +287,7 @@ bool LoadDwarf(const string& dwarf_filename, const typename ElfClass::Ehdr* elf_header, const bool big_endian, bool handle_inter_cu_refs, + bool handle_inline, Module* module) { typedef typename ElfClass::Shdr Shdr; @@ -333,7 +334,7 @@ bool LoadDwarf(const string& dwarf_filename, // data that was found. DwarfCUToModule::WarningReporter reporter(dwarf_filename, offset); DwarfCUToModule root_handler(&file_context, &line_to_module, - &ranges_handler, &reporter); + &ranges_handler, &reporter, handle_inline); // Make a Dwarf2Handler that drives the DIEHandler. google_breakpad::DIEDispatcher die_dispatcher(&root_handler); // Make a DWARF parser for the compilation unit at OFFSET. @@ -786,7 +787,8 @@ bool LoadSymbols(const string& obj_file, found_usable_info = true; info->LoadedSection(".debug_info"); if (!LoadDwarf(obj_file, elf_header, big_endian, - options.handle_inter_cu_refs, module)) { + options.handle_inter_cu_refs, + options.symbol_data & INLINES, module)) { fprintf(stderr, "%s: \".debug_info\" section found, but failed to load " "DWARF debugging information\n", obj_file.c_str()); } diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 3592e4bb1..6df32bc10 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -476,7 +476,8 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module* module, DwarfCUToModule::WarningReporter reporter(selected_object_name_, offset); DwarfCUToModule root_handler(&file_context, &line_to_module, - &ranges_handler, &reporter); + &ranges_handler, &reporter, + symbol_data_ & INLINES); // Make a Dwarf2Handler that drives our DIEHandler. DIEDispatcher die_dispatcher(&root_handler); // Make a DWARF parser for the compilation unit at OFFSET. diff --git a/src/common/module.cc b/src/common/module.cc index eccd01f09..7dfd6a3e6 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -303,8 +303,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } if (symbol_data & SYMBOLS_AND_FILES) { - if (symbol_data & INLINES) - CreateInlineOrigins(); + CreateInlineOrigins(); AssignSourceIds(); // Write out files. @@ -318,13 +317,11 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } } // Write out inline origins. - if (symbol_data & INLINES) { - for (InlineOrigin* origin : inline_origins_) { - stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() - << " " << origin->name << "\n"; - if (!stream.good()) - return ReportError(); - } + for (InlineOrigin* origin : inline_origins_) { + stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() + << " " << origin->name << "\n"; + if (!stream.good()) + return ReportError(); } // Write out functions and their inlines and lines. @@ -344,19 +341,17 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { return ReportError(); // Write out inlines. - if (symbol_data & INLINES) { - auto write_inline = [&](unique_ptr& in) { - stream << "INLINE "; - stream << in->inline_nest_level << " " << in->call_site_line << " " - << in->origin->id << hex; - for (const Range& r : in->ranges) - stream << " " << (r.address - load_address_) << " " << r.size; - stream << dec << "\n"; - }; - InlineDFS(func->inlines, write_inline); - if (!stream.good()) - return ReportError(); - } + auto write_inline = [&](unique_ptr& in) { + stream << "INLINE "; + stream << in->inline_nest_level << " " << in->call_site_line << " " + << in->origin->id << hex; + for (const Range& r : in->ranges) + stream << " " << (r.address - load_address_) << " " << r.size; + stream << dec << "\n"; + }; + InlineDFS(func->inlines, write_inline); + if (!stream.good()) + return ReportError(); while ((line_it != func->lines.end()) && (line_it->address >= range_it->address) && From 1147c2fcf09cf150e6d7891e94bd390c6c8a9def Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 16 Sep 2021 17:49:41 -0700 Subject: [PATCH 014/195] Fix an uninitialized member variable in previous commit Change-Id: I83a2d026f1cef1771d28b420d76de17f0cf296ec Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166678 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 85be32204..7f7e5f10a 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -972,7 +972,8 @@ class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler { public: NamedScopeHandler(CUContext* cu_context, DIEContext* parent_context, uint64_t offset, bool handle_inline) - : GenericDIEHandler(cu_context, parent_context, offset) { } + : GenericDIEHandler(cu_context, parent_context, offset), + handle_inline_(handle_inline) { } bool EndAttributes(); DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); From 1816ae7f35ce1a2fd390d2f25fe8d47be318514c Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 24 Sep 2021 13:27:13 -0700 Subject: [PATCH 015/195] Fix dump_syms memory leak It moves InlineOriginMap to module.h. Let Module keeps the global InlineOriginMap to easily get all referenced InlineOrigin when emitting. And release allocated memory inside its destructor. Verified that the symbol file with inline records for chrome is the same before and after this change. Change-Id: I7541aa05d3d2df0b9d52d670cab58241baecf20d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3171638 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 79 +++--------------------------- src/common/module.cc | 84 +++++++++++++++++++++++++++----- src/common/module.h | 44 ++++++++++++++--- 3 files changed, 116 insertions(+), 91 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 7f7e5f10a..3ec486aa6 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -100,71 +100,6 @@ struct AbstractOrigin { typedef map AbstractOriginByOffset; -using InlineOriginByOffset = map; - -class InlineOriginMap { - public: - Module::InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, - const string& name) { - uint64_t specification_offset = references_[offset]; - if (inline_origins_.find(specification_offset) != inline_origins_.end()) { - if (inline_origins_[specification_offset]->name == "") { - inline_origins_[specification_offset]->name = name; - } - return inline_origins_[specification_offset]; - } - inline_origins_[specification_offset] = new Module::InlineOrigin(name); - return inline_origins_[specification_offset]; - } - - // offset is the offset of a DW_TAG_subprogram. specification_offset is the - // value of its DW_AT_specification or equals to offset if DW_AT_specification - // doesn't exist in that DIE. - void SetReference(uint64_t offset, uint64_t specification_offset) { - // If we haven't seen this doesn't exist in reference map, always add it. - if (references_.find(offset) == references_.end()) { - references_[offset] = specification_offset; - return; - } - // If offset equals specification_offset and offset exists in references_, - // there is no need to update the references_ map. This early return is - // necessary because the call to erase in following if will remove the entry - // of specification_offset in inline_origins_. - // If specification_offset equals to references_[offset], it might be - // duplicate debug info. - if (offset == specification_offset || - specification_offset == references_[offset]) - return; - - // Fix up mapping in inline_origins_. - auto remove = inline_origins_.find(references_[offset]); - if (remove != inline_origins_.end()) { - inline_origins_[specification_offset] = remove->second; - inline_origins_.erase(remove); - } - references_[offset] = specification_offset; - } - - void AssignFilesToInlineOrigins(vector& inline_origin_offsets, - Module::File* file) { - for (uint64_t offset : inline_origin_offsets) - if (references_.find(offset) != references_.end()) { - auto origin = inline_origins_.find(references_[offset]); - if (origin != inline_origins_.end()) - origin->second->file = file; - } - } - - private: - // A map from a DW_TAG_subprogram's offset to the DW_TAG_subprogram. - InlineOriginByOffset inline_origins_; - - // A map from a DW_TAG_subprogram's offset to the offset of its specification - // or abstract origin subprogram. The set of values in this map should always - // be the same set of keys in inline_origins_. - map references_; -}; - // Data global to the DWARF-bearing file that is private to the // DWARF-to-Module process. struct DwarfCUToModule::FilePrivate { @@ -197,8 +132,6 @@ struct DwarfCUToModule::FilePrivate { // Keep a list of forward references from DW_AT_abstract_origin and // DW_AT_specification attributes so names can be fixed up. std::map forward_ref_die_to_func; - - InlineOriginMap inline_origin_map; }; DwarfCUToModule::FileContext::FileContext(const string& filename, @@ -751,10 +684,10 @@ void DwarfCUToModule::InlineHandler::Finish() { // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. assert(specification_offset_ != 0); - cu_context_->file_context->file_private_->inline_origin_map.SetReference( + cu_context_->file_context->module_->inline_origin_map.SetReference( specification_offset_, specification_offset_); Module::InlineOrigin* origin = - cu_context_->file_context->file_private_->inline_origin_map + cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(specification_offset_, name_); unique_ptr in( new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, @@ -956,9 +889,9 @@ void DwarfCUToModule::FuncHandler::Finish() { (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; - cu_context_->file_context->file_private_->inline_origin_map.SetReference( - offset_, offset); - cu_context_->file_context->file_private_->inline_origin_map + cu_context_->file_context->module_->inline_origin_map.SetReference(offset_, + offset); + cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(offset_, name_.empty() ? "" : name_); if (decl_file_data_ != UINT64_MAX) @@ -1546,7 +1479,7 @@ void DwarfCUToModule::AssignLinesToFunctions() { void DwarfCUToModule::AssignFilesToInlines() { for (auto iter : files_) { - cu_context_->file_context->file_private_->inline_origin_map + cu_context_->file_context->module_->inline_origin_map .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], iter.second); } diff --git a/src/common/module.cc b/src/common/module.cc index 7dfd6a3e6..16026532c 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -49,6 +49,64 @@ using std::dec; using std::hex; using std::unique_ptr; +Module::InlineOrigin* Module::InlineOriginMap::GetOrCreateInlineOrigin( + uint64_t offset, + const string& name) { + uint64_t specification_offset = references_[offset]; + // Find the root offset. + auto iter = references_.find(specification_offset); + while (iter != references_.end() && + specification_offset != references_[specification_offset]) { + specification_offset = references_[specification_offset]; + iter = references_.find(specification_offset); + } + if (inline_origins_.find(specification_offset) != inline_origins_.end()) { + if (inline_origins_[specification_offset]->name == "") { + inline_origins_[specification_offset]->name = name; + } + return inline_origins_[specification_offset]; + } + inline_origins_[specification_offset] = new Module::InlineOrigin(name); + return inline_origins_[specification_offset]; +} + +void Module::InlineOriginMap::SetReference(uint64_t offset, + uint64_t specification_offset) { + // If we haven't seen this doesn't exist in reference map, always add it. + if (references_.find(offset) == references_.end()) { + references_[offset] = specification_offset; + return; + } + // If offset equals specification_offset and offset exists in + // references_, there is no need to update the references_ map. + // This early return is necessary because the call to erase in following if + // will remove the entry of specification_offset in inline_origins_. If + // specification_offset equals to references_[offset], it might be + // duplicate debug info. + if (offset == specification_offset || + specification_offset == references_[offset]) + return; + + // Fix up mapping in inline_origins_. + auto remove = inline_origins_.find(references_[offset]); + if (remove != inline_origins_.end()) { + inline_origins_[specification_offset] = std::move(remove->second); + inline_origins_.erase(remove); + } + references_[offset] = specification_offset; +} + +void Module::InlineOriginMap::AssignFilesToInlineOrigins( + vector& inline_origin_offsets, + Module::File* file) { + for (uint64_t offset : inline_origin_offsets) + if (references_.find(offset) != references_.end()) { + auto origin = inline_origins_.find(references_[offset]); + if (origin != inline_origins_.end()) + origin->second->file = file; + } +} + Module::Module(const string& name, const string& os, const string& architecture, const string& id, const string& code_id /* = "" */) : @@ -200,7 +258,8 @@ void Module::GetStackFrameEntries(vector* vec) const { *vec = stack_frame_entries_; } -void Module::AssignSourceIds() { +void Module::AssignSourceIds( + set& inline_origins) { // First, give every source file an id of -1. for (FileByNameMap::iterator file_it = files_.begin(); file_it != files_.end(); ++file_it) { @@ -218,7 +277,7 @@ void Module::AssignSourceIds() { } // Also mark all files cited by inline functions by setting each one's source // id to zero. - for (InlineOrigin* origin : inline_origins_) + for (InlineOrigin* origin : inline_origins) // There are some artificial inline functions which don't belong to // any file. Those will have file id -1. if (origin->file) @@ -245,20 +304,21 @@ static void InlineDFS( } } -void Module::CreateInlineOrigins() { +void Module::CreateInlineOrigins( + set& inline_origins) { // Only add origins that have file and deduplicate origins with same name and // file id by doing a DFS. - auto addInlineOrigins = [&](unique_ptr &in) { - auto it = inline_origins_.find(in->origin); - if (it == inline_origins_.end()) - inline_origins_.insert(in->origin); + auto addInlineOrigins = [&](unique_ptr& in) { + auto it = inline_origins.find(in->origin); + if (it == inline_origins.end()) + inline_origins.insert(in->origin); else in->origin = *it; }; for (Function* func : functions_) InlineDFS(func->inlines, addInlineOrigins); int next_id = 0; - for (InlineOrigin* origin: inline_origins_) { + for (InlineOrigin* origin : inline_origins) { origin->id = next_id++; } } @@ -303,8 +363,10 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } if (symbol_data & SYMBOLS_AND_FILES) { - CreateInlineOrigins(); - AssignSourceIds(); + // Get all referenced inline origins. + set inline_origins; + CreateInlineOrigins(inline_origins); + AssignSourceIds(inline_origins); // Write out files. for (FileByNameMap::iterator file_it = files_.begin(); @@ -317,7 +379,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } } // Write out inline origins. - for (InlineOrigin* origin : inline_origins_) { + for (InlineOrigin* origin : inline_origins) { stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() << " " << origin->name << "\n"; if (!stream.good()) diff --git a/src/common/module.h b/src/common/module.h index e8678914f..7ee6b37e9 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -129,7 +129,8 @@ class Module { }; struct InlineOrigin { - InlineOrigin(const string& name): id(-1), name(name), file(NULL) {} + explicit InlineOrigin(const string& name) + : id(-1), name(name), file(nullptr) {} // A unique id for each InlineOrigin object. INLINE records use the id to // refer to its INLINE_ORIGIN record. @@ -169,6 +170,38 @@ class Module { vector> child_inlines; }; + typedef map InlineOriginByOffset; + + class InlineOriginMap { + public: + // Add INLINE ORIGIN to the module. Return a pointer to origin . + InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, const string& name); + + // offset is the offset of a DW_TAG_subprogram. specification_offset is the + // value of its DW_AT_specification or equals to offset if + // DW_AT_specification doesn't exist in that DIE. + void SetReference(uint64_t offset, uint64_t specification_offset); + void AssignFilesToInlineOrigins( + const vector& inline_origin_offsets, + File* file); + ~InlineOriginMap() { + for (const auto& iter : inline_origins_) { + delete iter.second; + } + } + + private: + // A map from a DW_TAG_subprogram's offset to the DW_TAG_subprogram. + InlineOriginByOffset inline_origins_; + + // A map from a DW_TAG_subprogram's offset to the offset of its + // specification or abstract origin subprogram. The set of values in this + // map should always be the same set of keys in inline_origins_. + map references_; + }; + + InlineOriginMap inline_origin_map; + // A source line. struct Line { // For sorting by address. (Not style-guide compliant, but it's @@ -328,11 +361,12 @@ class Module { // Set the source id numbers for all other files --- unused by the // source line data --- to -1. We do this before writing out the // symbol file, at which point we omit any unused files. - void AssignSourceIds(); + void AssignSourceIds(set& inline_origins); // This function should be called before AssignSourceIds() to get the set of // valid InlineOrigins*. - void CreateInlineOrigins(); + void CreateInlineOrigins( + set& inline_origins); // Call AssignSourceIds, and write this module to STREAM in the // breakpad symbol format. Return true if all goes well, or false if @@ -393,9 +427,6 @@ class Module { // A set containing Function structures, sorted by address. typedef set FunctionSet; - // A set containing Function structures, sorted by address. - typedef set InlineOriginSet; - // A set containing Extern structures, sorted by address. typedef set ExternSet; @@ -404,7 +435,6 @@ class Module { // point to. FileByNameMap files_; // This module's source files. FunctionSet functions_; // This module's functions. - InlineOriginSet inline_origins_; // This module's inline origins. // The module owns all the call frame info entries that have been // added to it. From d4bf038be7402d9e899bbde5e496de94203e6aa0 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 24 Sep 2021 15:46:03 -0700 Subject: [PATCH 016/195] Add missing const in AssignFilesToInlineOrigins method Change-Id: I3904d52e946158439899f4c5aaa92d1d15160745 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3183519 Reviewed-by: Ivan Penkov --- src/common/module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/module.cc b/src/common/module.cc index 16026532c..8b65bd07b 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -97,7 +97,7 @@ void Module::InlineOriginMap::SetReference(uint64_t offset, } void Module::InlineOriginMap::AssignFilesToInlineOrigins( - vector& inline_origin_offsets, + const vector& inline_origin_offsets, Module::File* file) { for (uint64_t offset : inline_origin_offsets) if (references_.find(offset) != references_.end()) { From ff5892c5da86c50af1951328215a5a3a203a9bb1 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 30 Sep 2021 12:49:44 -0700 Subject: [PATCH 017/195] Add a string pool to store functions names - Added StringView which is used as a reference to a string, but doesn't own the string. - Removed the old string pool in DwarfCUToModule::FilePrivate, since it's doing string copy. - Added a string pool in Module to store functions/inline origins' names (mangled and demangled). - The peak memory usage drops from 20.6 GB to 12.5 GB when disabling inline records and drops from 36 GB to 20.3 GB when enabling inline records. Bug: chromium:1246974, chromium:1250351 Change-Id: Ie7e9740ea10c1930a0fc58c6becaae2d718b83b8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3189410 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 138 ++++++++++++------------------- src/common/module.cc | 3 +- src/common/module.h | 22 +++-- src/common/stabs_to_module.cc | 3 +- src/common/string_view.h | 113 +++++++++++++++++++++++++ 5 files changed, 188 insertions(+), 91 deletions(-) create mode 100644 src/common/string_view.h diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 3ec486aa6..04d19479b 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -48,8 +48,8 @@ #include #include +#include "common/string_view.h" #include "common/dwarf_line_to_module.h" -#include "common/unordered.h" #include "google_breakpad/common/breakpad_types.h" namespace google_breakpad { @@ -80,22 +80,21 @@ using std::unique_ptr; // we may need if we find a DW_AT_specification link pointing to it. struct DwarfCUToModule::Specification { // The qualified name that can be found by demangling DW_AT_MIPS_linkage_name. - string qualified_name; + StringView qualified_name; // The name of the enclosing scope, or the empty string if there is none. - string enclosing_name; + StringView enclosing_name; // The name for the specification DIE itself, without any enclosing // name components. - string unqualified_name; + StringView unqualified_name; }; // An abstract origin -- base definition of an inline function. struct AbstractOrigin { - AbstractOrigin() : name() {} - explicit AbstractOrigin(const string& name) : name(name) {} + explicit AbstractOrigin(StringView name) : name(name) {} - string name; + StringView name; }; typedef map AbstractOriginByOffset; @@ -103,25 +102,6 @@ typedef map AbstractOriginByOffset; // Data global to the DWARF-bearing file that is private to the // DWARF-to-Module process. struct DwarfCUToModule::FilePrivate { - // A set of strings used in this CU. Before storing a string in one of - // our data structures, insert it into this set, and then use the string - // from the set. - // - // In some STL implementations, strings are reference-counted internally, - // meaning that simply using strings from this set, even if passed by - // value, assigned, or held directly in structures and containers - // (map, for example), causes those strings to share a - // single instance of each distinct piece of text. GNU's libstdc++ uses - // reference counts, and I believe MSVC did as well, at some point. - // However, C++ '11 implementations are moving away from reference - // counting. - // - // In other implementations, string assignments copy the string's text, - // so this set will actually hold yet another copy of the string (although - // everything will still work). To improve memory consumption portably, - // we will probably need to use pointers to strings held in this set. - unordered_set common_strings; - // A map from offsets of DIEs within the .debug_info section to // Specifications describing those DIEs. Specification references can // cross compilation unit boundaries. @@ -293,7 +273,7 @@ struct DwarfCUToModule::DIEContext { // in a C++ compilation unit, the DIEContext's name for the // DW_TAG_subprogram DIE would be "Foo::Bar". The DIEContext's // name for the DW_TAG_namespace DIE would be "". - string name; + StringView name; }; // An abstract base class for all the dumper's DIE handlers. @@ -339,20 +319,12 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { // Use this from EndAttributes member functions, not ProcessAttribute* // functions; only the former can be sure that all the DIE's attributes // have been seen. - string ComputeQualifiedName(); + StringView ComputeQualifiedName(); CUContext* cu_context_; DIEContext* parent_context_; uint64_t offset_; - // Place the name in the global set of strings. Even though this looks - // like a copy, all the major string implementations use reference - // counting internally, so the effect is to have all the data structures - // share copies of strings whenever possible. - // FIXME: Should this return something like a string_ref to avoid the - // assumption about how strings are implemented? - string AddStringToPool(const string& str); - // If this DIE has a DW_AT_declaration attribute, this is its value. // It is false on DIEs with no DW_AT_declaration attribute. bool declaration_; @@ -377,16 +349,16 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { // The value of the DW_AT_name attribute, or the empty string if the // DIE has no such attribute. - string name_attribute_; + StringView name_attribute_; // The demangled value of the DW_AT_MIPS_linkage_name attribute, or the empty // string if the DIE has no such attribute or its content could not be // demangled. - string demangled_name_; + StringView demangled_name_; // The non-demangled value of the DW_AT_MIPS_linkage_name attribute, // it its content count not be demangled. - string raw_name_; + StringView raw_name_; }; void DwarfCUToModule::GenericDIEHandler::ProcessAttributeUnsigned( @@ -445,19 +417,14 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( } } -string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string& str) { - pair::iterator, bool> result = - cu_context_->file_context->file_private_->common_strings.insert(str); - return *result.first; -} - void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( enum DwarfAttribute attr, enum DwarfForm form, const string& data) { switch (attr) { case DW_AT_name: - name_attribute_ = AddStringToPool(data); + name_attribute_ = + cu_context_->file_context->module_->AddStringToPool(data); break; case DW_AT_MIPS_linkage_name: case DW_AT_linkage_name: { @@ -466,15 +433,16 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( cu_context_->language->DemangleName(data, &demangled); switch (result) { case Language::kDemangleSuccess: - demangled_name_ = AddStringToPool(demangled); + demangled_name_ = + cu_context_->file_context->module_->AddStringToPool(demangled); break; case Language::kDemangleFailure: cu_context_->reporter->DemangleError(data); // fallthrough case Language::kDontDemangle: - demangled_name_.clear(); - raw_name_ = AddStringToPool(data); + demangled_name_ = StringView(); + raw_name_ = cu_context_->file_context->module_->AddStringToPool(data); break; } break; @@ -483,11 +451,11 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( } } -string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { +StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { // Use the demangled name, if one is available. Demangled names are // preferable to those inferred from the DWARF structure because they // include argument types. - const string* qualified_name = NULL; + StringView* qualified_name = nullptr; if (!demangled_name_.empty()) { // Found it is this DIE. qualified_name = &demangled_name_; @@ -496,37 +464,39 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { qualified_name = &specification_->qualified_name; } - const string* unqualified_name = NULL; - const string* enclosing_name; + StringView* unqualified_name = nullptr; + StringView* enclosing_name = nullptr; if (!qualified_name) { // Find the unqualified name. If the DIE has its own DW_AT_name // attribute, then use that; otherwise, check the specification. - if (!name_attribute_.empty()) + if (!name_attribute_.empty()) { unqualified_name = &name_attribute_; - else if (specification_) + } else if (specification_) { unqualified_name = &specification_->unqualified_name; - else if (!raw_name_.empty()) + } else if (!raw_name_.empty()) { unqualified_name = &raw_name_; + } // Find the name of the enclosing context. If this DIE has a // specification, it's the specification's enclosing context that // counts; otherwise, use this DIE's context. - if (specification_) + if (specification_) { enclosing_name = &specification_->enclosing_name; - else + } else { enclosing_name = &parent_context_->name; + } } // Prepare the return value before upcoming mutations possibly invalidate the // existing pointers. string return_value; if (qualified_name) { - return_value = *qualified_name; + return_value = qualified_name->str(); } else if (unqualified_name && enclosing_name) { // Combine the enclosing name and unqualified name to produce our // own fully-qualified name. - return_value = cu_context_->language->MakeQualifiedName(*enclosing_name, - *unqualified_name); + return_value = cu_context_->language->MakeQualifiedName( + enclosing_name->str(), unqualified_name->str()); } // If this DIE was marked as a declaration, record its names in the @@ -543,7 +513,7 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { cu_context_->file_context->file_private_->specifications[offset_] = spec; } - return return_value; + return cu_context_->file_context->module_->AddStringToPool(return_value); } static bool IsEmptyRange(const vector& ranges) { @@ -585,7 +555,7 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler { private: // The fully-qualified name, as derived from name_attribute_, // specification_, parent_context_. Computed in EndAttributes. - string name_; + StringView name_; uint64_t low_pc_; // DW_AT_low_pc uint64_t high_pc_; // DW_AT_high_pc DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. @@ -644,7 +614,8 @@ bool DwarfCUToModule::InlineHandler::EndAttributes() { // We haven't seen the abstract origin yet, which might appears later and we // will fix the name after calling // InlineOriginMap::GetOrCreateInlineOrigin with right name. - name_ = ""; + name_ = + cu_context_->file_context->module_->AddStringToPool(""); } return true; } @@ -698,13 +669,19 @@ void DwarfCUToModule::InlineHandler::Finish() { // A handler class for DW_TAG_subprogram DIEs. class DwarfCUToModule::FuncHandler: public GenericDIEHandler { public: - FuncHandler(CUContext* cu_context, DIEContext* parent_context, - uint64_t offset, bool handle_inline) + FuncHandler(CUContext* cu_context, + DIEContext* parent_context, + uint64_t offset, + bool handle_inline) : GenericDIEHandler(cu_context, parent_context, offset), - low_pc_(0), high_pc_(0), high_pc_form_(DW_FORM_addr), - ranges_form_(DW_FORM_sec_offset), ranges_data_(0), - decl_file_data_(UINT64_MAX), inline_(false), - handle_inline_(handle_inline) { } + low_pc_(0), + high_pc_(0), + high_pc_form_(DW_FORM_addr), + ranges_form_(DW_FORM_sec_offset), + ranges_data_(0), + decl_file_data_(UINT64_MAX), + inline_(false), + handle_inline_(handle_inline) {} void ProcessAttributeUnsigned(enum DwarfAttribute attr, enum DwarfForm form, @@ -719,7 +696,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { private: // The fully-qualified name, as derived from name_attribute_, // specification_, parent_context_. Computed in EndAttributes. - string name_; + StringView name_; uint64_t low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx @@ -841,6 +818,8 @@ void DwarfCUToModule::FuncHandler::Finish() { } } + StringView name_omitted = + cu_context_->file_context->module_->AddStringToPool(""); bool empty_range = IsEmptyRange(ranges); // Did we collect the information we need? Not all DWARF function // entries are non-empty (for example, inlined functions that were never @@ -848,16 +827,9 @@ void DwarfCUToModule::FuncHandler::Finish() { // bytes. if (!empty_range) { low_pc_ = ranges.front().address; - // Malformed DWARF may omit the name, but all Module::Functions must // have names. - string name; - if (!name_.empty()) { - name = name_; - } else { - name = ""; - } - + StringView name = name_.empty() ? name_omitted : name_; // Create a Module::Function based on the data we've gathered, and // add it to the functions_ list. scoped_ptr func(new Module::Function(name, low_pc_)); @@ -880,20 +852,20 @@ void DwarfCUToModule::FuncHandler::Finish() { } } else if (inline_) { AbstractOrigin origin(name_); - cu_context_->file_context->file_private_->origins[offset_] = origin; + cu_context_->file_context->file_private_->origins.insert({offset_, origin}); } // Only keep track of DW_TAG_subprogram which have the attributes we are // interested. if (handle_inline_ && (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { + StringView name = name_.empty() ? name_omitted : name_; uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; cu_context_->file_context->module_->inline_origin_map.SetReference(offset_, offset); cu_context_->file_context->module_->inline_origin_map - .GetOrCreateInlineOrigin(offset_, - name_.empty() ? "" : name_); + .GetOrCreateInlineOrigin(offset_, name); if (decl_file_data_ != UINT64_MAX) cu_context_->inline_origins[decl_file_data_].push_back(offset_); } @@ -993,7 +965,7 @@ void DwarfCUToModule::WarningReporter::UncoveredFunction( UncoveredHeading(); fprintf(stderr, " function%s: %s\n", IsEmptyRange(function.ranges) ? " (zero-length)" : "", - function.name.c_str()); + function.name.str().c_str()); } void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line& line) { diff --git a/src/common/module.cc b/src/common/module.cc index 8b65bd07b..3945e2dd3 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -32,6 +32,7 @@ // module.cc: Implement google_breakpad::Module. See module.h. #include "common/module.h" +#include "common/string_view.h" #include #include @@ -51,7 +52,7 @@ using std::unique_ptr; Module::InlineOrigin* Module::InlineOriginMap::GetOrCreateInlineOrigin( uint64_t offset, - const string& name) { + StringView name) { uint64_t specification_offset = references_[offset]; // Find the root offset. auto iter = references_.find(specification_offset); diff --git a/src/common/module.h b/src/common/module.h index 7ee6b37e9..c5e0abfc5 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -46,7 +46,9 @@ #include #include +#include "common/string_view.h" #include "common/symbol_data.h" +#include "common/unordered.h" #include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" @@ -101,7 +103,7 @@ class Module { // A function. struct Function { - Function(const string& name_input, const Address& address_input) : + Function(StringView name_input, const Address& address_input) : name(name_input), address(address_input), parameter_size(0) {} // For sorting by address. (Not style-guide compliant, but it's @@ -111,7 +113,7 @@ class Module { } // The function's name. - string name; + StringView name; // The start address and the address ranges covered by the function. const Address address; @@ -129,15 +131,14 @@ class Module { }; struct InlineOrigin { - explicit InlineOrigin(const string& name) - : id(-1), name(name), file(nullptr) {} + explicit InlineOrigin(StringView name): id(-1), name(name), file(nullptr) {} // A unique id for each InlineOrigin object. INLINE records use the id to // refer to its INLINE_ORIGIN record. int id; // The inlined function's name. - string name; + StringView name; File* file; @@ -175,7 +176,7 @@ class Module { class InlineOriginMap { public: // Add INLINE ORIGIN to the module. Return a pointer to origin . - InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, const string& name); + InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, StringView name); // offset is the offset of a DW_TAG_subprogram. specification_offset is the // value of its DW_AT_specification or equals to offset if @@ -382,6 +383,13 @@ class Module { // established by SetLoadAddress. bool Write(std::ostream& stream, SymbolData symbol_data); + // Place the name in the global set of strings. Return a StringView points to + // a string inside the pool. + StringView AddStringToPool(const string& str) { + auto result = common_strings_.insert(str); + return *(result.first); + } + string name() const { return name_; } string os() const { return os_; } string architecture() const { return architecture_; } @@ -443,6 +451,8 @@ class Module { // The module owns all the externs that have been added to it; // destroying the module frees the Externs these point to. ExternSet externs_; + + unordered_set common_strings_; }; } // namespace google_breakpad diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index dd61d4d4d..cbddd33db 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -90,7 +90,8 @@ bool StabsToModule::EndCompilationUnit(uint64_t address) { bool StabsToModule::StartFunction(const string& name, uint64_t address) { assert(!current_function_); - Module::Function *f = new Module::Function(Demangle(name), address); + Module::Function* f = + new Module::Function(module_->AddStringToPool(Demangle(name)), address); Module::Range r(address, 0); // We compute this in StabsToModule::Finalize(). f->ranges.push_back(r); f->parameter_size = 0; // We don't provide this information. diff --git a/src/common/string_view.h b/src/common/string_view.h new file mode 100644 index 000000000..3c2fc744b --- /dev/null +++ b/src/common/string_view.h @@ -0,0 +1,113 @@ +// Copyright (c) 2021 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_STRING_VIEW_H__ +#define COMMON_STRING_VIEW_H__ + +#include +#include +#include +#include "common/using_std_string.h" + +namespace google_breakpad { + +// A StringView is a string reference to a string object, but not own the +// string object. +class StringView { + private: + // The start of the string, in an external buffer. It doesn't have to be + // null-terminated. + const char* data_ = ""; + + size_t length_ = 0; + + public: + // Construct an empty StringView. + StringView() = default; + + // Disallow construct StringView from nullptr. + StringView(nullptr_t) = delete; + + // Construct a StringView from a cstring. + StringView(const char* str) : data_(str) { + assert(str); + length_ = strlen(str); + } + + // Construct a StringView from a cstring with fixed length. + StringView(const char* str, size_t length) : data_(str), length_(length) { + assert(str); + } + + // Construct a StringView from an std::string. + StringView(const string& str) : data_(str.data()), length_(str.length()) {} + + string str() const { return string(data_, length_); } + + const char* data() const { return data_; } + + bool empty() const { return length_ == 0; } + + size_t size() const { return length_; } + + int compare(StringView rhs) const { + size_t min_len = std::min(size(), rhs.size()); + int res = memcmp(data_, rhs.data(), min_len); + if (res != 0) + return res; + if (size() == rhs.size()) + return 0; + return size() < rhs.size() ? -1 : 1; + } +}; + +inline bool operator==(StringView lhs, StringView rhs) { + return lhs.compare(rhs) == 0; +} + +inline bool operator!=(StringView lhs, StringView rhs) { + return lhs.compare(rhs) != 0; +} + +inline bool operator<(StringView lhs, StringView rhs) { + return lhs.compare(rhs) < 0; +} + +inline bool operator>(StringView lhs, StringView rhs) { + return lhs.compare(rhs) > 0; +} + +inline std::ostream& operator<<(std::ostream& os, StringView s) { + os << s.str(); + return os; +} + +} // namespace google_breakpad + +#endif // COMMON_STRING_VIEW_H__ From cf6246e2ba18426a1ab021108ecefdb8c95336a2 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Tue, 21 Sep 2021 03:03:04 +0200 Subject: [PATCH 018/195] Fix warnings in http_upload.cc with GCC The context arguments are of type DWORD_PTR which is actually a integer type, not a pointer, so using NULL here causes a type missmatch warning: error: passing NULL to non-pointer argument 8 [...] Change-Id: Ia52f51fd0cd33af3b139f0427dec6c59c2455d0a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3168663 Reviewed-by: Primiano Tucci --- src/common/windows/http_upload.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index efee0d58b..af6f8d9ce 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -262,7 +262,7 @@ namespace { NULL, // password INTERNET_SERVICE_HTTP, 0, // flags - NULL)); // context + 0)); // context if (!connection.get()) { return false; } @@ -276,7 +276,7 @@ namespace { NULL, // referer NULL, // agent type http_open_flags, - NULL)); // context + 0)); // context if (!request.get()) { return false; } From 0c049447270bdf9fee1ebe24ceeeab2f3f49e35a Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 4 Oct 2021 16:48:15 +0200 Subject: [PATCH 019/195] Fix StringView build After ff5892c5da86c50af1951328215a5a3a203a9bb1 added the new StringView, building fails with GCC 6 due to it apparently failing to properly find the type for nullptr_t resulting in the following error: In file included from ../src/common/module.h:49:0, from ../src/common/dwarf_cfi_to_module.h:49, from ../src/common/linux/dump_symbols.cc:59: ../src/common/string_view.h:55:27: error: field 'nullptr_t' has incomplete type 'google_breakpad::StringView' StringView(nullptr_t) = delete; ^~~~~~ ../src/common/string_view.h:42:7: note: definition of 'class google_breakpad::StringView' is not complete until the closing brace class StringView { ^~~~~~~~~~ This can be fixed by adding the std:: namespace to nullptr_t. Change-Id: I00a090d307ebe21d1143eac4a605ff319ce27048 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3201997 Reviewed-by: Joshua Peraza --- src/common/string_view.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/string_view.h b/src/common/string_view.h index 3c2fc744b..3d59ec4e0 100644 --- a/src/common/string_view.h +++ b/src/common/string_view.h @@ -52,7 +52,7 @@ class StringView { StringView() = default; // Disallow construct StringView from nullptr. - StringView(nullptr_t) = delete; + StringView(std::nullptr_t) = delete; // Construct a StringView from a cstring. StringView(const char* str) : data_(str) { From 73296aa5e36ae0c1b605e5fbfe6ad2f3b7436139 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 12 Oct 2021 17:32:18 -0400 Subject: [PATCH 020/195] github: convert pull closing to GH actions The probot app we were using has been shutdown, so switch over to the new GH actions flow. Change-Id: Ifa8c2835e1ac1a4df53a5c4f0aa851fbacbd4096 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3217681 Reviewed-by: Mark Mentovai --- .github/mistaken-pull-closer.yml | 17 ----------------- .github/workflows/close-pull-request.yml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) delete mode 100644 .github/mistaken-pull-closer.yml create mode 100644 .github/workflows/close-pull-request.yml diff --git a/.github/mistaken-pull-closer.yml b/.github/mistaken-pull-closer.yml deleted file mode 100644 index 13c8d1b3d..000000000 --- a/.github/mistaken-pull-closer.yml +++ /dev/null @@ -1,17 +0,0 @@ -# The JSONPath filter expression used to identify which PRs to close. -# The data filtered is the pull request data along with other metadata passed in -# by probot. -# See http://goessner.net/articles/JsonPath/ -# `true` will close all PRs. -filters: - - true - -# The message to post to the closed PR. -commentBody: | - Thanks for your contribution! Unfortunately, we don't use GitHub pull - requests to manage code contributions to this repository. Instead, please - see [README.md](../blob/master/README.md) which provides full instructions - on how to get involved. - -# Whether to add a label to the closed PR. -addLabel: false diff --git a/.github/workflows/close-pull-request.yml b/.github/workflows/close-pull-request.yml new file mode 100644 index 000000000..da11c4a6e --- /dev/null +++ b/.github/workflows/close-pull-request.yml @@ -0,0 +1,22 @@ +# GitHub actions workflow. +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions + +# https://github.com/superbrothers/close-pull-request +name: Close Pull Request + +on: + pull_request_target: + types: [opened] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: > + Thanks for your contribution! + Unfortunately, we don't use GitHub pull requests to manage code + contributions to this repository. + Instead, please see [README.md](../blob/HEAD/README.md) which + provides full instructions on how to get involved. From 36032719b1e10ad4029d6a183228f1394b79de11 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 12 Oct 2021 21:25:44 -0400 Subject: [PATCH 021/195] CI: convert Travis to GH actions With Travis shutdown, convert our flows over to GH actions. Change-Id: Ia4d358dbbf3d8a73c347f4b9e4cd4637ce44e594 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3216116 Reviewed-by: Mark Mentovai --- .github/workflows/build-test-ci.yml | 65 +++++++++++++++++++++++++++ .github/workflows/coverity.yml | 36 +++++++++++++++ .travis.yml | 34 -------------- README.md | 2 +- scripts/travis-build.sh | 70 ----------------------------- scripts/travis-checkout.sh | 24 ---------- 6 files changed, 102 insertions(+), 129 deletions(-) create mode 100644 .github/workflows/build-test-ci.yml create mode 100644 .github/workflows/coverity.yml delete mode 100644 .travis.yml delete mode 100755 scripts/travis-build.sh delete mode 100755 scripts/travis-checkout.sh diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml new file mode 100644 index 000000000..75f6ca217 --- /dev/null +++ b/.github/workflows/build-test-ci.yml @@ -0,0 +1,65 @@ +# GitHub actions workflow. +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions + +name: Build+Test CI + +on: + push: + branches: [main] + +jobs: + autotools: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cc: gcc + cxx: g++ + - os: ubuntu-latest + cc: clang + cxx: clang++ + - os: macos-latest + cc: clang + cxx: clang++ + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + + steps: + - name: System settings + run: | + set -x + $CC --version + $CXX --version + getconf _NPROCESSORS_ONLN + getconf _NPROCESSORS_CONF + true + + - name: Checkout depot_tools + run: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ../depot_tools + + - name: Checkout breakpad + run: | + set -xe + PATH+=:$PWD/../depot_tools + gclient config --unmanaged --name=src https://github.com/${{ github.repository }} + gclient sync --no-history --nohooks + + # First build & test in-tree. + - run: ./configure --disable-silent-rules + working-directory: src + - run: make -j$(getconf _NPROCESSORS_CONF) + working-directory: src + - run: make -j$(getconf _NPROCESSORS_CONF) check VERBOSE=1 + working-directory: src + - run: make -j$(getconf _NPROCESSORS_CONF) distclean + working-directory: src + + # Then build & test out-of-tree. + - run: mkdir -p src/build/native + - run: ../../configure --disable-silent-rules + working-directory: src/build/native + - run: make -j$(getconf _NPROCESSORS_CONF) distcheck VERBOSE=1 + working-directory: src/build/native diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 000000000..84e6edaf3 --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,36 @@ +# GitHub actions workflow. +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions + +# https://scan.coverity.com/projects/gentoo-pax-utils +name: Coverity Scan + +on: + push: + branches: [main] + +jobs: + coverity: + runs-on: ubuntu-latest + env: + CC: clang + CXX: clang++ + steps: + - name: Checkout depot_tools + run: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ../depot_tools + + - name: Checkout breakpad + run: | + set -xe + PATH+=:$PWD/../depot_tools + gclient config --unmanaged --name=src https://github.com/${{ github.repository }} + gclient sync --no-history --nohooks + + - run: ./configure --disable-silent-rules + working-directory: src + + - uses: vapier/coverity-scan-action@v0 + with: + project: google%2Fbreakpad + command: make -C src -O -j$(getconf _NPROCESSORS_CONF) + email: google-breakpad-dev@googlegroups.com + token: ${{ secrets.COVERITY_SCAN_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 628362d27..000000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Travis build integration. -# https://docs.travis-ci.com/ -language: cpp - -sudo: required - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - clang - - gcc-4.8 - - g++-4.8 - -env: - global: - - secure: "FPczJ1u7FWGXOtUVf5AONeexfQDYnKRtuNs3phLwlPPAbgAlIc/WeTRSHC8DAb1T8IyPdN3Zi7cqLz0dvPol0iX1fWSfr8YdtW0ea8nUYH5ldmmp6H75FEUJUcISmYwL4WN7TldC6Hnzrlbw/0xmBH8gtAgddtBXKc9P9SwEZvM4OiFMHbMPwZEhRj+D95rfH12lgh3D16nbXGnx3rSNbHszvIxrU2VvlLo9Aa+hbmVj5CsBiNJjhDS64ie+VMTkuzcWNqLRYaGOCQ8ftKAlj/fjGfoKjPDN9dSJg9gW1FjOMPeQo93qhSc/hCmTq7sWxBJu48telinUgESdE5q/8gRf5J05ImWPntZAkC/wQkA20K7Kp/fH1CRaYXQMWKjts8c6dQZ5R4WxE4WXUo5rz573Ti9uyVTLys9whnzaib3YbqYv04irkhpgzo3rd8PF8SXpgK99ySQCcv/Dh7UQuXPpcaknOk2mBySXjQDgpQHHXDN2uUek1HEo5xit8fQuQw3TdPIZ9ZgzQ/c5/Dx6sLWAGEfVH9MN+hy6AiZnJ1JI+XF82kAf1pnf8WddHtlE7pAdWRFQt0iOj9T9esV1/o0VCJVzJLRdpKecF0sTpJxDuan6cFI0tNCkNjHFA5wJKYAvdOPAmYkqre7aIIqSOKy3Fjh9JP9CBJFy7eals9U=" - -# TODO: Add an OS X config. -matrix: - include: - - os: linux - compiler: gcc - env: USE_CC=gcc-4.8 USE_CXX=g++-4.8 COVERITY_SCAN=true - - os: linux - compiler: clang - -before_install: ./scripts/travis-checkout.sh -script: ./scripts/travis-build.sh - -notifications: - email: - - google-breakpad-dev@googlegroups.com diff --git a/README.md b/README.md index edc285733..a9094a27a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ crash-reporting system. * [Bugs](https://bugs.chromium.org/p/google-breakpad/) * Discussion/Questions: [google-breakpad-discuss@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-discuss) * Developer/Reviews: [google-breakpad-dev@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-dev) -* Tests: [![Build Status](https://travis-ci.org/google/breakpad.svg?branch=main)](https://travis-ci.org/google/breakpad) [![Build status](https://ci.appveyor.com/api/projects/status/eguv4emv2rhq68u2?svg=true)](https://ci.appveyor.com/project/vapier/breakpad) +* Tests: [![Build+Test CI](https://github.com/google/breakpad/actions/workflows/build-test-ci.yml/badge.svg)](https://github.com/google/breakpad/actions/workflows/build-test-ci.yml) [![Build status](https://ci.appveyor.com/api/projects/status/eguv4emv2rhq68u2?svg=true)](https://ci.appveyor.com/project/vapier/breakpad) * Coverage [![Coverity Status](https://scan.coverity.com/projects/9215/badge.svg)](https://scan.coverity.com/projects/google-breakpad) ## Getting started (from main) diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh deleted file mode 100755 index 1d1beb3d5..000000000 --- a/scripts/travis-build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -set -ex - -setup_env() { - # Travis sets CC/CXX to the system toolchain, so our .travis.yml - # exports USE_{CC,CXX} for this script to use. - if [ -n "$USE_CC" ]; then - export CC=$USE_CC - fi - if [ -n "$USE_CXX" ]; then - export CXX=$USE_CXX - fi - # Use -jN for faster builds. Travis build machines under Docker - # have a lot of cores, but are memory-limited, so the kernel - # will OOM if we try to use them all, so use at most 4. - # See https://github.com/travis-ci/travis-ci/issues/1972 - export NCPUS=$(getconf _NPROCESSORS_ONLN) - export JOBS=$(( $NCPUS < 4 ? $NCPUS : 4 )) -} - -# We have to do this by hand rather than use the coverity addon because of -# matrix explosion: https://github.com/travis-ci/travis-ci/issues/1975 -# We also do it by hand because when we're throttled, the addon will exit -# the build immediately and skip the main script! -coverity_scan() { - if [ "${COVERITY_SCAN}" != "true" ] || \ - [ -n "${TRAVIS_TAG}" ] || \ - [ "${TRAVIS_PULL_REQUEST}" = "true" ] - then - echo "Skipping coverity scan." - return - fi - - export COVERITY_SCAN_PROJECT_NAME="${TRAVIS_REPO_SLUG}" - export COVERITY_SCAN_NOTIFICATION_EMAIL="google-breakpad-dev@googlegroups.com" - export COVERITY_SCAN_BUILD_COMMAND="make -j${JOBS}" - export COVERITY_SCAN_BUILD_COMMAND_PREPEND="git clean -q -x -d -f; git checkout -f; ./configure" - export COVERITY_SCAN_BRANCH_PATTERN="master" - - curl -s "https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" | bash || : -} - -# Do an in-tree build and make sure tests pass. -build() { - ./configure --with-tests-as-root - make -j${JOBS} check VERBOSE=1 - make distclean -} - -# Do an out-of-tree build and make sure we can create a release tarball. -build_out_of_tree() { - mkdir -p build/native - pushd build/native >/dev/null - ../../configure --with-tests-as-root - make -j${JOBS} distcheck VERBOSE=1 - popd >/dev/null -} - -main() { - setup_env - build - build_out_of_tree - - # Do scans last as they like to dirty the tree and some tests - # expect a clean tree (like code style checks). - coverity_scan -} - -main "$@" diff --git a/scripts/travis-checkout.sh b/scripts/travis-checkout.sh deleted file mode 100755 index e5b33324d..000000000 --- a/scripts/travis-checkout.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -ex - -get_depot_tools() { - cd - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - PATH="$HOME/depot_tools:$PATH" -} - -gclient_sync() { - # Rename the source dir to match what gclient expects. - srcdir=$(basename "$TRAVIS_BUILD_DIR") - cd "${TRAVIS_BUILD_DIR}"/.. - mv "${srcdir}" src - gclient config --unmanaged https://github.com/google/breakpad.git - gclient sync -} - -main() { - get_depot_tools - gclient_sync -} - -main "$@" From 2d0d117749536dd1fbc0d966ef2f09a851df9e45 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 14 Oct 2021 11:44:34 -0400 Subject: [PATCH 022/195] gtest: update to 1.11 release Keeps us in sync with Chromium a bit better. Change-Id: I4cb80f28fc3aa2e3d0cd8637dd2a5b1ff4ae633d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3223799 Reviewed-by: Mark Mentovai --- DEPS | 2 +- default.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c814d37ce..a5b53aa9c 100644 --- a/DEPS +++ b/DEPS @@ -36,7 +36,7 @@ deps = { # Testing libraries and utilities. "src/src/testing": "https://github.com/google/googletest.git" + - "@4fe018038f87675c083d0cfb6a6b57c274fb1753", + "@release-1.11.0", # Protobuf. "src/src/third_party/protobuf/protobuf": diff --git a/default.xml b/default.xml index c67f43c3d..3c157012a 100644 --- a/default.xml +++ b/default.xml @@ -27,7 +27,7 @@ Date: Thu, 14 Oct 2021 13:04:32 -0400 Subject: [PATCH 023/195] ios/mac: Add exception code for Crashpad uncaught exceptions. Change-Id: I4c6a6fb353cacb09710c579e59332d70d1e801a8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3093129 Reviewed-by: Mark Mentovai --- src/google_breakpad/common/minidump_exception_mac.h | 2 ++ src/processor/minidump_processor.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h index fadbf4ef6..d5e596524 100644 --- a/src/google_breakpad/common/minidump_exception_mac.h +++ b/src/google_breakpad/common/minidump_exception_mac.h @@ -69,6 +69,8 @@ typedef enum { /* EXC_RPC_ALERT */ MD_EXCEPTION_MAC_SIMULATED = 0x43507378 /* Fake exception code used by Crashpad's SimulateCrash ('CPsx'). */ + MD_NS_EXCEPTION_SIMULATED = 0x43506E78 + /* Fake exception code used by Crashpad's uncaught exceptions ('CPnx'). */ } MDExceptionMac; /* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index 04b7e129e..ac86fbd39 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -1138,6 +1138,9 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address) { case MD_EXCEPTION_MAC_SIMULATED: reason = "Simulated Exception"; break; + case MD_NS_EXCEPTION_SIMULATED: + reason = "Uncaught NSException"; + break; } break; } From db97ea1fd077693049b3b30a702053a474f5c58b Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Thu, 14 Oct 2021 14:45:08 -0400 Subject: [PATCH 024/195] Fix errors in minidump_exception_mac and dwarf_cu_to_module_unittest Change-Id: I468f19048f6b48b230913e911d0da7a20d96cae8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3222826 Reviewed-by: Mark Mentovai Reviewed-by: Nelson Billing --- src/common/dwarf_cu_to_module_unittest.cc | 2 +- src/google_breakpad/common/minidump_exception_mac.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index cb943ae3f..ce9f2da41 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -1570,7 +1570,7 @@ TEST_F(Specifications, InterCU) { vector functions; m.GetFunctions(&functions, functions.end()); EXPECT_EQ(1U, functions.size()); - EXPECT_STREQ("class_A::member_func_B", functions[0]->name.c_str()); + EXPECT_STREQ("class_A::member_func_B", functions[0]->name.str().c_str()); } TEST_F(Specifications, UnhandledInterCU) { diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h index d5e596524..e53edc5d5 100644 --- a/src/google_breakpad/common/minidump_exception_mac.h +++ b/src/google_breakpad/common/minidump_exception_mac.h @@ -67,7 +67,7 @@ typedef enum { /* EXC_MACH_SYSCALL */ MD_EXCEPTION_MAC_RPC_ALERT = 9, /* EXC_RPC_ALERT */ - MD_EXCEPTION_MAC_SIMULATED = 0x43507378 + MD_EXCEPTION_MAC_SIMULATED = 0x43507378, /* Fake exception code used by Crashpad's SimulateCrash ('CPsx'). */ MD_NS_EXCEPTION_SIMULATED = 0x43506E78 /* Fake exception code used by Crashpad's uncaught exceptions ('CPnx'). */ From 6b66d136ca36c23a2457cad43e2a65f725e3bba6 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 14 Oct 2021 10:39:55 -0700 Subject: [PATCH 025/195] Fix building unittests failure caused by the introduction of StringView at https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3189410 Change-Id: I258863e5de6201bc24b53dbe50b4d2515d29e338 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3221513 Reviewed-by: Mike Frysinger --- src/common/module_unittest.cc | 3 ++- src/common/stabs_to_module_unittest.cc | 6 +++--- src/common/string_view.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index ddccc3204..26964a560 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -193,7 +193,8 @@ TEST(Write, OmitUnusedFiles) { function->lines.push_back(line2); m.AddFunction(function); - m.AssignSourceIds(); + std::set inline_origins; + m.AssignSourceIds(inline_origins); vector vec; m.GetFiles(&vec); diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc index 9c134e733..d265f4dc4 100644 --- a/src/common/stabs_to_module_unittest.cc +++ b/src/common/stabs_to_module_unittest.cc @@ -62,7 +62,7 @@ TEST(StabsToModule, SimpleCU) { m.GetFunctions(&functions, functions.end()); ASSERT_EQ((size_t) 1, functions.size()); Module::Function *function = functions[0]; - EXPECT_STREQ("function", function->name.c_str()); + EXPECT_STREQ("function", function->name.str().c_str()); EXPECT_EQ(0xfde4abbed390c394LL, function->address); EXPECT_EQ(0x10U, function->ranges[0].size); EXPECT_EQ(0U, function->parameter_size); @@ -164,7 +164,7 @@ TEST(InferSizes, LineSize) { ASSERT_EQ((size_t) 1, functions.size()); Module::Function *function = functions[0]; - EXPECT_STREQ("function", function->name.c_str()); + EXPECT_STREQ("function", function->name.str().c_str()); EXPECT_EQ(0xb4513962eff94e92LL, function->address); EXPECT_EQ(0x1000100000000ULL, function->ranges[0].size); // inferred from CU end EXPECT_EQ(0U, function->parameter_size); @@ -214,7 +214,7 @@ TEST(FunctionNames, Mangled) { EXPECT_STREQ("std::vector >::" "push_back(unsigned long long const&)", - function->name.c_str()); + function->name.str().c_str()); EXPECT_EQ(0xf2cfda63cef7f46dLL, function->address); EXPECT_LT(0U, function->ranges[0].size); // should have used dummy size EXPECT_EQ(0U, function->parameter_size); diff --git a/src/common/string_view.h b/src/common/string_view.h index 3d59ec4e0..aa01db8bc 100644 --- a/src/common/string_view.h +++ b/src/common/string_view.h @@ -38,7 +38,8 @@ namespace google_breakpad { // A StringView is a string reference to a string object, but not own the -// string object. +// string object. It's a compatibile layer until we can use std::string_view in +// C++17. class StringView { private: // The start of the string, in an external buffer. It doesn't have to be From 71387fc200201b36dbb42733e41fdd4159a4039c Mon Sep 17 00:00:00 2001 From: Peter Kasting Date: Mon, 18 Oct 2021 09:46:15 -0700 Subject: [PATCH 026/195] Fix an instance of -Wshadow. Bug: chromium:794619 Change-Id: I7edb70a915ffb3c6f945dce77b0bd913e32e85eb Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3229392 Reviewed-by: Mark Mentovai --- src/client/mac/Framework/OnDemandServer.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/mac/Framework/OnDemandServer.mm b/src/client/mac/Framework/OnDemandServer.mm index b6b59ca5a..ee934ec93 100644 --- a/src/client/mac/Framework/OnDemandServer.mm +++ b/src/client/mac/Framework/OnDemandServer.mm @@ -81,15 +81,15 @@ mach_port_t self_task = mach_task_self(); - mach_port_t bootstrap_port; - kern_return_t kr = task_get_bootstrap_port(self_task, &bootstrap_port); + mach_port_t self_bootstrap_port; + kern_return_t kr = task_get_bootstrap_port(self_task, &self_bootstrap_port); if (kr != KERN_SUCCESS) { PRINT_MACH_RESULT(kr, "task_get_bootstrap_port(): "); return kr; } mach_port_t bootstrap_subset_port; - kr = bootstrap_subset(bootstrap_port, self_task, &bootstrap_subset_port); + kr = bootstrap_subset(self_bootstrap_port, self_task, &bootstrap_subset_port); if (kr != BOOTSTRAP_SUCCESS) { PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_subset(): "); return kr; @@ -105,7 +105,7 @@ kr = breakpad::BootstrapRegister( bootstrap_subset_port, const_cast(BREAKPAD_BOOTSTRAP_PARENT_PORT), - bootstrap_port); + self_bootstrap_port); if (kr != BOOTSTRAP_SUCCESS) { PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_register(): "); return kr; @@ -135,7 +135,8 @@ PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_create_service(): "); // perhaps the service has already been created - try to look it up - kr = bootstrap_look_up(bootstrap_port, (char*)service_name, &service_port_); + kr = bootstrap_look_up(self_bootstrap_port, (char*)service_name, + &service_port_); if (kr != BOOTSTRAP_SUCCESS) { PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_look_up(): "); From 54d878abcb61623a71e5c2b5bb251e7f7fc8563d Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 20 Oct 2021 14:07:55 -0700 Subject: [PATCH 027/195] Fix incorrect source file name for inlined frames Processor shows incorrect source file name if a frame have an inlined frame and their source files are different. Consider this example: FILE 0 /tmp/a.h FILE 1 /tmp/a.cpp INLINE_ORIGIN 0 0 foo() FUNC 1110 a 0 main INLINE 0 22 0 1110 7 1110 7 3 0 1117 3 23 1 When querying the address 0x1110, we know this line 0x1110 corresponds to /tmp/a.h line 3 and it's inside a inlined function foo() which is defined at /tmp/a.h and called at line 22. But we don't know at which file it's being called at line 22. So, we will get stacks like this: void foo() /tmp/a.h:3 int main() /tmp/a.h:22 The correct stacks should be this: void foo() /tmp/a.h:3 int main() /tmp/a.cpp:22 In this change: 1. Remove file_id field for INLINE_ORIGIN record. 2. Add call_site_file_id for INLINE record to represents the file where this call being inlined. After adding call_site_file_id to it (as third field), it looks like this: FILE 0 /tmp/a.h FILE 1 /tmp/a.cpp INLINE_ORIGIN 0 foo() FUNC 1110 a 0 main INLINE 0 22 1 0 1110 7 1110 7 3 0 1117 3 23 1 Bug: 1190878 Change-Id: Ibbb697d2f7e1b6ac3208cac6fae4353c8743198d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 36 +++--- src/common/module.cc | 42 ++---- src/common/module.h | 39 ++++-- .../processor/basic_source_line_resolver.h | 22 ++-- .../processor/source_line_resolver_base.h | 3 +- .../source_line_resolver_interface.h | 3 +- .../processor/stack_frame_symbolizer.h | 3 +- src/processor/basic_source_line_resolver.cc | 111 ++++++++-------- .../basic_source_line_resolver_types.h | 16 ++- .../basic_source_line_resolver_unittest.cc | 120 +++++++++--------- src/processor/fast_source_line_resolver.cc | 2 +- .../fast_source_line_resolver_types.h | 2 +- src/processor/source_line_resolver_base.cc | 2 +- .../source_line_resolver_base_types.h | 11 +- src/processor/stack_frame_symbolizer.cc | 2 +- src/processor/stackwalk_common.cc | 2 +- src/processor/stackwalker.cc | 8 +- .../linux_inline.sym | 15 ++- 18 files changed, 224 insertions(+), 215 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 04d19479b..82131e7b9 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -254,9 +254,6 @@ struct DwarfCUToModule::CUContext { // A map of function pointers to the its forward specification DIE's offset. map spec_function_offsets; - - // From file index to vector of subprogram's offset in this CU. - map> inline_origins; }; // Information about the context of a particular DIE. This is for @@ -561,7 +558,8 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler { DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx uint64_t ranges_data_; // DW_AT_ranges - int call_site_line_; + int call_site_line_; // DW_AT_call_line + int call_site_file_id_; // DW_AT_call_file int inline_nest_level_; // A vector of inlines in the same nest level. It's owned by its parent // function/inline. At Finish(), add this inline into the vector. @@ -589,6 +587,9 @@ void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned( case DW_AT_call_line: call_site_line_ = data; break; + case DW_AT_call_file: + call_site_file_id_ = data; + break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -661,8 +662,8 @@ void DwarfCUToModule::InlineHandler::Finish() { cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(specification_offset_, name_); unique_ptr in( - new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, - std::move(child_inlines_))); + new Module::Inline(origin, ranges, call_site_line_, call_site_file_id_, + inline_nest_level_, std::move(child_inlines_))); inlines_.push_back(std::move(in)); } @@ -679,7 +680,6 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { high_pc_form_(DW_FORM_addr), ranges_form_(DW_FORM_sec_offset), ranges_data_(0), - decl_file_data_(UINT64_MAX), inline_(false), handle_inline_(handle_inline) {} @@ -700,9 +700,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { uint64_t low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx - uint64_t ranges_data_; // DW_AT_ranges - // DW_AT_decl_file, value of UINT64_MAX means undefined. - uint64_t decl_file_data_; + uint64_t ranges_data_; // DW_AT_ranges bool inline_; vector> child_inlines_; bool handle_inline_; @@ -727,9 +725,6 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( ranges_data_ = data; ranges_form_ = form; break; - case DW_AT_decl_file: - decl_file_data_ = data; - break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -857,8 +852,7 @@ void DwarfCUToModule::FuncHandler::Finish() { // Only keep track of DW_TAG_subprogram which have the attributes we are // interested. - if (handle_inline_ && - (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { + if (handle_inline_ && (!empty_range || inline_)) { StringView name = name_.empty() ? name_omitted : name_; uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; @@ -866,8 +860,6 @@ void DwarfCUToModule::FuncHandler::Finish() { offset); cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(offset_, name); - if (decl_file_data_ != UINT64_MAX) - cu_context_->inline_origins[decl_file_data_].push_back(offset_); } } @@ -1450,10 +1442,12 @@ void DwarfCUToModule::AssignLinesToFunctions() { } void DwarfCUToModule::AssignFilesToInlines() { - for (auto iter : files_) { - cu_context_->file_context->module_->inline_origin_map - .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], - iter.second); + // Assign File* to Inlines inside this CU. + auto assignFile = [this](unique_ptr& in) { + in->call_site_file = files_[in->call_site_file_id]; + }; + for (auto func : cu_context_->functions) { + Module::Inline::InlineDFS(func->inlines, assignFile); } } diff --git a/src/common/module.cc b/src/common/module.cc index 3945e2dd3..381dd5d5a 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -97,17 +97,6 @@ void Module::InlineOriginMap::SetReference(uint64_t offset, references_[offset] = specification_offset; } -void Module::InlineOriginMap::AssignFilesToInlineOrigins( - const vector& inline_origin_offsets, - Module::File* file) { - for (uint64_t offset : inline_origin_offsets) - if (references_.find(offset) != references_.end()) { - auto origin = inline_origins_.find(references_[offset]); - if (origin != inline_origins_.end()) - origin->second->file = file; - } -} - Module::Module(const string& name, const string& os, const string& architecture, const string& id, const string& code_id /* = "" */) : @@ -276,13 +265,18 @@ void Module::AssignSourceIds( line_it != func->lines.end(); ++line_it) line_it->file->source_id = 0; } - // Also mark all files cited by inline functions by setting each one's source + + // Also mark all files cited by inline callsite by setting each one's source // id to zero. - for (InlineOrigin* origin : inline_origins) + auto markInlineFiles = [](unique_ptr& in) { // There are some artificial inline functions which don't belong to // any file. Those will have file id -1. - if (origin->file) - origin->file->source_id = 0; + if (in->call_site_file) + in->call_site_file->source_id = 0; + }; + for (auto func : functions_) { + Inline::InlineDFS(func->inlines, markInlineFiles); + } // Finally, assign source ids to those files that have been marked. // We could have just assigned source id numbers while traversing @@ -296,15 +290,6 @@ void Module::AssignSourceIds( } } -static void InlineDFS( - vector>& inlines, - std::function&)> const& forEach) { - for (unique_ptr& in : inlines) { - forEach(in); - InlineDFS(in->child_inlines, forEach); - } -} - void Module::CreateInlineOrigins( set& inline_origins) { // Only add origins that have file and deduplicate origins with same name and @@ -317,7 +302,7 @@ void Module::CreateInlineOrigins( in->origin = *it; }; for (Function* func : functions_) - InlineDFS(func->inlines, addInlineOrigins); + Module::Inline::InlineDFS(func->inlines, addInlineOrigins); int next_id = 0; for (InlineOrigin* origin : inline_origins) { origin->id = next_id++; @@ -381,8 +366,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } // Write out inline origins. for (InlineOrigin* origin : inline_origins) { - stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() - << " " << origin->name << "\n"; + stream << "INLINE_ORIGIN " << origin->id << " " << origin->name << "\n"; if (!stream.good()) return ReportError(); } @@ -407,12 +391,12 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { auto write_inline = [&](unique_ptr& in) { stream << "INLINE "; stream << in->inline_nest_level << " " << in->call_site_line << " " - << in->origin->id << hex; + << in->getCallSiteFileID() << " " << in->origin->id << hex; for (const Range& r : in->ranges) stream << " " << (r.address - load_address_) << " " << r.size; stream << dec << "\n"; }; - InlineDFS(func->inlines, write_inline); + Module::Inline::InlineDFS(func->inlines, write_inline); if (!stream.good()) return ReportError(); diff --git a/src/common/module.h b/src/common/module.h index c5e0abfc5..bfd344dd7 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -38,6 +38,7 @@ #ifndef COMMON_LINUX_MODULE_H__ #define COMMON_LINUX_MODULE_H__ +#include #include #include #include @@ -131,7 +132,7 @@ class Module { }; struct InlineOrigin { - explicit InlineOrigin(StringView name): id(-1), name(name), file(nullptr) {} + explicit InlineOrigin(StringView name) : id(-1), name(name) {} // A unique id for each InlineOrigin object. INLINE records use the id to // refer to its INLINE_ORIGIN record. @@ -139,10 +140,6 @@ class Module { // The inlined function's name. StringView name; - - File* file; - - int getFileID() const { return file ? file->source_id : -1; } }; // A inlined call site. @@ -150,11 +147,14 @@ class Module { Inline(InlineOrigin* origin, const vector& ranges, int call_site_line, + int call_site_file_id, int inline_nest_level, vector> child_inlines) : origin(origin), ranges(ranges), call_site_line(call_site_line), + call_site_file_id(call_site_file_id), + call_site_file(nullptr), inline_nest_level(inline_nest_level), child_inlines(std::move(child_inlines)) {} @@ -165,10 +165,29 @@ class Module { int call_site_line; + // The id is only meanful inside a CU. It's only used for looking up real + // File* after scanning a CU. + int call_site_file_id; + + File* call_site_file; + int inline_nest_level; // A list of inlines which are children of this inline. vector> child_inlines; + + int getCallSiteFileID() const { + return call_site_file ? call_site_file->source_id : -1; + } + + static void InlineDFS( + vector>& inlines, + std::function&)> const& forEach) { + for (std::unique_ptr& in : inlines) { + forEach(in); + InlineDFS(in->child_inlines, forEach); + } + } }; typedef map InlineOriginByOffset; @@ -182,9 +201,7 @@ class Module { // value of its DW_AT_specification or equals to offset if // DW_AT_specification doesn't exist in that DIE. void SetReference(uint64_t offset, uint64_t specification_offset); - void AssignFilesToInlineOrigins( - const vector& inline_origin_offsets, - File* file); + ~InlineOriginMap() { for (const auto& iter : inline_origins_) { delete iter.second; @@ -261,10 +278,8 @@ class Module { }; struct InlineOriginCompare { - bool operator() (const InlineOrigin* lhs, const InlineOrigin* rhs) const { - if (lhs->getFileID() == rhs->getFileID()) - return lhs->name < rhs->name; - return lhs->getFileID() < rhs->getFileID(); + bool operator()(const InlineOrigin* lhs, const InlineOrigin* rhs) const { + return lhs->name < rhs->name; } }; diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index fe76ad4d4..e9459c773 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -98,28 +98,28 @@ class SymbolParseHelper { char** filename); // out // Parses a |inline_origin_line| declaration. Returns true on success. - // Format: INLINE_ORIGIN . + // Format: INLINE_ORIGIN . // Notice, that this method modifies the input |inline_origin_line| which is - // why it can't be const. On success, , and are - // stored in |*origin_id|, |*file_id|, and |*name|. No allocation is + // why it can't be const. On success, and are + // stored in |*origin_id| and |*name|. No allocation is // done, |*name| simply points inside |inline_origin_line|. static bool ParseInlineOrigin(char* inline_origin_line, // in long* origin_id, // out - long* file_id, // out char** name); // out // Parses a |inline| declaration. Returns true on success. - // Format: INLINE
- // .... - // Notice, that this method modifies the input |inline| - // which is why it can't be const. On success, , - // and are stored in |*inline_nest_level|, - // |*call_site_line|, and |*origin_id|, and all pairs of (
, ) - // are added into ranges . + // Format: INLINE + // [
]+ + // Notice, that this method modifies the input + // |inline| which is why it can't be const. On success, , + // , and are stored in + // |*inline_nest_level|, |*call_site_line|, |*call_site_file_id| and + // |*origin_id|, and all pairs of (
, ) are added into ranges. static bool ParseInline( char* inline_line, // in long* inline_nest_level, // out long* call_site_line, // out + long* call_site_file_id, // out long* origin_id, // out std::vector>* ranges); // out diff --git a/src/google_breakpad/processor/source_line_resolver_base.h b/src/google_breakpad/processor/source_line_resolver_base.h index 2d2e4b35e..ba68798ab 100644 --- a/src/google_breakpad/processor/source_line_resolver_base.h +++ b/src/google_breakpad/processor/source_line_resolver_base.h @@ -41,6 +41,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ +#include #include #include #include @@ -86,7 +87,7 @@ class SourceLineResolverBase : public SourceLineResolverInterface { virtual bool IsModuleCorrupt(const CodeModule* module); virtual void FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames); + std::deque>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame); diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index 7880c922f..2614f65e0 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -34,6 +34,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ +#include #include #include #include @@ -98,7 +99,7 @@ class SourceLineResolverInterface { // inlined_frames in an order from outermost frame to inner most frame. virtual void FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames) = 0; + std::deque>* inlined_frames) = 0; // If Windows stack walking information is available covering // FRAME's instruction address, return a WindowsFrameInfo structure diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h index 0e2c60880..91ef64b54 100644 --- a/src/google_breakpad/processor/stack_frame_symbolizer.h +++ b/src/google_breakpad/processor/stack_frame_symbolizer.h @@ -35,6 +35,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ #define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ +#include #include #include #include @@ -82,7 +83,7 @@ class StackFrameSymbolizer { const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* stack_frame, - std::vector>* inlined_frames); + std::deque>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index bbaa13318..0db0d7353 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -50,10 +50,11 @@ #include "processor/tokenize.h" -using std::map; -using std::vector; +using std::deque; using std::make_pair; +using std::map; using std::unique_ptr; +using std::vector; namespace google_breakpad { @@ -237,42 +238,43 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( return true; } -int BasicSourceLineResolver::Module::ConstructInlineFrames( +void BasicSourceLineResolver::Module::ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - vector>* inlined_frames) const { + deque>* inlined_frames) const { linked_ptr in; MemAddr inline_base; if (!inlines.RetrieveRange(address, &in, &inline_base, nullptr, nullptr)) - return -1; + return; auto origin = inline_origins_.find(in->origin_id); if (origin == inline_origins_.end()) - return -1; + return; - StackFrame new_frame = StackFrame(*frame); - new_frame.function_name = origin->second->name; + // Update parent frame's source line and source file. + frame->source_line = in->call_site_line; + auto file = files_.find(in->call_site_file_id); + if (file != files_.end()) { + frame->source_file_name = file->second; + } + + // Create a child frame of `frame`. + StackFrame child_frame = StackFrame(*frame); + child_frame.function_name = origin->second->name; // Use the starting adress of the inlined range as inlined function base. - new_frame.function_base = new_frame.module->base_address() + inline_base; - auto it = files_.find(origin->second->source_file_id); - if (it != files_.end()) - new_frame.source_file_name = it->second; - - new_frame.trust = StackFrame::FRAME_TRUST_INLINE; - // Must add frames before calling ConstructInlineFrames to get correct order. - int current_idx = inlined_frames->size(); - inlined_frames->push_back(unique_ptr(new StackFrame(new_frame))); - int source_line = ConstructInlineFrames(&new_frame, address, - in->child_inlines, inlined_frames); - if (source_line != -1) { - (*inlined_frames)[current_idx]->source_line = source_line; - } - return in->call_site_line; + child_frame.function_base = child_frame.module->base_address() + inline_base; + child_frame.trust = StackFrame::FRAME_TRUST_INLINE; + ConstructInlineFrames(&child_frame, address, in->child_inlines, + inlined_frames); + // Add child_frame after ConstructInlineFrames so that the innermost frame is + // the first frame inside inlined_frames. + inlined_frames->push_back( + unique_ptr(new StackFrame(child_frame))); } void BasicSourceLineResolver::Module::LookupAddress( StackFrame* frame, - vector>* inlined_frames) const { + deque>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use @@ -306,10 +308,13 @@ void BasicSourceLineResolver::Module::LookupAddress( // Check if this is inlined function call. if (inlined_frames) { - int source_line = - ConstructInlineFrames(frame, address, func->inlines, inlined_frames); - if (source_line != -1) { - frame->source_line = source_line; + int source_line = frame->source_line; + string source_file_name = frame->source_file_name; + ConstructInlineFrames(frame, address, func->inlines, inlined_frames); + if (!inlined_frames->empty()) { + // Update the inner most frame's source line and source file name. + inlined_frames->front()->source_line = source_line; + inlined_frames->front()->source_file_name = source_file_name; } } } else if (public_symbols_.Retrieve(address, @@ -416,12 +421,10 @@ bool BasicSourceLineResolver::Module::ParseFile(char* file_line) { bool BasicSourceLineResolver::Module::ParseInlineOrigin( char* inline_origin_line) { long origin_id; - long source_file_id; char* origin_name; if (SymbolParseHelper::ParseInlineOrigin(inline_origin_line, &origin_id, - &source_file_id, &origin_name)) { - inline_origins_.insert( - make_pair(origin_id, new InlineOrigin(source_file_id, origin_name))); + &origin_name)) { + inline_origins_.insert(make_pair(origin_id, new InlineOrigin(origin_name))); return true; } return false; @@ -431,12 +434,14 @@ linked_ptr BasicSourceLineResolver::Module::ParseInline(char* inline_line) { long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; vector> ranges; if (SymbolParseHelper::ParseInline(inline_line, &inline_nest_level, - &call_site_line, &origin_id, &ranges)) { - return linked_ptr( - new Inline(inline_nest_level, call_site_line, origin_id, ranges)); + &call_site_line, &call_site_file_id, + &origin_id, &ranges)) { + return linked_ptr(new Inline(inline_nest_level, call_site_line, + call_site_file_id, origin_id, ranges)); } return linked_ptr(); } @@ -636,13 +641,12 @@ bool SymbolParseHelper::ParseFile(char* file_line, long* index, // static bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, long* origin_id, - long* file_id, char** name) { - // INLINE_ORIGIN + // INLINE_ORIGIN assert(strncmp(inline_origin_line, "INLINE_ORIGIN ", 14) == 0); inline_origin_line += 14; // skip prefix vector tokens; - if (!Tokenize(inline_origin_line, kWhitespace, 3, &tokens)) { + if (!Tokenize(inline_origin_line, kWhitespace, 2, &tokens)) { return false; } @@ -653,15 +657,7 @@ bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, return false; } - *file_id = strtol(tokens[1], &after_number, 10); - // If the file id is -1, it might be an artificial function that doesn't have - // file id. So, we consider -1 as a valid special case. - if (!IsValidAfterNumber(after_number) || - *file_id < -1 | *origin_id == std::numeric_limits::max()) { - return false; - } - - *name = tokens[2]; + *name = tokens[1]; if (!*name) { return false; } @@ -674,18 +670,19 @@ bool SymbolParseHelper::ParseInline( char* inline_line, long* inline_nest_level, long* call_site_line, + long* call_site_file_id, long* origin_id, vector>* ranges) { - // INLINE
- // ... + // INLINE + // [
]+ assert(strncmp(inline_line, "INLINE ", 7) == 0); inline_line += 7; // skip prefix vector tokens; Tokenize(inline_line, kWhitespace, std::numeric_limits::max(), &tokens); - // The length of the vector should be at least 5 and an odd number. - if (tokens.size() < 5 && tokens.size() % 2 == 0) + // The length of the vector should be at least 6 and an even number. + if (tokens.size() < 6 || tokens.size() % 2 != 0) return false; char* after_number; @@ -701,13 +698,21 @@ bool SymbolParseHelper::ParseInline( return false; } - *origin_id = strtol(tokens[2], &after_number, 10); + *call_site_file_id = strtol(tokens[2], &after_number, 10); + // If the file id is -1, it might be an artificial function that doesn't have + // file id. So, we consider -1 as a valid special case. + if (!IsValidAfterNumber(after_number) || *call_site_file_id < -1 || + *call_site_file_id == std::numeric_limits::max()) { + return false; + } + + *origin_id = strtol(tokens[3], &after_number, 10); if (!IsValidAfterNumber(after_number) || *origin_id < 0 || *origin_id == std::numeric_limits::max()) { return false; } - for (size_t i = 3; i < tokens.size();) { + for (size_t i = 4; i < tokens.size();) { MemAddr address = strtoull(tokens[i++], &after_number, 16); if (!IsValidAfterNumber(after_number) || address == std::numeric_limits::max()) { diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h index 482176f45..60c067560 100644 --- a/src/processor/basic_source_line_resolver_types.h +++ b/src/processor/basic_source_line_resolver_types.h @@ -37,6 +37,7 @@ #ifndef PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__ #define PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__ +#include #include #include @@ -108,15 +109,18 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frame) const; - - // Construct inlined frame for frame and return inlined function call site - // source line. If failed to construct inlined frame, return -1. - virtual int ConstructInlineFrames( + std::deque>* inlined_frame) const; + + // Construct inlined frames for frame. Return true on success. + // If successfully construct inlined frames for `frame`, `inline_frames` will + // be filled with lined frames and frame->source_file_name and + // frame->source_line will be update to represents the outermost frame. + // If failed, `inline_frames` will be empty and frame remains unchanged. + virtual void ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - std::vector>* inline_frames) const; + std::deque>* inline_frames) const; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index 914f0963c..8db562176 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -421,40 +421,40 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveInlines) { "linux_inline.sym")); ASSERT_TRUE(resolver.HasModule(&module)); StackFrame frame; - std::vector> inlined_frames; + std::deque> inlined_frames; frame.instruction = 0x161b6; frame.module = &module; // main frame. resolver.FillSourceLineInfo(&frame, &inlined_frames); ASSERT_EQ(frame.function_name, "main"); ASSERT_EQ(frame.function_base, 0x15b30U); - ASSERT_EQ(frame.source_file_name, "linux_inline.cpp"); + ASSERT_EQ(frame.source_file_name, "a.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames.size(), 3UL); // Inlined frames inside main frame. - ASSERT_EQ(inlined_frames[0]->function_name, "foo()"); - ASSERT_EQ(inlined_frames[0]->function_base, 0x15b45U); - ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); - ASSERT_EQ(inlined_frames[0]->source_line, 39); - ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); - ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); + ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "b.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 39); + ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); - ASSERT_EQ(inlined_frames[1]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[1]->source_file_name, "c.cpp"); ASSERT_EQ(inlined_frames[1]->source_line, 32); ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); - ASSERT_EQ(inlined_frames[2]->function_name, "func()"); - ASSERT_EQ(inlined_frames[2]->function_base, 0x15b83U); - ASSERT_EQ(inlined_frames[2]->source_file_name, "linux_inline.cpp"); - ASSERT_EQ(inlined_frames[2]->source_line, 27); - ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); - ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); + ASSERT_EQ(inlined_frames[0]->function_name, "func()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); } // Test parsing of valid FILE lines. The format is: @@ -781,25 +781,15 @@ TEST(SymbolParseHelper, ParsePublicSymbolInvalid) { } // Test parsing of valid INLINE_ORIGIN lines. The format is: -// INLINE_ORIGIN +// INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginValid) { long origin_id; - long file_id; char* name; - char kTestLine[] = "INLINE_ORIGIN 1 1 function name"; - ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, - &file_id, &name)); + char kTestLine[] = "INLINE_ORIGIN 1 function name"; + ASSERT_TRUE( + SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, &name)); EXPECT_EQ(1, origin_id); - EXPECT_EQ(1, file_id); - EXPECT_EQ("function name", string(name)); - - // -1 is a file id, which is used when the function is artifical. - char kTestLine1[] = "INLINE_ORIGIN 0 -1 function name"; - ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, - &file_id, &name)); - EXPECT_EQ(0, origin_id); - EXPECT_EQ(-1, file_id); EXPECT_EQ("function name", string(name)); } @@ -807,28 +797,27 @@ TEST(SymbolParseHelper, ParseInlineOriginValid) { // INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginInvalid) { long origin_id; - long file_id; char* name; // Test missing function name. - char kTestLine[] = "INLINE_ORIGIN 1 1"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, - &file_id, &name)); + char kTestLine[] = "INLINE_ORIGIN 1"; + ASSERT_FALSE( + SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, &name)); // Test bad origin id. - char kTestLine1[] = "INLINE_ORIGIN x1 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, - &file_id, &name)); + char kTestLine1[] = "INLINE_ORIGIN x1 function name"; + ASSERT_FALSE( + SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, &name)); // Test large origin id. - char kTestLine2[] = "INLINE_ORIGIN 123123123123123123123123 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine2, &origin_id, - &file_id, &name)); + char kTestLine2[] = "INLINE_ORIGIN 123123123123123123123123 function name"; + ASSERT_FALSE( + SymbolParseHelper::ParseInlineOrigin(kTestLine2, &origin_id, &name)); // Test negative origin id. - char kTestLine3[] = "INLINE_ORIGIN -1 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine3, &origin_id, - &file_id, &name)); + char kTestLine3[] = "INLINE_ORIGIN -1 function name"; + ASSERT_FALSE( + SymbolParseHelper::ParseInlineOrigin(kTestLine3, &origin_id, &name)); } // Test parsing of valid INLINE lines. The format is: @@ -836,26 +825,31 @@ TEST(SymbolParseHelper, ParseInlineOriginInvalid) { TEST(SymbolParseHelper, ParseInlineValid) { long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; std::vector> ranges; - char kTestLine[] = "INLINE 0 1 2 3 4"; + char kTestLine[] = "INLINE 0 1 2 3 4 5"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); - EXPECT_EQ(2, origin_id); - EXPECT_EQ(0x3ULL, ranges[0].first); - EXPECT_EQ(0x4ULL, ranges[0].second); + EXPECT_EQ(2, call_site_file_id); + EXPECT_EQ(3, origin_id); + EXPECT_EQ(0x4ULL, ranges[0].first); + EXPECT_EQ(0x5ULL, ranges[0].second); ranges.clear(); // Test hex and discontinuous ranges. - char kTestLine1[] = "INLINE 0 1 2 a b 1a 1b"; + char kTestLine1[] = "INLINE 0 1 2 3 a b 1a 1b"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine1, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); - EXPECT_EQ(2, origin_id); + EXPECT_EQ(2, call_site_file_id); + EXPECT_EQ(3, origin_id); EXPECT_EQ(0xaULL, ranges[0].first); EXPECT_EQ(0xbULL, ranges[0].second); EXPECT_EQ(0x1aULL, ranges[1].first); @@ -867,33 +861,39 @@ TEST(SymbolParseHelper, ParseInlineValid) { TEST(SymbolParseHelper, ParseInlineInvalid) { long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; std::vector> ranges; // Test negative inline_nest_level. - char kTestLine[] = "INLINE -1 1 2 3 4"; + char kTestLine[] = "INLINE -1 1 2 3 4 5"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); // Test negative call_site_line. - char kTestLine1[] = "INLINE 0 -1 2 3 4"; + char kTestLine1[] = "INLINE 0 -1 2 3 4 5"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine1, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); // Test negative origin_id. - char kTestLine2[] = "INLINE 0 1 -2 3 4"; + char kTestLine2[] = "INLINE 0 1 2 -3 4 5"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine2, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine2, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); // Test missing ranges. - char kTestLine3[] = "INLINE 0 1 -2"; + char kTestLine3[] = "INLINE 0 1 2 -2"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine3, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine3, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); // Test missing size for range. - char kTestLine4[] = "INLINE 0 1 -2 3"; + char kTestLine4[] = "INLINE 0 1 -2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine4, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine4, &inline_nest_level, &call_site_line, &call_site_file_id, + &origin_id, &ranges)); } } // namespace diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 029f21f47..317864604 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -64,7 +64,7 @@ bool FastSourceLineResolver::ShouldDeleteMemoryBufferAfterLoadModule() { void FastSourceLineResolver::Module::LookupAddress( StackFrame* frame, - vector>* inlined_frames) const { + std::deque>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index aa02fc113..2d1bcfcbc 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -119,7 +119,7 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frames) const; + std::deque>* inlined_frames) const; // Loads a map from the given buffer in char* type. virtual bool LoadMapFromMemory(char* memory_buffer, diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index 16c822246..cea1a46d1 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -297,7 +297,7 @@ bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule* module) { void SourceLineResolverBase::FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames) { + std::deque>* inlined_frames) { if (frame->module) { ModuleMap::const_iterator it = modules_->find(frame->module->code_file()); if (it != modules_->end()) { diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 3e3afd0ef..44968bf6b 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -40,6 +40,7 @@ #include +#include #include #include #include @@ -70,10 +71,7 @@ class SourceLineResolverBase::AutoFileCloser { }; struct SourceLineResolverBase::InlineOrigin { - InlineOrigin(int32_t source_file_id, const string& name) - : source_file_id(source_file_id), name(name) {} - - int32_t source_file_id; + explicit InlineOrigin(const string& name) : name(name) {} string name; }; @@ -82,15 +80,18 @@ struct SourceLineResolverBase::Inline { using InlineRanges = std::vector>; Inline(int32_t inline_nest_level, int32_t call_site_line, + int32_t call_site_file_id, int32_t origin_id, InlineRanges inline_ranges) : inline_nest_level(inline_nest_level), call_site_line(call_site_line), + call_site_file_id(call_site_file_id), origin_id(origin_id), inline_ranges(inline_ranges) {} int32_t inline_nest_level; int32_t call_site_line; + int32_t call_site_file_id; int32_t origin_id; InlineRanges inline_ranges; RangeMap> child_inlines; @@ -174,7 +175,7 @@ class SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frames) const = 0; + std::deque>* inlined_frames) const = 0; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc index 6490ca90e..a460bc9ed 100644 --- a/src/processor/stack_frame_symbolizer.cc +++ b/src/processor/stack_frame_symbolizer.cc @@ -58,7 +58,7 @@ StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo( const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* frame, - std::vector>* inlined_frames) { + std::deque>* inlined_frames) { assert(frame); const CodeModule* module = NULL; diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index 856a6a668..c1e17084d 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -218,7 +218,7 @@ static void PrintStackContents(const string& indent, modules->GetModuleForAddress(pointee_frame.instruction); // Try to look up the function name. - vector> inlined_frames; + std::deque> inlined_frames; if (pointee_frame.module) resolver->FillSourceLineInfo(&pointee_frame, &inlined_frames); diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index d4897d4c1..cb3831197 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -138,7 +138,7 @@ bool Stackwalker::Walk( // frame_pointer fields. The frame structure comes from either the // context frame (above) or a caller frame (below). - vector> inlined_frames; + std::deque> inlined_frames; // Resolve the module information, if a module map was provided. StackFrameSymbolizer::SymbolizerResult symbolizer_result = frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_, @@ -174,10 +174,10 @@ bool Stackwalker::Walk( default: break; } - // Add all nested inlined frames belonging to this frame in reverse order. + // Add all nested inlined frames belonging to this frame from left to right. while (!inlined_frames.empty()) { - stack->frames_.push_back(inlined_frames.back().release()); - inlined_frames.pop_back(); + stack->frames_.push_back(inlined_frames.front().release()); + inlined_frames.pop_front(); } // Add the frame to the call stack. Relinquish the ownership claim // over the frame, because the stack now owns it. diff --git a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym index 775640f0d..db7971421 100644 --- a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym +++ b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym @@ -1,13 +1,16 @@ MODULE Linux x86_64 BBA6FA10B8AAB33D00000000000000000 linux_inline INFO CODE_ID 10FAA6BBAAB83DB3 FILE 0 linux_inline.cpp -INLINE_ORIGIN 0 0 bar() -INLINE_ORIGIN 1 0 foo() -INLINE_ORIGIN 2 0 func() +FILE 1 a.cpp +FILE 2 b.cpp +FILE 3 c.cpp +INLINE_ORIGIN 0 bar() +INLINE_ORIGIN 1 foo() +INLINE_ORIGIN 2 func() FUNC 15b30 6cf 0 main -INLINE 0 42 1 15b45 6b1 -INLINE 1 39 0 15b72 684 -INLINE 2 32 2 15b83 673 +INLINE 0 42 1 1 15b45 6b1 +INLINE 1 39 2 0 15b72 684 +INLINE 2 32 3 2 15b83 673 15b30 15 41 0 15b45 11 36 0 15b56 a 37 0 From 076073c96b3df6823f8e00fa525cd90f71eae347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kempe?= Date: Fri, 15 Oct 2021 17:20:23 +0100 Subject: [PATCH 028/195] Enable PA and BTI for breakpad Introduces Arm's Pointer Authentication and Branch Target Identification to breakpad. The changes are similar to changes for PA/BTI to Marl, see https://github.com/google/marl/pull/204 Bug: 1145581 Change-Id: I6a770316ad333bfcfad2ce7f3c1ff78afb35c010 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3226471 Reviewed-by: Primiano Tucci --- src/common/linux/breakpad_getcontext.S | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/common/linux/breakpad_getcontext.S b/src/common/linux/breakpad_getcontext.S index 528dba7a9..2ebcf3191 100644 --- a/src/common/linux/breakpad_getcontext.S +++ b/src/common/linux/breakpad_getcontext.S @@ -90,6 +90,47 @@ breakpad_getcontext: #elif defined(__aarch64__) +#if defined(__ARM_FEATURE_PAC_DEFAULT) && __ARM_FEATURE_PAC_DEFAULT + // ENABLE_PAUTH must be defined to 1 since this value will be used in + // bitwise-shift later! + #define ENABLE_PAUTH 1 + + #if ((__ARM_FEATURE_PAC_DEFAULT&((1<<0)|(1<<1)))==0) + #error Pointer authentication defines no valid key! + #endif +#else + #define ENABLE_PAUTH 0 +#endif + +#if defined(__ARM_FEATURE_BTI_DEFAULT) && (__ARM_FEATURE_BTI_DEFAULT==1) + // ENABLE_BTI must be defined to 1 since this value will be used in + // bitwise-shift later! + #define ENABLE_BTI 1 +#else + #define ENABLE_BTI 0 +#endif + + +// Although Pointer Authentication and Branch Target Instructions are technically +// seperate features they work together, i.e. the paciasp and pacibsp instructions +// serve as BTI landing pads. +// Therefore PA-instructions are enabled when PA _or_ BTI is enabled! +#if ENABLE_PAUTH || ENABLE_BTI + // See section "Pointer Authentication" of + // https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros + // for details how to interpret __ARM_FEATURE_PAC_DEFAULT + #if (__ARM_FEATURE_PAC_DEFAULT & (1<<0)) + #define PAUTH_SIGN_SP paciasp + #define PAUTH_AUTH_SP autiasp + #else + #define PAUTH_SIGN_SP pacibsp + #define PAUTH_AUTH_SP autibsp + #endif +#else + #define PAUTH_SIGN_SP + #define PAUTH_AUTH_SP +#endif + #define _NSIG 64 #define __NR_rt_sigprocmask 135 @@ -101,6 +142,8 @@ breakpad_getcontext: .cfi_startproc breakpad_getcontext: + PAUTH_SIGN_SP + /* The saved context will return to the getcontext() call point with a return value of 0 */ str xzr, [x0, MCONTEXT_GREGS_OFFSET + 0 * REGISTER_SIZE] @@ -170,6 +213,9 @@ breakpad_getcontext: /* Return x0 for success */ mov x0, 0 + + PAUTH_AUTH_SP + ret .cfi_endproc @@ -484,3 +530,23 @@ breakpad_getcontext: #else #error "This file has not been ported for your CPU!" #endif + +#if defined(__aarch64__) +// ENABLE_PAUTH and ENABLE_BTI would be enabled at the definition +// of AArch64 specific breakpad_getcontext function +#if ENABLE_PAUTH || ENABLE_BTI +// for further information on the .note.gnu.property section see +// https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#program-property +.pushsection .note.gnu.property, "a"; + .balign 8 + .long 4 + .long 0x10 + .long 0x5 + .asciz "GNU" + .long 0xc0000000 /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */ + .long 4 + .long ((ENABLE_PAUTH)<<1) | ((ENABLE_BTI)<<0) /* PAuth and BTI */ + .long 0 +.popsection +#endif +#endif From dfcb7b6799b7c1e2c8d65e857d8afede185471d8 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Tue, 26 Oct 2021 09:31:09 -0400 Subject: [PATCH 029/195] Revert "Fix incorrect source file name for inlined frames" This reverts commit 54d878abcb61623a71e5c2b5bb251e7f7fc8563d. 54d878abcb61 changed the dump_syms format incompatibly. This must be redone in a multi-step process: the processor must be made to understand the old and new formats simultaneously and the processor service must be rebuilt and run with that update before dump_syms output can change to use the new format. Bug: chromium:1263390 Change-Id: I5b6f8aff8ea2916b2c07ac6a74b569fa27db51b9 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3244775 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 36 +++--- src/common/module.cc | 42 ++++-- src/common/module.h | 39 ++---- .../processor/basic_source_line_resolver.h | 22 ++-- .../processor/source_line_resolver_base.h | 3 +- .../source_line_resolver_interface.h | 3 +- .../processor/stack_frame_symbolizer.h | 3 +- src/processor/basic_source_line_resolver.cc | 111 ++++++++-------- .../basic_source_line_resolver_types.h | 16 +-- .../basic_source_line_resolver_unittest.cc | 120 +++++++++--------- src/processor/fast_source_line_resolver.cc | 2 +- .../fast_source_line_resolver_types.h | 2 +- src/processor/source_line_resolver_base.cc | 2 +- .../source_line_resolver_base_types.h | 11 +- src/processor/stack_frame_symbolizer.cc | 2 +- src/processor/stackwalk_common.cc | 2 +- src/processor/stackwalker.cc | 8 +- .../linux_inline.sym | 15 +-- 18 files changed, 215 insertions(+), 224 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 82131e7b9..04d19479b 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -254,6 +254,9 @@ struct DwarfCUToModule::CUContext { // A map of function pointers to the its forward specification DIE's offset. map spec_function_offsets; + + // From file index to vector of subprogram's offset in this CU. + map> inline_origins; }; // Information about the context of a particular DIE. This is for @@ -558,8 +561,7 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler { DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx uint64_t ranges_data_; // DW_AT_ranges - int call_site_line_; // DW_AT_call_line - int call_site_file_id_; // DW_AT_call_file + int call_site_line_; int inline_nest_level_; // A vector of inlines in the same nest level. It's owned by its parent // function/inline. At Finish(), add this inline into the vector. @@ -587,9 +589,6 @@ void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned( case DW_AT_call_line: call_site_line_ = data; break; - case DW_AT_call_file: - call_site_file_id_ = data; - break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -662,8 +661,8 @@ void DwarfCUToModule::InlineHandler::Finish() { cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(specification_offset_, name_); unique_ptr in( - new Module::Inline(origin, ranges, call_site_line_, call_site_file_id_, - inline_nest_level_, std::move(child_inlines_))); + new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, + std::move(child_inlines_))); inlines_.push_back(std::move(in)); } @@ -680,6 +679,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { high_pc_form_(DW_FORM_addr), ranges_form_(DW_FORM_sec_offset), ranges_data_(0), + decl_file_data_(UINT64_MAX), inline_(false), handle_inline_(handle_inline) {} @@ -700,7 +700,9 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { uint64_t low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx - uint64_t ranges_data_; // DW_AT_ranges + uint64_t ranges_data_; // DW_AT_ranges + // DW_AT_decl_file, value of UINT64_MAX means undefined. + uint64_t decl_file_data_; bool inline_; vector> child_inlines_; bool handle_inline_; @@ -725,6 +727,9 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( ranges_data_ = data; ranges_form_ = form; break; + case DW_AT_decl_file: + decl_file_data_ = data; + break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -852,7 +857,8 @@ void DwarfCUToModule::FuncHandler::Finish() { // Only keep track of DW_TAG_subprogram which have the attributes we are // interested. - if (handle_inline_ && (!empty_range || inline_)) { + if (handle_inline_ && + (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { StringView name = name_.empty() ? name_omitted : name_; uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; @@ -860,6 +866,8 @@ void DwarfCUToModule::FuncHandler::Finish() { offset); cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(offset_, name); + if (decl_file_data_ != UINT64_MAX) + cu_context_->inline_origins[decl_file_data_].push_back(offset_); } } @@ -1442,12 +1450,10 @@ void DwarfCUToModule::AssignLinesToFunctions() { } void DwarfCUToModule::AssignFilesToInlines() { - // Assign File* to Inlines inside this CU. - auto assignFile = [this](unique_ptr& in) { - in->call_site_file = files_[in->call_site_file_id]; - }; - for (auto func : cu_context_->functions) { - Module::Inline::InlineDFS(func->inlines, assignFile); + for (auto iter : files_) { + cu_context_->file_context->module_->inline_origin_map + .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], + iter.second); } } diff --git a/src/common/module.cc b/src/common/module.cc index 381dd5d5a..3945e2dd3 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -97,6 +97,17 @@ void Module::InlineOriginMap::SetReference(uint64_t offset, references_[offset] = specification_offset; } +void Module::InlineOriginMap::AssignFilesToInlineOrigins( + const vector& inline_origin_offsets, + Module::File* file) { + for (uint64_t offset : inline_origin_offsets) + if (references_.find(offset) != references_.end()) { + auto origin = inline_origins_.find(references_[offset]); + if (origin != inline_origins_.end()) + origin->second->file = file; + } +} + Module::Module(const string& name, const string& os, const string& architecture, const string& id, const string& code_id /* = "" */) : @@ -265,18 +276,13 @@ void Module::AssignSourceIds( line_it != func->lines.end(); ++line_it) line_it->file->source_id = 0; } - - // Also mark all files cited by inline callsite by setting each one's source + // Also mark all files cited by inline functions by setting each one's source // id to zero. - auto markInlineFiles = [](unique_ptr& in) { + for (InlineOrigin* origin : inline_origins) // There are some artificial inline functions which don't belong to // any file. Those will have file id -1. - if (in->call_site_file) - in->call_site_file->source_id = 0; - }; - for (auto func : functions_) { - Inline::InlineDFS(func->inlines, markInlineFiles); - } + if (origin->file) + origin->file->source_id = 0; // Finally, assign source ids to those files that have been marked. // We could have just assigned source id numbers while traversing @@ -290,6 +296,15 @@ void Module::AssignSourceIds( } } +static void InlineDFS( + vector>& inlines, + std::function&)> const& forEach) { + for (unique_ptr& in : inlines) { + forEach(in); + InlineDFS(in->child_inlines, forEach); + } +} + void Module::CreateInlineOrigins( set& inline_origins) { // Only add origins that have file and deduplicate origins with same name and @@ -302,7 +317,7 @@ void Module::CreateInlineOrigins( in->origin = *it; }; for (Function* func : functions_) - Module::Inline::InlineDFS(func->inlines, addInlineOrigins); + InlineDFS(func->inlines, addInlineOrigins); int next_id = 0; for (InlineOrigin* origin : inline_origins) { origin->id = next_id++; @@ -366,7 +381,8 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } // Write out inline origins. for (InlineOrigin* origin : inline_origins) { - stream << "INLINE_ORIGIN " << origin->id << " " << origin->name << "\n"; + stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() + << " " << origin->name << "\n"; if (!stream.good()) return ReportError(); } @@ -391,12 +407,12 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { auto write_inline = [&](unique_ptr& in) { stream << "INLINE "; stream << in->inline_nest_level << " " << in->call_site_line << " " - << in->getCallSiteFileID() << " " << in->origin->id << hex; + << in->origin->id << hex; for (const Range& r : in->ranges) stream << " " << (r.address - load_address_) << " " << r.size; stream << dec << "\n"; }; - Module::Inline::InlineDFS(func->inlines, write_inline); + InlineDFS(func->inlines, write_inline); if (!stream.good()) return ReportError(); diff --git a/src/common/module.h b/src/common/module.h index bfd344dd7..c5e0abfc5 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -38,7 +38,6 @@ #ifndef COMMON_LINUX_MODULE_H__ #define COMMON_LINUX_MODULE_H__ -#include #include #include #include @@ -132,7 +131,7 @@ class Module { }; struct InlineOrigin { - explicit InlineOrigin(StringView name) : id(-1), name(name) {} + explicit InlineOrigin(StringView name): id(-1), name(name), file(nullptr) {} // A unique id for each InlineOrigin object. INLINE records use the id to // refer to its INLINE_ORIGIN record. @@ -140,6 +139,10 @@ class Module { // The inlined function's name. StringView name; + + File* file; + + int getFileID() const { return file ? file->source_id : -1; } }; // A inlined call site. @@ -147,14 +150,11 @@ class Module { Inline(InlineOrigin* origin, const vector& ranges, int call_site_line, - int call_site_file_id, int inline_nest_level, vector> child_inlines) : origin(origin), ranges(ranges), call_site_line(call_site_line), - call_site_file_id(call_site_file_id), - call_site_file(nullptr), inline_nest_level(inline_nest_level), child_inlines(std::move(child_inlines)) {} @@ -165,29 +165,10 @@ class Module { int call_site_line; - // The id is only meanful inside a CU. It's only used for looking up real - // File* after scanning a CU. - int call_site_file_id; - - File* call_site_file; - int inline_nest_level; // A list of inlines which are children of this inline. vector> child_inlines; - - int getCallSiteFileID() const { - return call_site_file ? call_site_file->source_id : -1; - } - - static void InlineDFS( - vector>& inlines, - std::function&)> const& forEach) { - for (std::unique_ptr& in : inlines) { - forEach(in); - InlineDFS(in->child_inlines, forEach); - } - } }; typedef map InlineOriginByOffset; @@ -201,7 +182,9 @@ class Module { // value of its DW_AT_specification or equals to offset if // DW_AT_specification doesn't exist in that DIE. void SetReference(uint64_t offset, uint64_t specification_offset); - + void AssignFilesToInlineOrigins( + const vector& inline_origin_offsets, + File* file); ~InlineOriginMap() { for (const auto& iter : inline_origins_) { delete iter.second; @@ -278,8 +261,10 @@ class Module { }; struct InlineOriginCompare { - bool operator()(const InlineOrigin* lhs, const InlineOrigin* rhs) const { - return lhs->name < rhs->name; + bool operator() (const InlineOrigin* lhs, const InlineOrigin* rhs) const { + if (lhs->getFileID() == rhs->getFileID()) + return lhs->name < rhs->name; + return lhs->getFileID() < rhs->getFileID(); } }; diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index e9459c773..fe76ad4d4 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -98,28 +98,28 @@ class SymbolParseHelper { char** filename); // out // Parses a |inline_origin_line| declaration. Returns true on success. - // Format: INLINE_ORIGIN . + // Format: INLINE_ORIGIN . // Notice, that this method modifies the input |inline_origin_line| which is - // why it can't be const. On success, and are - // stored in |*origin_id| and |*name|. No allocation is + // why it can't be const. On success, , and are + // stored in |*origin_id|, |*file_id|, and |*name|. No allocation is // done, |*name| simply points inside |inline_origin_line|. static bool ParseInlineOrigin(char* inline_origin_line, // in long* origin_id, // out + long* file_id, // out char** name); // out // Parses a |inline| declaration. Returns true on success. - // Format: INLINE - // [
]+ - // Notice, that this method modifies the input - // |inline| which is why it can't be const. On success, , - // , and are stored in - // |*inline_nest_level|, |*call_site_line|, |*call_site_file_id| and - // |*origin_id|, and all pairs of (
, ) are added into ranges. + // Format: INLINE
+ // .... + // Notice, that this method modifies the input |inline| + // which is why it can't be const. On success, , + // and are stored in |*inline_nest_level|, + // |*call_site_line|, and |*origin_id|, and all pairs of (
, ) + // are added into ranges . static bool ParseInline( char* inline_line, // in long* inline_nest_level, // out long* call_site_line, // out - long* call_site_file_id, // out long* origin_id, // out std::vector>* ranges); // out diff --git a/src/google_breakpad/processor/source_line_resolver_base.h b/src/google_breakpad/processor/source_line_resolver_base.h index ba68798ab..2d2e4b35e 100644 --- a/src/google_breakpad/processor/source_line_resolver_base.h +++ b/src/google_breakpad/processor/source_line_resolver_base.h @@ -41,7 +41,6 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ -#include #include #include #include @@ -87,7 +86,7 @@ class SourceLineResolverBase : public SourceLineResolverInterface { virtual bool IsModuleCorrupt(const CodeModule* module); virtual void FillSourceLineInfo( StackFrame* frame, - std::deque>* inlined_frames); + std::vector>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame); diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index 2614f65e0..7880c922f 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -34,7 +34,6 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ -#include #include #include #include @@ -99,7 +98,7 @@ class SourceLineResolverInterface { // inlined_frames in an order from outermost frame to inner most frame. virtual void FillSourceLineInfo( StackFrame* frame, - std::deque>* inlined_frames) = 0; + std::vector>* inlined_frames) = 0; // If Windows stack walking information is available covering // FRAME's instruction address, return a WindowsFrameInfo structure diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h index 91ef64b54..0e2c60880 100644 --- a/src/google_breakpad/processor/stack_frame_symbolizer.h +++ b/src/google_breakpad/processor/stack_frame_symbolizer.h @@ -35,7 +35,6 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ #define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ -#include #include #include #include @@ -83,7 +82,7 @@ class StackFrameSymbolizer { const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* stack_frame, - std::deque>* inlined_frames); + std::vector>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 0db0d7353..bbaa13318 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -50,11 +50,10 @@ #include "processor/tokenize.h" -using std::deque; -using std::make_pair; using std::map; -using std::unique_ptr; using std::vector; +using std::make_pair; +using std::unique_ptr; namespace google_breakpad { @@ -238,43 +237,42 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( return true; } -void BasicSourceLineResolver::Module::ConstructInlineFrames( +int BasicSourceLineResolver::Module::ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - deque>* inlined_frames) const { + vector>* inlined_frames) const { linked_ptr in; MemAddr inline_base; if (!inlines.RetrieveRange(address, &in, &inline_base, nullptr, nullptr)) - return; + return -1; auto origin = inline_origins_.find(in->origin_id); if (origin == inline_origins_.end()) - return; + return -1; - // Update parent frame's source line and source file. - frame->source_line = in->call_site_line; - auto file = files_.find(in->call_site_file_id); - if (file != files_.end()) { - frame->source_file_name = file->second; - } - - // Create a child frame of `frame`. - StackFrame child_frame = StackFrame(*frame); - child_frame.function_name = origin->second->name; + StackFrame new_frame = StackFrame(*frame); + new_frame.function_name = origin->second->name; // Use the starting adress of the inlined range as inlined function base. - child_frame.function_base = child_frame.module->base_address() + inline_base; - child_frame.trust = StackFrame::FRAME_TRUST_INLINE; - ConstructInlineFrames(&child_frame, address, in->child_inlines, - inlined_frames); - // Add child_frame after ConstructInlineFrames so that the innermost frame is - // the first frame inside inlined_frames. - inlined_frames->push_back( - unique_ptr(new StackFrame(child_frame))); + new_frame.function_base = new_frame.module->base_address() + inline_base; + auto it = files_.find(origin->second->source_file_id); + if (it != files_.end()) + new_frame.source_file_name = it->second; + + new_frame.trust = StackFrame::FRAME_TRUST_INLINE; + // Must add frames before calling ConstructInlineFrames to get correct order. + int current_idx = inlined_frames->size(); + inlined_frames->push_back(unique_ptr(new StackFrame(new_frame))); + int source_line = ConstructInlineFrames(&new_frame, address, + in->child_inlines, inlined_frames); + if (source_line != -1) { + (*inlined_frames)[current_idx]->source_line = source_line; + } + return in->call_site_line; } void BasicSourceLineResolver::Module::LookupAddress( StackFrame* frame, - deque>* inlined_frames) const { + vector>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use @@ -308,13 +306,10 @@ void BasicSourceLineResolver::Module::LookupAddress( // Check if this is inlined function call. if (inlined_frames) { - int source_line = frame->source_line; - string source_file_name = frame->source_file_name; - ConstructInlineFrames(frame, address, func->inlines, inlined_frames); - if (!inlined_frames->empty()) { - // Update the inner most frame's source line and source file name. - inlined_frames->front()->source_line = source_line; - inlined_frames->front()->source_file_name = source_file_name; + int source_line = + ConstructInlineFrames(frame, address, func->inlines, inlined_frames); + if (source_line != -1) { + frame->source_line = source_line; } } } else if (public_symbols_.Retrieve(address, @@ -421,10 +416,12 @@ bool BasicSourceLineResolver::Module::ParseFile(char* file_line) { bool BasicSourceLineResolver::Module::ParseInlineOrigin( char* inline_origin_line) { long origin_id; + long source_file_id; char* origin_name; if (SymbolParseHelper::ParseInlineOrigin(inline_origin_line, &origin_id, - &origin_name)) { - inline_origins_.insert(make_pair(origin_id, new InlineOrigin(origin_name))); + &source_file_id, &origin_name)) { + inline_origins_.insert( + make_pair(origin_id, new InlineOrigin(source_file_id, origin_name))); return true; } return false; @@ -434,14 +431,12 @@ linked_ptr BasicSourceLineResolver::Module::ParseInline(char* inline_line) { long inline_nest_level; long call_site_line; - long call_site_file_id; long origin_id; vector> ranges; if (SymbolParseHelper::ParseInline(inline_line, &inline_nest_level, - &call_site_line, &call_site_file_id, - &origin_id, &ranges)) { - return linked_ptr(new Inline(inline_nest_level, call_site_line, - call_site_file_id, origin_id, ranges)); + &call_site_line, &origin_id, &ranges)) { + return linked_ptr( + new Inline(inline_nest_level, call_site_line, origin_id, ranges)); } return linked_ptr(); } @@ -641,12 +636,13 @@ bool SymbolParseHelper::ParseFile(char* file_line, long* index, // static bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, long* origin_id, + long* file_id, char** name) { - // INLINE_ORIGIN + // INLINE_ORIGIN assert(strncmp(inline_origin_line, "INLINE_ORIGIN ", 14) == 0); inline_origin_line += 14; // skip prefix vector tokens; - if (!Tokenize(inline_origin_line, kWhitespace, 2, &tokens)) { + if (!Tokenize(inline_origin_line, kWhitespace, 3, &tokens)) { return false; } @@ -657,7 +653,15 @@ bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, return false; } - *name = tokens[1]; + *file_id = strtol(tokens[1], &after_number, 10); + // If the file id is -1, it might be an artificial function that doesn't have + // file id. So, we consider -1 as a valid special case. + if (!IsValidAfterNumber(after_number) || + *file_id < -1 | *origin_id == std::numeric_limits::max()) { + return false; + } + + *name = tokens[2]; if (!*name) { return false; } @@ -670,19 +674,18 @@ bool SymbolParseHelper::ParseInline( char* inline_line, long* inline_nest_level, long* call_site_line, - long* call_site_file_id, long* origin_id, vector>* ranges) { - // INLINE - // [
]+ + // INLINE
+ // ... assert(strncmp(inline_line, "INLINE ", 7) == 0); inline_line += 7; // skip prefix vector tokens; Tokenize(inline_line, kWhitespace, std::numeric_limits::max(), &tokens); - // The length of the vector should be at least 6 and an even number. - if (tokens.size() < 6 || tokens.size() % 2 != 0) + // The length of the vector should be at least 5 and an odd number. + if (tokens.size() < 5 && tokens.size() % 2 == 0) return false; char* after_number; @@ -698,21 +701,13 @@ bool SymbolParseHelper::ParseInline( return false; } - *call_site_file_id = strtol(tokens[2], &after_number, 10); - // If the file id is -1, it might be an artificial function that doesn't have - // file id. So, we consider -1 as a valid special case. - if (!IsValidAfterNumber(after_number) || *call_site_file_id < -1 || - *call_site_file_id == std::numeric_limits::max()) { - return false; - } - - *origin_id = strtol(tokens[3], &after_number, 10); + *origin_id = strtol(tokens[2], &after_number, 10); if (!IsValidAfterNumber(after_number) || *origin_id < 0 || *origin_id == std::numeric_limits::max()) { return false; } - for (size_t i = 4; i < tokens.size();) { + for (size_t i = 3; i < tokens.size();) { MemAddr address = strtoull(tokens[i++], &after_number, 16); if (!IsValidAfterNumber(after_number) || address == std::numeric_limits::max()) { diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h index 60c067560..482176f45 100644 --- a/src/processor/basic_source_line_resolver_types.h +++ b/src/processor/basic_source_line_resolver_types.h @@ -37,7 +37,6 @@ #ifndef PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__ #define PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__ -#include #include #include @@ -109,18 +108,15 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::deque>* inlined_frame) const; - - // Construct inlined frames for frame. Return true on success. - // If successfully construct inlined frames for `frame`, `inline_frames` will - // be filled with lined frames and frame->source_file_name and - // frame->source_line will be update to represents the outermost frame. - // If failed, `inline_frames` will be empty and frame remains unchanged. - virtual void ConstructInlineFrames( + std::vector>* inlined_frame) const; + + // Construct inlined frame for frame and return inlined function call site + // source line. If failed to construct inlined frame, return -1. + virtual int ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - std::deque>* inline_frames) const; + std::vector>* inline_frames) const; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index 8db562176..914f0963c 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -421,40 +421,40 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveInlines) { "linux_inline.sym")); ASSERT_TRUE(resolver.HasModule(&module)); StackFrame frame; - std::deque> inlined_frames; + std::vector> inlined_frames; frame.instruction = 0x161b6; frame.module = &module; // main frame. resolver.FillSourceLineInfo(&frame, &inlined_frames); ASSERT_EQ(frame.function_name, "main"); ASSERT_EQ(frame.function_base, 0x15b30U); - ASSERT_EQ(frame.source_file_name, "a.cpp"); + ASSERT_EQ(frame.source_file_name, "linux_inline.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames.size(), 3UL); // Inlined frames inside main frame. - ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); - ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); - ASSERT_EQ(inlined_frames[2]->source_file_name, "b.cpp"); - ASSERT_EQ(inlined_frames[2]->source_line, 39); - ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); - ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); + ASSERT_EQ(inlined_frames[0]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 39); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); - ASSERT_EQ(inlined_frames[1]->source_file_name, "c.cpp"); + ASSERT_EQ(inlined_frames[1]->source_file_name, "linux_inline.cpp"); ASSERT_EQ(inlined_frames[1]->source_line, 32); ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); - ASSERT_EQ(inlined_frames[0]->function_name, "func()"); - ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); - ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); - ASSERT_EQ(inlined_frames[0]->source_line, 27); - ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); - ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); + ASSERT_EQ(inlined_frames[2]->function_name, "func()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 27); + ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); } // Test parsing of valid FILE lines. The format is: @@ -781,15 +781,25 @@ TEST(SymbolParseHelper, ParsePublicSymbolInvalid) { } // Test parsing of valid INLINE_ORIGIN lines. The format is: -// INLINE_ORIGIN +// INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginValid) { long origin_id; + long file_id; char* name; - char kTestLine[] = "INLINE_ORIGIN 1 function name"; - ASSERT_TRUE( - SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, &name)); + char kTestLine[] = "INLINE_ORIGIN 1 1 function name"; + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, + &file_id, &name)); EXPECT_EQ(1, origin_id); + EXPECT_EQ(1, file_id); + EXPECT_EQ("function name", string(name)); + + // -1 is a file id, which is used when the function is artifical. + char kTestLine1[] = "INLINE_ORIGIN 0 -1 function name"; + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, + &file_id, &name)); + EXPECT_EQ(0, origin_id); + EXPECT_EQ(-1, file_id); EXPECT_EQ("function name", string(name)); } @@ -797,27 +807,28 @@ TEST(SymbolParseHelper, ParseInlineOriginValid) { // INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginInvalid) { long origin_id; + long file_id; char* name; // Test missing function name. - char kTestLine[] = "INLINE_ORIGIN 1"; - ASSERT_FALSE( - SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, &name)); + char kTestLine[] = "INLINE_ORIGIN 1 1"; + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, + &file_id, &name)); // Test bad origin id. - char kTestLine1[] = "INLINE_ORIGIN x1 function name"; - ASSERT_FALSE( - SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, &name)); + char kTestLine1[] = "INLINE_ORIGIN x1 1 function name"; + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, + &file_id, &name)); // Test large origin id. - char kTestLine2[] = "INLINE_ORIGIN 123123123123123123123123 function name"; - ASSERT_FALSE( - SymbolParseHelper::ParseInlineOrigin(kTestLine2, &origin_id, &name)); + char kTestLine2[] = "INLINE_ORIGIN 123123123123123123123123 1 function name"; + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine2, &origin_id, + &file_id, &name)); // Test negative origin id. - char kTestLine3[] = "INLINE_ORIGIN -1 function name"; - ASSERT_FALSE( - SymbolParseHelper::ParseInlineOrigin(kTestLine3, &origin_id, &name)); + char kTestLine3[] = "INLINE_ORIGIN -1 1 function name"; + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine3, &origin_id, + &file_id, &name)); } // Test parsing of valid INLINE lines. The format is: @@ -825,31 +836,26 @@ TEST(SymbolParseHelper, ParseInlineOriginInvalid) { TEST(SymbolParseHelper, ParseInlineValid) { long inline_nest_level; long call_site_line; - long call_site_file_id; long origin_id; std::vector> ranges; - char kTestLine[] = "INLINE 0 1 2 3 4 5"; + char kTestLine[] = "INLINE 0 1 2 3 4"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); - EXPECT_EQ(2, call_site_file_id); - EXPECT_EQ(3, origin_id); - EXPECT_EQ(0x4ULL, ranges[0].first); - EXPECT_EQ(0x5ULL, ranges[0].second); + EXPECT_EQ(2, origin_id); + EXPECT_EQ(0x3ULL, ranges[0].first); + EXPECT_EQ(0x4ULL, ranges[0].second); ranges.clear(); // Test hex and discontinuous ranges. - char kTestLine1[] = "INLINE 0 1 2 3 a b 1a 1b"; + char kTestLine1[] = "INLINE 0 1 2 a b 1a 1b"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); - EXPECT_EQ(2, call_site_file_id); - EXPECT_EQ(3, origin_id); + EXPECT_EQ(2, origin_id); EXPECT_EQ(0xaULL, ranges[0].first); EXPECT_EQ(0xbULL, ranges[0].second); EXPECT_EQ(0x1aULL, ranges[1].first); @@ -861,39 +867,33 @@ TEST(SymbolParseHelper, ParseInlineValid) { TEST(SymbolParseHelper, ParseInlineInvalid) { long inline_nest_level; long call_site_line; - long call_site_file_id; long origin_id; std::vector> ranges; // Test negative inline_nest_level. - char kTestLine[] = "INLINE -1 1 2 3 4 5"; + char kTestLine[] = "INLINE -1 1 2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); // Test negative call_site_line. - char kTestLine1[] = "INLINE 0 -1 2 3 4 5"; + char kTestLine1[] = "INLINE 0 -1 2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); // Test negative origin_id. - char kTestLine2[] = "INLINE 0 1 2 -3 4 5"; + char kTestLine2[] = "INLINE 0 1 -2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine2, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine2, &inline_nest_level, &call_site_line, &origin_id, &ranges)); // Test missing ranges. - char kTestLine3[] = "INLINE 0 1 2 -2"; + char kTestLine3[] = "INLINE 0 1 -2"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine3, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine3, &inline_nest_level, &call_site_line, &origin_id, &ranges)); // Test missing size for range. - char kTestLine4[] = "INLINE 0 1 -2 3 4"; + char kTestLine4[] = "INLINE 0 1 -2 3"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine4, &inline_nest_level, &call_site_line, &call_site_file_id, - &origin_id, &ranges)); + kTestLine4, &inline_nest_level, &call_site_line, &origin_id, &ranges)); } } // namespace diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 317864604..029f21f47 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -64,7 +64,7 @@ bool FastSourceLineResolver::ShouldDeleteMemoryBufferAfterLoadModule() { void FastSourceLineResolver::Module::LookupAddress( StackFrame* frame, - std::deque>* inlined_frames) const { + vector>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index 2d1bcfcbc..aa02fc113 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -119,7 +119,7 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::deque>* inlined_frames) const; + std::vector>* inlined_frames) const; // Loads a map from the given buffer in char* type. virtual bool LoadMapFromMemory(char* memory_buffer, diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index cea1a46d1..16c822246 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -297,7 +297,7 @@ bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule* module) { void SourceLineResolverBase::FillSourceLineInfo( StackFrame* frame, - std::deque>* inlined_frames) { + std::vector>* inlined_frames) { if (frame->module) { ModuleMap::const_iterator it = modules_->find(frame->module->code_file()); if (it != modules_->end()) { diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 44968bf6b..3e3afd0ef 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -40,7 +40,6 @@ #include -#include #include #include #include @@ -71,7 +70,10 @@ class SourceLineResolverBase::AutoFileCloser { }; struct SourceLineResolverBase::InlineOrigin { - explicit InlineOrigin(const string& name) : name(name) {} + InlineOrigin(int32_t source_file_id, const string& name) + : source_file_id(source_file_id), name(name) {} + + int32_t source_file_id; string name; }; @@ -80,18 +82,15 @@ struct SourceLineResolverBase::Inline { using InlineRanges = std::vector>; Inline(int32_t inline_nest_level, int32_t call_site_line, - int32_t call_site_file_id, int32_t origin_id, InlineRanges inline_ranges) : inline_nest_level(inline_nest_level), call_site_line(call_site_line), - call_site_file_id(call_site_file_id), origin_id(origin_id), inline_ranges(inline_ranges) {} int32_t inline_nest_level; int32_t call_site_line; - int32_t call_site_file_id; int32_t origin_id; InlineRanges inline_ranges; RangeMap> child_inlines; @@ -175,7 +174,7 @@ class SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::deque>* inlined_frames) const = 0; + std::vector>* inlined_frames) const = 0; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc index a460bc9ed..6490ca90e 100644 --- a/src/processor/stack_frame_symbolizer.cc +++ b/src/processor/stack_frame_symbolizer.cc @@ -58,7 +58,7 @@ StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo( const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* frame, - std::deque>* inlined_frames) { + std::vector>* inlined_frames) { assert(frame); const CodeModule* module = NULL; diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index c1e17084d..856a6a668 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -218,7 +218,7 @@ static void PrintStackContents(const string& indent, modules->GetModuleForAddress(pointee_frame.instruction); // Try to look up the function name. - std::deque> inlined_frames; + vector> inlined_frames; if (pointee_frame.module) resolver->FillSourceLineInfo(&pointee_frame, &inlined_frames); diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index cb3831197..d4897d4c1 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -138,7 +138,7 @@ bool Stackwalker::Walk( // frame_pointer fields. The frame structure comes from either the // context frame (above) or a caller frame (below). - std::deque> inlined_frames; + vector> inlined_frames; // Resolve the module information, if a module map was provided. StackFrameSymbolizer::SymbolizerResult symbolizer_result = frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_, @@ -174,10 +174,10 @@ bool Stackwalker::Walk( default: break; } - // Add all nested inlined frames belonging to this frame from left to right. + // Add all nested inlined frames belonging to this frame in reverse order. while (!inlined_frames.empty()) { - stack->frames_.push_back(inlined_frames.front().release()); - inlined_frames.pop_front(); + stack->frames_.push_back(inlined_frames.back().release()); + inlined_frames.pop_back(); } // Add the frame to the call stack. Relinquish the ownership claim // over the frame, because the stack now owns it. diff --git a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym index db7971421..775640f0d 100644 --- a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym +++ b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym @@ -1,16 +1,13 @@ MODULE Linux x86_64 BBA6FA10B8AAB33D00000000000000000 linux_inline INFO CODE_ID 10FAA6BBAAB83DB3 FILE 0 linux_inline.cpp -FILE 1 a.cpp -FILE 2 b.cpp -FILE 3 c.cpp -INLINE_ORIGIN 0 bar() -INLINE_ORIGIN 1 foo() -INLINE_ORIGIN 2 func() +INLINE_ORIGIN 0 0 bar() +INLINE_ORIGIN 1 0 foo() +INLINE_ORIGIN 2 0 func() FUNC 15b30 6cf 0 main -INLINE 0 42 1 1 15b45 6b1 -INLINE 1 39 2 0 15b72 684 -INLINE 2 32 3 2 15b83 673 +INLINE 0 42 1 15b45 6b1 +INLINE 1 39 0 15b72 684 +INLINE 2 32 2 15b83 673 15b30 15 41 0 15b45 11 36 0 15b56 a 37 0 From ee2ad61263ebc54396df7d7a835e1e3f8455134e Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 29 Oct 2021 16:20:55 -0700 Subject: [PATCH 030/195] Make processor compatible with both old and new format INLINE/INLINE_ORIGIN This is similar to the processor part of https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838/, but added compatibility to process both old and new format of INLINE/INLINE_ORIGIN records in symbol file. Old INLINE format: INLINE [
]+ New INLINE format: INLINE [
]+ Old INLINE_ORIGIN format: INLINE_ORIGIN New INLINE_ORIGIN format: INLINE_ORIGIN Change-Id: I555d9747bfd44a1a95113b9946dcd509b7710876 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3248433 Reviewed-by: Joshua Peraza --- .../processor/basic_source_line_resolver.h | 27 ++- .../processor/source_line_resolver_base.h | 3 +- .../source_line_resolver_interface.h | 3 +- .../processor/stack_frame_symbolizer.h | 3 +- src/processor/basic_source_line_resolver.cc | 162 +++++++++++----- .../basic_source_line_resolver_types.h | 12 +- .../basic_source_line_resolver_unittest.cc | 174 ++++++++++++++---- src/processor/fast_source_line_resolver.cc | 2 +- .../fast_source_line_resolver_types.h | 2 +- src/processor/source_line_resolver_base.cc | 2 +- .../source_line_resolver_base_types.h | 24 ++- src/processor/stack_frame_symbolizer.cc | 2 +- src/processor/stackwalk_common.cc | 2 +- src/processor/stackwalker.cc | 9 +- .../linux_inline.new.sym | 71 +++++++ ...{linux_inline.sym => linux_inline.old.sym} | 0 16 files changed, 377 insertions(+), 121 deletions(-) create mode 100644 src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.new.sym rename src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/{linux_inline.sym => linux_inline.old.sym} (100%) diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index fe76ad4d4..d676ab70e 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -98,28 +98,35 @@ class SymbolParseHelper { char** filename); // out // Parses a |inline_origin_line| declaration. Returns true on success. - // Format: INLINE_ORIGIN . + // Old Format: INLINE_ORIGIN . + // New Format: INLINE_ORIGIN . // Notice, that this method modifies the input |inline_origin_line| which is - // why it can't be const. On success, , and are - // stored in |*origin_id|, |*file_id|, and |*name|. No allocation is - // done, |*name| simply points inside |inline_origin_line|. + // why it can't be const. On success, , , + // and are stored in |*has_file_id*|, |*origin_id|, |*file_id|, and + // |*name|. No allocation is done, |*name| simply points inside + // |inline_origin_line|. static bool ParseInlineOrigin(char* inline_origin_line, // in + bool* has_file_id, // out long* origin_id, // out long* file_id, // out char** name); // out // Parses a |inline| declaration. Returns true on success. - // Format: INLINE
- // .... + // Old Format: INLINE + // [
]+ + // New Format: INLINE + // [
]+ // Notice, that this method modifies the input |inline| - // which is why it can't be const. On success, , - // and are stored in |*inline_nest_level|, - // |*call_site_line|, and |*origin_id|, and all pairs of (
, ) - // are added into ranges . + // which is why it can't be const. On success, , + // , and are stored in + // |*has_call_site_file_id*|, |*inline_nest_level|, |*call_site_line|, and + // |*origin_id|, and all pairs of (
, ) are added into ranges. static bool ParseInline( char* inline_line, // in + bool* has_call_site_file_id, // out long* inline_nest_level, // out long* call_site_line, // out + long* call_site_file_id, // out long* origin_id, // out std::vector>* ranges); // out diff --git a/src/google_breakpad/processor/source_line_resolver_base.h b/src/google_breakpad/processor/source_line_resolver_base.h index 2d2e4b35e..ba68798ab 100644 --- a/src/google_breakpad/processor/source_line_resolver_base.h +++ b/src/google_breakpad/processor/source_line_resolver_base.h @@ -41,6 +41,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__ +#include #include #include #include @@ -86,7 +87,7 @@ class SourceLineResolverBase : public SourceLineResolverInterface { virtual bool IsModuleCorrupt(const CodeModule* module); virtual void FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames); + std::deque>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame); diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index 7880c922f..2614f65e0 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -34,6 +34,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ #define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__ +#include #include #include #include @@ -98,7 +99,7 @@ class SourceLineResolverInterface { // inlined_frames in an order from outermost frame to inner most frame. virtual void FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames) = 0; + std::deque>* inlined_frames) = 0; // If Windows stack walking information is available covering // FRAME's instruction address, return a WindowsFrameInfo structure diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h index 0e2c60880..91ef64b54 100644 --- a/src/google_breakpad/processor/stack_frame_symbolizer.h +++ b/src/google_breakpad/processor/stack_frame_symbolizer.h @@ -35,6 +35,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ #define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__ +#include #include #include #include @@ -82,7 +83,7 @@ class StackFrameSymbolizer { const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* stack_frame, - std::vector>* inlined_frames); + std::deque>* inlined_frames); virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index bbaa13318..2e05d72a3 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -50,10 +50,11 @@ #include "processor/tokenize.h" -using std::map; -using std::vector; +using std::deque; using std::make_pair; +using std::map; using std::unique_ptr; +using std::vector; namespace google_breakpad { @@ -237,42 +238,47 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( return true; } -int BasicSourceLineResolver::Module::ConstructInlineFrames( +void BasicSourceLineResolver::Module::ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - vector>* inlined_frames) const { + deque>* inlined_frames) const { linked_ptr in; MemAddr inline_base; if (!inlines.RetrieveRange(address, &in, &inline_base, nullptr, nullptr)) - return -1; + return; auto origin = inline_origins_.find(in->origin_id); if (origin == inline_origins_.end()) - return -1; + return; + + // Update parent frame's source line (and source file if it's the new format). + frame->source_line = in->call_site_line; + if (in->has_call_site_file_id) { + auto file = files_.find(in->call_site_file_id); + if (file != files_.end()) { + frame->source_file_name = file->second; + } + } StackFrame new_frame = StackFrame(*frame); new_frame.function_name = origin->second->name; + if (origin->second->has_file_id) { + auto file = files_.find(origin->second->source_file_id); + if (file != files_.end()) + new_frame.source_file_name = file->second; + } // Use the starting adress of the inlined range as inlined function base. new_frame.function_base = new_frame.module->base_address() + inline_base; - auto it = files_.find(origin->second->source_file_id); - if (it != files_.end()) - new_frame.source_file_name = it->second; - new_frame.trust = StackFrame::FRAME_TRUST_INLINE; - // Must add frames before calling ConstructInlineFrames to get correct order. - int current_idx = inlined_frames->size(); + ConstructInlineFrames(&new_frame, address, in->child_inlines, inlined_frames); + // Add child_frame after ConstructInlineFrames so that the innermost frame is + // the first frame inside inlined_frames. inlined_frames->push_back(unique_ptr(new StackFrame(new_frame))); - int source_line = ConstructInlineFrames(&new_frame, address, - in->child_inlines, inlined_frames); - if (source_line != -1) { - (*inlined_frames)[current_idx]->source_line = source_line; - } - return in->call_site_line; } void BasicSourceLineResolver::Module::LookupAddress( StackFrame* frame, - vector>* inlined_frames) const { + deque>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use @@ -306,10 +312,13 @@ void BasicSourceLineResolver::Module::LookupAddress( // Check if this is inlined function call. if (inlined_frames) { - int source_line = - ConstructInlineFrames(frame, address, func->inlines, inlined_frames); - if (source_line != -1) { - frame->source_line = source_line; + int source_line = frame->source_line; + string source_file_name = frame->source_file_name; + ConstructInlineFrames(frame, address, func->inlines, inlined_frames); + if (!inlined_frames->empty()) { + // Update the inner most frame's source line and source file name. + inlined_frames->front()->source_line = source_line; + inlined_frames->front()->source_file_name = source_file_name; } } } else if (public_symbols_.Retrieve(address, @@ -415,13 +424,16 @@ bool BasicSourceLineResolver::Module::ParseFile(char* file_line) { bool BasicSourceLineResolver::Module::ParseInlineOrigin( char* inline_origin_line) { + bool has_file_id; long origin_id; long source_file_id; char* origin_name; - if (SymbolParseHelper::ParseInlineOrigin(inline_origin_line, &origin_id, - &source_file_id, &origin_name)) { - inline_origins_.insert( - make_pair(origin_id, new InlineOrigin(source_file_id, origin_name))); + if (SymbolParseHelper::ParseInlineOrigin(inline_origin_line, &has_file_id, + &origin_id, &source_file_id, + &origin_name)) { + inline_origins_.insert(make_pair( + origin_id, + new InlineOrigin(has_file_id, source_file_id, origin_name))); return true; } return false; @@ -429,14 +441,18 @@ bool BasicSourceLineResolver::Module::ParseInlineOrigin( linked_ptr BasicSourceLineResolver::Module::ParseInline(char* inline_line) { + bool has_call_site_file_id; long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; vector> ranges; - if (SymbolParseHelper::ParseInline(inline_line, &inline_nest_level, - &call_site_line, &origin_id, &ranges)) { - return linked_ptr( - new Inline(inline_nest_level, call_site_line, origin_id, ranges)); + if (SymbolParseHelper::ParseInline(inline_line, &has_call_site_file_id, + &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)) { + return linked_ptr(new Inline(has_call_site_file_id, + inline_nest_level, call_site_line, + call_site_file_id, origin_id, ranges)); } return linked_ptr(); } @@ -635,14 +651,21 @@ bool SymbolParseHelper::ParseFile(char* file_line, long* index, // static bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, + bool* has_file_id, long* origin_id, long* file_id, char** name) { + // Old INLINE_ORIGIN format: // INLINE_ORIGIN + // New INLINE_ORIGIN format: + // INLINE_ORIGIN assert(strncmp(inline_origin_line, "INLINE_ORIGIN ", 14) == 0); inline_origin_line += 14; // skip prefix vector tokens; - if (!Tokenize(inline_origin_line, kWhitespace, 3, &tokens)) { + // Split the line into two parts so that the first token is "", and + // second token is either " "" or """ depending on the + // format version. + if (!Tokenize(inline_origin_line, kWhitespace, 2, &tokens)) { return false; } @@ -653,15 +676,35 @@ bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, return false; } - *file_id = strtol(tokens[1], &after_number, 10); - // If the file id is -1, it might be an artificial function that doesn't have - // file id. So, we consider -1 as a valid special case. - if (!IsValidAfterNumber(after_number) || - *file_id < -1 | *origin_id == std::numeric_limits::max()) { - return false; + // If the field after origin_id is a number, then it's old format. + char* remaining_line = tokens[1]; + *has_file_id = true; + for (size_t i = 0; + i < strlen(remaining_line) && remaining_line[i] != ' ' && *has_file_id; + ++i) { + // If the file id is -1, it might be an artificial function that doesn't + // have file id. So, we consider -1 as a valid special case. + if (remaining_line[i] == '-' && i == 0) { + continue; + } + *has_file_id = isdigit(remaining_line[i]); } - *name = tokens[2]; + if (*has_file_id) { + // If it's old format, split " " to {"", ""}. + if (!Tokenize(remaining_line, kWhitespace, 2, &tokens)) { + return false; + } + *file_id = strtol(tokens[0], &after_number, 10); + // If the file id is -1, it might be an artificial function that doesn't + // have file id. So, we consider -1 as a valid special case. + if (!IsValidAfterNumber(after_number) || *file_id < -1 || + *file_id == std::numeric_limits::max()) { + return false; + } + } + + *name = tokens[1]; if (!*name) { return false; } @@ -672,48 +715,69 @@ bool SymbolParseHelper::ParseInlineOrigin(char* inline_origin_line, // static bool SymbolParseHelper::ParseInline( char* inline_line, + bool* has_call_site_file_id, long* inline_nest_level, long* call_site_line, + long* call_site_file_id, long* origin_id, vector>* ranges) { - // INLINE
- // ... + // Old INLINE format: + // INLINE [
]+ + // New INLINE format: + // INLINE + // [
]+ assert(strncmp(inline_line, "INLINE ", 7) == 0); inline_line += 7; // skip prefix vector tokens; Tokenize(inline_line, kWhitespace, std::numeric_limits::max(), &tokens); - // The length of the vector should be at least 5 and an odd number. - if (tokens.size() < 5 && tokens.size() % 2 == 0) + // Determine the version of INLINE record by parity of the vector length. + *has_call_site_file_id = tokens.size() % 2 == 0; + + // The length of the vector should be at least 5. + if (tokens.size() < 5) { return false; + } char* after_number; - *inline_nest_level = strtol(tokens[0], &after_number, 10); + size_t next_idx = 0; + + *inline_nest_level = strtol(tokens[next_idx++], &after_number, 10); if (!IsValidAfterNumber(after_number) || *inline_nest_level < 0 || *inline_nest_level == std::numeric_limits::max()) { return false; } - *call_site_line = strtol(tokens[1], &after_number, 10); + *call_site_line = strtol(tokens[next_idx++], &after_number, 10); if (!IsValidAfterNumber(after_number) || *call_site_line < 0 || *call_site_line == std::numeric_limits::max()) { return false; } - *origin_id = strtol(tokens[2], &after_number, 10); + if (*has_call_site_file_id) { + *call_site_file_id = strtol(tokens[next_idx++], &after_number, 10); + // If the file id is -1, it might be an artificial function that doesn't + // have file id. So, we consider -1 as a valid special case. + if (!IsValidAfterNumber(after_number) || *call_site_file_id < -1 || + *call_site_file_id == std::numeric_limits::max()) { + return false; + } + } + + *origin_id = strtol(tokens[next_idx++], &after_number, 10); if (!IsValidAfterNumber(after_number) || *origin_id < 0 || *origin_id == std::numeric_limits::max()) { return false; } - for (size_t i = 3; i < tokens.size();) { - MemAddr address = strtoull(tokens[i++], &after_number, 16); + while (next_idx < tokens.size()) { + MemAddr address = strtoull(tokens[next_idx++], &after_number, 16); if (!IsValidAfterNumber(after_number) || address == std::numeric_limits::max()) { return false; } - MemAddr size = strtoull(tokens[i++], &after_number, 16); + MemAddr size = strtoull(tokens[next_idx++], &after_number, 16); if (!IsValidAfterNumber(after_number) || size == std::numeric_limits::max()) { return false; diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h index 482176f45..7d9d5cb58 100644 --- a/src/processor/basic_source_line_resolver_types.h +++ b/src/processor/basic_source_line_resolver_types.h @@ -108,15 +108,17 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frame) const; + std::deque>* inlined_frame) const; - // Construct inlined frame for frame and return inlined function call site - // source line. If failed to construct inlined frame, return -1. - virtual int ConstructInlineFrames( + // Recursively construct inlined frames for |frame| and store them in + // |inline_frames|. |frame|'s source line and source file name may be updated + // if an inlined frame is found inside |frame|. As a result, the innermost + // inlined frame will be the first one in |inline_frames|. + virtual void ConstructInlineFrames( StackFrame* frame, MemAddr address, const RangeMap>& inlines, - std::vector>* inline_frames) const; + std::deque>* inline_frames) const; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index 914f0963c..e608a5485 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -413,15 +413,15 @@ TEST_F(TestBasicSourceLineResolver, TestUnload) ASSERT_TRUE(resolver.HasModule(&module1)); } -TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveInlines) { +TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveOldInlines) { TestCodeModule module("linux_inline"); ASSERT_TRUE(resolver.LoadModule( &module, testdata_dir + "/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/" - "linux_inline.sym")); + "linux_inline.old.sym")); ASSERT_TRUE(resolver.HasModule(&module)); StackFrame frame; - std::vector> inlined_frames; + std::deque> inlined_frames; frame.instruction = 0x161b6; frame.module = &module; // main frame. @@ -435,12 +435,12 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveInlines) { ASSERT_EQ(inlined_frames.size(), 3UL); // Inlined frames inside main frame. - ASSERT_EQ(inlined_frames[0]->function_name, "foo()"); - ASSERT_EQ(inlined_frames[0]->function_base, 0x15b45U); - ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); - ASSERT_EQ(inlined_frames[0]->source_line, 39); - ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); - ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); + ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 39); + ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); @@ -449,12 +449,56 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveInlines) { ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); - ASSERT_EQ(inlined_frames[2]->function_name, "func()"); - ASSERT_EQ(inlined_frames[2]->function_base, 0x15b83U); - ASSERT_EQ(inlined_frames[2]->source_file_name, "linux_inline.cpp"); - ASSERT_EQ(inlined_frames[2]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->function_name, "func()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); +} + +TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveNewInlines) { + TestCodeModule module("linux_inline"); + ASSERT_TRUE(resolver.LoadModule( + &module, testdata_dir + + "/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/" + "linux_inline.new.sym")); + ASSERT_TRUE(resolver.HasModule(&module)); + StackFrame frame; + std::deque> inlined_frames; + frame.instruction = 0x161b6; + frame.module = &module; + // main frame. + resolver.FillSourceLineInfo(&frame, &inlined_frames); + ASSERT_EQ(frame.function_name, "main"); + ASSERT_EQ(frame.function_base, 0x15b30U); + ASSERT_EQ(frame.source_file_name, "a.cpp"); + ASSERT_EQ(frame.source_line, 42); + ASSERT_EQ(frame.source_line_base, 0x161b6U); + + ASSERT_EQ(inlined_frames.size(), 3UL); + + // Inlined frames inside main frame. + ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "b.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 39); ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); + ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); + ASSERT_EQ(inlined_frames[1]->source_file_name, "c.cpp"); + ASSERT_EQ(inlined_frames[1]->source_line, 32); + ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[0]->function_name, "func()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); } // Test parsing of valid FILE lines. The format is: @@ -780,68 +824,99 @@ TEST(SymbolParseHelper, ParsePublicSymbolInvalid) { &name)); } -// Test parsing of valid INLINE_ORIGIN lines. The format is: +// Test parsing of valid INLINE_ORIGIN lines. +// The old format: // INLINE_ORIGIN +// The new format: +// INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginValid) { + bool has_file_id; long origin_id; long file_id; char* name; - + // Test for old format. char kTestLine[] = "INLINE_ORIGIN 1 1 function name"; - ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, - &file_id, &name)); + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin( + kTestLine, &has_file_id, &origin_id, &file_id, &name)); + EXPECT_EQ(true, has_file_id); EXPECT_EQ(1, origin_id); EXPECT_EQ(1, file_id); EXPECT_EQ("function name", string(name)); // -1 is a file id, which is used when the function is artifical. char kTestLine1[] = "INLINE_ORIGIN 0 -1 function name"; - ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, - &file_id, &name)); + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin( + kTestLine1, &has_file_id, &origin_id, &file_id, &name)); + EXPECT_EQ(true, has_file_id); EXPECT_EQ(0, origin_id); EXPECT_EQ(-1, file_id); EXPECT_EQ("function name", string(name)); + + // Test for new format. + char kTestLine2[] = "INLINE_ORIGIN 0 function name"; + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin( + kTestLine2, &has_file_id, &origin_id, &file_id, &name)); + EXPECT_EQ(false, has_file_id); + EXPECT_EQ(0, origin_id); + EXPECT_EQ("function name", string(name)); + + char kTestLine3[] = "INLINE_ORIGIN 0 function"; + ASSERT_TRUE(SymbolParseHelper::ParseInlineOrigin( + kTestLine3, &has_file_id, &origin_id, &file_id, &name)); + EXPECT_EQ(false, has_file_id); + EXPECT_EQ(0, origin_id); + EXPECT_EQ("function", string(name)); } // Test parsing of valid INLINE ORIGIN lines. The format is: // INLINE_ORIGIN TEST(SymbolParseHelper, ParseInlineOriginInvalid) { + bool has_file_id; long origin_id; long file_id; char* name; // Test missing function name. char kTestLine[] = "INLINE_ORIGIN 1 1"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine, &origin_id, - &file_id, &name)); + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin( + kTestLine, &has_file_id, &origin_id, &file_id, &name)); // Test bad origin id. char kTestLine1[] = "INLINE_ORIGIN x1 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine1, &origin_id, - &file_id, &name)); + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin( + kTestLine1, &has_file_id, &origin_id, &file_id, &name)); // Test large origin id. char kTestLine2[] = "INLINE_ORIGIN 123123123123123123123123 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine2, &origin_id, - &file_id, &name)); + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin( + kTestLine2, &has_file_id, &origin_id, &file_id, &name)); // Test negative origin id. char kTestLine3[] = "INLINE_ORIGIN -1 1 function name"; - ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin(kTestLine3, &origin_id, - &file_id, &name)); + ASSERT_FALSE(SymbolParseHelper::ParseInlineOrigin( + kTestLine3, &has_file_id, &origin_id, &file_id, &name)); } -// Test parsing of valid INLINE lines. The format is: -// INLINE
... +// Test parsing of valid INLINE lines. +// The old format: +// INLINE [
]+ +// The new format: +// INLINE +// [
]+ TEST(SymbolParseHelper, ParseInlineValid) { + bool has_call_site_file_id; long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; std::vector> ranges; + // Test for old format. char kTestLine[] = "INLINE 0 1 2 3 4"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); + EXPECT_EQ(false, has_call_site_file_id); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); EXPECT_EQ(2, origin_id); @@ -852,7 +927,9 @@ TEST(SymbolParseHelper, ParseInlineValid) { // Test hex and discontinuous ranges. char kTestLine1[] = "INLINE 0 1 2 a b 1a 1b"; ASSERT_TRUE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine1, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); + EXPECT_EQ(false, has_call_site_file_id); EXPECT_EQ(0, inline_nest_level); EXPECT_EQ(1, call_site_line); EXPECT_EQ(2, origin_id); @@ -860,40 +937,61 @@ TEST(SymbolParseHelper, ParseInlineValid) { EXPECT_EQ(0xbULL, ranges[0].second); EXPECT_EQ(0x1aULL, ranges[1].first); EXPECT_EQ(0x1bULL, ranges[1].second); + + // Test for new format. + char kTestLine2[] = "INLINE 0 1 2 3 a b 1a 1b"; + ASSERT_TRUE(SymbolParseHelper::ParseInline( + kTestLine2, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); + EXPECT_EQ(true, has_call_site_file_id); + EXPECT_EQ(0, inline_nest_level); + EXPECT_EQ(1, call_site_line); + EXPECT_EQ(2, call_site_file_id); + EXPECT_EQ(3, origin_id); + EXPECT_EQ(0xaULL, ranges[0].first); + EXPECT_EQ(0xbULL, ranges[0].second); + EXPECT_EQ(0x1aULL, ranges[1].first); + EXPECT_EQ(0x1bULL, ranges[1].second); } -// Test parsing of Invalid INLINE lines. The format is: -// INLINE
... +// Test parsing of Invalid INLINE lines. TEST(SymbolParseHelper, ParseInlineInvalid) { + bool has_call_site_file_id; long inline_nest_level; long call_site_line; + long call_site_file_id; long origin_id; std::vector> ranges; // Test negative inline_nest_level. char kTestLine[] = "INLINE -1 1 2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); // Test negative call_site_line. char kTestLine1[] = "INLINE 0 -1 2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine1, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine1, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); // Test negative origin_id. char kTestLine2[] = "INLINE 0 1 -2 3 4"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine2, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine2, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); // Test missing ranges. char kTestLine3[] = "INLINE 0 1 -2"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine3, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine3, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); // Test missing size for range. char kTestLine4[] = "INLINE 0 1 -2 3"; ASSERT_FALSE(SymbolParseHelper::ParseInline( - kTestLine4, &inline_nest_level, &call_site_line, &origin_id, &ranges)); + kTestLine4, &has_call_site_file_id, &inline_nest_level, &call_site_line, + &call_site_file_id, &origin_id, &ranges)); } } // namespace diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 029f21f47..317864604 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -64,7 +64,7 @@ bool FastSourceLineResolver::ShouldDeleteMemoryBufferAfterLoadModule() { void FastSourceLineResolver::Module::LookupAddress( StackFrame* frame, - vector>* inlined_frames) const { + std::deque>* inlined_frames) const { MemAddr address = frame->instruction - frame->module->base_address(); // First, look for a FUNC record that covers address. Use diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index aa02fc113..2d1bcfcbc 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -119,7 +119,7 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frames) const; + std::deque>* inlined_frames) const; // Loads a map from the given buffer in char* type. virtual bool LoadMapFromMemory(char* memory_buffer, diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index 16c822246..cea1a46d1 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -297,7 +297,7 @@ bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule* module) { void SourceLineResolverBase::FillSourceLineInfo( StackFrame* frame, - std::vector>* inlined_frames) { + std::deque>* inlined_frames) { if (frame->module) { ModuleMap::const_iterator it = modules_->find(frame->module->code_file()); if (it != modules_->end()) { diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 3e3afd0ef..bac918027 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -40,6 +40,7 @@ #include +#include #include #include #include @@ -70,9 +71,12 @@ class SourceLineResolverBase::AutoFileCloser { }; struct SourceLineResolverBase::InlineOrigin { - InlineOrigin(int32_t source_file_id, const string& name) - : source_file_id(source_file_id), name(name) {} - + InlineOrigin(bool has_file_id, int32_t source_file_id, const string& name) + : has_file_id(has_file_id), + source_file_id(source_file_id), + name(name) {} + // If it's old format, source file id is set, otherwise not useful. + bool has_file_id; int32_t source_file_id; string name; }; @@ -80,17 +84,23 @@ struct SourceLineResolverBase::InlineOrigin { struct SourceLineResolverBase::Inline { // A vector of (address, size) pair for a INLINE record. using InlineRanges = std::vector>; - Inline(int32_t inline_nest_level, + Inline(bool has_call_site_file_id, + int32_t inline_nest_level, int32_t call_site_line, + int32_t call_site_file_id, int32_t origin_id, InlineRanges inline_ranges) - : inline_nest_level(inline_nest_level), + : has_call_site_file_id(has_call_site_file_id), + inline_nest_level(inline_nest_level), call_site_line(call_site_line), + call_site_file_id(call_site_file_id), origin_id(origin_id), inline_ranges(inline_ranges) {} - + // If it's new format, call site file id is set, otherwise not useful. + bool has_call_site_file_id; int32_t inline_nest_level; int32_t call_site_line; + int32_t call_site_file_id; int32_t origin_id; InlineRanges inline_ranges; RangeMap> child_inlines; @@ -174,7 +184,7 @@ class SourceLineResolverBase::Module { // with the result. virtual void LookupAddress( StackFrame* frame, - std::vector>* inlined_frames) const = 0; + std::deque>* inlined_frames) const = 0; // If Windows stack walking information is available covering ADDRESS, // return a WindowsFrameInfo structure describing it. If the information diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc index 6490ca90e..a460bc9ed 100644 --- a/src/processor/stack_frame_symbolizer.cc +++ b/src/processor/stack_frame_symbolizer.cc @@ -58,7 +58,7 @@ StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo( const CodeModules* unloaded_modules, const SystemInfo* system_info, StackFrame* frame, - std::vector>* inlined_frames) { + std::deque>* inlined_frames) { assert(frame); const CodeModule* module = NULL; diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index 856a6a668..c1e17084d 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -218,7 +218,7 @@ static void PrintStackContents(const string& indent, modules->GetModuleForAddress(pointee_frame.instruction); // Try to look up the function name. - vector> inlined_frames; + std::deque> inlined_frames; if (pointee_frame.module) resolver->FillSourceLineInfo(&pointee_frame, &inlined_frames); diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index d4897d4c1..e123b0277 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -138,7 +138,7 @@ bool Stackwalker::Walk( // frame_pointer fields. The frame structure comes from either the // context frame (above) or a caller frame (below). - vector> inlined_frames; + std::deque> inlined_frames; // Resolve the module information, if a module map was provided. StackFrameSymbolizer::SymbolizerResult symbolizer_result = frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_, @@ -174,10 +174,11 @@ bool Stackwalker::Walk( default: break; } - // Add all nested inlined frames belonging to this frame in reverse order. + // Add all nested inlined frames belonging to this frame from the innermost + // frame to the outermost frame. while (!inlined_frames.empty()) { - stack->frames_.push_back(inlined_frames.back().release()); - inlined_frames.pop_back(); + stack->frames_.push_back(inlined_frames.front().release()); + inlined_frames.pop_front(); } // Add the frame to the call stack. Relinquish the ownership claim // over the frame, because the stack now owns it. diff --git a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.new.sym b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.new.sym new file mode 100644 index 000000000..5cd832097 --- /dev/null +++ b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.new.sym @@ -0,0 +1,71 @@ +MODULE Linux x86_64 BBA6FA10B8AAB33D00000000000000000 linux_inline +INFO CODE_ID 10FAA6BBAAB83DB3 +FILE 0 linux_inline.cpp +FILE 1 a.cpp +FILE 2 b.cpp +FILE 3 c.cpp +INLINE_ORIGIN 0 bar() +INLINE_ORIGIN 1 foo() +INLINE_ORIGIN 2 func() +FUNC 15b30 6cf 0 main +INLINE 0 42 1 1 15b45 6b1 +INLINE 1 39 2 0 15b72 684 +INLINE 2 32 3 2 15b83 673 +15b30 15 41 0 +15b45 11 36 0 +15b56 a 37 0 +15b60 6 37 0 +15b66 5 38 0 +15b6b 7 0 0 +15b72 11 31 0 +15b83 a 9 0 +15b8d 4 9 0 +15b91 6 9 0 +15b97 7 0 0 +15b9e 11 10 0 +15baf 7 0 0 +15bb6 2e 12 0 +15be4 7 0 0 +15beb 5 12 0 +15bf0 1d 13 0 +15c0d 1d 14 0 +15c2a e 0 0 +15c38 1c 15 0 +15c54 a 16 0 +15c5e 7 0 0 +15c65 2c 16 0 +15c91 15 0 0 +15ca6 a 16 0 +15cb0 87 15 0 +15d37 7 0 0 +15d3e 33 15 0 +15d71 7 0 0 +15d78 24 15 0 +15d9c a 17 0 +15da6 e 0 0 +15db4 a 18 0 +15dbe e 0 0 +15dcc a 19 0 +15dd6 7 0 0 +15ddd a 20 0 +15de7 7 0 0 +15dee 2c 21 0 +15e1a 3c 22 0 +15e56 28 23 0 +15e7e 5a 18 0 +15ed8 d 28 0 +15ee5 11 12 0 +15ef6 67 28 0 +15f5d 2b 15 0 +15f88 7 0 0 +15f8f 8c 15 0 +1601b 7 0 0 +16022 3d 15 0 +1605f 67 28 0 +160c6 54 18 0 +1611a 3c 28 0 +16156 c 12 0 +16162 54 18 0 +161b6 2 27 0 +161b8 3e 28 0 +161f6 9 43 0 \ No newline at end of file diff --git a/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym b/src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.old.sym similarity index 100% rename from src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.sym rename to src/processor/testdata/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/linux_inline.old.sym From fe35cd43f2c7386704837b686f91a4e3c882664d Mon Sep 17 00:00:00 2001 From: Alex Gough Date: Tue, 2 Nov 2021 20:14:52 +0000 Subject: [PATCH 031/195] Allow breakpad to read extended amd64 contexts Minidumps can contain extended, and compacted extended, contexts to include xstate data such as the state of the cet registers cetumsr and cetussp. Previously breakpad would reject dumps with contexts larger than expected. With this chage, breakpad now accepts and reads these minidumps. This change does not yet add processing for this extra data, but will allow any minidumps to be passed on to other processing tools, or be available for manual inspection. See chromium-review.googlesource.com/c/crashpad/crashpad/+/2575920 for motivation. Bug: 1250098 Change-Id: Id67649738ef1c7fb6308e05e6cd8fde790771cb2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3256483 Reviewed-by: Robert Sesek --- src/processor/minidump.cc | 39 ++++++++++++------ src/processor/minidump_processor_unittest.cc | 23 +++++++++++ .../testdata/tiny-exe-with-cet-xsave.dmp | Bin 0 -> 92736 bytes 3 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 src/processor/testdata/tiny-exe-with-cet-xsave.dmp diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 11a5fc4c6..572c717cd 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -470,7 +470,16 @@ bool MinidumpContext::Read(uint32_t expected_size) { // First, figure out what type of CPU this context structure is for. // For some reason, the AMD64 Context doesn't have context_flags // at the beginning of the structure, so special case it here. - if (expected_size == sizeof(MDRawContextAMD64)) { + + uint32_t sysinfo_cpu_type = 0; + if (!minidump_->GetContextCPUFlagsFromSystemInfo(&sysinfo_cpu_type)) { + BPLOG(ERROR) << "Failed to preserve the current stream position"; + return false; + } + + if (expected_size == sizeof(MDRawContextAMD64) || + (sysinfo_cpu_type == MD_CONTEXT_AMD64 && + expected_size >= sizeof(MDRawContextAMD64))) { BPLOG(INFO) << "MinidumpContext: looks like AMD64 context"; scoped_ptr context_amd64(new MDRawContextAMD64()); @@ -480,17 +489,24 @@ bool MinidumpContext::Read(uint32_t expected_size) { return false; } + // Context may include xsave registers and so be larger than + // sizeof(MDRawContextAMD64). For now we skip this extended data. + if (expected_size > sizeof(MDRawContextAMD64)) { + size_t bytes_left = expected_size - sizeof(MDRawContextAMD64); + std::vector xstate(bytes_left); + if (!minidump_->ReadBytes(xstate.data(), + bytes_left)) { + BPLOG(ERROR) << "MinidumpContext could not skip amd64 xstate"; + return false; + } + } + if (minidump_->swap()) Swap(&context_amd64->context_flags); uint32_t cpu_type = context_amd64->context_flags & MD_CONTEXT_CPU_MASK; if (cpu_type == 0) { - if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) { - context_amd64->context_flags |= cpu_type; - } else { - BPLOG(ERROR) << "Failed to preserve the current stream position"; - return false; - } + context_amd64->context_flags |= sysinfo_cpu_type; } if (cpu_type != MD_CONTEXT_AMD64) { @@ -765,13 +781,10 @@ bool MinidumpContext::Read(uint32_t expected_size) { } } + // Fixup if we were not provided a cpu type. if (cpu_type == 0) { - if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) { - context_flags |= cpu_type; - } else { - BPLOG(ERROR) << "Failed to preserve the current stream position"; - return false; - } + cpu_type = sysinfo_cpu_type; + context_flags |= cpu_type; } // Allocate the context structure for the correct CPU and fill it. The diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 306c2f0b0..775a48ea3 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -761,6 +761,29 @@ TEST_F(MinidumpProcessorTest, Test32BitCrashingAddress) { ASSERT_EQ(state.crash_address(), 0x45U); } +TEST_F(MinidumpProcessorTest, TestXStateAmd64ContextMinidump) { + // This tests if we can passively process a minidump with cet registers in its + // context. Dump is captured from a toy executable and is readable by windbg. + MinidumpProcessor processor(nullptr, nullptr /*&supplier, &resolver*/); + + string minidump_file = GetTestDataPath() + + "tiny-exe-with-cet-xsave.dmp"; + + ProcessState state; + ASSERT_EQ(processor.Process(minidump_file, &state), + google_breakpad::PROCESS_OK); + ASSERT_EQ(state.system_info()->os, "Windows NT"); + ASSERT_EQ(state.system_info()->os_version, "10.0.22000 282"); + ASSERT_EQ(state.system_info()->cpu, "amd64"); + ASSERT_EQ(state.system_info()->cpu_info, + "family 6 model 140 stepping 1"); + ASSERT_FALSE(state.crashed()); + ASSERT_EQ(state.threads()->size(), size_t(1)); + + // TODO: verify cetumsr and cetussp once these are supported by + // breakpad. +} + } // namespace int main(int argc, char* argv[]) { diff --git a/src/processor/testdata/tiny-exe-with-cet-xsave.dmp b/src/processor/testdata/tiny-exe-with-cet-xsave.dmp new file mode 100644 index 0000000000000000000000000000000000000000..9b641afb64a5022569364de3875d8d24d9f0c692 GIT binary patch literal 92736 zcmeHw3xHfjm3B=MAw1JS(0~ChFAajB^MViv-n>W#64K;}I+~s&Ll~K4dM6V|@Ifo+ zqG4rtNl=tVL4%8Ki>MJ1I)D-&t|Q_ut}Kp%k|2*(c|=6=pHt_2_fgX|J;}eT?(S4F zeQs5KbOx}%(a|Q2&%R`8ra_OBgv6S$q}f=atkX;aEjZ1X_gLKp`A1^P zf4;zSdZ=8^G@E6n)tpCv%S>SAn@&nuWtP)#2mJ?G;7svE;6f$!`Y-)V8)oN8EyZ@k~OmS-{{CTHB=i&`X6qAW#pC3 z%gssDBTulNFwuI%3FIg2G4(=*I>IH?hX(T?AYHv)k=@Ddi7~U9+ZJ%vPj9^OFEsS-R9Hm5 zs-Zl6sCk0w{`4t_+j5t9bmuzu<`S{{s~x;}&)1$z{*4)P(uA2O2VpRF^u+AUSr`A+ z6d4dSV1fSu7Rdg2=gtC+gG{?=&YB~g`ER#_oMUCey&LCRj9*(`e3y*Djv|NH`1jYo zN@JMJ*p0d3_+oSZ&BlCx$ct|n0}f6>PxM$y-#}&kVYnUlOd+t4C+@lSTa}coz0IKw zJgWzdIk`jSQJnRbIKRfxFdm!jg$9u~-*VH}k0E?qFUSCmIk>X8UTuBK`oaEIR(P^y za@RW=559IcWxbs^^z;>&8284|5xZZn9F_Hl!!x#CS&{YV>9e}lrey6& z9wO}}H0I=b&e4>0cb~FO7g^nVSteJm-eZrRl&rn`EsL)yj}hmN6-pg7i48M!kxAjR zH%xwY7U7e=F-ZMTXk6I!4X)P}eadPVStU7L-Z^^cA!SEae|?_o^-`a*isFZA!^MC3 z&JiOHP1noUUT(eKMzZo$)*n`htjqxxvi*u@%;mc&i~Co1pR$bjMnyo?ZTDTb!;#fr z8*+P{_EvwbjJZ$hl^2T~(DBcs^Mp_OhEG;4pTDI~S*J?9xYI z#y({|yPuU+v7*d|8`ccp+D}=oA97zFez@?d{aX|pW~5#ZPHmlV8sU?^u`BiZP@l36 ze0~R?m-7c%RkGX9Y%V2a?PU(8RX$$p6IxqeN&QD6!|7V7k03r@ke0r3>KhAgB>e8w zi^q+gK4m>M#I{#SwCQ=|-UEjOyC;kNa2A#IhX?nuvO;OE=WhMnRc(atPrY2kk{nhIZB0n0x)v|iOgtE)})mtMVUqSa7d zrCLX8RxM_&uCmUXKYjj9|K4=piAOe#n>~AakefbrG}p7Ub=A7jEo)mw7nUz&sgol9 zi%lb~h)y?i&0<=?ZKA(-)87I!!_1-8g|U>fiX<(kHP|+iB-9v|Q~B2uMm+Sb|M=R^ zK7Gpc&)vS~RF<=Xv2ax33mK zyHcNdWVvbNB@1Z1HkKl`yMIyVhnfaIGj#OVGVf~q(#OBgayklBo$PMqH?&W|EYTI`xK?btNrfRdP9F2_ zd%pLHh2MVk%CV24jS5RHYF)J(eQb^T!cw~m-qOp4`@Zd~k2Ze#!C!Cx#H58!-PQD2 zmbZpX7<)U-7k8n43vI8OSJT(Ge0SZoM?U_^^&JNXm%a3Fm+fn1t#0Xnr|*g!S*_j`1v~y{!e!V|HbHSVkkm zO4HlxSk8SvJnqjQxqi>3U){3!iKl)(;xv}CtbJwVa(&gsJx|G~KZnj+>3($GqWxCy z_rrrvEZ*|9uYGCyF^94Y@`05rwGZ{xKCTQNf8I^w&;k>mHE^cl`aJ#Wh(j)!^`~)D z-g4SEPr35fU$FJ*SXW4PqQ2_n`dlN`M$W_W8Ik3j^|6T;OuKROl((Gn#0w|y^NuT7 zPV35*QTy=SD>)bDXx`9HcTaitu+jwP4Dv5-bG{QgislUy>HgPobe5k+>79gXrL-pU z^J#RZ3h0;by|&mnKoijdjUjOg-#JU$`k7yDpEqxFY5Etlpa12$#YeQWUehKubuMeV zsJ-KYrsk8EH=jIq%-Au_V_TYAmNreD(==mMXUDo+M|)?>vd*SuZLKYqY5|M}^KkNy17fa|h!88@cL>8lU8au(V7&3v-!T$<&iZ8mzZ z!Eb!y>LAGn>#w2ZH0J!w!ibIq}|xV_&z`TPbWWou{ag)OVKJK8-DygbJG88buIjP^IJKil8zeg8g>6_2EA z9m?T5xjeRXki?|C4CV3s`JIF4r_b;PUwu(%P+1Z)2I)d0Hq4j7N|Z#BmOzw8ABnkzx1Q{oZcrj4nC<*1DApR9(<886kPpHR`n4I zElsyapKjbUaPY*}2BL$K`tg6!d?AC;58qlf&-WTMCC6O zRx^R(iNB<&L%l{PRFEr90JH}l7Gm~oDr|RQ>s^W##=YQHR@}I1Dp%MSA z>f`F41s?h;?MB?S&*{ovXnp&8@OHN!$p|0^?KP!#eS3g&^_i-8p;3K%cy}NLx4u1R z*XAEsH2t{z=PF)k#NX==x!U}zKK|z@UTA&(^LCN{e8mfm+AAw-g1yH7?4sIu=pWe$ z?X|czp6qS|(NurTdhoo_lS5#C=?9irru>CQ`U6M&1qppT_#WkpauNUK%3o;2-=}}Z zhgW;L{DT$BU*&`J;K22_^A#@?RxqLBqx!0*VI6z`If^d=k94I)#9e(_RUe^|J_-9s zn)1&84}MCkh`anhp!|i_=MOyi)#HDG@)zoFU+53K%U{QnUgN`B!1AyA6(htm7RQ+~>SsC-R)N%>N~1g%-cgNHsY|85Vy ztZW0N(7)JFTOS|)E)PEI;a~CKp$ExH*{8>Y@A2^;v}^izd+=2s|G~S+--GwrhiYHb zAIL5?xc13-@MWL=9=wk~ZD^~hPr<`Kd{b?_kAKdC_vue}iEHZP1vp)Sjcprb- z)Lc^^ul{@1#{2kZJb17E9=wl#&V%>yFM9Ak{#_n?*=K**E6urV*Iwf-$w`e5IS;<- zE!Fww-VA17JpI2)Iw54DbLdts?I7->&?HhJbnb0}r55FaKwiztH;pf$uN> z-zk5g_4xzeU;fW2f1&mH1K(f%&nthS_4xzeU;ZyBf1&mH1K(f%FDieb_4xzeU;b6) zFSI^?;QPz}_sU;reg44rm;WD>ztH;pf$uN>KPrEr_4xzeU;ZyCf1&mH1K(f%FDrkc z_4xzeU;eKsf1&mH1K(f%uPT3`_4xzeU;aCkztH;pf$uN>KPi8q_4xzeU;eKtf1&mH z1K(f%e^&lN>+=V`zx-cU{zB{X2fn}j|Dybb*5?m=fBC+=WR z<$v9AFR$S=cYbo+aW8$C(}hOs4>?YwK=TwylUb|DdGKZTew^aXt;%00QkiS*`P)~H zd)ewEG{&nMfz^tBpy^kRuZj20uYd<1rQZ3~M&&OQQls?~*FG8G`^*0}vNFOPv_<{#tyigdUoL-ff>SeY0C+wNxZ$4fdUpo3VyTa%4FKvAL z!5?AKj{bR0qu|=p+*TW3{q?VY$%+JAh=bO*x_+;h?HzcBe`rCy`Dd@Fjn92T7SIDN z2mZwa_p8aja;CV3Yya?l!)oI59(_t4e9!x(fXlylcWwTO_Dc2NE)PDpUv2(957p)$ zc=R_9*T!e~tr-+t{WFi(#s?N%qrE)%fjP@4<&LKE=P}!Ta>j{I<3} zKK?lmK8W>6*{9&ahoW__@v6M7wmx3}*(f8*;MM5dzf$}|555@dpR#|&gZJsv?ZIa~{LNOaujWVO47+c#_k3HQBQrva zz$f%c>7Vi7^YMO?KzN8h6b_f?)Lj0>cz;ETfAz@P_=G+w`m_Du25 zc<@;*NaX@Kl=clhcm>7hBctPk2cOUfCtu{Uz<5TwO^59D`KE*#fS@~-|NcSf_ z_R(h~jnE?Sq_+*O{uvKGR4oV}NJ+6z?jd;w)8$_jP%r=K_TZIiul`&0;By}S;lrwr z=7Us@h|DO8BSW7rHbRR?_S(mT&uT%}K4E=)q!_a(c<>2*QvOr);KNv-6#okFnhz2l ztVeGDGWy)B&?4{&eNy~09(+ly?%Jo^P@8{V1ra{Ye^70FLZ6g<0uMgt;a`aGsHxDd z3pDQ9N8kTogceaMp-)f`YD*(dYK+W3S%srg3W!DmH@ zUgK5HgD=MTRDHXF*L;xd;dpJgU@S4s9cJ_(f4&IEh>!dZi9=@`0)BtQ^E&QQYsYOrTR;`qU6y_ z`c&&){O_%e&uKxzr|O&c;42<`2Ah>X6j9oPxa$x4o)&#yOA#>A!-ih^d+?PQAIPC7 z*zLjh+8=HN-*dm}FXf8LHrZY&`&2#nf);f3&p%MxJ|zfp?W6CcGD3@hdF|uD=X82b zLWA+9{fqKz@{nxtOqY3yFM(I zQhW}0FjiVd+||d(GmG>hIes@u5iruj2BOMYDwOfyyX__-t4|;$1>du0ZT|WW6z*p! z{=q)A@dJoA}ip!RY2=RNc1o}+8y6Z)k3OSL{e z)nCjpwfP5HagvkbA9(NyeNz0h9(-5KKV{Df@G!hmeTQT3^+tVXpb=U`v4lP;{uvM6 zzV)68Q@KERh+AYnp!RY2>$~B4jVGnH+IVHk_>?^>9(>|{M_T_?%3qX>eyccg{aN30 zXoMC4^V-LQ&n=OXu6^?Vs`@zmv-YLKPu#X2XOndoT zmj|D9pU2T*v2rN*D?=qAMorf~BNZ<+M5(MEkp6)^)LLXccmdTo9|5oYK*~69^*K!S z5gGzUdf4FVlc|pv|5W`04?a--plG!ac+Cf?;K0>i-}P#Q76D7>pYn%{2T%L_ZHVft z?OQrl?c?w-Y5NjB#Xo#|ZG2W0BYdj=7CiVM#;5vkmk00TU-94zG5?hQ*-@&$=7V(O zz_tHziWeFJme41#X(}b_!3(H{KLZcOO3R45`n*H+5gG!P(F3A^Jyd-%_3>$c_TZt9 zFeeGhzZ-ZfH2%rr(AEEV)n8}`81SzCSr0zYf`m`$p93C@m6j2A^*KTH5gGzUd~I;` z$<)WE^a(upqVf-v!k#7Ik*+k4xU2s=Rezx&U|BtI_0M|nL5xr7p93C@m6j2A^%<@D z2n_)vJ#29G$<)WE^a(upK>35ho+0p>4^qK_tN)3rzt9k{tRA@fXFd2J#;5ep0T0GX z%ZR)BWK|!bAz-A34X!?!`uLPSfd}8C`~#)1rx~OA2n~^))dN?btOp;&_>?|5;K5jF z8FAM>V^traAz)s8JorEhlKyFZfCpoxUVX-?K0-qj^XlWl2U@U~KEQ*qQm;PaRUe@t ziVQ0)1#&qB9T8nV|X$4S~<(!&NXc%&=MA@1sb zis~;k1T3ouuKrmMK8W!t{d2&BvC=Z)u0E4gAE6;&q=yZzKAHOXls zN4nA+;;#Ps?tLS)2v|aY^?Vs7G9G-77L4kv!%EeI4|UWbe2RZ|vf9(HkJv}~haNoY z>+8g*=B4EVV2A6-vgHNo71X5BAP@G%oi%uS)k?-^hCKC8=aD{kwtJe2^>-T>I;H4UEttV2S#s{3qkVo3}|xDi_F+ z`tvHakHbHR_hY2^XD_ae&kNID_UZEAefO7(mneVb2U5g=Yajh)fe{+Py!P?nt8sq} zM3g3cO!aa27gQgTld@02gHPy_^3S3N-{s+-xwN)@s*0y!K^518%M>p(1T3ouq*q`M zwH8?qUO+Y06M$EKAY~l5`g~mV5gG#K)yIPmv>@r9I$z{~2VLWBnG2&~3t52prKBZ6K!H3E}PzrnIfk(R165_6Zep2-p8UmKp16Tj72Oq@vl>Ry3 z!B}Y-aaW&DsXjtOz(@}pTzxY2@hN=*55A=Q1EsKM1$d+@4H0+sU$6QLjbK^DyZUE6 z_#noo^v?mW`5S(mw}07%MF!?&|Yt)kkOu80leyt52prKBZ6K!RM8Kpfs{4@JLr$ zMBLT?O4VOz2$)y@`uMc|9(+j!1rVs?e+77?D-98M_3u*sg+{Qf;$8b^J@_ETr}WPO zulXQl9Ju;irTPdB0rT3kK0c*S;K4&s0D)@HJn%?YT0-2_|7z7=Xb70so*sOl1*zUC z{d2&Bu~M%+uTg!3hA8H>XMKE1pTL99tDpb^)t*J*k*>6exNFaARezx&U|xHA@PQWW zWl!M2SgF^Z*Qq{2LlpDcvpzm;PY=GNf&vIce+M4vN<+k5dwxds7aGC5_VnNb<=@Mm zz(c-LuRX6q)4?NP9md@1!SN~U3 zf1yPbOX#nbY_M4w555$?k0KBrf-eu2Z!sH}zh{47Wsll;W!h`~r^ka&=$~4Dt9tNd zMNzp_eM`esAE{LIo0nGVy?;-?J#B;*Q6QmDihss~FUdE9xxRt$PO$YRUcRX z?D4hn34OGr@DDwBRf6?N*)#9K7e(pb?d8FDdF)>pU)%m&%D>n6FhTJ`(Mqg`4MYQb zpskSc;0pqe^;dimc+CeXiuro`!^x_T&=B~n9=Q5sJ@_ETOPy4o9PnVQw2Zjh-zTa* zLPNkv4;x&4GWGE(eF6_Yr~Ct@=w$`qk*>7shcC#Ef;NqW*m5*hYVwr*+a-10~dIpB>b`v--&YGv&|L{G|T`YTwr>A8wn>Xa8dR zbN&J?pCrlpNf>Hp!!Y{dCAH70G3Eiy_m$tG`O_2p2V?v!8nd-dez)c)Nzy)#B{TFmng4j5 z{3q(<_teRMx=#MKI{DAl$**cY+Lxor{{NEZ`}*$=%}Rke zKT7kHCQ91Jeh536Nyo|jY@PDs`;t%gomeN|ew3DE`r0R~Q+|4#{8@GKXKQ}a1j+j6 zG(S22;3rE~(BI0F$C(9n%AZ>&zo|}szE1w~I{D|<$#1KZU#OF>FU?AtFXcaLwLIo0 z3~We@zaOf@zgQ>#vO4*fYrb#%zoJflm*&^>PpZkanxCv6&M(~mH)wv+KuQ0)v5x#w zo%~zs*Q~$lYh77XA|e=J@xvBJ*847{{hWU+8_SK_TN&c{MI`8 z-J0)fzsKs7f4olq6Ls=?>f}FNCx2U={O9WASL@`zR40E&o&4A9*NP@@{g&LKT7j`{)^Y>`TEau4u6ggp}#ZfZ|5aP znW`tB->%a@&mh0#$w&Deo_v&lnuSro_{(ryUo;fy`eP{P8Uy_~pRb>B{hQavQsEz* z&n)?EHG^o)v|C?Wlg#JwhcSbS4Te`?r_d@vj=tU<&@X=xyOYxR?a0&Z*SIgBcsqUL z+*s^%`bsx{Gkcj$?J(;ookh&B-|prwh|BsZz7$VU%d64MqqPM7(sv7$r+Fj&H4@)x z^tY0@^H=5h3*hbawRjF(zq2Tf`LizbRVEOuH>dIU$_w-@Z~2n9F>Kcbl(N{STtJ8p z`f7c1O5ah0SxjmC&GB0Da~98Kxi-ceYVob4*>d7~5y|E6qsQ7#VNg-OBVD9d|J=-R z`OftMTFj{)*2~5(Fq1US?UE9m9%Tl~jka$S>6^i$)j`PjD29sSA$Ga%reWAps6F!(v^;sX6FHk)D z=@?(8c=weOKaKF=0?NNS&M#8D`x=R#PWhRIl>eDHKS%NI>*Ml0od4N4KUhThpNq?v zIet@|U!{2AW{FQF{>8=A9$$*{yD8pvtHeXf&!0;`#4L zKKoA(#m#pm&b_VBMDgz>@+sc)a2zkZkIMfjj+^&W{*U8$7sd0B#_?bYweL^kc$wlo zkHzsYPx+6>@otLu{5+25n;T5IG@}-~+i_maiZqzMMdzs(MR|)+bdy;#B^~OA={xX-ofm^Rdh+o$+5L z1g=(rKSvp&{$~HQzM378(80rA$6cMaSCMcm5B!2*!k5!Ixb{N%jN+hIXwk;d8`A7c z(!wu@eK*{nws)(_@48F!OIHZhH>*iu<;6DW(tPL#yh5yqyAi;1LT3izo0kTbMi>3uat_*v5PR~$&o`J=Dd)9C}f26 z`Ym#sQP_T{==Z`=!WVkMk5FFUv@gy_)fWT@KY+b5>Q`|&!9gFC&+9?)&ytVw1&yP8fy0?} zfBuk;d&}Q)vaP4ysvvHnPo#(11^o^3qIyRDq5Vh8XH>6fTvY$kWV7)a9e=bu>{#Ac z^c;2ML8)&k4L9-*(MpS~9p3gCj9=g=6z!Z&{qK)KfB1i7cC`mIfZa+n&|Z=QKgcW4 zS03#Wmyi9+zC%_02YdqMw{Z~sSre3G)c%j0e3;l<+o|#$vG4nTD&Gi$KkaYi8QK?* zmi7tnJj9m!)Oyq>EywkP%m<`>`H2l4Zx3E6?}7=GLc6RJNBUoz=2al{hJ4ro_IX78 zb!|!PR`B?zuf8j<6Z`RfOAa{|l*>u`YSd4LrR{Ev#KGrIZU4%?E>2kTy`N-2Ii#fq zdrI7XJ^G*MSF8OWA)L$CG@Q8QFiPip0sIHQnq=f|dG`k4JA^ubd(I$uufROuW1KmQ z{(*2$Wxp#0XF=zc4%jK_ZyYC-<`c1l@aECnOlD#oq&aDR~v-X|_ zmEX}aLhez}aWcg6g5@VJ$+T+o5=d_Lfr9;b>hwQf(p49m^=HrNi=5COB zVLl4G;5-6)!b}-2P!8t>wm*koj}iahsQhN0@>Xk4&gXFgd_hsp7N(y|&J+Gy&Y5hV zDVz8?(TnjemgBTNM}zq9s ze*2k%?@~Rs-}=RQwBvWHJ8oc{z3U16cBA4=UdBa?uaFCS##H3R{Zr!53*|x_Bq-Yz zIM^sjcba1(+rh4jw7#b~Pa;yM0}>%iaPqxxO@oaAp)dD|$R{ju7BciagOO=+b!wGvNM&@uzE*$p7@+sGr2quQPi7+um|>PR1X3rwryT z$1p<*g%$ElC$5Ly@xhUHURToc+KmKEzuB9mJ$Kw9^hfIi4?Q=jzHzHa(UPX0u_lcN z<6lfY>|2}YqzXPrzy1ShJo3RGehL0uj@t_L3$8rE)(5!BO~Q{LHXZy>FD{=9x6Kj! zwx?x29DZ5-8K4fC*Pi2~AAo$N)qfCN@In0+?Z3(OjL}a@L0`0c_@8oq`h&`ysQj5P zua$5esSB8wsbc#OMR?+iq91KhLI<%~7}tRF(FV7{6?pCOq7UW+?mAb@PjEkeZ#;go z?GgS{>kB``UQtlW{~`B3*n_(8Adb8KS=Q?p=o8DAqee}@{3Kfcx>f9h^Jr0V;8$?g zznZ>->l>-paaumFxCL6C<#GRnTux?Fg0C?mx01MSW(@GK3#Wl6AG1A}f)DJ0_+V3% z^QX2O+vDW(&O2pHcHGjFmQTo5dqi*WbnOxABe)_9G_xgFSUJpMy3wj0Bl z?jV1H-Qfq2OM|5i=ahwZ{##n!_T%1X+XL5G#K*GQsO6&e(zr`-ZIk&G{4kAh=OfTR zMoBv%Uc>>RwBdUnmhqP&*5sJ~qTgaZ5RHRU z%tYg%j!!pySjNj(Z_yX?T`d-otd;{^^Q^2#V7_2~!1*6=}C)vJ{dXP5U>Sll_YW`{5f$$@v-cbWrGf z&6AQ}*iX(6#|=mbE7YE2qplA;@*KFKb!7ItmDyHAdcP z#`4(5jP{4hKd1Wz=JTpfL_#`Z`yzlZ^Q#rkZeH24eCnF>&THwYX{B0ab|>xMpT~SG zT^e?B=ey7s{t7z+-}!stS6MFe1=pW}V`*$h%;%0-Cird@0J^u%cfk)@zH7dW7q0xt z-*M}s?_AaOKj2x6w8znQUWIn#`x$5_S>Y0iuD@2Ni2w86PWD&Y*>3q5oiDFg-a2mV z=;dwhdPUrCgztw(YybVa_)(A24PQ(9)ewTCpGwKTe{uaev#ot;b6Zp2V9K@lRA&?U zxPF3OU<5xn>km5A`Vst#(|HUYmaBb!e10VSPUM%=Z@{-_w)88+ zA(#2Gp9l2Ef#V!v|CIA!J{spGAM+2M7jS(suW;wJ;D=JUpN;xsK5@C~i@59eDDR%% zfya3sdgFRJ*1PZXIp!0PbG>suhW&W`l>b_%Nq8 zbNm1An*{IL0sa5heazQUmMJxXZG|rNSI*~l&2Rwtp>$7~Sbii=3*M|0*NsKh&&-zk1CQ$!_;)1#7{PtEIjt}3 zg8HBwJ^o+=C~({FknynL(1rH;qe1tPFgV%H=Ggi4#0agwj}W=I{-j|u6^a`Bg7q3| z6RQ7_2?X?qU62L6x(1o6*@bEwQE9wvX0}opK zfwboy2aA0R8h6Y4`0)6}_Ch^4&H?;Q$wo~B?gy(MVgCaB$CU@a=9@y+ue3b)!d^!G z1LGC+gdQTDepQcl^Rst4@VGg15mevR@Gf0Y}R z*ZRXA(6a#-2r9P$@>D+X;0ucSqF%6<7Bi7taG02V9qMD%Wp+Bk$P6{slqPxpy_V*Yw*pDsDwRu){~w_{S{*H57nC_+WVuh1MGwS3lles9kP*sM>^Va zzWQSS!odnh`(^i(@nwmovpRf!9e!+U)-7$1 ztPr7D6`)Fh2dw$?Zmu7tzSVYr}4mq zdUHG(u&)F8b`VPdCVoGyXMguETs36q=jZ7Dh3WK+{OknJ{ z#-lvO1MObX{soTnID`EQ@GmaQ0rM{KkyJygwHoyNit`eZD|BGTXHDSoM}myszWob8 zx%VS+|FAMm+Be?6ur0NJA*X({eZtm}X3Byo?zkbN?9QFozfk#}wr8038|V?+1Lt9p z7xzzzLobvIagd;F58%)aiEOjpJduprV_pI3`XSy$0*d_$ zn17(2umjfLknZkZKzddW&b=o+PGS8FdbsPkD2My|pwajj>P$bQ6FXe6l05e7cs?$1 zte^Gbqx$*xFQoe+_WQ>B7bGA14=}E|#qM$c#<;?aCZL!&kr^1Z}uC; z<1FUy*q8o$jM@6!Q0^L;AELkY=y|nxh@``xzID)jcApdYgO)w%$nP(OJ$(LYw4Trh ze7hcy`k%W+DEzak_z{{9|3NvU>F`hBk$>tD;-79h{1fS*;1B-iH-5piTEtp%b^rZIg-F@#B_dF+cbQrStd^YC+dOF@NvnpNfaRkE-pzt>c_Ev z9uca^4wn57@p_BI z!Dnl){ofczg>Fa^RnwcW~Nv9XBzb!}Sxc`{VhDaDe}h()v!AF8hnYzo-XT z7Q}iq>JJ=fM#s6xD7ydZgF5~a4wpE#2<8o#58!@&2!=ZDVO+%ig+J0 zXjSV4iv0`7r#oVHUXA-^Ma3f@|f})OzegGEv`I_bJ)Lt{86xv_P?P@O_#iz>+?%7|B&aE zqIOpU{qTK~UwZh^=sqaVqxgE7!|e4>%wIG`IuX+c^g5vZG?^cx9(Xqx3x3J~^DopJ@?G5P+O9j4LVl8R z*^fW;>}GBY=mR?klm^|n49nv<~zKP>h6-9l-PjHaUu_8YkMjqFcA9^Wxu zpxlA_wS&_6vVMyF3&^*W+O?2M_-jN48QyPG(0XrqM*RO+63z99_b=FpS-E;y=XrMj zLi)LjK(bBOJQ-(j|I++e>{(LEFw6Hq8Q*b!j?R0^2hV%C&--BhHe7Ka0S=V9?fvse zzUYVX2Xaw7$(QfnW;Nr+OXK|s3(i<_c6(>*dF#wsEx}LH{lsXTeUrlkdYu~6(~lQ_ z+F|7Rox|xqn6*PD@=aT0hd$rK<;4D6I=R1J;_ff@FTlT$KMn^=bzsyVc+4Yms`o)>2p)Q& zU)-eiM>*rv6Y1cGc#ryXHS%l82{eAlOKE!`9p#Naj~-A$a{mIyIq*3%y?;T{2l_wV z0UPN5))|uhU%Z26iJt!N_QNBtm3=WEp@QsZRUMby@rd*JT!iz`ocCz|t;qO-^rFSk zPgyq@(6|~%8jCiV*R{~`s=BiQV{RFaeLJASY{S3E^AndVmDKnb;~wl_g;RDAL+t$# z%x4={uGDR=ben`Ql}Dw1n7?N~n4Z5^oadRqwyfnqF@KN7NwYmQe-9P!mdE-8=Ipj{Dn_a7g&RodTek6QL; zKMjZxp9i=-cwUY9dvsl;_Hp-f_O<_5Rn8jXUn`{N??2hpKt4Hpz0fbI9bj)z*cbbc zi_4__vHuwM1Eo8{c0GyfWrNFOh@Wtce*gCSk7fPLU9X0| z@K@LocI~zQSo@KSLq%~u-=+P>)V}wQmidg!xA*?zH|)Bdt1s8Xw#RESk3u_=%i8Ct zSwFk~Sof#7{yOm~@t30sm)?IY>x37zt{OLXP45lJSYO2a3-kBNe~2IDe<5^)##s*z zJpExm?{C2TeV6wiN1aXd!2J*C1^Ms;cmMIZsz2NN?9PR&TRL(rEf>t8?%lkC&k6PR zA8$yM=lbIQ3HA>Y3y8L=WTB7|yJP*Kh;;H58;G*`Fn{MX9a!u*}(as9cnJb!=j==A&@>kp7$Z~bAE`cqCR^JV@4QMLo( zSE?Lb??>18Y7duB8TBVV9DM5!F788GZmm+Rw5ReEv(U8}#{ID9;-Qloshm z$80aGKX83|ly9i@J(Kcl1*|_H54h3`(!Q_UcK_N}i67D%b9;FaW_muWDm&Jn&-OZHi)i^1A{fc$* zaF2hs<)?O~`DHdJU#(;LN%6D4L6rwY{vBE1!q%C$yg~0!>4x8_Za94*{pu^z{$$jj zfCK$Is@nf(RWP6EZzV9F=r10)?qA6`@VL_d-}%IsFA#qMe~jz2pX}Rwep>QY8P_RY zvh-UgkY8^;vG&)ZZ%HZk$KgI7=p`x#=Wm>|b9(>7(KyOrzl>YolIn+TJ=iaga(q9- zUZ?y<`1kThtc#++UyTm3^T$x@=~DO`DCQF{9+I9HB_AfC6Szbi@bnclgnXlMjjR+j9PE8JSMdFF!96DA0bo|A-K)vyIhw2+_ z)BdCJ5B{gTpXXhN3;&%e#~pvWw@W#fPf_`3H6nk9{c%6p#m&}ovz+oHey{ow!`&T! z`5p=MacQ7-E~_0d{^qrQz&~)$1X~5SzKIJS3k{VY%He+UrVw5;j8Zo!PE4U_Q+=_t>6$pCzyiQw1ev=98PGFZ+tJ=9=4egKd1 zxWCQplJ?^`hpxgr>(3HP{ql{SwKj!%9qbFlB?pL|;U_x%Fh4#}?SI)!;j80WN$r91 zmuo!tqS(*9pA0*JqMYleNOvjkcdJ!j;BY^Alq!zrJ@Q|W{UR54-)Gl*fXDr0j>|ki z#@8)6t^uEaUg~qX(my+6)(*vg^l{-*E6HO@DQ38V@-iTXfCDMO*baRGK&HI5rwpi-FR_$bUqMxY#itlpxNA=hA->M(-dqgB} z*BrTDil0iH=eT%RJ{_9Z$pChargEW2@loLmJHSp{h68XzZWjHDRcX)sq=&3N@EbwX zJnLo2->4M(>$)@!e%Egjeq5f{S8KCnL0{#G{-@q7P8_u6{o z@hwEHKls6Zybi?U;KaoIi`%ASq4?oYZ3lT z)Ti{kv=izLegdPp-W2hRZ7QdtdLT~n?EdUu>A0|6;~SO2pDykadF;m=8k;uT`tx|k zK~jxDImA)khj*`Ark*8sL3$7dW0@EH8|fV_qZV*_R>!w}4is=d4g?~=<8U5rv*8aaibuaIYkwMf zjnvns6XV;TlKR@tVFbQTJ^AzQVniynNI^?P(~Iv?XA#<}OqVqd6v_#N^5 zp6CCWu~J{QGl%>J`9^EzPf~Bzf$MwO8xo)RtWb*f=7lG|G;0|ez5%!H_#(ZDx`f+VvyC(t+i8g2l(xg4G{&R=6JMUcJ`=wC`-;|C=8FFxb zSFDed)vsvJg4j<}1<*N#7LoVfSz-soeN_7^ZJ?8He*16(=>rxRu)u%?1}rdOfdLEr zud;w$G35Cs2bvk#d2w)+%ttHB8c=97Xeq++L~Yf$2%6XnmZKBCGVVnhc=x!{$Xh!u&wS(Rd0Up%F zBmHkh_reXGzm)<5a#I%AaJ4+w4$9*y_vNR*@OCWKr|?~hPbDTIZ~R{$kQ25TI2^FR zfCc_{Tflc-c55BYlQm;dd>#)tDa_oV^CVCO_LEd+eAk(0^<8kUA#x^udNSkD|4)91d4dc_Cw2Q2X4Z-GJoWtWXV`Hk#TI(y_SyYCF|iN*WQ*B{w# z_c6V8kI;v|FZ9pfl>KtpmyZ3P*q4d@mDo3l{f&d4m3?MMoF@A>u}=^C@30RJ`_-^d z3Hy!QeMG+RQ@q>Er+1pnF!D``CVEF!r&(^==wJFhkCW+bag&VvHc`V(vCrNuq|!6Y zJo?Si?_6^R?aQ7`DU*%J%b5<-ZdTB5vsp>c=`|DgW?MQ(C8iUX1@s5>LbKYm5O%d` zGHdj>iSi5d4`rK3PP^sSO1iEfUehSPlK!<*JT31G(@OPdAx@Bx&JRdmAevHqk~#g8 zFp3^gnP^U;?_t!J70@$3#|{#GiQ^v=V<%QpfuEd zKD9uLSr*l8F}3sA)FyMyVru&)vhX_k>mygi$xfw3KhNUeZE5xs5KQ z*fKiezRlc`8}!QO(yT|?%a%~>*uQgB=T37z<<}k|UC%zXCa!jBEl*x-mXg*h&90P4 z_KuwGC2WEDq;(6`yNx{KLNkW?T9%Ib&v&lv)2oQjeDbfjWbHO_N8#9Cn#d2hEqJ6~ zO@HT+J)0bBOX=059a~&HdWJcdT3|BiJ&jsu4&{v|&pDU=_-Lv{@zFHOn{Lw49+*`sMBe>Q2s{hC|;Jkq#>+G82f_VI*hUST4#3jqV#z-9--6e@!7X_x%64sS2jME*5{Hu z^Riu%b=Z}2DwmzFt;1t^3&qppNbO!Uo!WC5wb4r3R-N{2mmZgD_iyn7k;J{I*6b>2 zEw}&e3fKDQ_Wo!bk4S0V*>Vf1AI~PAnnoTaHAz}4NA_7tHsvwJP(Nv*SzasIZ53hB zM|qw?Z*(F5=8xGK`Do6Ye=Eoy&8}cIscyD{TvY`ybDgb5VX$?=>Wm z$K~EL*5p{ZfG{hm?=r9dDo&Vv@O*3zS%zmclgWBKi=pp)T07075h%`GV#g>RwPf~_ zo*DHn8`~DOjQP4{d$(v@<{~>fEvMg($cCK3H`EE_LLbkx0rAEN`-63b>k5z z9g6L;uPF?Kc4<7P@!T3o&*}b1`jTVny&a|ySca2~Y@EvNDR{gGp!=ipeES1mk{aQ?9$A%F*7tmbk^Cf@k7fU6PxQRWFbl{Ud4gu>2SlHYk!?1k zG`{sHdFHyL^{eRq&MS^DHYX*7^w2H;HH4CyOJ>qBU(<2O+h2OWq0+z%wb#($1tOo% zowb6iXMtLn!z9(SnvwFg%GOE)zuUF^;dF-M@TA7EFYt{hZnFn|1}rdO0kXig`=-qx zqw;F%mCLBF^K8AD&R6HtnW&lidJ~-~c;2{<=G$_`ew3b>ccnyN-bw#1wBxfJ^Nh6F zp3Pe*hp(hp*t0pW+)O6H2KZ_;X(zYM(6)uaxs2Xu}EP-bmJ`XSI~adAX`_oR>>_ey-?w(HMOX&Ws1;dC>4= z%WgVd6>;dkQ232BvhjI`#8#HFIip9UM=;3okESnPC1RkPR7W0+Nu}p_u8`3UZ)v(qPAPV*EZb9 zllwa~F735*XIA|V^wHC2bxBQjtv)NM*IsDHkIs}`vg%jx!%*Y!!<@#^ujol}yC1Cb z^LNR%0y0vo}nB)fz&7 z`s=^*$kV3L2(f@x3zB}@eUsKl+o4C}XeXoNQ}IWFGp60vBY)E+QlApP6oFa|?ejUo zMeU<;_*=Ku2lUR-L-`f(QRr`dcm;>YI*fMGd+4#}FKKq<_%Gi%BB~4>^tV3fKLxs`k*lF( zE5#f$8$}-4EzmgHt*Y$@Kcugl*m`B(FZZ2HhQ9jk>~ zif3YF=%~N-TccycQaitBiF~k2+XL-Z(m2`;epmdC=t&~&xDXsZNXCbXoLAAG%C`v) z{poRyqrHmif1uTE_g$B)P=D)#tLNm{&3y8zC)%l?akNwLJ<%^}C;c8kq(gp?Jw$yn z-%8hKqQ=oa1?3l(1b0BkKjRf0mQR1{!|R+YX-3Agzqob$?d#qjlr!EOx)M+OZGYv< znv82rzx;URhRZb3D(7_POez-j$#?bVvGLtBMlPU!fwQ~3M>J}gU9zY2Vb*O;$|62} z-1@Ab8E~te8JtHPdf#`Aw9@uRKgwtv{V1#B1N_dIQ*FQLY7}a^#NV*Kk^QFl5!N@( z)j0Z3m-ZjfKW;cqCcLVU)Gxh)np}ZQuC(%9qgFb*@*Tjn)P}tBH-)a}r`c6LzDD3X z2E3-dERn)@IAb5nKPvj7-xV~Deur@b<32s9YRALe*l)^sAINx!@xHA63*-IcQGb*9 z1;%-d`}@AO_lBq~=%Dnt=o9=xXj$V~jfYBeI6s+5L;3wznYBVqmY;0pZ?MUFQ@NaO zkH25+KtM}`RfXyrjQ;VdxncX81IK3Eb*;0 zALRA8lKLy?l~do~+j~(!I~naaXeaa|=z(@K<`rw7@pvtPcEWeD@LdvxkzI6NPdf_4pI=xk{#=ynYv_~F@do-#jK&}F zAEWjGeST!y)TBPX^PPMC<*|Mx%|1GaHYdjS{+5@$2)O4HpC5eX-ScfD&0J)!6IM>7 z7QXVX{!8urb{+M)Em!b2Uq8UTJ08P`ht4qwklKQ8s?>Jox11&7C%5{`|S~mNZVE zarT17Ga6^in{3~mchdOajOLZCZR>)Qf;sKWTiSv#0ZjFWJw?d)kBcGn+_jqTTX>B9~7XfUNu zxr@BR%o+EK?YG1{&*L!ch|8>A#D7fR{NLIy{?k4DSshY!*m<|@9M-wl>{D|)*05r; z*FQdMbI;HzpSo|><}E`TH~((0#?4O+o;~=mTS~*sob_*|)WOp~)jex-g)4f1tc|I_K2+q5xTJ*^Y+QSt>m!PQ3JYq|38|8aMx1 z5`Rvj$a-SN?Rk2`Eb&Na`^rs`wvEHSbpPr-Sz#)}WX}5km~t17)Z0fFP<$0%2U->+1?kj(C zoqS$3?W_E|>g0z`zHi?w!ECsEqO6z8yLynCqBWna#d~d1$V7yP3J&MeAC5VW`{0 Date: Wed, 10 Nov 2021 13:25:30 -0800 Subject: [PATCH 032/195] Update Rust demangling to use rustc-demangle The rust-demangle-capi crate hasn't been updated since 2016 and out-of-date. Instead, Breakpad needs to use C API offered by the rustc-demangle to demangle Rust symbols. *** TESTING *** 1) Set up rustc-demangle > git clone https://github.com/rust-lang/rustc-demangle.git > cd rustc-demangle > cargo build -p rustc-demangle-capi --release 2) Breakpad > ./configure --with-rustc-demangle= > make check src/common/dward_cu_to_module Change-Id: Ib68b62ef329f1397bc379a1d04c632781e4b2069 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3273324 Reviewed-by: Joshua Peraza --- Makefile.am | 12 +++---- Makefile.in | 16 ++++----- configure | 40 +++++++++++------------ configure.ac | 22 ++++++------- src/common/dwarf_cu_to_module_unittest.cc | 6 ++-- src/common/language.cc | 15 +++++---- 6 files changed, 56 insertions(+), 55 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0602314d1..e7dc06ac7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -623,9 +623,9 @@ src_tools_linux_dump_syms_dump_syms_SOURCES = \ src/common/linux/safe_readlink.cc \ src/tools/linux/dump_syms/dump_syms.cc src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \ - $(RUST_DEMANGLE_CFLAGS) + $(RUSTC_DEMANGLE_CFLAGS) src_tools_linux_dump_syms_dump_syms_LDADD = \ - $(RUST_DEMANGLE_LIBS) + $(RUSTC_DEMANGLE_LIBS) src_tools_linux_md2core_minidump_2_core_SOURCES = \ src/common/linux/memory_mapped_file.cc \ @@ -683,10 +683,10 @@ src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \ src/tools/mac/dump_syms/dump_syms_tool.cc src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \ -I$(top_srcdir)/src/third_party/mac_headers \ - $(RUST_DEMANGLE_CFLAGS) \ + $(RUSTC_DEMANGLE_CFLAGS) \ -DHAVE_MACH_O_NLIST_H src_tools_mac_dump_syms_dump_syms_mac_LDADD= \ - $(RUST_DEMANGLE_LIBS) + $(RUSTC_DEMANGLE_LIBS) src_common_dumper_unittest_SOURCES = \ src/common/byte_cursor_unittest.cc \ @@ -748,11 +748,11 @@ src_common_dumper_unittest_SOURCES = \ src/common/tests/file_utils.cc src_common_dumper_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) \ - $(RUST_DEMANGLE_CFLAGS) \ + $(RUSTC_DEMANGLE_CFLAGS) \ $(PTHREAD_CFLAGS) src_common_dumper_unittest_LDADD = \ $(TEST_LIBS) \ - $(RUST_DEMANGLE_LIBS) \ + $(RUSTC_DEMANGLE_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) src_common_mac_macho_reader_unittest_SOURCES = \ diff --git a/Makefile.in b/Makefile.in index 3c82fc953..87377f3ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2371,8 +2371,8 @@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ -RUST_DEMANGLE_CFLAGS = @RUST_DEMANGLE_CFLAGS@ -RUST_DEMANGLE_LIBS = @RUST_DEMANGLE_LIBS@ +RUSTC_DEMANGLE_CFLAGS = @RUSTC_DEMANGLE_CFLAGS@ +RUSTC_DEMANGLE_LIBS = @RUSTC_DEMANGLE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -2833,10 +2833,10 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.cc @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_SOURCES = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ @@ -2895,11 +2895,11 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_SOURCES = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/byte_cursor_unittest.cc \ @@ -2962,12 +2962,12 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_CPPFLAGS = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_SOURCES = \ diff --git a/configure b/configure index 64fea8151..b6a86c72d 100755 --- a/configure +++ b/configure @@ -628,8 +628,8 @@ LTLIBOBJS LIBOBJS TESTS_AS_ROOT_FALSE TESTS_AS_ROOT_TRUE -RUST_DEMANGLE_LIBS -RUST_DEMANGLE_CFLAGS +RUSTC_DEMANGLE_LIBS +RUSTC_DEMANGLE_CFLAGS SELFTEST_FALSE SELFTEST_TRUE GTEST_LIBS @@ -781,7 +781,7 @@ enable_processor enable_tools enable_system_test_libs enable_selftest -with_rust_demangle +with_rustc_demangle with_tests_as_root ' ac_precious_vars='build_alias @@ -802,8 +802,8 @@ GMOCK_CFLAGS GMOCK_LIBS GTEST_CFLAGS GTEST_LIBS -RUST_DEMANGLE_CFLAGS -RUST_DEMANGLE_LIBS' +RUSTC_DEMANGLE_CFLAGS +RUSTC_DEMANGLE_LIBS' # Initialize some variables set by options. @@ -1455,8 +1455,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-rust-demangle=/path/to/rust-demangle-capi - Link against the rust-demangle library to demangle + --with-rustc-demangle=/path/to/rustc-demangle + Link against the rustc-demangle library to demangle Rust language symbols during symbol dumping (default is no) Pass the path to the crate root. --with-tests-as-root Run the tests as root. Use this on platforms like @@ -1482,10 +1482,10 @@ Some influential environment variables: GTEST_CFLAGS Compiler flags for gtest GTEST_LIBS Linker flags for gtest - RUST_DEMANGLE_CFLAGS - Compiler flags for rust-demangle - RUST_DEMANGLE_LIBS - Linker flags for rust-demangle + RUSTC_DEMANGLE_CFLAGS + Compiler flags for rustc-demangle + RUSTC_DEMANGLE_LIBS + Linker flags for rustc-demangle Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -7690,25 +7690,25 @@ fi -# Check whether --with-rust-demangle was given. -if test "${with_rust_demangle+set}" = set; then : - withval=$with_rust_demangle; case "${withval}" in +# Check whether --with-rustc-demangle was given. +if test "${with_rustc_demangle+set}" = set; then : + withval=$with_rustc_demangle; case "${withval}" in yes) - as_fn_error $? "You must pass the path to the rust-demangle-capi crate for --with-rust-demangle" "$LINENO" 5 + as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 ;; no) - rust_demangle=false + rustc_demangle=false ;; *) if ! test -f "${withval}/Cargo.toml"; then - as_fn_error $? "You must pass the path to the rust-demangle-capi crate for --with-rust-demangle" "$LINENO" 5 + as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 fi - RUST_DEMANGLE_CFLAGS="-DHAVE_RUST_DEMANGLE -I${withval}/target/include" - RUST_DEMANGLE_LIBS="-L${withval}/target/release -lrust_demangle -lpthread -ldl" + RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${withval}/crates/capi/include" + RUSTC_DEMANGLE_LIBS="-L${withval}/target/release -lrustc_demangle -lpthread -ldl" ;; esac else - rust_demangle=false + rustc_demangle=false fi diff --git a/configure.ac b/configure.ac index b62b8fe53..20fb07532 100644 --- a/configure.ac +++ b/configure.ac @@ -219,30 +219,30 @@ AC_ARG_ENABLE(selftest, [selftest=false]) AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue) -AC_ARG_WITH(rust-demangle, - AS_HELP_STRING([--with-rust-demangle=/path/to/rust-demangle-capi], - [Link against the rust-demangle library] +AC_ARG_WITH(rustc-demangle, + AS_HELP_STRING([--with-rustc-demangle=/path/to/rustc-demangle], + [Link against the rustc-demangle library] [to demangle Rust language symbols during] [symbol dumping (default is no)] [Pass the path to the crate root.]), [case "${withval}" in yes) - AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle) + AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) ;; no) - rust_demangle=false + rustc_demangle=false ;; *) if ! test -f "${withval}/Cargo.toml"; then - AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle) + AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) fi - RUST_DEMANGLE_CFLAGS="-DHAVE_RUST_DEMANGLE -I${withval}/target/include" - RUST_DEMANGLE_LIBS="-L${withval}/target/release -lrust_demangle -lpthread -ldl" + RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${withval}/crates/capi/include" + RUSTC_DEMANGLE_LIBS="-L${withval}/target/release -lrustc_demangle -lpthread -ldl" ;; esac], - [rust_demangle=false]) -AC_ARG_VAR([RUST_DEMANGLE_CFLAGS], [Compiler flags for rust-demangle]) -AC_ARG_VAR([RUST_DEMANGLE_LIBS], [Linker flags for rust-demangle]) + [rustc_demangle=false]) +AC_ARG_VAR([RUSTC_DEMANGLE_CFLAGS], [Compiler flags for rustc-demangle]) +AC_ARG_VAR([RUSTC_DEMANGLE_LIBS], [Linker flags for rustc-demangle]) AC_ARG_WITH(tests-as-root, AS_HELP_STRING([--with-tests-as-root], diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index ce9f2da41..499ec49bb 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -1268,12 +1268,12 @@ TEST_F(Specifications, MangledNameRust) { TestFunctionCount(1); TestFunction(0, -#ifndef HAVE_RUST_DEMANGLE +#ifndef HAVE_RUSTC_DEMANGLE // Rust mangled names should pass through untouched if not - // using rust-demangle. + // using rustc-demangle. kName, #else - // If rust-demangle is available this should be properly + // If rustc-demangle is available this should be properly // demangled. "rustc_demangle::demangle", #endif diff --git a/src/common/language.cc b/src/common/language.cc index 381c8bd4f..63b72a79c 100644 --- a/src/common/language.cc +++ b/src/common/language.cc @@ -35,13 +35,14 @@ #include "common/language.h" #include +#include #if !defined(__ANDROID__) #include #endif -#if defined(HAVE_RUST_DEMANGLE) -#include +#if defined(HAVE_RUSTC_DEMANGLE) +#include #endif #include @@ -178,13 +179,13 @@ class RustLanguage: public Language { // abi_demangle doesn't produce stellar results due to them having // another layer of encoding. // If callers provide rustc-demangle, use that. -#if defined(HAVE_RUST_DEMANGLE) - char* rust_demangled = rust_demangle(mangled.c_str()); - if (rust_demangled == nullptr) { +#if defined(HAVE_RUSTC_DEMANGLE) + std::array rustc_demangled; + if (rustc_demangle(mangled.c_str(), rustc_demangled.data(), + rustc_demangled.size()) == 0) { return kDemangleFailure; } - demangled->assign(rust_demangled); - free_rust_demangled_name(rust_demangled); + demangled->assign(rustc_demangled.data()); #else // Otherwise, pass through the mangled name so callers can demangle // after the fact. From 2dce3fe73e1f22f3915d824a9e52a8c7e698f530 Mon Sep 17 00:00:00 2001 From: Sunbreak Date: Thu, 21 Oct 2021 13:33:38 +0800 Subject: [PATCH 033/195] Add missing config for encoding_util.h/m in iOS client project Change-Id: I448bc3d20e8b9bc091577e9c11bcb1603bff2588 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3236246 Reviewed-by: Mark Mentovai Reviewed-by: Nelson Billing --- src/client/ios/Breakpad.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/ios/Breakpad.xcodeproj/project.pbxproj b/src/client/ios/Breakpad.xcodeproj/project.pbxproj index bf00472ad..ca5f1f058 100644 --- a/src/client/ios/Breakpad.xcodeproj/project.pbxproj +++ b/src/client/ios/Breakpad.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 06D561E62700974500F9F2E8 /* encoding_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 06D561E42700974500F9F2E8 /* encoding_util.h */; }; + 06D561E72700974500F9F2E8 /* encoding_util.m in Sources */ = {isa = PBXBuildFile; fileRef = 06D561E52700974500F9F2E8 /* encoding_util.m */; }; 14569321182CE29F0029C465 /* ucontext_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 14569320182CE29F0029C465 /* ucontext_compat.h */; }; 14569323182CE2C10029C465 /* mach_vm_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 14569322182CE2C10029C465 /* mach_vm_compat.h */; }; 16BFA67014E195E9009704F8 /* ios_exception_minidump_generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 16BFA66E14E195E9009704F8 /* ios_exception_minidump_generator.h */; }; @@ -64,6 +66,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 06D561E42700974500F9F2E8 /* encoding_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = encoding_util.h; sourceTree = ""; }; + 06D561E52700974500F9F2E8 /* encoding_util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = encoding_util.m; sourceTree = ""; }; 14569320182CE29F0029C465 /* ucontext_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ucontext_compat.h; sourceTree = ""; }; 14569322182CE2C10029C465 /* mach_vm_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_vm_compat.h; sourceTree = ""; }; 16BFA66E14E195E9009704F8 /* ios_exception_minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ios_exception_minidump_generator.h; sourceTree = ""; }; @@ -291,6 +295,8 @@ 16C7CC82147D4A4300776EAD /* mac */ = { isa = PBXGroup; children = ( + 06D561E42700974500F9F2E8 /* encoding_util.h */, + 06D561E52700974500F9F2E8 /* encoding_util.m */, 16C7CC88147D4A4300776EAD /* GTMLogger.h */, 16C7CC89147D4A4300776EAD /* GTMLogger.m */, E69213D6265202570071B04F /* HTTPRequest.h */, @@ -339,6 +345,7 @@ 16C7CE08147D4A4300776EAD /* uploader.h in Headers */, 16C7CE18147D4A4300776EAD /* minidump_file_writer-inl.h in Headers */, 16C7CE1A147D4A4300776EAD /* minidump_file_writer.h in Headers */, + 06D561E62700974500F9F2E8 /* encoding_util.h in Headers */, 16C7CE41147D4A4300776EAD /* convert_UTF.h in Headers */, 16C7CE78147D4A4300776EAD /* GTMLogger.h in Headers */, E69213D8265202570071B04F /* HTTPRequest.h in Headers */, @@ -435,6 +442,7 @@ 16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */, 16C7CE40147D4A4300776EAD /* convert_UTF.cc in Sources */, 16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */, + 06D561E72700974500F9F2E8 /* encoding_util.m in Sources */, 16C7CE7B147D4A4300776EAD /* HTTPMultipartUpload.m in Sources */, 16C7CE83147D4A4300776EAD /* file_id.cc in Sources */, 16C7CE85147D4A4300776EAD /* macho_id.cc in Sources */, From 57281798ba3d2d0cbcdaadd699261f14f401e2dc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 24 Nov 2021 20:10:34 -0500 Subject: [PATCH 034/195] add DIR_METADATA settings Change-Id: I104e667a354591b35c50902dd84917910b90d2d2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3301422 Reviewed-by: Mark Mentovai --- DIR_METADATA | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 DIR_METADATA diff --git a/DIR_METADATA b/DIR_METADATA new file mode 100644 index 000000000..bc37756ef --- /dev/null +++ b/DIR_METADATA @@ -0,0 +1,13 @@ +# Metadata information for this directory. +# +# For more information on DIR_METADATA files, see: +# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/README.md +# +# For the schema of this file, see Metadata message: +# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/proto/dir_metadata.proto + +monorail { + project: "google-breakpad" +} + +team_email: "google-breakpad-dev@googlegroups.com" From 998a0a480cfaa85be1da3fc02fbe664790d4e0a1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 18 Nov 2021 15:25:00 -0500 Subject: [PATCH 035/195] github: enable cron schedule Since GH is mirroring the code directly from our GoB systems, they aren't triggering push events. Set them up with a daily/weekly cron so we get some level of coverage. Change-Id: I9ececc74a4904e0e3060a10ee1acb952e2021240 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3289899 Reviewed-by: Mark Mentovai --- .github/workflows/build-test-ci.yml | 8 ++++++++ .github/workflows/coverity.yml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index 75f6ca217..2196d55f5 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -7,6 +7,14 @@ on: push: branches: [main] + schedule: + # The GH mirroring from Google GoB does not trigger push actions. + # Fire it every other day to provide some coverage. This will run ~8 AM PT. + - cron: '39 3 */2 * *' + + # Allow for manual triggers from the web. + workflow_dispatch: + jobs: autotools: strategy: diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 84e6edaf3..cfa0f2ab5 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -8,6 +8,14 @@ on: push: branches: [main] + schedule: + # The GH mirroring from Google GoB does not trigger push actions. + # Fire it once a week to provide some coverage. + - cron: '39 2 * * WED' + + # Allow for manual triggers from the web. + workflow_dispatch: + jobs: coverity: runs-on: ubuntu-latest From 4ee9854be5218b504fd4c1bc502ba9503caf021f Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 24 Nov 2021 15:18:45 -0800 Subject: [PATCH 036/195] Limit Tokenize max_tokens to 512 when parsing INLINE record. This is a more practical reserved capacity than std::numeric_limits::max() for the vector. Change-Id: Ic8d4e812c3804e4f15cc51650f7a91bae7313415 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3301419 Reviewed-by: Joshua Peraza Reviewed-by: Lei Zhang --- src/processor/basic_source_line_resolver.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 2e05d72a3..5dc73801b 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -730,7 +730,8 @@ bool SymbolParseHelper::ParseInline( inline_line += 7; // skip prefix vector tokens; - Tokenize(inline_line, kWhitespace, std::numeric_limits::max(), &tokens); + // Increase max_tokens if necessary. + Tokenize(inline_line, kWhitespace, 512, &tokens); // Determine the version of INLINE record by parity of the vector length. *has_call_site_file_id = tokens.size() % 2 == 0; From 4458a5965a3c534ab43487ff5ddd4916553d4ab0 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 30 Nov 2021 13:53:53 -0800 Subject: [PATCH 037/195] Extend ContainedRangeMap and StaticContainedRangeMap This adds a new mode in ContainedRangeMap which allows existance of equal ranges. Among those equal ranges, the most recently added range is the innermost range. This also adds a function to ContainedRangeMap and StaticContainedRangeMap to allow users get a vector of entries that contains given address from innermost to outermost ranges. Change-Id: I84c1f2e49ffcaf8238df60e41498730103d1ead6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3291137 Reviewed-by: Joshua Peraza --- src/processor/contained_range_map-inl.h | 28 ++- src/processor/contained_range_map.h | 28 ++- src/processor/contained_range_map_unittest.cc | 187 ++++++++++++++---- .../static_contained_range_map-inl.h | 17 ++ src/processor/static_contained_range_map.h | 6 + .../static_contained_range_map_unittest.cc | 19 ++ 6 files changed, 240 insertions(+), 45 deletions(-) diff --git a/src/processor/contained_range_map-inl.h b/src/processor/contained_range_map-inl.h index edd11d7cf..605f60f2b 100644 --- a/src/processor/contained_range_map-inl.h +++ b/src/processor/contained_range_map-inl.h @@ -84,10 +84,12 @@ bool ContainedRangeMap::StoreRange( // range's, it violates the containment rules, and an attempt to store // it must fail. iterator_base->first contains the key, which was the // containing child's high address. - if (iterator_base->second->base_ == base && iterator_base->first == high) { + if (!allow_equal_range_ && iterator_base->second->base_ == base && + iterator_base->first == high) { // TODO(nealsid): See the TODO above on why this is commented out. -// BPLOG(INFO) << "StoreRange failed, identical range is already " -// "present: " << HexString(base) << "+" << HexString(size); + // BPLOG(INFO) << "StoreRange failed, identical range is already " + // "present: " << HexString(base) << "+" << + // HexString(size); return false; } @@ -141,8 +143,10 @@ bool ContainedRangeMap::StoreRange( // the new child range contains were formerly children of this range but // are now this range's grandchildren. Ownership of these is transferred // to the new child range. - map_->insert(MapValue(high, - new ContainedRangeMap(base, entry, child_map))); + ContainedRangeMap* new_child = + new ContainedRangeMap(base, entry, child_map, allow_equal_range_); + + map_->insert(MapValue(high, new_child)); return true; } @@ -177,6 +181,20 @@ bool ContainedRangeMap::RetrieveRange( return true; } +template +bool ContainedRangeMap::RetrieveRanges( + const AddressType& address, + std::vector& entries) const { + // If nothing was ever stored, then there's nothing to retrieve. + if (!map_) + return false; + MapIterator iterator = map_->lower_bound(address); + if (iterator == map_->end() || address < iterator->second->base_) + return false; + iterator->second->RetrieveRanges(address, entries); + entries.push_back(&iterator->second->entry_); + return true; +} template void ContainedRangeMap::Clear() { diff --git a/src/processor/contained_range_map.h b/src/processor/contained_range_map.h index 18d03af7a..963548f47 100644 --- a/src/processor/contained_range_map.h +++ b/src/processor/contained_range_map.h @@ -62,6 +62,7 @@ #include +#include namespace google_breakpad { @@ -75,7 +76,8 @@ class ContainedRangeMap { // The default constructor creates a ContainedRangeMap with no geometry // and no entry, and as such is only suitable for the root node of a // ContainedRangeMap tree. - ContainedRangeMap() : base_(), entry_(), map_(NULL) {} + explicit ContainedRangeMap(bool allow_equal_range = false) + : base_(), entry_(), map_(NULL), allow_equal_range_(allow_equal_range) {} ~ContainedRangeMap(); @@ -95,7 +97,12 @@ class ContainedRangeMap { // child ranges, and not the entry contained by |this|. This is necessary // to support a sparsely-populated root range. If no descendant range // encompasses the address, returns false. - bool RetrieveRange(const AddressType& address, EntryType* entry) const; + bool RetrieveRange(const AddressType& address, EntryType* entries) const; + + // Retrieves the vector of entries encompassing the specified address from the + // innermost entry to the outermost entry. + bool RetrieveRanges(const AddressType& address, + std::vector& entries) const; // Removes all children. Note that Clear only removes descendants, // leaving the node on which it is called intact. Because the only @@ -118,9 +125,14 @@ class ContainedRangeMap { // Creates a new ContainedRangeMap with the specified base address, entry, // and initial child map, which may be NULL. This is only used internally // by ContainedRangeMap when it creates a new child. - ContainedRangeMap(const AddressType& base, const EntryType& entry, - AddressToRangeMap* map) - : base_(base), entry_(entry), map_(map) {} + ContainedRangeMap(const AddressType& base, + const EntryType& entry, + AddressToRangeMap* map, + bool allow_equal_range) + : base_(base), + entry_(entry), + map_(map), + allow_equal_range_(allow_equal_range) {} // The base address of this range. The high address does not need to // be stored, because it is used as the key to an object in its parent's @@ -141,6 +153,12 @@ class ContainedRangeMap { // address. This is a pointer to avoid allocating map structures for // leaf nodes, where they are not needed. AddressToRangeMap* map_; + + // Whether or not we allow storing an entry into a range that equals to + // existing range in the map. Default is false. + // If this is true, the newly added range will become a child of existing + // innermost range which has same base and size. + bool allow_equal_range_; }; diff --git a/src/processor/contained_range_map_unittest.cc b/src/processor/contained_range_map_unittest.cc index a97c5d0f9..6597cac81 100644 --- a/src/processor/contained_range_map_unittest.cc +++ b/src/processor/contained_range_map_unittest.cc @@ -51,9 +51,82 @@ namespace { using google_breakpad::ContainedRangeMap; +// The first is the querying address, the second is the entries vector result. +using EntriesTestPair = std::pair>; +using EntriesTestPairVec = std::vector; +static bool RunTestsWithRetrieveRange( + const ContainedRangeMap& crm, + const int* test_data, + unsigned int test_length) { + // Now, do the RetrieveRange tests. This further validates that the + // objects were stored properly and that retrieval returns the correct + // object. + // If GENERATE_TEST_DATA is defined, instead of the retrieval tests, a + // new test_data array will be printed. Exercise caution when doing this. + // Be sure to verify the results manually! +#ifdef GENERATE_TEST_DATA + printf(" const int test_data[] = {\n"); +#endif // GENERATE_TEST_DATA -static bool RunTests() { + for (unsigned int address = 0; address < test_length; ++address) { + int value; + if (!crm.RetrieveRange(address, &value)) + value = 0; + +#ifndef GENERATE_TEST_DATA + // Don't use ASSERT inside the loop because it won't show the failed + // |address|, and the line number will always be the same. That makes + // it difficult to figure out which test failed. + if (value != test_data[address]) { + fprintf(stderr, "FAIL: retrieve %d expected %d observed %d @ %s:%d\n", + address, test_data[address], value, __FILE__, __LINE__); + return false; + } +#else // !GENERATE_TEST_DATA + printf(" %d%c%s // %d\n", value, address == test_high - 1 ? ' ' : ',', + value < 10 ? " " : "", address); +#endif // !GENERATE_TEST_DATA + } + +#ifdef GENERATE_TEST_DATA + printf(" };\n"); +#endif // GENERATE_TEST_DATA + + return true; +} + +static bool RunTestsWithRetrieveRangeVector( + const ContainedRangeMap& crm, + const EntriesTestPairVec& entries_tests) { + for (const EntriesTestPair& entries_test : entries_tests) { + std::vector entries; + crm.RetrieveRanges(entries_test.first, entries); + if (entries.size() != entries_test.second.size()) { + fprintf(stderr, + "FAIL: retrieving entries at address %u has size %zu " + "expected to have size %zu " + "@ %s: %d\n", + entries_test.first, entries.size(), entries_test.second.size(), + __FILE__, __LINE__); + return false; + } + for (size_t i = 0; i < entries.size(); ++i) { + if (*entries[i] != entries_test.second[i]) { + fprintf(stderr, + "FAIL: retrieving entries at address %u entries[%zu] is %d " + "expected %d" + "@ %s: %d\n", + entries_test.first, i, *entries[i], entries_test.second[i], + __FILE__, __LINE__); + return false; + } + } + } + return true; +} + +static bool RunTestsWithNoEqualRange() { ContainedRangeMap crm; // First, do the StoreRange tests. This validates the containment @@ -211,45 +284,89 @@ static bool RunTests() { 0, // 98 0 // 99 }; - unsigned int test_high = sizeof(test_data) / sizeof(int); + unsigned int test_length = sizeof(test_data) / sizeof(int); + return RunTestsWithRetrieveRange(crm, test_data, test_length); +} - // Now, do the RetrieveRange tests. This further validates that the - // objects were stored properly and that retrieval returns the correct - // object. - // If GENERATE_TEST_DATA is defined, instead of the retrieval tests, a - // new test_data array will be printed. Exercise caution when doing this. - // Be sure to verify the results manually! -#ifdef GENERATE_TEST_DATA - printf(" const int test_data[] = {\n"); -#endif // GENERATE_TEST_DATA +static bool RunTestsWithEqualRange() { + ContainedRangeMap crm(true); - for (unsigned int address = 0; address < test_high; ++address) { - int value; - if (!crm.RetrieveRange(address, &value)) - value = 0; + // First, do the StoreRange tests. This validates the containment + // rules. + ASSERT_TRUE (crm.StoreRange(1, 3, 1)); + ASSERT_TRUE (crm.StoreRange(1, 3, 2)); // exactly equal to 1 + ASSERT_TRUE (crm.StoreRange(1, 3, 3)); // exactly equal to 1, 2 + ASSERT_TRUE (crm.StoreRange(1, 3, 4)); // exactly equal to 1, 2, 3 + ASSERT_FALSE(crm.StoreRange(0, 3, 5)); // partial overlap. + ASSERT_FALSE(crm.StoreRange(2, 3, 6)); // partial overlap. -#ifndef GENERATE_TEST_DATA - // Don't use ASSERT inside the loop because it won't show the failed - // |address|, and the line number will always be the same. That makes - // it difficult to figure out which test failed. - if (value != test_data[address]) { - fprintf(stderr, "FAIL: retrieve %d expected %d observed %d @ %s:%d\n", - address, test_data[address], value, __FILE__, __LINE__); - return false; - } -#else // !GENERATE_TEST_DATA - printf(" %d%c%s // %d\n", value, - address == test_high - 1 ? ' ' : ',', - value < 10 ? " " : "", - address); -#endif // !GENERATE_TEST_DATA - } + ASSERT_TRUE (crm.StoreRange(5, 3, 7)); + ASSERT_TRUE (crm.StoreRange(5, 3, 8)); // exactly equal to 7 + ASSERT_TRUE (crm.StoreRange(5, 3, 9)); // exactly equal to 7, 8 + ASSERT_TRUE (crm.StoreRange(5, 4, 10)); // encompasses 7, 8, 9 + ASSERT_TRUE (crm.StoreRange(5, 5, 11)); // encompasses 7, 8, 9, 10 -#ifdef GENERATE_TEST_DATA - printf(" };\n"); -#endif // GENERATE_TEST_DATA + ASSERT_TRUE (crm.StoreRange(10, 3, 12)); + ASSERT_TRUE (crm.StoreRange(10, 3, 13)); // exactly equal to 12 + ASSERT_TRUE (crm.StoreRange(11, 2, 14)); // encompasses by 12 + ASSERT_TRUE (crm.StoreRange(11, 1, 15)); // encompasses by 12, 13 - return true; + ASSERT_TRUE (crm.StoreRange(14, 3, 16)); + ASSERT_TRUE (crm.StoreRange(14, 3, 17)); // exactly equal to 14 + ASSERT_TRUE (crm.StoreRange(14, 1, 18)); // encompasses by 14, 15 + ASSERT_TRUE (crm.StoreRange(14, 2, 19)); // encompasses by 14, 15 and encompasses 16 + ASSERT_TRUE (crm.StoreRange(14, 1, 20)); // exactly equal to 18 + ASSERT_TRUE (crm.StoreRange(14, 2, 21)); // exactly equal to 19 + + // Each element in test_data contains the expected result when calling + // RetrieveRange on an address. + const int test_data[] = { + 0, // 0 + 4, // 1 + 4, // 2 + 4, // 3 + 0, // 4 + 9, // 5 + 9, // 6 + 9, // 7 + 10, // 8 + 11, // 9 + 13, // 10 + 15, // 11 + 14, // 12 + 0, // 13 + 20, // 14 + 21, // 15 + 17, // 16 + 0, // 17 + }; + unsigned int test_length = sizeof(test_data) / sizeof(int); + EntriesTestPairVec entries_tests = { + {0, {}}, + {1, {4, 3, 2, 1}}, + {2, {4, 3, 2, 1}}, + {3, {4, 3, 2, 1}}, + {4, {}}, + {5, {9, 8, 7, 10, 11}}, + {6, {9, 8, 7, 10, 11}}, + {7, {9, 8, 7, 10, 11}}, + {8, {10, 11}}, + {9, {11}}, + {10, {13, 12}}, + {11, {15, 14, 13, 12}}, + {12, {14, 13, 12}}, + {13, {}}, + {14, {20, 18, 21, 19, 17, 16}}, + {15, {21, 19, 17, 16}}, + {16, {17, 16}}, + {17, {}}, + }; + return RunTestsWithRetrieveRange(crm, test_data, test_length) && + RunTestsWithRetrieveRangeVector(crm, entries_tests); +} + +static bool RunTests() { + return RunTestsWithNoEqualRange() && RunTestsWithEqualRange(); } diff --git a/src/processor/static_contained_range_map-inl.h b/src/processor/static_contained_range_map-inl.h index 87ea6c7f5..58c833717 100644 --- a/src/processor/static_contained_range_map-inl.h +++ b/src/processor/static_contained_range_map-inl.h @@ -87,6 +87,23 @@ bool StaticContainedRangeMap::RetrieveRange( return true; } +template +bool StaticContainedRangeMap::RetrieveRanges( + const AddressType& address, + std::vector& entries) const { + MapConstIterator iterator = map_.lower_bound(address); + if (iterator == map_.end()) + return false; + const char* memory_child = + reinterpret_cast(iterator.GetValuePtr()); + StaticContainedRangeMap child_map(memory_child); + if (address < child_map.base_) + return false; + child_map.RetrieveRanges(address, entries); + entries.push_back(child_map.entry_ptr_); + return true; +} + } // namespace google_breakpad #endif // PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__ diff --git a/src/processor/static_contained_range_map.h b/src/processor/static_contained_range_map.h index 14fa5e95e..efdfbeabb 100644 --- a/src/processor/static_contained_range_map.h +++ b/src/processor/static_contained_range_map.h @@ -42,6 +42,7 @@ #ifndef PROCESSOR_STATIC_CONTAINED_RANGE_MAP_H__ #define PROCESSOR_STATIC_CONTAINED_RANGE_MAP_H__ +#include #include "processor/static_map-inl.h" namespace google_breakpad { @@ -59,6 +60,11 @@ class StaticContainedRangeMap { // encompasses the address, returns false. bool RetrieveRange(const AddressType& address, const EntryType*& entry) const; + // Retrieves the vector of entries encompassing the specified address from the + // innermost entry to the outermost entry. + bool RetrieveRanges(const AddressType& address, + std::vector& entry) const; + private: friend class ModuleComparer; // AddressToRangeMap stores pointers. This makes reparenting simpler in diff --git a/src/processor/static_contained_range_map_unittest.cc b/src/processor/static_contained_range_map_unittest.cc index 4ee47578e..e2b25a2a1 100644 --- a/src/processor/static_contained_range_map_unittest.cc +++ b/src/processor/static_contained_range_map_unittest.cc @@ -273,6 +273,25 @@ TEST_F(TestStaticCRMMap, TestSingleElementMap) { ASSERT_EQ(*entry_test, entry); } +TEST_F(TestStaticCRMMap, TestRetrieveRangeEntries) { + CRMMap crm_map; + + crm_map.StoreRange(2, 5, 0); + crm_map.StoreRange(2, 6, 1); + crm_map.StoreRange(2, 7, 2); + + unsigned int size; + scoped_array serialized_data; + serialized_data.reset(serializer_.Serialize(&crm_map, &size)); + scoped_ptr test_map(new TestMap(serialized_data.get())); + + std::vector entry_tests; + ASSERT_TRUE(test_map->RetrieveRanges(3, entry_tests)); + ASSERT_EQ(*entry_tests[0], 0); + ASSERT_EQ(*entry_tests[1], 1); + ASSERT_EQ(*entry_tests[2], 2); +} + TEST_F(TestStaticCRMMap, RunTestData) { unsigned int test_high = sizeof(test_data) / sizeof(test_data[0]); From c472afe0643b96d09157f92fd0bb699ef5d752b9 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 30 Nov 2021 13:54:24 -0800 Subject: [PATCH 038/195] Change Inlines in Function to be ContainedRangeMap that is easier to serialize. Change-Id: I565d41f7d629d7ea9b66cec6760686ca201994b3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3294125 Reviewed-by: Ivan Penkov Reviewed-by: Joshua Peraza --- src/processor/basic_source_line_resolver.cc | 92 ++++++++++--------- .../basic_source_line_resolver_types.h | 34 ++++--- .../source_line_resolver_base_types.h | 1 - 3 files changed, 65 insertions(+), 62 deletions(-) diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 5dc73801b..4a565f11c 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -241,39 +241,59 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( void BasicSourceLineResolver::Module::ConstructInlineFrames( StackFrame* frame, MemAddr address, - const RangeMap>& inlines, + const ContainedRangeMap>& inline_map, deque>* inlined_frames) const { - linked_ptr in; - MemAddr inline_base; - if (!inlines.RetrieveRange(address, &in, &inline_base, nullptr, nullptr)) - return; - auto origin = inline_origins_.find(in->origin_id); - if (origin == inline_origins_.end()) + vector*> inlines; + if (!inline_map.RetrieveRanges(address, inlines)) { return; + } - // Update parent frame's source line (and source file if it's the new format). - frame->source_line = in->call_site_line; - if (in->has_call_site_file_id) { - auto file = files_.find(in->call_site_file_id); - if (file != files_.end()) { - frame->source_file_name = file->second; + for (const linked_ptr* const in : inlines) { + unique_ptr new_frame = + unique_ptr(new StackFrame(*frame)); + auto origin = inline_origins_.find(in->get()->origin_id); + if (origin != inline_origins_.end()) { + new_frame->function_name = origin->second->name; + } else { + new_frame->function_name = ""; + } + + // Store call site file and line in current frame, which will be updated + // later. + new_frame->source_line = in->get()->call_site_line; + if (in->get()->has_call_site_file_id) { + auto file = files_.find(in->get()->call_site_file_id); + if (file != files_.end()) { + new_frame->source_file_name = file->second; + } } - } - StackFrame new_frame = StackFrame(*frame); - new_frame.function_name = origin->second->name; - if (origin->second->has_file_id) { - auto file = files_.find(origin->second->source_file_id); - if (file != files_.end()) - new_frame.source_file_name = file->second; - } - // Use the starting adress of the inlined range as inlined function base. - new_frame.function_base = new_frame.module->base_address() + inline_base; - new_frame.trust = StackFrame::FRAME_TRUST_INLINE; - ConstructInlineFrames(&new_frame, address, in->child_inlines, inlined_frames); - // Add child_frame after ConstructInlineFrames so that the innermost frame is - // the first frame inside inlined_frames. - inlined_frames->push_back(unique_ptr(new StackFrame(new_frame))); + // Use the starting address of the inlined range as inlined function base. + new_frame->function_base = new_frame->module->base_address(); + for (const auto& range : in->get()->inline_ranges) { + if (address >= range.first && address < range.first + range.second) { + new_frame->function_base += range.first; + break; + } + } + new_frame->trust = StackFrame::FRAME_TRUST_INLINE; + + // The inlines vector has an order from innermost entry to outermost entry. + // By push_back, we will have inlined_frames with the same order. + inlined_frames->push_back(std::move(new_frame)); + } + + // Update the source file and source line for each inlined frame. + if (!inlined_frames->empty()) { + string parent_frame_source_file_name = frame->source_file_name; + int parent_frame_source_line = frame->source_line; + frame->source_file_name = inlined_frames->back()->source_file_name; + frame->source_line = inlined_frames->back()->source_line; + for (unique_ptr& inlined_frame : *inlined_frames) { + std::swap(inlined_frame->source_file_name, parent_frame_source_file_name); + std::swap(inlined_frame->source_line, parent_frame_source_line); + } + } } void BasicSourceLineResolver::Module::LookupAddress( @@ -312,14 +332,7 @@ void BasicSourceLineResolver::Module::LookupAddress( // Check if this is inlined function call. if (inlined_frames) { - int source_line = frame->source_line; - string source_file_name = frame->source_file_name; ConstructInlineFrames(frame, address, func->inlines, inlined_frames); - if (!inlined_frames->empty()) { - // Update the inner most frame's source line and source file name. - inlined_frames->front()->source_line = source_line; - inlined_frames->front()->source_file_name = source_file_name; - } } } else if (public_symbols_.Retrieve(address, &public_symbol, &public_address) && @@ -606,19 +619,12 @@ bool BasicSourceLineResolver::Function::AppendInline(linked_ptr in) { // This happends if in's parent wasn't added due to a malformed INLINE record. if (in->inline_nest_level > last_added_inline_nest_level + 1) return false; - RangeMap>* current_inlines = &this->inlines; - auto iter = recent_inlines.find(in->inline_nest_level - 1); - if (iter != recent_inlines.end()) - current_inlines = &iter->second->child_inlines; - else - assert(in->inline_nest_level == 0); last_added_inline_nest_level = in->inline_nest_level; - recent_inlines[last_added_inline_nest_level] = in; // Store all ranges into current level of inlines. for (auto range : in->inline_ranges) - current_inlines->StoreRange(range.first, range.second, in); + inlines.StoreRange(range.first, range.second, in); return true; } diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h index 7d9d5cb58..6bd6968ce 100644 --- a/src/processor/basic_source_line_resolver_types.h +++ b/src/processor/basic_source_line_resolver_types.h @@ -61,28 +61,26 @@ BasicSourceLineResolver::Function : public SourceLineResolverBase::Function { MemAddr function_address, MemAddr code_size, int set_parameter_size, - bool is_mutiple) : Base(function_name, - function_address, - code_size, - set_parameter_size, - is_mutiple), - inlines(), - lines(), - last_added_inline_nest_level(0) { } + bool is_mutiple) + : Base(function_name, + function_address, + code_size, + set_parameter_size, + is_mutiple), + inlines(true), + last_added_inline_nest_level(0) {} + // Append inline into corresponding RangeMap. // This function assumes it's called in the order of reading INLINE records. bool AppendInline(linked_ptr in); - RangeMap> inlines; + ContainedRangeMap> inlines; RangeMap> lines; private: typedef SourceLineResolverBase::Function Base; - // A map from inline_nest_level to most recently added Inline* at that level. - std::map> recent_inlines; - - // The last added inline_nest_level in recent_inlines. + // The last added inline_nest_level from INLINE record. int last_added_inline_nest_level; }; @@ -110,14 +108,14 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module { StackFrame* frame, std::deque>* inlined_frame) const; - // Recursively construct inlined frames for |frame| and store them in - // |inline_frames|. |frame|'s source line and source file name may be updated - // if an inlined frame is found inside |frame|. As a result, the innermost - // inlined frame will be the first one in |inline_frames|. + // Construct inlined frames for |frame| and store them in |inline_frames|. + // |frame|'s source line and source file name may be updated if an inlined + // frame is found inside |frame|. As a result, the innermost inlined frame + // will be the first one in |inline_frames|. virtual void ConstructInlineFrames( StackFrame* frame, MemAddr address, - const RangeMap>& inlines, + const ContainedRangeMap>& inline_map, std::deque>* inline_frames) const; // If Windows stack walking information is available covering ADDRESS, diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index bac918027..4d3ce0661 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -103,7 +103,6 @@ struct SourceLineResolverBase::Inline { int32_t call_site_file_id; int32_t origin_id; InlineRanges inline_ranges; - RangeMap> child_inlines; }; struct SourceLineResolverBase::Line { From 0ae29c99d1a0abed797ad78e5e061f4e2cb9c1cb Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 30 Nov 2021 16:29:00 -0800 Subject: [PATCH 039/195] Add serialization of inlines and inline origins for FastSourceLineResolver so that it can construct inlined frames later. Bug: 1190878 Change-Id: Ie3b0f2f44e04e790501ea54680fe223974c750ab Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3294126 Reviewed-by: Joshua Peraza --- .../processor/fast_source_line_resolver.h | 2 + src/processor/fast_source_line_resolver.cc | 73 ++++++++++- .../fast_source_line_resolver_types.h | 96 ++++++++++++--- .../fast_source_line_resolver_unittest.cc | 102 ++++++++++++++++ src/processor/module_serializer.cc | 16 ++- src/processor/module_serializer.h | 2 + src/processor/simple_serializer-inl.h | 113 +++++++++++++++++- .../source_line_resolver_base_types.h | 2 + 8 files changed, 379 insertions(+), 27 deletions(-) diff --git a/src/google_breakpad/processor/fast_source_line_resolver.h b/src/google_breakpad/processor/fast_source_line_resolver.h index fdf910776..535fc1064 100644 --- a/src/google_breakpad/processor/fast_source_line_resolver.h +++ b/src/google_breakpad/processor/fast_source_line_resolver.h @@ -79,6 +79,8 @@ class FastSourceLineResolver : public SourceLineResolverBase { // SourceLineResolverBase. struct Line; struct Function; + struct Inline; + struct InlineOrigin; struct PublicSymbol; class Module; diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 317864604..374b06cfb 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -49,9 +49,8 @@ #include "processor/module_factory.h" #include "processor/simple_serializer-inl.h" -using std::map; -using std::make_pair; -using std::vector; +using std::deque; +using std::unique_ptr; namespace google_breakpad { @@ -101,6 +100,10 @@ void FastSourceLineResolver::Module::LookupAddress( frame->source_line = line->line; frame->source_line_base = frame->module->base_address() + line_base; } + // Check if this is inlined function call. + if (inlined_frames) { + ConstructInlineFrames(frame, address, func->inlines, inlined_frames); + } } else if (public_symbols_.Retrieve(address, public_symbol_ptr, &public_address) && (!func_ptr || public_address > function_base)) { @@ -110,6 +113,68 @@ void FastSourceLineResolver::Module::LookupAddress( } } +void FastSourceLineResolver::Module::ConstructInlineFrames( + StackFrame* frame, + MemAddr address, + const StaticContainedRangeMap& inline_map, + std::deque>* inlined_frames) const { + std::vector inline_ptrs; + if (!inline_map.RetrieveRanges(address, inline_ptrs)) { + return; + } + + for (const char* inline_ptr : inline_ptrs) { + scoped_ptr in(new Inline); + in.get()->CopyFrom(inline_ptr); + unique_ptr new_frame = + unique_ptr(new StackFrame(*frame)); + auto origin_iter = inline_origins_.find(in->origin_id); + if (origin_iter != inline_origins_.end()) { + scoped_ptr origin(new InlineOrigin); + origin.get()->CopyFrom(origin_iter.GetValuePtr()); + new_frame->function_name = origin->name; + } else { + new_frame->function_name = ""; + } + + // Store call site file and line in current frame, which will be updated + // later. + new_frame->source_line = in->call_site_line; + if (in->has_call_site_file_id) { + auto file_iter = files_.find(in->call_site_file_id); + if (file_iter != files_.end()) { + new_frame->source_file_name = file_iter.GetValuePtr(); + } + } + + // Use the starting adress of the inlined range as inlined function base. + new_frame->function_base = new_frame->module->base_address(); + for (const auto& range : in->inline_ranges) { + if (address >= range.first && address < range.first + range.second) { + new_frame->function_base += range.first; + break; + } + } + new_frame->trust = StackFrame::FRAME_TRUST_INLINE; + + // The inlines vector has an order from innermost entry to outermost entry. + // By push_back, we will have inlined_frames with the same order. + inlined_frames->push_back(std::move(new_frame)); + } + + // Update the source file and source line for each inlined frame. + if (!inlined_frames->empty()) { + string parent_frame_source_file_name = frame->source_file_name; + int parent_frame_source_line = frame->source_line; + frame->source_file_name = inlined_frames->back()->source_file_name; + frame->source_line = inlined_frames->back()->source_line; + for (unique_ptr& inlined_frame : *inlined_frames) { + std::swap(inlined_frame->source_file_name, parent_frame_source_file_name); + std::swap(inlined_frame->source_line, parent_frame_source_line); + } + } +} + // WFI: WindowsFrameInfo. // Returns a WFI object reading from a raw memory chunk of data WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char* raw) { @@ -184,7 +249,7 @@ bool FastSourceLineResolver::Module::LoadMapFromMemory( cfi_initial_rules_ = StaticRangeMap(mem_buffer + offsets[map_id++]); cfi_delta_rules_ = StaticMap(mem_buffer + offsets[map_id++]); - + inline_origins_ = StaticMap(mem_buffer + offsets[map_id++]); return true; } diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index 2d1bcfcbc..577b98e6e 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -37,6 +37,7 @@ #ifndef PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__ #define PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__ +#include "contained_range_map.h" #include "google_breakpad/processor/fast_source_line_resolver.h" #include "processor/source_line_resolver_base_types.h" @@ -53,6 +54,10 @@ namespace google_breakpad { +#define DESERIALIZE(raw_ptr, field) \ + field = *(reinterpret_cast(raw_ptr)); \ + raw_ptr += sizeof(field); + struct FastSourceLineResolver::Line : public SourceLineResolverBase::Line { void CopyFrom(const Line* line_ptr) { const char* raw = reinterpret_cast(line_ptr); @@ -61,12 +66,10 @@ struct FastSourceLineResolver::Line : public SourceLineResolverBase::Line { // De-serialize the memory data of a Line. void CopyFrom(const char* raw) { - address = *(reinterpret_cast(raw)); - size = *(reinterpret_cast(raw + sizeof(address))); - source_file_id = *(reinterpret_cast( - raw + 2 * sizeof(address))); - line = *(reinterpret_cast( - raw + 2 * sizeof(address) + sizeof(source_file_id))); + DESERIALIZE(raw, address); + DESERIALIZE(raw, size); + DESERIALIZE(raw, source_file_id); + DESERIALIZE(raw, line); } }; @@ -81,18 +84,60 @@ public SourceLineResolverBase::Function { void CopyFrom(const char* raw) { size_t name_size = strlen(raw) + 1; name = raw; - address = *(reinterpret_cast(raw + name_size)); - size = *(reinterpret_cast( - raw + name_size + sizeof(MemAddr))); - parameter_size = *(reinterpret_cast( - raw + name_size + 2 * sizeof(MemAddr))); - lines = StaticRangeMap( - raw + name_size + 2 * sizeof(MemAddr) + sizeof(int32_t)); + raw += name_size; + DESERIALIZE(raw, address); + DESERIALIZE(raw, size); + DESERIALIZE(raw, parameter_size); + DESERIALIZE(raw, is_multiple); + int32_t inline_size; + DESERIALIZE(raw, inline_size); + inlines = StaticContainedRangeMap(raw); + lines = StaticRangeMap(raw + inline_size); } + StaticContainedRangeMap inlines; StaticRangeMap lines; }; +struct FastSourceLineResolver::Inline : public SourceLineResolverBase::Inline { + void CopyFrom(const Inline* inline_ptr) { + const char* raw = reinterpret_cast(inline_ptr); + CopyFrom(raw); + } + + // De-serialize the memory data of a Inline. + void CopyFrom(const char* raw) { + DESERIALIZE(raw, has_call_site_file_id); + DESERIALIZE(raw, inline_nest_level); + DESERIALIZE(raw, call_site_line); + DESERIALIZE(raw, call_site_file_id); + DESERIALIZE(raw, origin_id); + uint32_t inline_range_size; + DESERIALIZE(raw, inline_range_size); + for (size_t i = 0; i < inline_range_size; i += 2) { + std::pair range; + DESERIALIZE(raw, range.first); + DESERIALIZE(raw, range.second); + inline_ranges.push_back(range); + } + } +}; + +struct FastSourceLineResolver::InlineOrigin + : public SourceLineResolverBase::InlineOrigin { + void CopyFrom(const InlineOrigin* origin_ptr) { + const char* raw = reinterpret_cast(origin_ptr); + CopyFrom(raw); + } + + // De-serialize the memory data of a Line. + void CopyFrom(const char* raw) { + DESERIALIZE(raw, has_file_id); + DESERIALIZE(raw, source_file_id); + name = raw; + } +}; + struct FastSourceLineResolver::PublicSymbol : public SourceLineResolverBase::PublicSymbol { void CopyFrom(const PublicSymbol* public_symbol_ptr) { @@ -104,12 +149,15 @@ public SourceLineResolverBase::PublicSymbol { void CopyFrom(const char* raw) { size_t name_size = strlen(raw) + 1; name = raw; - address = *(reinterpret_cast(raw + name_size)); - parameter_size = *(reinterpret_cast( - raw + name_size + sizeof(MemAddr))); + raw += name_size; + DESERIALIZE(raw, address); + DESERIALIZE(raw, parameter_size); + DESERIALIZE(raw, is_multiple); } }; +#undef DESERIALIZE + class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { public: explicit Module(const string& name) : name_(name), is_corrupt_(false) { } @@ -121,6 +169,16 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { StackFrame* frame, std::deque>* inlined_frames) const; + // Construct inlined frames for |frame| and store them in |inline_frames|. + // |frame|'s source line and source file name may be updated if an inlined + // frame is found inside |frame|. As a result, the innermost inlined frame + // will be the first one in |inline_frames|. + virtual void ConstructInlineFrames( + StackFrame* frame, + MemAddr address, + const StaticContainedRangeMap& inline_map, + std::deque>* inlined_frames) const; + // Loads a map from the given buffer in char* type. virtual bool LoadMapFromMemory(char* memory_buffer, size_t memory_buffer_size); @@ -143,7 +201,7 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) const; // Number of serialized map components of Module. - static const int kNumberMaps_ = 5 + WindowsFrameInfo::STACK_INFO_LAST; + static const int kNumberMaps_ = 6 + WindowsFrameInfo::STACK_INFO_LAST; private: friend class FastSourceLineResolver; @@ -180,6 +238,10 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module { // this map, or the end of the range as given by the cfi_initial_rules_ // entry (which FindCFIFrameInfo looks up first). StaticMap cfi_delta_rules_; + + // INLINE_ORIGIN records: used as a function name string pool for INLINE + // records. + StaticMap inline_origins_; }; } // namespace google_breakpad diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc index 5109e4f19..a8e224085 100644 --- a/src/processor/fast_source_line_resolver_unittest.cc +++ b/src/processor/fast_source_line_resolver_unittest.cc @@ -408,6 +408,108 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { ASSERT_EQ(frame.function_name, "Public2_2"); } +// Test adapted from basic_source_line_resolver_unittest. +TEST_F(TestFastSourceLineResolver, TestLoadAndResolveOldInlines) { + TestCodeModule module("linux_inline"); + ASSERT_TRUE(basic_resolver.LoadModule( + &module, testdata_dir + + "/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/" + "linux_inline.old.sym")); + ASSERT_TRUE(basic_resolver.HasModule(&module)); + // Convert module1 to fast_module: + ASSERT_TRUE(serializer.ConvertOneModule(module.code_file(), &basic_resolver, + &fast_resolver)); + ASSERT_TRUE(fast_resolver.HasModule(&module)); + + StackFrame frame; + std::deque> inlined_frames; + frame.instruction = 0x161b6; + frame.module = &module; + fast_resolver.FillSourceLineInfo(&frame, &inlined_frames); + + // main frame. + ASSERT_EQ(frame.function_name, "main"); + ASSERT_EQ(frame.function_base, 0x15b30U); + ASSERT_EQ(frame.source_file_name, "linux_inline.cpp"); + ASSERT_EQ(frame.source_line, 42); + ASSERT_EQ(frame.source_line_base, 0x161b6U); + + ASSERT_EQ(inlined_frames.size(), 3UL); + + // Inlined frames inside main frame. + ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 39); + ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); + ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); + ASSERT_EQ(inlined_frames[1]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[1]->source_line, 32); + ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[0]->function_name, "func()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); +} + +// Test adapted from basic_source_line_resolver_unittest. +TEST_F(TestFastSourceLineResolver, TestLoadAndResolveNewInlines) { + TestCodeModule module("linux_inline"); + ASSERT_TRUE(basic_resolver.LoadModule( + &module, testdata_dir + + "/symbols/linux_inline/BBA6FA10B8AAB33D00000000000000000/" + "linux_inline.new.sym")); + ASSERT_TRUE(basic_resolver.HasModule(&module)); + // Convert module1 to fast_module: + ASSERT_TRUE(serializer.ConvertOneModule(module.code_file(), &basic_resolver, + &fast_resolver)); + ASSERT_TRUE(fast_resolver.HasModule(&module)); + + StackFrame frame; + std::deque> inlined_frames; + frame.instruction = 0x161b6; + frame.module = &module; + fast_resolver.FillSourceLineInfo(&frame, &inlined_frames); + + // main frame. + ASSERT_EQ(frame.function_name, "main"); + ASSERT_EQ(frame.function_base, 0x15b30U); + ASSERT_EQ(frame.source_file_name, "a.cpp"); + ASSERT_EQ(frame.source_line, 42); + ASSERT_EQ(frame.source_line_base, 0x161b6U); + + ASSERT_EQ(inlined_frames.size(), 3UL); + + // Inlined frames inside main frame. + ASSERT_EQ(inlined_frames[2]->function_name, "foo()"); + ASSERT_EQ(inlined_frames[2]->function_base, 0x15b45U); + ASSERT_EQ(inlined_frames[2]->source_file_name, "b.cpp"); + ASSERT_EQ(inlined_frames[2]->source_line, 39); + ASSERT_EQ(inlined_frames[2]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[2]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[1]->function_name, "bar()"); + ASSERT_EQ(inlined_frames[1]->function_base, 0x15b72U); + ASSERT_EQ(inlined_frames[1]->source_file_name, "c.cpp"); + ASSERT_EQ(inlined_frames[1]->source_line, 32); + ASSERT_EQ(inlined_frames[1]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[1]->trust, StackFrame::FRAME_TRUST_INLINE); + + ASSERT_EQ(inlined_frames[0]->function_name, "func()"); + ASSERT_EQ(inlined_frames[0]->function_base, 0x15b83U); + ASSERT_EQ(inlined_frames[0]->source_file_name, "linux_inline.cpp"); + ASSERT_EQ(inlined_frames[0]->source_line, 27); + ASSERT_EQ(inlined_frames[0]->source_line_base, 0x161b6U); + ASSERT_EQ(inlined_frames[0]->trust, StackFrame::FRAME_TRUST_INLINE); +} + TEST_F(TestFastSourceLineResolver, TestInvalidLoads) { TestCodeModule module3("module3"); ASSERT_TRUE(basic_resolver.LoadModule(&module3, diff --git a/src/processor/module_serializer.cc b/src/processor/module_serializer.cc index 04cadc80d..8ad0d589b 100644 --- a/src/processor/module_serializer.cc +++ b/src/processor/module_serializer.cc @@ -43,10 +43,15 @@ namespace google_breakpad { -// Definition of static member variable in SimplerSerializer, which -// is declared in file "simple_serializer-inl.h" -RangeMapSerializer< MemAddr, linked_ptr > -SimpleSerializer::range_map_serializer_; +// Definition of static member variables in SimplerSerializer and +// SimplerSerializer, which are declared in file +// "simple_serializer-inl.h" +RangeMapSerializer> + SimpleSerializer::range_map_serializer_; +ContainedRangeMapSerializer> + SimpleSerializer< + BasicSourceLineResolver::Function>::inline_range_map_serializer_; size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module& module) { size_t total_size_alloc_ = 0; @@ -66,6 +71,8 @@ size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module& module) { module.cfi_initial_rules_); map_sizes_[map_index++] = cfi_delta_rules_serializer_.SizeOf( module.cfi_delta_rules_); + map_sizes_[map_index++] = + inline_origin_serializer_.SizeOf(module.inline_origins_); // Header size. total_size_alloc_ += kNumberMaps_ * sizeof(uint32_t); @@ -95,6 +102,7 @@ char* ModuleSerializer::Write(const BasicSourceLineResolver::Module& module, dest = wfi_serializer_.Write(&(module.windows_frame_info_[i]), dest); dest = cfi_init_rules_serializer_.Write(module.cfi_initial_rules_, dest); dest = cfi_delta_rules_serializer_.Write(module.cfi_delta_rules_, dest); + dest = inline_origin_serializer_.Write(module.inline_origins_, dest); // Write a null terminator. dest = SimpleSerializer::Write(0, dest); return dest; diff --git a/src/processor/module_serializer.h b/src/processor/module_serializer.h index 932ac3d76..94e25c010 100644 --- a/src/processor/module_serializer.h +++ b/src/processor/module_serializer.h @@ -99,6 +99,7 @@ class ModuleSerializer { typedef BasicSourceLineResolver::Line Line; typedef BasicSourceLineResolver::Function Function; typedef BasicSourceLineResolver::PublicSymbol PublicSymbol; + typedef BasicSourceLineResolver::InlineOrigin InlineOrigin; // Internal implementation for ConvertOneModule and ConvertAllModules methods. bool SerializeModuleAndLoadIntoFastResolver( @@ -120,6 +121,7 @@ class ModuleSerializer { linked_ptr > wfi_serializer_; RangeMapSerializer cfi_init_rules_serializer_; StdMapSerializer cfi_delta_rules_serializer_; + StdMapSerializer> inline_origin_serializer_; }; } // namespace google_breakpad diff --git a/src/processor/simple_serializer-inl.h b/src/processor/simple_serializer-inl.h index cb1a04081..4b4200e4b 100644 --- a/src/processor/simple_serializer-inl.h +++ b/src/processor/simple_serializer-inl.h @@ -113,6 +113,25 @@ class SimpleSerializer { } }; +// Specializations of SimpleSerializer: InlineOrigin +template <> +class SimpleSerializer { + typedef BasicSourceLineResolver::InlineOrigin InlineOrigin; + + public: + static size_t SizeOf(const InlineOrigin& origin) { + return SimpleSerializer::SizeOf(origin.has_file_id) + + SimpleSerializer::SizeOf(origin.source_file_id) + + SimpleSerializer::SizeOf(origin.name); + } + static char* Write(const InlineOrigin& origin, char* dest) { + dest = SimpleSerializer::Write(origin.has_file_id, dest); + dest = SimpleSerializer::Write(origin.source_file_id, dest); + dest = SimpleSerializer::Write(origin.name, dest); + return dest; + } +}; + // Specializations of SimpleSerializer: PublicSymbol template<> class SimpleSerializer { @@ -165,7 +184,7 @@ class SimpleSerializer { }; // Specializations of SimpleSerializer: Linked_ptr version of -// Line, Function, PublicSymbol, WindowsFrameInfo. +// Line, InlineOrigin, Inline, Function, PublicSymbol, WindowsFrameInfo. template<> class SimpleSerializer< linked_ptr > { typedef BasicSourceLineResolver::Line Line; @@ -181,11 +200,86 @@ class SimpleSerializer< linked_ptr > { } }; +template <> +class SimpleSerializer> { + typedef BasicSourceLineResolver::InlineOrigin InlineOrigin; + + public: + static size_t SizeOf(const linked_ptr& origin_ptr) { + if (origin_ptr.get() == NULL) + return 0; + return SimpleSerializer::SizeOf(*(origin_ptr.get())); + } + static char* Write(const linked_ptr& origin_ptr, char* dest) { + if (origin_ptr.get()) + dest = SimpleSerializer::Write(*(origin_ptr.get()), dest); + return dest; + } +}; + +// Specializations of SimpleSerializer: Inline +template <> +class SimpleSerializer>; +template <> +class SimpleSerializer { + typedef BasicSourceLineResolver::Inline Inline; + + public: + inline static size_t SizeOf(const Inline& in); + inline static char* Write(const Inline& in, char* dest); +}; + +template <> +class SimpleSerializer> { + typedef BasicSourceLineResolver::Inline Inline; + + public: + static size_t SizeOf(const linked_ptr& inline_ptr) { + if (inline_ptr.get() == NULL) + return 0; + return SimpleSerializer::SizeOf(*(inline_ptr.get())); + } + static char* Write(const linked_ptr& inline_ptr, char* dest) { + if (inline_ptr.get()) + dest = SimpleSerializer::Write(*(inline_ptr.get()), dest); + return dest; + } +}; + +size_t SimpleSerializer::SizeOf( + const Inline& in) { + return SimpleSerializer::SizeOf(in.has_call_site_file_id) + + SimpleSerializer::SizeOf(in.inline_nest_level) + + SimpleSerializer::SizeOf(in.call_site_line) + + SimpleSerializer::SizeOf(in.call_site_file_id) + + SimpleSerializer::SizeOf(in.origin_id) + + sizeof(uint32_t) + // This is to store the size of inline_ranges. + (in.inline_ranges.size() * sizeof(MemAddr) * 2); +} + +char* SimpleSerializer::Write(const Inline& in, + char* dest) { + dest = SimpleSerializer::Write(in.has_call_site_file_id, dest); + dest = SimpleSerializer::Write(in.inline_nest_level, dest); + dest = SimpleSerializer::Write(in.call_site_line, dest); + dest = SimpleSerializer::Write(in.call_site_file_id, dest); + dest = SimpleSerializer::Write(in.origin_id, dest); + // Write the size of inline_ranges. + dest = SimpleSerializer::Write(in.inline_ranges.size(), dest); + for (const std::pair& range : in.inline_ranges) { + dest = SimpleSerializer::Write(range.first, dest); + dest = SimpleSerializer::Write(range.second, dest); + } + return dest; +} + template<> class SimpleSerializer { // Convenient type names. typedef BasicSourceLineResolver::Function Function; typedef BasicSourceLineResolver::Line Line; + typedef BasicSourceLineResolver::Inline Inline; + public: static size_t SizeOf(const Function& func) { unsigned int size = 0; @@ -193,6 +287,11 @@ class SimpleSerializer { size += SimpleSerializer::SizeOf(func.address); size += SimpleSerializer::SizeOf(func.size); size += SimpleSerializer::SizeOf(func.parameter_size); + size += SimpleSerializer::SizeOf(func.is_multiple); + // This extra size is used to store the size of serialized func.inlines, so + // we know where to start de-serialize func.lines. + size += sizeof(int32_t); + size += inline_range_map_serializer_.SizeOf(&func.inlines); size += range_map_serializer_.SizeOf(func.lines); return size; } @@ -202,12 +301,22 @@ class SimpleSerializer { dest = SimpleSerializer::Write(func.address, dest); dest = SimpleSerializer::Write(func.size, dest); dest = SimpleSerializer::Write(func.parameter_size, dest); + dest = SimpleSerializer::Write(func.is_multiple, dest); + char* old_dest = dest; + dest += sizeof(int32_t); + dest = inline_range_map_serializer_.Write(&func.inlines, dest); + // Write the size of serialized func.inlines. The size doesn't include size + // field itself. + SimpleSerializer::Write(dest - old_dest - sizeof(int32_t), + old_dest); dest = range_map_serializer_.Write(func.lines, dest); return dest; } private: // This static member is defined in module_serializer.cc. - static RangeMapSerializer< MemAddr, linked_ptr > range_map_serializer_; + static RangeMapSerializer> range_map_serializer_; + static ContainedRangeMapSerializer> + inline_range_map_serializer_; }; template<> diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 4d3ce0661..828895503 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -71,6 +71,7 @@ class SourceLineResolverBase::AutoFileCloser { }; struct SourceLineResolverBase::InlineOrigin { + InlineOrigin() {} InlineOrigin(bool has_file_id, int32_t source_file_id, const string& name) : has_file_id(has_file_id), source_file_id(source_file_id), @@ -84,6 +85,7 @@ struct SourceLineResolverBase::InlineOrigin { struct SourceLineResolverBase::Inline { // A vector of (address, size) pair for a INLINE record. using InlineRanges = std::vector>; + Inline() {} Inline(bool has_call_site_file_id, int32_t inline_nest_level, int32_t call_site_line, From 647aa17a7aa8ec0b99ffd005908b8a4ab1995a30 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 7 Dec 2021 12:37:07 -0800 Subject: [PATCH 040/195] Fix corrupted symbol file due to malformed INLINE/INLINE_ORIGIN records - Ignore DW_TAG_inlined_subroutine with empty range. - Don't stop parsing after parsing malformed INLINE/INLINE_ORIGIN records, because reports can still be generated without them but won't have inlined frames. Bug: 1190878 Change-Id: I445105ad06b9146268f7d064e85b0d162c3f2a39 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3321166 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 5 +++++ src/processor/basic_source_line_resolver.cc | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 04d19479b..4bd715647 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -652,6 +652,11 @@ void DwarfCUToModule::InlineHandler::Finish() { } } + // Ignore DW_TAG_inlined_subroutine with empty range. + if (ranges.empty()) { + return; + } + // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. assert(specification_offset_ != 0); diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 4a565f11c..dccbd74bf 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -128,6 +128,7 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( linked_ptr cur_func; int line_number = 0; int num_errors = 0; + int inline_num_errors = 0; char* save_ptr; // If the length is 0, we can still pretend we have a symbol file. This is @@ -208,12 +209,13 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory( } else if (strncmp(buffer, "INLINE ", 7) == 0) { linked_ptr in = ParseInline(buffer); if (!in.get()) - LogParseError("ParseInline failed", line_number, &num_errors); + LogParseError("ParseInline failed", line_number, &inline_num_errors); else cur_func->AppendInline(in); } else if (strncmp(buffer, "INLINE_ORIGIN ", 14) == 0) { if (!ParseInlineOrigin(buffer)) { - LogParseError("ParseInlineOrigin failed", line_number, &num_errors); + LogParseError("ParseInlineOrigin failed", line_number, + &inline_num_errors); } } else { if (!cur_func.get()) { From 64b25d6653ad62cdd05c837afb56839d4dc60f5b Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Thu, 9 Dec 2021 04:58:57 +0000 Subject: [PATCH 041/195] Fixing issues in the Breakpad symbol file serialization code. - FastSourceLineResolver::Module::LoadMapFromMemory now rejects an older version of the serialization format. - Cleaned up several unneeded usages of scoped_ptr::get. - Fixed the serialization of bool. The serialization code was using 255 for 'true' while the deserialization code was expecting to see 1. - Serialization for PublicSymbol.is_multiple was missing. Deserialization was expecting it - Added some logging to processor/source_line_resolver_base.cc Change-Id: Iadc7d8ee23bf3a07e4ea280d5d4c3f25f6278b69 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3324395 Reviewed-by: Joshua Peraza --- src/processor/fast_source_line_resolver.cc | 32 ++++++++++++++----- .../fast_source_line_resolver_types.h | 13 ++++---- src/processor/simple_serializer-inl.h | 11 ++++--- src/processor/simple_serializer.h | 2 ++ src/processor/source_line_resolver_base.cc | 13 +++++--- 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 374b06cfb..81a6b7acf 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -40,12 +40,14 @@ #include "google_breakpad/processor/fast_source_line_resolver.h" #include "processor/fast_source_line_resolver_types.h" +#include #include #include #include #include "common/scoped_ptr.h" #include "common/using_std_string.h" +#include "processor/logging.h" #include "processor/module_factory.h" #include "processor/simple_serializer-inl.h" @@ -83,7 +85,7 @@ void FastSourceLineResolver::Module::LookupAddress( if (functions_.RetrieveNearestRange(address, func_ptr, &function_base, &function_size) && address >= function_base && address - function_base < function_size) { - func.get()->CopyFrom(func_ptr); + func->CopyFrom(func_ptr); frame->function_name = func->name; frame->function_base = frame->module->base_address() + function_base; @@ -91,7 +93,7 @@ void FastSourceLineResolver::Module::LookupAddress( const Line* line_ptr = 0; MemAddr line_base; if (func->lines.RetrieveRange(address, line_ptr, &line_base, NULL)) { - line.get()->CopyFrom(line_ptr); + line->CopyFrom(line_ptr); FileMap::iterator it = files_.find(line->source_file_id); if (it != files_.end()) { frame->source_file_name = @@ -107,7 +109,7 @@ void FastSourceLineResolver::Module::LookupAddress( } else if (public_symbols_.Retrieve(address, public_symbol_ptr, &public_address) && (!func_ptr || public_address > function_base)) { - public_symbol.get()->CopyFrom(public_symbol_ptr); + public_symbol->CopyFrom(public_symbol_ptr); frame->function_name = public_symbol->name; frame->function_base = frame->module->base_address() + public_address; } @@ -125,13 +127,13 @@ void FastSourceLineResolver::Module::ConstructInlineFrames( for (const char* inline_ptr : inline_ptrs) { scoped_ptr in(new Inline); - in.get()->CopyFrom(inline_ptr); + in->CopyFrom(inline_ptr); unique_ptr new_frame = unique_ptr(new StackFrame(*frame)); auto origin_iter = inline_origins_.find(in->origin_id); if (origin_iter != inline_origins_.end()) { scoped_ptr origin(new InlineOrigin); - origin.get()->CopyFrom(origin_iter.GetValuePtr()); + origin->CopyFrom(origin_iter.GetValuePtr()); new_frame->function_name = origin->name; } else { new_frame->function_name = ""; @@ -234,6 +236,19 @@ bool FastSourceLineResolver::Module::LoadMapFromMemory( for (int i = 1; i < kNumberMaps_; ++i) { offsets[i] = offsets[i - 1] + map_sizes[i - 1]; } + unsigned int expected_size = sizeof(bool) + offsets[kNumberMaps_ - 1] + + map_sizes[kNumberMaps_ - 1] + 1; + if (expected_size != memory_buffer_size && + // Allow for having an extra null terminator. + expected_size != memory_buffer_size - 1) { + // This could either be a random corruption or the serialization format was + // changed without updating the version in kSerializedBreakpadFileExtension. + BPLOG(ERROR) << "Memory buffer is either corrupt or an unsupported version" + << ", expected size: " << expected_size + << ", actual size: " << memory_buffer_size; + return false; + } + BPLOG(INFO) << "Memory buffer size looks good, size: " << memory_buffer_size; // Use pointers to construct Static*Map data members in Module: int map_id = 0; @@ -242,9 +257,10 @@ bool FastSourceLineResolver::Module::LoadMapFromMemory( StaticRangeMap(mem_buffer + offsets[map_id++]); public_symbols_ = StaticAddressMap(mem_buffer + offsets[map_id++]); - for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i) + for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i) { windows_frame_info_[i] = StaticContainedRangeMap(mem_buffer + offsets[map_id++]); + } cfi_initial_rules_ = StaticRangeMap(mem_buffer + offsets[map_id++]); @@ -286,7 +302,7 @@ WindowsFrameInfo* FastSourceLineResolver::Module::FindWindowsFrameInfo( if (functions_.RetrieveNearestRange(address, function_ptr, &function_base, &function_size) && address >= function_base && address - function_base < function_size) { - function.get()->CopyFrom(function_ptr); + function->CopyFrom(function_ptr); result->parameter_size = function->parameter_size; result->valid |= WindowsFrameInfo::VALID_PARAMETER_SIZE; return result.release(); @@ -299,7 +315,7 @@ WindowsFrameInfo* FastSourceLineResolver::Module::FindWindowsFrameInfo( MemAddr public_address; if (public_symbols_.Retrieve(address, public_symbol_ptr, &public_address) && (!function_ptr || public_address > function_base)) { - public_symbol.get()->CopyFrom(public_symbol_ptr); + public_symbol->CopyFrom(public_symbol_ptr); result->parameter_size = public_symbol->parameter_size; } diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index 577b98e6e..718905dfe 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -37,15 +37,16 @@ #ifndef PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__ #define PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__ -#include "contained_range_map.h" -#include "google_breakpad/processor/fast_source_line_resolver.h" -#include "processor/source_line_resolver_base_types.h" - +#include #include #include +#include "google_breakpad/processor/fast_source_line_resolver.h" #include "google_breakpad/processor/stack_frame.h" #include "processor/cfi_frame_info.h" +#include "processor/contained_range_map.h" +#include "processor/simple_serializer-inl.h" +#include "processor/source_line_resolver_base_types.h" #include "processor/static_address_map-inl.h" #include "processor/static_contained_range_map-inl.h" #include "processor/static_map.h" @@ -88,7 +89,7 @@ public SourceLineResolverBase::Function { DESERIALIZE(raw, address); DESERIALIZE(raw, size); DESERIALIZE(raw, parameter_size); - DESERIALIZE(raw, is_multiple); + raw = SimpleSerializer::Read(raw, &is_multiple); int32_t inline_size; DESERIALIZE(raw, inline_size); inlines = StaticContainedRangeMap(raw); @@ -152,7 +153,7 @@ public SourceLineResolverBase::PublicSymbol { raw += name_size; DESERIALIZE(raw, address); DESERIALIZE(raw, parameter_size); - DESERIALIZE(raw, is_multiple); + raw = SimpleSerializer::Read(raw, &is_multiple); } }; diff --git a/src/processor/simple_serializer-inl.h b/src/processor/simple_serializer-inl.h index 4b4200e4b..c8d3e3c29 100644 --- a/src/processor/simple_serializer-inl.h +++ b/src/processor/simple_serializer-inl.h @@ -38,14 +38,15 @@ #ifndef PROCESSOR_SIMPLE_SERIALIZER_INL_H__ #define PROCESSOR_SIMPLE_SERIALIZER_INL_H__ -#include - #include "processor/simple_serializer.h" -#include "map_serializers-inl.h" + +#include +#include #include "google_breakpad/processor/basic_source_line_resolver.h" #include "processor/basic_source_line_resolver_types.h" #include "processor/linked_ptr.h" +#include "processor/map_serializers-inl.h" #include "processor/windows_frame_info.h" namespace google_breakpad { @@ -140,12 +141,14 @@ class SimpleSerializer { static size_t SizeOf(const PublicSymbol& pubsymbol) { return SimpleSerializer::SizeOf(pubsymbol.name) + SimpleSerializer::SizeOf(pubsymbol.address) - + SimpleSerializer::SizeOf(pubsymbol.parameter_size); + + SimpleSerializer::SizeOf(pubsymbol.parameter_size) + + SimpleSerializer::SizeOf(pubsymbol.is_multiple); } static char* Write(const PublicSymbol& pubsymbol, char* dest) { dest = SimpleSerializer::Write(pubsymbol.name, dest); dest = SimpleSerializer::Write(pubsymbol.address, dest); dest = SimpleSerializer::Write(pubsymbol.parameter_size, dest); + dest = SimpleSerializer::Write(pubsymbol.is_multiple, dest); return dest; } }; diff --git a/src/processor/simple_serializer.h b/src/processor/simple_serializer.h index 9e51d8067..e1b1efd14 100644 --- a/src/processor/simple_serializer.h +++ b/src/processor/simple_serializer.h @@ -38,6 +38,8 @@ #ifndef PROCESSOR_SIMPLE_SERIALIZER_H__ #define PROCESSOR_SIMPLE_SERIALIZER_H__ +#include + #include "google_breakpad/common/breakpad_types.h" namespace google_breakpad { diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index cea1a46d1..463033482 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -42,10 +42,10 @@ #include #include "google_breakpad/processor/source_line_resolver_base.h" -#include "processor/source_line_resolver_base_types.h" +#include "processor/logging.h" #include "processor/module_factory.h" +#include "processor/source_line_resolver_base_types.h" -using std::map; using std::make_pair; namespace google_breakpad { @@ -168,7 +168,9 @@ bool SourceLineResolverBase::LoadModule(const CodeModule* module, if (!ReadSymbolFile(map_file, &memory_buffer, &memory_buffer_size)) return false; - BPLOG(INFO) << "Read symbol file " << map_file << " succeeded"; + BPLOG(INFO) << "Read symbol file " << map_file << " succeeded. " + << "module = " << module->code_file() + << ", memory_buffer_size = " << memory_buffer_size; bool load_result = LoadModuleUsingMemoryBuffer(module, memory_buffer, memory_buffer_size); @@ -185,6 +187,9 @@ bool SourceLineResolverBase::LoadModule(const CodeModule* module, bool SourceLineResolverBase::LoadModuleUsingMapBuffer( const CodeModule* module, const string& map_buffer) { + BPLOG(INFO) << "SourceLineResolverBase::LoadModuleUsingMapBuffer(module = " + << module->code_file() + << ", map_buffer.size() = " << map_buffer.size() << ")"; if (module == NULL) return false; @@ -234,7 +239,7 @@ bool SourceLineResolverBase::LoadModuleUsingMemoryBuffer( } BPLOG(INFO) << "Loading symbols for module " << module->code_file() - << " from memory buffer"; + << " from memory buffer, size: " << memory_buffer_size; Module* basic_module = module_factory_->CreateModule(module->code_file()); From b6510f998a2b09ce1cc6aa591730283bb56ed800 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 13 Dec 2021 14:40:07 -0800 Subject: [PATCH 042/195] Fix RegisterValidFlag Return CONTEXT_VALID_NONE if register num is greater than 15 or negative. Change-Id: I7203d9d51f54e5d589f9ea6fd62bbbaa71de3a4d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3336256 Reviewed-by: Joshua Peraza --- src/google_breakpad/processor/stack_frame_cpu.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h index dc5d8ae67..24e28ca12 100644 --- a/src/google_breakpad/processor/stack_frame_cpu.h +++ b/src/google_breakpad/processor/stack_frame_cpu.h @@ -251,7 +251,10 @@ struct StackFrameARM : public StackFrame { // Return the ContextValidity flag for register rN. static ContextValidity RegisterValidFlag(int n) { - return ContextValidity(1 << n); + if (0 <= n && n <= 15) { + return ContextValidity(1 << n); + } + return CONTEXT_VALID_NONE; } // Register state. This is only fully valid for the topmost frame in a From 3846f6d297339c17663d7a797ba481b3411f13ad Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 27 Oct 2021 13:40:35 -0700 Subject: [PATCH 043/195] Add to INLINE and remove from INLINE_ORIGIN This is the dump_syms side change on https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838/. This fixes incorrect source file names when a inlined function's source file name is different from its parent's. Change-Id: I25683912d206c6a8db44e322eca5f7383ea8c47e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3248438 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 46 +++++++++++++++----------------- src/common/module.cc | 43 ++++++++++------------------- src/common/module.h | 35 ++++++++++++++++++------ 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 4bd715647..3435e5b1d 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -254,9 +254,6 @@ struct DwarfCUToModule::CUContext { // A map of function pointers to the its forward specification DIE's offset. map spec_function_offsets; - - // From file index to vector of subprogram's offset in this CU. - map> inline_origins; }; // Information about the context of a particular DIE. This is for @@ -561,7 +558,8 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler { DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx uint64_t ranges_data_; // DW_AT_ranges - int call_site_line_; + int call_site_line_; // DW_AT_call_line + int call_site_file_id_; // DW_AT_call_file int inline_nest_level_; // A vector of inlines in the same nest level. It's owned by its parent // function/inline. At Finish(), add this inline into the vector. @@ -589,6 +587,9 @@ void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned( case DW_AT_call_line: call_site_line_ = data; break; + case DW_AT_call_file: + call_site_file_id_ = data; + break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -666,8 +667,8 @@ void DwarfCUToModule::InlineHandler::Finish() { cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(specification_offset_, name_); unique_ptr in( - new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, - std::move(child_inlines_))); + new Module::Inline(origin, ranges, call_site_line_, call_site_file_id_, + inline_nest_level_, std::move(child_inlines_))); inlines_.push_back(std::move(in)); } @@ -684,7 +685,6 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { high_pc_form_(DW_FORM_addr), ranges_form_(DW_FORM_sec_offset), ranges_data_(0), - decl_file_data_(UINT64_MAX), inline_(false), handle_inline_(handle_inline) {} @@ -705,9 +705,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { uint64_t low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx - uint64_t ranges_data_; // DW_AT_ranges - // DW_AT_decl_file, value of UINT64_MAX means undefined. - uint64_t decl_file_data_; + uint64_t ranges_data_; // DW_AT_ranges bool inline_; vector> child_inlines_; bool handle_inline_; @@ -732,9 +730,6 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( ranges_data_ = data; ranges_form_ = form; break; - case DW_AT_decl_file: - decl_file_data_ = data; - break; default: GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); break; @@ -862,8 +857,7 @@ void DwarfCUToModule::FuncHandler::Finish() { // Only keep track of DW_TAG_subprogram which have the attributes we are // interested. - if (handle_inline_ && - (!empty_range || inline_ || decl_file_data_ != UINT64_MAX)) { + if (handle_inline_ && (!empty_range || inline_)) { StringView name = name_.empty() ? name_omitted : name_; uint64_t offset = specification_offset_ != 0 ? specification_offset_ : offset_; @@ -871,8 +865,6 @@ void DwarfCUToModule::FuncHandler::Finish() { offset); cu_context_->file_context->module_->inline_origin_map .GetOrCreateInlineOrigin(offset_, name); - if (decl_file_data_ != UINT64_MAX) - cu_context_->inline_origins[decl_file_data_].push_back(offset_); } } @@ -880,10 +872,12 @@ void DwarfCUToModule::FuncHandler::Finish() { // component to their names: namespaces, classes, etc. class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler { public: - NamedScopeHandler(CUContext* cu_context, DIEContext* parent_context, - uint64_t offset, bool handle_inline) - : GenericDIEHandler(cu_context, parent_context, offset), - handle_inline_(handle_inline) { } + NamedScopeHandler(CUContext* cu_context, + DIEContext* parent_context, + uint64_t offset, + bool handle_inline) + : GenericDIEHandler(cu_context, parent_context, offset), + handle_inline_(handle_inline) {} bool EndAttributes(); DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); @@ -1455,10 +1449,12 @@ void DwarfCUToModule::AssignLinesToFunctions() { } void DwarfCUToModule::AssignFilesToInlines() { - for (auto iter : files_) { - cu_context_->file_context->module_->inline_origin_map - .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], - iter.second); + // Assign File* to Inlines inside this CU. + auto assignFile = [this](unique_ptr& in) { + in->call_site_file = files_[in->call_site_file_id]; + }; + for (auto func : cu_context_->functions) { + Module::Inline::InlineDFS(func->inlines, assignFile); } } diff --git a/src/common/module.cc b/src/common/module.cc index 3945e2dd3..13c229eb4 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -97,17 +97,6 @@ void Module::InlineOriginMap::SetReference(uint64_t offset, references_[offset] = specification_offset; } -void Module::InlineOriginMap::AssignFilesToInlineOrigins( - const vector& inline_origin_offsets, - Module::File* file) { - for (uint64_t offset : inline_origin_offsets) - if (references_.find(offset) != references_.end()) { - auto origin = inline_origins_.find(references_[offset]); - if (origin != inline_origins_.end()) - origin->second->file = file; - } -} - Module::Module(const string& name, const string& os, const string& architecture, const string& id, const string& code_id /* = "" */) : @@ -276,13 +265,19 @@ void Module::AssignSourceIds( line_it != func->lines.end(); ++line_it) line_it->file->source_id = 0; } - // Also mark all files cited by inline functions by setting each one's source + + // Also mark all files cited by inline callsite by setting each one's source // id to zero. - for (InlineOrigin* origin : inline_origins) + auto markInlineFiles = [](unique_ptr& in) { // There are some artificial inline functions which don't belong to // any file. Those will have file id -1. - if (origin->file) - origin->file->source_id = 0; + if (in->call_site_file) { + in->call_site_file->source_id = 0; + } + }; + for (auto func : functions_) { + Inline::InlineDFS(func->inlines, markInlineFiles); + } // Finally, assign source ids to those files that have been marked. // We could have just assigned source id numbers while traversing @@ -296,15 +291,6 @@ void Module::AssignSourceIds( } } -static void InlineDFS( - vector>& inlines, - std::function&)> const& forEach) { - for (unique_ptr& in : inlines) { - forEach(in); - InlineDFS(in->child_inlines, forEach); - } -} - void Module::CreateInlineOrigins( set& inline_origins) { // Only add origins that have file and deduplicate origins with same name and @@ -317,7 +303,7 @@ void Module::CreateInlineOrigins( in->origin = *it; }; for (Function* func : functions_) - InlineDFS(func->inlines, addInlineOrigins); + Module::Inline::InlineDFS(func->inlines, addInlineOrigins); int next_id = 0; for (InlineOrigin* origin : inline_origins) { origin->id = next_id++; @@ -381,8 +367,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { } // Write out inline origins. for (InlineOrigin* origin : inline_origins) { - stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() - << " " << origin->name << "\n"; + stream << "INLINE_ORIGIN " << origin->id << " " << origin->name << "\n"; if (!stream.good()) return ReportError(); } @@ -407,12 +392,12 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { auto write_inline = [&](unique_ptr& in) { stream << "INLINE "; stream << in->inline_nest_level << " " << in->call_site_line << " " - << in->origin->id << hex; + << in->getCallSiteFileID() << " " << in->origin->id << hex; for (const Range& r : in->ranges) stream << " " << (r.address - load_address_) << " " << r.size; stream << dec << "\n"; }; - InlineDFS(func->inlines, write_inline); + Module::Inline::InlineDFS(func->inlines, write_inline); if (!stream.good()) return ReportError(); diff --git a/src/common/module.h b/src/common/module.h index c5e0abfc5..01ecfa8aa 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -38,6 +38,7 @@ #ifndef COMMON_LINUX_MODULE_H__ #define COMMON_LINUX_MODULE_H__ +#include #include #include #include @@ -131,7 +132,7 @@ class Module { }; struct InlineOrigin { - explicit InlineOrigin(StringView name): id(-1), name(name), file(nullptr) {} + explicit InlineOrigin(StringView name) : id(-1), name(name) {} // A unique id for each InlineOrigin object. INLINE records use the id to // refer to its INLINE_ORIGIN record. @@ -150,11 +151,14 @@ class Module { Inline(InlineOrigin* origin, const vector& ranges, int call_site_line, + int call_site_file_id, int inline_nest_level, vector> child_inlines) : origin(origin), ranges(ranges), call_site_line(call_site_line), + call_site_file_id(call_site_file_id), + call_site_file(nullptr), inline_nest_level(inline_nest_level), child_inlines(std::move(child_inlines)) {} @@ -165,10 +169,29 @@ class Module { int call_site_line; + // The id is only meanful inside a CU. It's only used for looking up real + // File* after scanning a CU. + int call_site_file_id; + + File* call_site_file; + int inline_nest_level; // A list of inlines which are children of this inline. vector> child_inlines; + + int getCallSiteFileID() const { + return call_site_file ? call_site_file->source_id : -1; + } + + static void InlineDFS( + vector>& inlines, + std::function&)> const& forEach) { + for (std::unique_ptr& in : inlines) { + forEach(in); + InlineDFS(in->child_inlines, forEach); + } + } }; typedef map InlineOriginByOffset; @@ -182,9 +205,7 @@ class Module { // value of its DW_AT_specification or equals to offset if // DW_AT_specification doesn't exist in that DIE. void SetReference(uint64_t offset, uint64_t specification_offset); - void AssignFilesToInlineOrigins( - const vector& inline_origin_offsets, - File* file); + ~InlineOriginMap() { for (const auto& iter : inline_origins_) { delete iter.second; @@ -261,10 +282,8 @@ class Module { }; struct InlineOriginCompare { - bool operator() (const InlineOrigin* lhs, const InlineOrigin* rhs) const { - if (lhs->getFileID() == rhs->getFileID()) - return lhs->name < rhs->name; - return lhs->getFileID() < rhs->getFileID(); + bool operator()(const InlineOrigin* lhs, const InlineOrigin* rhs) const { + return lhs->name < rhs->name; } }; From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 15 Dec 2021 22:26:40 +0100 Subject: [PATCH 044/195] Fix for non-constant SIGSTKSZ On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case it expands to a call to `sysconf` which returns a `long int`); see https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html Pass unsigned explicitly to std::max, to avoid relying on template argument deduction. This works both with the old-style constant `SIGSTKSZ` and the new configurable one. Initially based on https://chromium-review.googlesource.com/c/2776379 Change-Id: I9fc95337f973e871b84735ce822b5e11ba73ea8c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721 Reviewed-by: Mark Mentovai --- src/client/linux/handler/exception_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index ca353c409..499be0a98 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { // SIGSTKSZ may be too small to prevent the signal handlers from overrunning // the alternative stack. Ensure that the size of the alternative stack is // large enough. - static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); + const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); // Only set an alternative stack if there isn't already one, or if the current // one is too small. From 634a7b3fad26e8587b129b317bb2c9a913b1aae0 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Thu, 16 Dec 2021 11:28:23 -0500 Subject: [PATCH 045/195] mac: add go.mod for upload_system_symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was created by running “go mod init upload_system_symbols”. This is necessary for “go build” to work in recent versions of golang. Previously, errors such as this were produced: go: cannot find main module, but found .git/config in …/breakpad/src to create a module there, run: cd ../../../.. && go mod init Change-Id: Ia88834aec2eb8ee01db452889c525a5f6ebefa25 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3345400 Reviewed-by: Robert Sesek --- src/tools/mac/upload_system_symbols/go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/tools/mac/upload_system_symbols/go.mod diff --git a/src/tools/mac/upload_system_symbols/go.mod b/src/tools/mac/upload_system_symbols/go.mod new file mode 100644 index 000000000..ff21bba9f --- /dev/null +++ b/src/tools/mac/upload_system_symbols/go.mod @@ -0,0 +1,3 @@ +module upload_system_symbols + +go 1.17 From 10afee3916b0c812511e8f285a9cd6f38a197bd4 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 4 Jan 2022 16:03:22 -0800 Subject: [PATCH 046/195] Add INLINE and INLINE_ORIGIN records on Windows dump_syms This adds INLINE and INLINE_ORIGIN records on Window dump_syms. It also adds more LINE records that represents the inner most callsite line info inside a function. Bug: chromium:1190878 Change-Id: I15c2044709f8ca831b03a453910d036f749452c6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3133606 Reviewed-by: Lei Zhang Reviewed-by: Joshua Peraza Reviewed-by: Ivan Penkov --- src/common/windows/pdb_source_line_writer.cc | 345 ++++++++++++++++--- src/common/windows/pdb_source_line_writer.h | 140 +++++++- src/tools/windows/dump_syms/dump_syms.cc | 55 ++- 3 files changed, 481 insertions(+), 59 deletions(-) diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index 08d52635b..ca0c6a39a 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,8 @@ namespace google_breakpad { namespace { +using std::set; +using std::unique_ptr; using std::vector; // The symbol (among possibly many) selected to represent an rva. @@ -208,9 +211,160 @@ void StripLlvmSuffixAndUndecorate(BSTR* name) { } // namespace -PDBSourceLineWriter::PDBSourceLineWriter() : output_(NULL) { +PDBSourceLineWriter::Inline::Inline(int inline_nest_level) + : inline_nest_level_(inline_nest_level) {} + +void PDBSourceLineWriter::Inline::SetOriginId(int origin_id) { + origin_id_ = origin_id; +} + +void PDBSourceLineWriter::Inline::ExtendRanges(const Line& line) { + if (ranges_.empty()) { + ranges_[line.rva] = line.length; + return; + } + auto iter = ranges_.lower_bound(line.rva); + // There is no overlap if this function is called with inlinee lines from + // the same callsite. + if (iter == ranges_.begin()) { + return; + } + if (line.rva + line.length == iter->first) { + // If they are connected, merge their ranges into one. + DWORD length = line.length + iter->second; + ranges_.erase(iter); + ranges_[line.rva] = length; + } else { + --iter; + if (iter->first + iter->second == line.rva) { + ranges_[iter->first] = iter->second + line.length; + } else { + ranges_[line.rva] = line.length; + } + } +} + +void PDBSourceLineWriter::Inline::SetCallSiteLine(DWORD call_site_line) { + call_site_line_ = call_site_line; +} + +void PDBSourceLineWriter::Inline::SetCallSiteFileId(DWORD call_site_file_id) { + call_site_file_id_ = call_site_file_id; +} + +void PDBSourceLineWriter::Inline::SetChildInlines( + vector> child_inlines) { + child_inlines_ = std::move(child_inlines); +} + +void PDBSourceLineWriter::Inline::Print(FILE* output) const { + // Ignore INLINE record that doesn't have any range. + if (ranges_.empty()) + return; + fprintf(output, "INLINE %d %lu %lu %d", inline_nest_level_, call_site_line_, + call_site_file_id_, origin_id_); + for (const auto& r : ranges_) { + fprintf(output, " %lx %lx", r.first, r.second); + } + fprintf(output, "\n"); + for (const unique_ptr& in : child_inlines_) { + in->Print(output); + } +} + +const PDBSourceLineWriter::Line* PDBSourceLineWriter::Lines::GetLine( + DWORD rva) const { + auto iter = line_map_.find(rva); + if (iter == line_map_.end()) { + // If not found exact rva, check if it's within any range. + iter = line_map_.lower_bound(rva); + if (iter == line_map_.begin()) + return nullptr; + --iter; + auto l = iter->second; + // This happens when there is no top level lines cover this rva (e.g. empty + // lines found for the function). Then we don't know the call site line + // number for this inlined function. + if (rva >= l.rva + l.length) + return nullptr; + } + return &iter->second; +} + +DWORD PDBSourceLineWriter::Lines::GetLineNum(DWORD rva) const { + const Line* line = GetLine(rva); + return line ? line->line_num : 0; } +DWORD PDBSourceLineWriter::Lines::GetFileId(DWORD rva) const { + const Line* line = GetLine(rva); + return line ? line->file_id : 0; +} + +void PDBSourceLineWriter::Lines::AddLine(const Line& line) { + if (line_map_.empty()) { + line_map_[line.rva] = line; + return; + } + + // Given an existing line in line_map_, remove it from line_map_ if it + // overlaps with the line and add a new line for the non-overlap range. Return + // true if there is an overlap. + auto intercept = [&](Line old_line) { + DWORD end = old_line.rva + old_line.length; + // No overlap. + if (old_line.rva >= line.rva + line.length || line.rva >= end) + return false; + // old_line is within the line. + if (old_line.rva >= line.rva && end <= line.rva + line.length) { + line_map_.erase(old_line.rva); + return true; + } + // Then there is a overlap. + if (old_line.rva < line.rva) { + old_line.length -= end - line.rva; + if (end > line.rva + line.length) { + Line new_line = old_line; + new_line.rva = line.rva + line.length; + new_line.length = end - new_line.rva; + line_map_[new_line.rva] = new_line; + } + } else { + line_map_.erase(old_line.rva); + old_line.length -= line.rva + line.length - old_line.rva; + old_line.rva = line.rva + line.length; + } + line_map_[old_line.rva] = old_line; + return true; + }; + + bool is_intercept; + // Use a loop in cases that there are multiple lines within the given line. + do { + auto iter = line_map_.lower_bound(line.rva); + if (iter == line_map_.end()) { + --iter; + intercept(iter->second); + break; + } + is_intercept = false; + if (iter != line_map_.begin()) { + // Check if the given line overlaps a line with smaller in the map. + auto prev = line_map_.lower_bound(line.rva); + --prev; + is_intercept = intercept(prev->second); + } + // Check if the given line overlaps a line with greater or equal rva in the + // map. Using operator |= here since it's possible that there are multiple + // lines with greater rva in the map overlap with the given line. + is_intercept |= intercept(iter->second); + } while (is_intercept); + line_map_[line.rva] = line; +} + +PDBSourceLineWriter::PDBSourceLineWriter(bool handle_inline) + : output_(NULL), handle_inline_(handle_inline) {} + PDBSourceLineWriter::~PDBSourceLineWriter() { Close(); } @@ -280,48 +434,61 @@ bool PDBSourceLineWriter::Open(const wstring& file, FileFormat format) { return true; } -bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers* lines) { - // The line number format is: - // - CComPtr line; - ULONG count; +bool PDBSourceLineWriter::GetLine(IDiaLineNumber* dia_line, Line* line) const { + if (FAILED(dia_line->get_relativeVirtualAddress(&line->rva))) { + fprintf(stderr, "failed to get line rva\n"); + return false; + } - while (SUCCEEDED(lines->Next(1, &line, &count)) && count == 1) { - DWORD rva; - if (FAILED(line->get_relativeVirtualAddress(&rva))) { - fprintf(stderr, "failed to get line rva\n"); - return false; - } + if (FAILED(dia_line->get_length(&line->length))) { + fprintf(stderr, "failed to get line code length\n"); + return false; + } - DWORD length; - if (FAILED(line->get_length(&length))) { - fprintf(stderr, "failed to get line code length\n"); - return false; - } + DWORD dia_source_id; + if (FAILED(dia_line->get_sourceFileId(&dia_source_id))) { + fprintf(stderr, "failed to get line source file id\n"); + return false; + } + // duplicate file names are coalesced to share one ID + line->file_id = GetRealFileID(dia_source_id); - DWORD dia_source_id; - if (FAILED(line->get_sourceFileId(&dia_source_id))) { - fprintf(stderr, "failed to get line source file id\n"); - return false; - } - // duplicate file names are coalesced to share one ID - DWORD source_id = GetRealFileID(dia_source_id); + if (FAILED(dia_line->get_lineNumber(&line->line_num))) { + fprintf(stderr, "failed to get line number\n"); + return false; + } + return true; +} - DWORD line_num; - if (FAILED(line->get_lineNumber(&line_num))) { - fprintf(stderr, "failed to get line number\n"); +bool PDBSourceLineWriter::GetLines(IDiaEnumLineNumbers* lines, + Lines* line_list) const { + CComPtr line; + ULONG count; + + while (SUCCEEDED(lines->Next(1, &line, &count)) && count == 1) { + Line l; + if (!GetLine(line, &l)) return false; - } + // Silently ignore zero-length lines. + if (l.length != 0) + line_list->AddLine(l); + line.Release(); + } + return true; +} +void PDBSourceLineWriter::PrintLines(const Lines& lines) const { + // The line number format is: + // + for (const auto& kv : lines.GetLineMap()) { + const Line& l = kv.second; AddressRangeVector ranges; - MapAddressRange(image_map_, AddressRange(rva, length), &ranges); - for (size_t i = 0; i < ranges.size(); ++i) { - fprintf(output_, "%lx %lx %lu %lu\n", ranges[i].rva, ranges[i].length, - line_num, source_id); + MapAddressRange(image_map_, AddressRange(l.rva, l.length), &ranges); + for (auto& range : ranges) { + fprintf(output_, "%lx %lx %lu %lu\n", range.rva, range.length, l.line_num, + l.file_id); } - line.Release(); } - return true; } bool PDBSourceLineWriter::PrintFunction(IDiaSymbol* function, @@ -372,9 +539,20 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol* function, return false; } - if (!PrintLines(lines)) { + // Get top level lines first, which later may be split into multiple smaller + // lines if any inline exists in their ranges if we want to handle inline. + Lines line_list; + if (!GetLines(lines, &line_list)) { return false; } + if (handle_inline_) { + vector> inlines; + if (!GetInlines(block, &line_list, 0, &inlines)) { + return false; + } + PrintInlines(inlines); + } + PrintLines(line_list); return true; } @@ -555,6 +733,97 @@ bool PDBSourceLineWriter::PrintFunctions() { return true; } +void PDBSourceLineWriter::PrintInlineOrigins() const { + struct OriginCompare { + bool operator()(const InlineOrigin lhs, const InlineOrigin rhs) const { + return lhs.id < rhs.id; + } + }; + set origins; + // Sort by origin id. + for (auto const& origin : inline_origins_) + origins.insert(origin.second); + for (auto o : origins) { + fprintf(output_, "INLINE_ORIGIN %d %ls\n", o.id, o.name.c_str()); + } +} + +bool PDBSourceLineWriter::GetInlines(IDiaSymbol* block, + Lines* line_list, + int inline_nest_level, + vector>* inlines) { + CComPtr inline_callsites; + if (FAILED(block->findChildrenEx(SymTagInlineSite, nullptr, nsNone, + &inline_callsites))) { + return false; + } + ULONG count; + CComPtr callsite; + while (SUCCEEDED(inline_callsites->Next(1, &callsite, &count)) && + count == 1) { + unique_ptr new_inline(new Inline(inline_nest_level)); + CComPtr lines; + // All inlinee lines have the same file id. + DWORD file_id = 0; + DWORD call_site_line = 0; + if (FAILED(session_->findInlineeLines(callsite, &lines))) { + return false; + } + CComPtr dia_line; + while (SUCCEEDED(lines->Next(1, &dia_line, &count)) && count == 1) { + Line line; + if (!GetLine(dia_line, &line)) { + return false; + } + // Silently ignore zero-length lines. + if (line.length != 0) { + // Use the first line num and file id at rva as this inline's call site + // line number, because after adding lines it may be changed to inner + // line number and inner file id. + if (call_site_line == 0) + call_site_line = line_list->GetLineNum(line.rva); + if (file_id == 0) + file_id = line_list->GetFileId(line.rva); + line_list->AddLine(line); + new_inline->ExtendRanges(line); + } + dia_line.Release(); + } + BSTR name; + callsite->get_name(&name); + if (SysStringLen(name) == 0) { + name = SysAllocString(L""); + } + auto iter = inline_origins_.find(name); + if (iter == inline_origins_.end()) { + InlineOrigin origin; + origin.id = inline_origins_.size(); + origin.name = name; + inline_origins_[name] = origin; + } + new_inline->SetOriginId(inline_origins_[name].id); + new_inline->SetCallSiteLine(call_site_line); + new_inline->SetCallSiteFileId(file_id); + // Go to next level. + vector> child_inlines; + if (!GetInlines(callsite, line_list, inline_nest_level + 1, + &child_inlines)) { + return false; + } + new_inline->SetChildInlines(std::move(child_inlines)); + inlines->push_back(std::move(new_inline)); + callsite.Release(); + } + return true; +} + +void PDBSourceLineWriter::PrintInlines( + const vector>& inlines) const { + for (const unique_ptr& in : inlines) { + in->Print(output_); + } +} + #undef max bool PDBSourceLineWriter::PrintFrameDataUsingPDB() { @@ -1105,10 +1374,8 @@ bool PDBSourceLineWriter::WriteSymbols(FILE* symbol_file) { bool ret = PrintPDBInfo(); // This is not a critical piece of the symbol file. PrintPEInfo(); - ret = ret && - PrintSourceFiles() && - PrintFunctions() && - PrintFrameData(); + ret = ret && PrintSourceFiles() && PrintFunctions() && PrintFrameData(); + PrintInlineOrigins(); output_ = NULL; return ret; diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h index 00f6e5929..b1aa85e14 100644 --- a/src/common/windows/pdb_source_line_writer.h +++ b/src/common/windows/pdb_source_line_writer.h @@ -35,8 +35,10 @@ #include +#include #include #include +#include #include "common/windows/module_info.h" #include "common/windows/omap.h" @@ -47,6 +49,8 @@ struct IDiaSymbol; namespace google_breakpad { +using std::map; +using std::vector; using std::wstring; using std::unordered_map; @@ -58,7 +62,7 @@ class PDBSourceLineWriter { ANY_FILE // try PDB_FILE and then EXE_FILE }; - explicit PDBSourceLineWriter(); + explicit PDBSourceLineWriter(bool handle_inline); ~PDBSourceLineWriter(); // Opens the given file. For executable files, the corresponding pdb @@ -99,9 +103,110 @@ class PDBSourceLineWriter { bool UsesGUID(bool *uses_guid); private: - // Outputs the line/address pairs for each line in the enumerator. + // InlineOrigin represents INLINE_ORIGIN record in a symbol file. It's an + // inlined function. + struct InlineOrigin { + // The unique id for an InlineOrigin. + int id; + // The name of the inlined function. + wstring name; + }; + + // Line represents LINE record in a symbol file. It represents a source code + // line. + struct Line { + // The relative address of a line. + DWORD rva; + // The number bytes this line has. + DWORD length; + // The source line number. + DWORD line_num; + // The source file id where the source line is located at. + DWORD file_id; + }; + + // Inline represents INLINE record in a symbol file. + class Inline { + public: + explicit Inline(int inline_nest_level); + + void SetOriginId(int origin_id); + + // Adding inlinee line's range into ranges. If line is adjacent with any + // existing lines, extend the range. Otherwise, add line as a new range. + void ExtendRanges(const Line& line); + + void SetCallSiteLine(DWORD call_site_line); + + void SetCallSiteFileId(DWORD call_site_file_id); + + void SetChildInlines(std::vector> child_inlines); + + void Print(FILE* output) const; + + private: + // The nest level of this inline record. + int inline_nest_level_; + // The source line number at where this inlined function is called. + DWORD call_site_line_ = 0; + // The call site file id at where this inlined function is called. + DWORD call_site_file_id_ = 0; + // The id used for referring to an InlineOrigin. + int origin_id_ = 0; + // A map from rva to length. This is the address ranges covered by this + // Inline. + map ranges_; + // The list of direct Inlines inlined inside this Inline. + vector> child_inlines_; + }; + + // Lines represents a map of lines inside a function with rva as the key. + // AddLine function adds a line into the map and ensures that there is no + // overlap between any two lines in the map. + class Lines { + public: + const map& GetLineMap() const { return line_map_; } + + // Finds the line from line_map_ that contains the given rva returns its + // line_num. If not found, return 0. + DWORD GetLineNum(DWORD rva) const; + + // Finds the line from line_map_ that contains the given rva returns its + // file_id. If not found, return 0. + DWORD GetFileId(DWORD rva) const; + + // Add the `line` into line_map_. If the `line` overlaps with existing + // lines, truncate the existing lines and add the given line. It ensures + // that all lines in line_map_ do not overlap with each other. For example, + // suppose there is a line A in the map and we call AddLine with Line B. + // Line A: rva: 100, length: 20, line_num: 10, file_id: 1 + // Line B: rva: 105, length: 10, line_num: 4, file_id: 2 + // After calling AddLine with Line B, we will have the following lines: + // Line 1: rva: 100, length: 5, line_num: 10, file_id: 1 + // Line 2: rva: 105, length: 10, line_num: 4, file_id: 2 + // Line 3: rva: 115, length: 5, line_num: 10, file_id: 1 + void AddLine(const Line& line); + + private: + // Finds the line from line_map_ that contains the given rva. If not found, + // return nullptr. + const Line* GetLine(DWORD rva) const; + // The key is rva. AddLine function ensures that any two lines in the map do + // not overlap. + map line_map_; + }; + + // Construct Line from IDiaLineNumber. The output Line is stored at line. + // Return true on success. + bool GetLine(IDiaLineNumber* dia_line, Line* line) const; + + // Construct Lines from IDiaEnumLineNumbers. The list of Lines are stored at + // line_list. // Returns true on success. - bool PrintLines(IDiaEnumLineNumbers *lines); + bool GetLines(IDiaEnumLineNumbers* lines, Lines* line_list) const; + + // Outputs the line/address pairs for each line in the enumerator. + void PrintLines(const Lines& lines) const; // 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 @@ -118,6 +223,25 @@ class PDBSourceLineWriter { // Returns true on success. bool PrintSourceFiles(); + // Output all inline origins. + void PrintInlineOrigins() const; + + // Retrieve inlines inside the given block. It also adds inlinee lines to + // `line_list` since inner lines are more precise source location. If the + // block has children wih SymTagInlineSite Tag, it will recursively (DFS) call + // itself with each child as first argument. Returns true on success. + // `block`: the IDiaSymbol that may have inline sites. + // `line_list`: the list of lines inside current function. + // `inline_nest_level`: the nest level of block's Inlines. + // `inlines`: the vector to store the list of inlines for the block. + bool GetInlines(IDiaSymbol* block, + Lines* line_list, + int inline_nest_level, + vector>* inlines); + + // Outputs all inlines. + void PrintInlines(const vector>& inlines) const; + // Outputs all of the frame information necessary to construct stack // backtraces in the absence of frame pointers. For x86 data stored in // .pdb files. Returns true on success. @@ -172,8 +296,8 @@ class PDBSourceLineWriter { // reference it. There may be multiple files with identical filenames // but different unique IDs. The cache attempts to coalesce these into // one ID per unique filename. - DWORD GetRealFileID(DWORD id) { - unordered_map::iterator iter = file_ids_.find(id); + DWORD GetRealFileID(DWORD id) const { + unordered_map::const_iterator iter = file_ids_.find(id); if (iter == file_ids_.end()) return id; return iter->second; @@ -213,9 +337,15 @@ class PDBSourceLineWriter { // This maps unique filenames to file IDs. unordered_map unique_files_; + // The INLINE_ORIGINS records. The key is the function name. + std::map inline_origins_; + // This is used for calculating post-transform symbol addresses and lengths. ImageMap image_map_; + // If we should output INLINE/INLINE_ORIGIN records + bool handle_inline_; + // Disallow copy ctor and operator= PDBSourceLineWriter(const PDBSourceLineWriter&); void operator=(const PDBSourceLineWriter&); diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc index 1b1797dc2..fa4980fc7 100644 --- a/src/tools/windows/dump_syms/dump_syms.cc +++ b/src/tools/windows/dump_syms/dump_syms.cc @@ -38,30 +38,55 @@ #include "common/windows/pdb_source_line_writer.h" #include "common/windows/pe_source_line_writer.h" -using std::wstring; using google_breakpad::PDBSourceLineWriter; using google_breakpad::PESourceLineWriter; using std::unique_ptr; +using std::wstring; + +int usage(const wchar_t* self) { + fprintf(stderr, "Usage: %ws [--pe] [--i] \n", self); + fprintf(stderr, "Options:\n"); + fprintf(stderr, + "--pe:\tRead debugging information from PE file and do " + "not attempt to locate matching PDB file.\n" + "\tThis is only supported for PE32+ (64 bit) PE files.\n"); + fprintf(stderr, + "--i:\tOutput INLINE/INLINE_ORIGIN record\n" + "\tThis cannot be used with [--pe].\n"); + return 1; +} int wmain(int argc, wchar_t** argv) { - bool success; - if (argc == 2) { - PDBSourceLineWriter pdb_writer; - if (!pdb_writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) { + bool success = false; + bool pe = false; + bool handle_inline = false; + int arg_index = 1; + while (arg_index < argc && wcslen(argv[arg_index]) > 0 && + wcsncmp(L"--", argv[arg_index], 2) == 0) { + if (wcscmp(L"--pe", argv[arg_index]) == 0) { + pe = true; + } else if (wcscmp(L"--i", argv[arg_index]) == 0) { + handle_inline = true; + } + ++arg_index; + } + + if ((pe && handle_inline) || arg_index == argc) { + usage(argv[0]); + return 1; + } + + wchar_t* file_path = argv[arg_index]; + if (pe) { + PESourceLineWriter pe_writer(file_path); + success = pe_writer.WriteSymbols(stdout); + } else { + PDBSourceLineWriter pdb_writer(handle_inline); + if (!pdb_writer.Open(wstring(file_path), PDBSourceLineWriter::ANY_FILE)) { fprintf(stderr, "Open failed.\n"); return 1; } success = pdb_writer.WriteSymbols(stdout); - } else if (argc == 3 && wcscmp(argv[1], L"--pe") == 0) { - PESourceLineWriter pe_writer(argv[2]); - success = pe_writer.WriteSymbols(stdout); - } else { - fprintf(stderr, "Usage: %ws [--pe] \n", argv[0]); - fprintf(stderr, "Options:\n"); - fprintf(stderr, "--pe:\tRead debugging information from PE file and do " - "not attempt to locate matching PDB file.\n" - "\tThis is only supported for PE32+ (64 bit) PE files.\n"); - return 1; } if (!success) { From bbf740148d4fbd77b6ac103c22d83703f9488da0 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 5 Jan 2022 13:41:21 -0800 Subject: [PATCH 047/195] Fix symupload build failure on Windows. - Make handle_inline default to false in PDBSourceLineWriter constructor. - Add --i flag for symupload to generate inline information. Change-Id: I3149173ee635a503b9508a12ef572f8b6e5c5dfe Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3364804 Reviewed-by: Joshua Peraza --- src/common/windows/pdb_source_line_writer.h | 2 +- src/tools/windows/symupload/symupload.cc | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h index b1aa85e14..091700a73 100644 --- a/src/common/windows/pdb_source_line_writer.h +++ b/src/common/windows/pdb_source_line_writer.h @@ -62,7 +62,7 @@ class PDBSourceLineWriter { ANY_FILE // try PDB_FILE and then EXE_FILE }; - explicit PDBSourceLineWriter(bool handle_inline); + explicit PDBSourceLineWriter(bool handle_inline = false); ~PDBSourceLineWriter(); // Opens the given file. For executable files, the corresponding pdb diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index e6fa126fa..c774b0e7c 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -116,8 +116,9 @@ static bool GetFileVersionString(const wchar_t* filename, wstring* version) { // and information about the pdb in pdb_info. static bool DumpSymbolsToTempFile(const wchar_t* file, wstring* temp_file_path, - PDBModuleInfo* pdb_info) { - google_breakpad::PDBSourceLineWriter writer; + PDBModuleInfo* pdb_info, + bool handle_inline) { + google_breakpad::PDBSourceLineWriter writer(handle_inline); // Use EXE_FILE to get information out of the exe/dll in addition to the // pdb. The name and version number of the exe/dll are of value, and // there's no way to locate an exe/dll given a pdb. @@ -247,9 +248,10 @@ static bool DoSymUploadV2( __declspec(noreturn) void printUsageAndExit() { wprintf(L"Usage:\n\n" - L" symupload [--timeout NN] [--product product_name] ^\n" + L" symupload [--i] [--timeout NN] [--product product_name] ^\n" L" ^\n" L" [...]\n\n"); + wprintf(L" - i: Extract inline information from pdb.\n"); wprintf(L" - Timeout is in milliseconds, or can be 0 to be unlimited.\n"); wprintf(L" - product_name is an HTTP-friendly product name. It must only\n" L" contain an ascii subset: alphanumeric and punctuation.\n" @@ -273,6 +275,7 @@ __declspec(noreturn) void printUsageAndExit() { int wmain(int argc, wchar_t* argv[]) { const wchar_t* module; const wchar_t* product = nullptr; + bool handle_inline = false; int timeout = -1; int currentarg = 1; bool use_sym_upload_v2 = false; @@ -280,6 +283,11 @@ int wmain(int argc, wchar_t* argv[]) { const wchar_t* api_url = nullptr; const wchar_t* api_key = nullptr; while (argc > currentarg + 1) { + if (!wcscmp(L"--i", argv[currentarg])) { + handle_inline = true; + ++currentarg; + continue; + } if (!wcscmp(L"--timeout", argv[currentarg])) { timeout = _wtoi(argv[currentarg + 1]); currentarg += 2; @@ -310,7 +318,7 @@ int wmain(int argc, wchar_t* argv[]) { wstring symbol_file; PDBModuleInfo pdb_info; - if (!DumpSymbolsToTempFile(module, &symbol_file, &pdb_info)) { + if (!DumpSymbolsToTempFile(module, &symbol_file, &pdb_info, handle_inline)) { fwprintf(stderr, L"Could not get symbol data from %s\n", module); return 1; } From 862dc68dbca99f5302a21c2b30dc0383a72ffa42 Mon Sep 17 00:00:00 2001 From: danakj Date: Thu, 13 Jan 2022 13:56:52 -0500 Subject: [PATCH 048/195] Match the return type of getopt(). getopt() returns an int, not a char. Bug: chromium:1287175 Change-Id: I9866112f7420b39ea470d9f04435ca328ab37ce0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3387609 Reviewed-by: Mark Mentovai --- src/tools/mac/symupload/symupload.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/mac/symupload/symupload.mm b/src/tools/mac/symupload/symupload.mm index 248351171..10cf293df 100644 --- a/src/tools/mac/symupload/symupload.mm +++ b/src/tools/mac/symupload/symupload.mm @@ -331,7 +331,7 @@ static void SetupOptions(int argc, const char* argv[], Options* options) { options->force = NO; extern int optind; - char ch; + int ch; while ((ch = getopt(argc, (char* const*)argv, "p:k:t:c:i:hf?")) != -1) { switch (ch) { From 92a20b650400d110bf14378195e1346c7b0635de Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 14 Jan 2022 15:17:42 -0800 Subject: [PATCH 049/195] Fix reading DW_AT_ranges in dwarf 5 Bug: chromium:1285381 Change-Id: I8be6b0920e4d137a5d62283ce622669fa56bc417 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3389983 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index aa4ec2b67..bf6758d8a 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -1793,7 +1793,7 @@ bool RangeListReader::ReadRanges(enum DwarfForm form, uint64_t data) { } } else if (form == DW_FORM_rnglistx) { offset_array_ = cu_info_->ranges_base_; - uint64_t index_offset = reader_->AddressSize() * data; + uint64_t index_offset = reader_->OffsetSize() * data; uint64_t range_list_offset = reader_->ReadOffset(cu_info_->buffer_ + offset_array_ + index_offset); From 772cfc1db6374b793a4a717466d3efc4effee12b Mon Sep 17 00:00:00 2001 From: Adam Duke Date: Tue, 25 Jan 2022 17:04:16 -0500 Subject: [PATCH 050/195] allow dump_syms to operate on contents in memory dump_syms assumes it is operating on a file and can access a compliant file system. This change allows dump_syms to operate on the contents of a file that has already been read into memory. This is useful in a server context where the file does not exist on the local file system. Change-Id: Id63f115c2df287083d548dadd5ac487f97bde057 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3327644 Reviewed-by: Mark Mentovai --- src/client/mac/handler/minidump_generator.cc | 2 +- src/common/mac/dump_syms.cc | 48 +++--- src/common/mac/dump_syms.h | 36 +++-- src/common/mac/file_id.cc | 44 ++---- src/common/mac/file_id.h | 23 ++- src/common/mac/macho_id.cc | 148 +------------------ src/common/mac/macho_id.h | 26 +--- 7 files changed, 97 insertions(+), 230 deletions(-) diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index e0351c4bb..d6b0561d5 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -1449,7 +1449,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule* module, int cpu_type, unsigned char identifier[16]; bool result = false; if (in_memory) { - MacFileUtilities::MachoID macho(module_path, + MacFileUtilities::MachoID macho( reinterpret_cast(module->base_of_image), static_cast(module->size_of_image)); result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier); diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 6df32bc10..bd69218df 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -128,10 +128,11 @@ bool DumpSymbols::Read(const string& filename) { return false; } - input_pathname_ = filename; + from_disk_ = true; // Does this filename refer to a dSYM bundle? - string contents_path = input_pathname_ + "/Contents/Resources/DWARF"; + string contents_path = filename + "/Contents/Resources/DWARF"; + string object_filename; if (S_ISDIR(st.st_mode) && access(contents_path.c_str(), F_OK) == 0) { // If there's one file under Contents/Resources/DWARF then use that, @@ -139,30 +140,31 @@ bool DumpSymbols::Read(const string& filename) { const vector entries = list_directory(contents_path); if (entries.size() == 0) { fprintf(stderr, "Unable to find DWARF-bearing file in bundle: %s\n", - input_pathname_.c_str()); + filename.c_str()); return false; } if (entries.size() > 1) { fprintf(stderr, "Too many DWARF files in bundle: %s\n", - input_pathname_.c_str()); + filename.c_str()); return false; } - object_filename_ = entries[0]; + object_filename = entries[0]; } else { - object_filename_ = input_pathname_; + object_filename = filename; } // Read the file's contents into memory. bool read_ok = true; string error; - if (stat(object_filename_.c_str(), &st) != -1) { - FILE* f = fopen(object_filename_.c_str(), "rb"); + scoped_array contents; + off_t total = 0; + if (stat(object_filename.c_str(), &st) != -1) { + FILE* f = fopen(object_filename.c_str(), "rb"); if (f) { - contents_.reset(new uint8_t[st.st_size]); - off_t total = 0; + contents.reset(new uint8_t[st.st_size]); while (total < st.st_size && !feof(f)) { - size_t read = fread(&contents_[0] + total, 1, st.st_size - total, f); + size_t read = fread(&contents[0] + total, 1, st.st_size - total, f); if (read == 0) { if (ferror(f)) { read_ok = false; @@ -180,16 +182,22 @@ bool DumpSymbols::Read(const string& filename) { if (!read_ok) { fprintf(stderr, "Error reading object file: %s: %s\n", - object_filename_.c_str(), - error.c_str()); + object_filename.c_str(), error.c_str()); return false; } + return ReadData(contents.release(), total, object_filename); +} + +bool DumpSymbols::ReadData(uint8_t* contents, size_t size, + const std::string& filename) { + contents_.reset(contents); + size_ = size; + object_filename_ = filename; // Get the list of object files present in the file. FatReader::Reporter fat_reporter(object_filename_); FatReader fat_reader(&fat_reporter); - if (!fat_reader.Read(&contents_[0], - st.st_size)) { + if (!fat_reader.Read(contents_.get(), size)) { return false; } @@ -283,7 +291,13 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( } string DumpSymbols::Identifier() { - FileID file_id(object_filename_.c_str()); + scoped_ptr file_id; + + if (from_disk_) { + file_id.reset(new FileID(object_filename_.c_str())); + } else { + file_id.reset(new FileID(contents_.get(), size_)); + } unsigned char identifier_bytes[16]; scoped_ptr module; if (!selected_object_file_) { @@ -292,7 +306,7 @@ string DumpSymbols::Identifier() { } cpu_type_t cpu_type = selected_object_file_->cputype; cpu_subtype_t cpu_subtype = selected_object_file_->cpusubtype; - if (!file_id.MachoIdentifier(cpu_type, cpu_subtype, identifier_bytes)) { + if (!file_id->MachoIdentifier(cpu_type, cpu_subtype, identifier_bytes)) { fprintf(stderr, "Unable to calculate UUID of mach-o binary %s!\n", object_filename_.c_str()); return ""; diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index 4365e2944..34ba14bc0 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -57,21 +57,30 @@ class DumpSymbols { DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs) : symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs), - input_pathname_(), object_filename_(), contents_(), + size_(0), + from_disk_(false), object_files_(), selected_object_file_(), - selected_object_name_() { } + selected_object_name_() {} ~DumpSymbols() { } // Prepare to read debugging information from |filename|. |filename| may be - // the name of a universal binary, a Mach-O file, or a dSYM bundle - // containing either of the above. On success, return true; if there is a - // problem reading |filename|, report it and return false. + // the name of a fat file, a Mach-O file, or a dSYM bundle containing either + // of the above. On success, return true; if there is a problem reading + // |filename|, report it and return false. bool Read(const std::string& filename); + // Prepare to read debugging information from |contents|. |contents| is + // expected to be the data obtained from reading a fat file, or a Mach-O file. + // |filename| is used to determine the object filename in the generated + // output; there will not be an attempt to open this file as the data + // is already expected to be in memory. On success, return true; if there is a + // problem reading |contents|, report it and return false. + bool ReadData(uint8_t* contents, size_t size, const std::string& filename); + // If this dumper's file includes an object file for |cpu_type| and // |cpu_subtype|, then select that object file for dumping, and return // true. Otherwise, return false, and leave this dumper's selected @@ -162,19 +171,22 @@ class DumpSymbols { // Whether to handle references between compilation units. const bool handle_inter_cu_refs_; - // The name of the file or bundle whose symbols this will dump. - // This is the path given to Read, for use in error messages. - std::string input_pathname_; - // The name of the file this DumpSymbols will actually read debugging - // information from. Normally, this is the same as input_pathname_, but if - // filename refers to a dSYM bundle, then this is the resource file - // within that bundle. + // information from. If the filename passed to Read refers to a dSYM bundle, + // then this is the resource file within that bundle. std::string object_filename_; // The complete contents of object_filename_, mapped into memory. scoped_array contents_; + // The size of contents_. + size_t size_; + + // Indicates which entry point to DumpSymbols was used, i.e. Read vs ReadData. + // This is used to indicate that downstream code paths can/should also read + // from disk or not. + bool from_disk_; + // A vector of SuperFatArch structures describing the object files // object_filename_ contains. If object_filename_ refers to a fat binary, // this may have more than one element; if it refers to a Mach-O file, this diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc index 4661d5d62..504e8202d 100644 --- a/src/common/mac/file_id.cc +++ b/src/common/mac/file_id.cc @@ -33,53 +33,41 @@ // // Author: Dan Waylonis +#include "common/mac/file_id.h" + #include #include #include -#include -#include "common/mac/file_id.h" #include "common/mac/macho_id.h" +#include "common/scoped_ptr.h" using MacFileUtilities::MachoID; namespace google_breakpad { -FileID::FileID(const char *path) { +// Constructs a FileID given a path to a file +FileID::FileID(const char* path) : memory_(nullptr), size_(0) { snprintf(path_, sizeof(path_), "%s", path); } -bool FileID::FileIdentifier(unsigned char identifier[16]) { - int fd = open(path_, O_RDONLY); - if (fd == -1) - return false; - - MD5Context md5; - MD5Init(&md5); - - // Read 4k x 2 bytes at a time. This is faster than just 4k bytes, but - // doesn't seem to be an unreasonable size for the stack. - unsigned char buffer[4096 * 2]; - size_t buffer_size = sizeof(buffer); - while ((buffer_size = read(fd, buffer, buffer_size) > 0)) { - MD5Update(&md5, buffer, static_cast(buffer_size)); - } - - close(fd); - MD5Final(identifier, &md5); - - return true; -} +// Constructs a FileID given the contents of a file and its size +FileID::FileID(void* memory, size_t size) + : path_(), memory_(memory), size_(size) {} bool FileID::MachoIdentifier(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) { - MachoID macho(path_); - - if (macho.UUIDCommand(cpu_type, cpu_subtype, identifier)) + scoped_ptr macho; + if (memory_) { + macho.reset(new MachoID(memory_, size_)); + } else { + macho.reset(new MachoID(path_)); + } + if (macho->UUIDCommand(cpu_type, cpu_subtype, identifier)) return true; - return macho.MD5(cpu_type, cpu_subtype, identifier); + return macho->MD5(cpu_type, cpu_subtype, identifier); } // static diff --git a/src/common/mac/file_id.h b/src/common/mac/file_id.h index 5d60e84c9..430d41d5a 100644 --- a/src/common/mac/file_id.h +++ b/src/common/mac/file_id.h @@ -36,19 +36,18 @@ #include #include +#include namespace google_breakpad { class FileID { public: - FileID(const char *path); - ~FileID() {} + // Constructs a FileID given a path to a file + FileID(const char* path); - // Load the identifier for the file path specified in the constructor into - // |identifier|. Return false if the identifier could not be created for the - // file. - // The current implementation will return the MD5 hash of the file's bytes. - bool FileIdentifier(unsigned char identifier[16]); + // Constructs a FileID given the contents of a file and its size. + FileID(void* memory, size_t size); + ~FileID() {} // Treat the file as a mach-o file that will contain one or more archicture. // Accepted values for |cpu_type| and |cpu_subtype| (e.g., CPU_TYPE_X86 or @@ -74,6 +73,16 @@ class FileID { private: // Storage for the path specified char path_[PATH_MAX]; + + // Storage for contents of a file if this instance is used to operate on in + // memory file data rather than directly from a filesystem. If memory_ is + // null, the file represented by path_ will be opened/read. If memory_ is + // non-null, it is assumed to contain valid data, and no file operations will + // occur. + void* memory_; + + // Size of memory_ + size_t size_; }; } // namespace google_breakpad diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc index 3cf1d4b5f..9b7ca24f3 100644 --- a/src/common/mac/macho_id.cc +++ b/src/common/mac/macho_id.cc @@ -37,11 +37,7 @@ #include #include #include -#include #include -#include -#include -#include #include "common/mac/macho_id.h" #include "common/mac/macho_walker.h" @@ -54,73 +50,18 @@ using google_breakpad::MD5Update; using google_breakpad::MD5Final; MachoID::MachoID(const char* path) - : memory_(0), - memory_size_(0), - crc_(0), - md5_context_(), - update_function_(NULL) { + : memory_(0), memory_size_(0), md5_context_(), update_function_(NULL) { snprintf(path_, sizeof(path_), "%s", path); } -MachoID::MachoID(const char* path, void* memory, size_t size) - : memory_(memory), - memory_size_(size), - crc_(0), - md5_context_(), - update_function_(NULL) { - snprintf(path_, sizeof(path_), "%s", path); -} - -MachoID::~MachoID() { -} +MachoID::MachoID(void* memory, size_t size) + : path_(), + memory_(memory), + memory_size_(size), + md5_context_(), + update_function_(NULL) {} -// The CRC info is from http://en.wikipedia.org/wiki/Adler-32 -// With optimizations from http://www.zlib.net/ - -// The largest prime smaller than 65536 -#define MOD_ADLER 65521 -// MAX_BLOCK is the largest n such that 255n(n+1)/2 + (n+1)(MAX_BLOCK-1) <= 2^32-1 -#define MAX_BLOCK 5552 - -void MachoID::UpdateCRC(unsigned char* bytes, size_t size) { -// Unrolled loops for summing -#define DO1(buf,i) {sum1 += (buf)[i]; sum2 += sum1;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - // Split up the crc - uint32_t sum1 = crc_ & 0xFFFF; - uint32_t sum2 = (crc_ >> 16) & 0xFFFF; - - // Do large blocks - while (size >= MAX_BLOCK) { - size -= MAX_BLOCK; - int block_count = MAX_BLOCK / 16; - do { - DO16(bytes); - bytes += 16; - } while (--block_count); - sum1 %= MOD_ADLER; - sum2 %= MOD_ADLER; - } - - // Do remaining bytes - if (size) { - while (size >= 16) { - size -= 16; - DO16(bytes); - bytes += 16; - } - while (size--) { - sum1 += *bytes++; - sum2 += sum1; - } - sum1 %= MOD_ADLER; - sum2 %= MOD_ADLER; - crc_ = (sum2 << 16) | sum1; - } -} +MachoID::~MachoID() {} void MachoID::UpdateMD5(unsigned char* bytes, size_t size) { MD5Update(&md5_context_, bytes, static_cast(size)); @@ -169,59 +110,6 @@ bool MachoID::UUIDCommand(cpu_type_t cpu_type, return false; } -bool MachoID::IDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]) { - struct dylib_command dylib_cmd; - dylib_cmd.cmd = 0; - if (!WalkHeader(cpu_type, cpu_subtype, IDWalkerCB, &dylib_cmd)) - return false; - - // If we found the command, we'll have initialized the dylib_command - // structure - if (dylib_cmd.cmd == LC_ID_DYLIB) { - // Take the hashed filename, version, and compatability version bytes - // to form the first 12 bytes, pad the rest with zeros - - // create a crude hash of the filename to generate the first 4 bytes - identifier[0] = 0; - identifier[1] = 0; - identifier[2] = 0; - identifier[3] = 0; - - for (int j = 0, i = (int)strlen(path_)-1; i>=0 && path_[i]!='/'; ++j, --i) { - identifier[j%4] += path_[i]; - } - - identifier[4] = (dylib_cmd.dylib.current_version >> 24) & 0xFF; - identifier[5] = (dylib_cmd.dylib.current_version >> 16) & 0xFF; - identifier[6] = (dylib_cmd.dylib.current_version >> 8) & 0xFF; - identifier[7] = dylib_cmd.dylib.current_version & 0xFF; - identifier[8] = (dylib_cmd.dylib.compatibility_version >> 24) & 0xFF; - identifier[9] = (dylib_cmd.dylib.compatibility_version >> 16) & 0xFF; - identifier[10] = (dylib_cmd.dylib.compatibility_version >> 8) & 0xFF; - identifier[11] = dylib_cmd.dylib.compatibility_version & 0xFF; - identifier[12] = (cpu_type >> 24) & 0xFF; - identifier[13] = (cpu_type >> 16) & 0xFF; - identifier[14] = (cpu_type >> 8) & 0xFF; - identifier[15] = cpu_type & 0xFF; - - return true; - } - - return false; -} - -uint32_t MachoID::Adler32(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - update_function_ = &MachoID::UpdateCRC; - crc_ = 0; - - if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) - return 0; - - return crc_; -} - bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) { update_function_ = &MachoID::UpdateMD5; @@ -346,24 +234,4 @@ bool MachoID::UUIDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset, // Continue processing return true; } - -// static -bool MachoID::IDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset, - bool swap, void* context) { - if (cmd->cmd == LC_ID_DYLIB) { - struct dylib_command* dylib_cmd = (struct dylib_command*)context; - - if (!walker->ReadBytes(dylib_cmd, sizeof(struct dylib_command), offset)) - return false; - - if (swap) - breakpad_swap_dylib_command(dylib_cmd); - - return false; - } - - // Continue processing - return true; -} - } // namespace MacFileUtilities diff --git a/src/common/mac/macho_id.h b/src/common/mac/macho_id.h index e8874c37c..0262697d4 100644 --- a/src/common/mac/macho_id.h +++ b/src/common/mac/macho_id.h @@ -46,7 +46,7 @@ namespace MacFileUtilities { class MachoID { public: MachoID(const char* path); - MachoID(const char* path, void* memory, size_t size); + MachoID(void* memory, size_t size); ~MachoID(); // For the given |cpu_type| and |cpu_subtype|, return a UUID from the LC_UUID @@ -56,19 +56,6 @@ class MachoID { cpu_subtype_t cpu_subtype, unsigned char identifier[16]); - // For the given |cpu_type| and |cpu_subtype|, return a UUID from the - // LC_ID_DYLIB command. - // Return false if there isn't a LC_ID_DYLIB command. - bool IDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]); - - // For the given |cpu_type| and |cpu_subtype|, return the Adler32 CRC for the - // mach-o data segment(s). - // Return 0 on error (e.g., if the file is not a mach-o file) - uint32_t Adler32(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype); - // For the given |cpu_type|, and |cpu_subtype| return the MD5 for the mach-o // data segment(s). // Return true on success, false otherwise @@ -80,10 +67,6 @@ class MachoID { // Signature of class member function to be called with data read from file typedef void (MachoID::*UpdateFunction)(unsigned char* bytes, size_t size); - // Update the CRC value by examining |size| |bytes| and applying the algorithm - // to each byte. - void UpdateCRC(unsigned char* bytes, size_t size); - // Update the MD5 value by examining |size| |bytes| and applying the algorithm // to each byte. void UpdateMD5(unsigned char* bytes, size_t size); @@ -103,10 +86,6 @@ class MachoID { static bool UUIDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset, bool swap, void* context); - // The callback from the MachoWalker for LC_ID_DYLIB - static bool IDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset, - bool swap, void* context); - // File path char path_[PATH_MAX]; @@ -116,9 +95,6 @@ class MachoID { // Size of the memory region size_t memory_size_; - // The current crc value - uint32_t crc_; - // The MD5 context google_breakpad::MD5Context md5_context_; From f6974b15ef96614e9a7df25c3ff31e350bd4e346 Mon Sep 17 00:00:00 2001 From: Adam Duke Date: Thu, 27 Jan 2022 17:21:21 -0500 Subject: [PATCH 051/195] namespace implementations of FileID In trying to create a backend service that can process both ELF and Mach-O binaries, I found that symbol collisions occur when trying to link different implementations of FileID. This change puts the different implementations into separate namespaces to avoid the collision. Change-Id: I15aabb222803f2ffbda15ed13e66793bae32ddce Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3421417 Reviewed-by: Mark Mentovai --- src/client/linux/microdump_writer/microdump_writer.cc | 2 +- src/client/linux/minidump_writer/linux_dumper.cc | 2 ++ .../minidump_writer/linux_ptrace_dumper_unittest.cc | 2 ++ src/client/linux/minidump_writer/minidump_writer.cc | 2 +- .../linux/minidump_writer/minidump_writer_unittest.cc | 2 ++ src/client/mac/handler/minidump_generator.cc | 2 ++ src/client/solaris/handler/minidump_generator.cc | 1 + src/common/linux/dump_symbols.cc | 4 ++-- src/common/linux/file_id.cc | 2 ++ src/common/linux/file_id.h | 2 ++ src/common/linux/file_id_unittest.cc | 2 ++ src/common/mac/dump_syms.cc | 2 +- src/common/mac/file_id.cc | 3 ++- src/common/mac/file_id.h | 2 ++ src/common/solaris/dump_symbols.cc | 2 +- src/common/solaris/file_id.cc | 11 +++++++---- src/common/solaris/file_id.h | 2 ++ 17 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc index fa3c1713a..22edb1b8d 100644 --- a/src/client/linux/microdump_writer/microdump_writer.cc +++ b/src/client/linux/microdump_writer/microdump_writer.cc @@ -49,8 +49,8 @@ namespace { using google_breakpad::auto_wasteful_vector; +using google_breakpad::elf::kDefaultBuildIdSize; using google_breakpad::ExceptionHandler; -using google_breakpad::kDefaultBuildIdSize; using google_breakpad::LinuxDumper; using google_breakpad::LinuxPtraceDumper; using google_breakpad::MappingInfo; diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc index 7fd6532ad..44430c4e9 100644 --- a/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/client/linux/minidump_writer/linux_dumper.cc @@ -53,6 +53,8 @@ #include "google_breakpad/common/minidump_exception_linux.h" #include "third_party/lss/linux_syscall_support.h" +using google_breakpad::elf::FileID; + #if defined(__ANDROID__) // Android packed relocations definitions are not yet available from the diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index da71e15dc..11c392d83 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -63,6 +63,8 @@ #endif using namespace google_breakpad; +using google_breakpad::elf::FileID; +using google_breakpad::elf::kDefaultBuildIdSize; namespace { diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 32634ef00..72a921664 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -83,9 +83,9 @@ namespace { using google_breakpad::AppMemoryList; using google_breakpad::auto_wasteful_vector; +using google_breakpad::elf::kDefaultBuildIdSize; using google_breakpad::ExceptionHandler; using google_breakpad::CpuSet; -using google_breakpad::kDefaultBuildIdSize; using google_breakpad::LineReader; using google_breakpad::LinuxDumper; using google_breakpad::LinuxPtraceDumper; diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index d192e5cbb..b7a2c61e1 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -54,6 +54,8 @@ #include "google_breakpad/processor/minidump.h" using namespace google_breakpad; +using google_breakpad::elf::FileID; +using google_breakpad::elf::kDefaultBuildIdSize; namespace { diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index d6b0561d5..05d91b08e 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -62,6 +62,8 @@ using MacStringUtils::IntegerValueAtIndex; namespace google_breakpad { +using mach_o::FileID; + #if defined(__LP64__) && __LP64__ #define LC_SEGMENT_ARCH LC_SEGMENT_64 #else diff --git a/src/client/solaris/handler/minidump_generator.cc b/src/client/solaris/handler/minidump_generator.cc index 567566655..81a535870 100644 --- a/src/client/solaris/handler/minidump_generator.cc +++ b/src/client/solaris/handler/minidump_generator.cc @@ -47,6 +47,7 @@ namespace { using namespace google_breakpad; +using namespace google_breakpad::elf::FileID; // Argument for the writer function. struct WriterArgument { diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index ac53ea286..75a4ceed2 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -87,11 +87,11 @@ using google_breakpad::DwarfRangeListHandler; using google_breakpad::ElfClass; using google_breakpad::ElfClass32; using google_breakpad::ElfClass64; -using google_breakpad::FileID; +using google_breakpad::elf::FileID; using google_breakpad::FindElfSectionByName; using google_breakpad::GetOffset; using google_breakpad::IsValidElf; -using google_breakpad::kDefaultBuildIdSize; +using google_breakpad::elf::kDefaultBuildIdSize; using google_breakpad::Module; using google_breakpad::PageAllocator; #ifndef NO_STABS_SUPPORT diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc index 9944af7ae..b483eb5c0 100644 --- a/src/common/linux/file_id.cc +++ b/src/common/linux/file_id.cc @@ -49,6 +49,7 @@ #include "third_party/lss/linux_syscall_support.h" namespace google_breakpad { +namespace elf { // Used in a few places for backwards-compatibility. const size_t kMDGUIDSize = sizeof(MDGUID); @@ -198,4 +199,5 @@ string FileID::ConvertIdentifierToString( return bytes_to_hex_string(&identifier[0], identifier.size()); } +} // elf } // namespace google_breakpad diff --git a/src/common/linux/file_id.h b/src/common/linux/file_id.h index 4aff021de..8556a2e5a 100644 --- a/src/common/linux/file_id.h +++ b/src/common/linux/file_id.h @@ -41,6 +41,7 @@ #include "common/using_std_string.h" namespace google_breakpad { +namespace elf { // GNU binutils' ld defaults to 'sha1', which is 160 bits == 20 bytes, // so this is enough to fit that, which most binaries will use. @@ -83,6 +84,7 @@ class FileID { string path_; }; +} // namespace elf } // namespace google_breakpad #endif // COMMON_LINUX_FILE_ID_H__ diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index 8225e5ac8..43c9af7b5 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -50,6 +50,8 @@ #include "breakpad_googletest_includes.h" using namespace google_breakpad; +using google_breakpad::elf::FileID; +using google_breakpad::elf::kDefaultBuildIdSize; using google_breakpad::synth_elf::ELF; using google_breakpad::synth_elf::Notes; using google_breakpad::test_assembler::kLittleEndian; diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index bd69218df..b1cb1a300 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -78,8 +78,8 @@ using google_breakpad::ByteReader; using google_breakpad::DwarfCUToModule; using google_breakpad::DwarfLineToModule; using google_breakpad::DwarfRangeListHandler; -using google_breakpad::FileID; using google_breakpad::mach_o::FatReader; +using google_breakpad::mach_o::FileID; using google_breakpad::mach_o::Section; using google_breakpad::mach_o::Segment; using google_breakpad::Module; diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc index 504e8202d..9ed65e5c8 100644 --- a/src/common/mac/file_id.cc +++ b/src/common/mac/file_id.cc @@ -45,7 +45,7 @@ using MacFileUtilities::MachoID; namespace google_breakpad { - +namespace mach_o { // Constructs a FileID given a path to a file FileID::FileID(const char* path) : memory_(nullptr), size_(0) { snprintf(path_, sizeof(path_), "%s", path); @@ -91,4 +91,5 @@ void FileID::ConvertIdentifierToString(const unsigned char identifier[16], buffer[(buffer_idx < buffer_length) ? buffer_idx : buffer_idx - 1] = 0; } +} // namespace mach_o } // namespace google_breakpad diff --git a/src/common/mac/file_id.h b/src/common/mac/file_id.h index 430d41d5a..fc1821e7f 100644 --- a/src/common/mac/file_id.h +++ b/src/common/mac/file_id.h @@ -39,6 +39,7 @@ #include namespace google_breakpad { +namespace mach_o { class FileID { public: @@ -85,6 +86,7 @@ class FileID { size_t size_; }; +} // namespace mach_o } // namespace google_breakpad #endif // COMMON_MAC_FILE_ID_H__ diff --git a/src/common/solaris/dump_symbols.cc b/src/common/solaris/dump_symbols.cc index 9524a18b5..93aeed243 100644 --- a/src/common/solaris/dump_symbols.cc +++ b/src/common/solaris/dump_symbols.cc @@ -492,7 +492,7 @@ bool WriteModuleInfo(int fd, GElf_Half arch, const std::string& obj_file) { } unsigned char identifier[16]; - google_breakpad::FileID file_id(obj_file.c_str()); + google_breakpad::elf::FileID file_id(obj_file.c_str()); if (file_id.ElfFileIdentifier(identifier)) { char identifier_str[40]; file_id.ConvertIdentifierToString(identifier, diff --git a/src/common/solaris/file_id.cc b/src/common/solaris/file_id.cc index c32c73bb0..837793c86 100644 --- a/src/common/solaris/file_id.cc +++ b/src/common/solaris/file_id.cc @@ -128,10 +128,6 @@ static bool FindElfTextSection(int fd, const void* elf_base, return false; } -FileID::FileID(const char* path) { - strcpy(path_, path); -} - class AutoCloser { public: AutoCloser(int fd) : fd_(fd) {} @@ -140,6 +136,12 @@ class AutoCloser { int fd_; }; +namespace elf { + +FileID::FileID(const char* path) { + strcpy(path_, path); +} + bool FileID::ElfFileIdentifier(unsigned char identifier[16]) { int fd = 0; if ((fd = open(path_, O_RDONLY)) < 0) @@ -194,4 +196,5 @@ bool FileID::ConvertIdentifierToString(const unsigned char identifier[16], return true; } +} // elf } // namespace google_breakpad diff --git a/src/common/solaris/file_id.h b/src/common/solaris/file_id.h index 375e85751..cacf17a96 100644 --- a/src/common/solaris/file_id.h +++ b/src/common/solaris/file_id.h @@ -37,6 +37,7 @@ #include namespace google_breakpad { +namespace elf { class FileID { public: @@ -61,6 +62,7 @@ class FileID { char path_[PATH_MAX]; }; +} // elf } // namespace google_breakpad #endif // COMMON_SOLARIS_FILE_ID_H__ From d55a5f3dcaf515dc07f24bf4d9a83bddc8b82354 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 27 Jan 2022 16:52:13 -0800 Subject: [PATCH 052/195] Make symupload v2 api respect --timeout flag Change-Id: I763f45aa395a56e9c3285544e7755a1e5a85dbe4 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3422007 Reviewed-by: Nelson Billing Reviewed-by: Joshua Peraza --- src/common/windows/symbol_collector_client.cc | 9 ++++++--- src/common/windows/symbol_collector_client.h | 3 +++ src/tools/windows/symupload/symupload.cc | 14 +++++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 30c663ed3..6e871bf0d 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -12,6 +12,7 @@ namespace google_breakpad { bool SymbolCollectorClient::CreateUploadUrl( wstring& api_url, wstring& api_key, + int* timeout_ms, UploadUrlResponse *uploadUrlResponse) { wstring url = api_url + L"/v1/uploads:create" @@ -23,7 +24,7 @@ namespace google_breakpad { url, L"", L"", - NULL, + timeout_ms, &response, &response_code)) { wprintf(L"Failed to create upload url.\n"); @@ -66,6 +67,7 @@ namespace google_breakpad { CompleteUploadResult SymbolCollectorClient::CompleteUpload( wstring& api_url, wstring& api_key, + int* timeout_ms, const wstring& upload_key, const wstring& debug_file, const wstring& debug_id) { @@ -84,7 +86,7 @@ namespace google_breakpad { url, body, L"application/json", - NULL, + timeout_ms, &response, &response_code)) { wprintf(L"Failed to complete upload.\n"); @@ -116,6 +118,7 @@ namespace google_breakpad { SymbolStatus SymbolCollectorClient::CheckSymbolStatus( wstring& api_url, wstring& api_key, + int* timeout_ms, const wstring& debug_file, const wstring& debug_id) { wstring response; @@ -126,7 +129,7 @@ namespace google_breakpad { if (!HTTPUpload::SendGetRequest( url, - NULL, + timeout_ms, &response, &response_code)) { wprintf(L"Failed to check symbol status.\n"); diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h index 30e0cb323..4a85c0529 100644 --- a/src/common/windows/symbol_collector_client.h +++ b/src/common/windows/symbol_collector_client.h @@ -64,6 +64,7 @@ namespace google_breakpad { static bool CreateUploadUrl( wstring& api_url, wstring& api_key, + int* timeout_ms, UploadUrlResponse *uploadUrlResponse); // Notify the API that symbol file upload is finished and its contents @@ -71,6 +72,7 @@ namespace google_breakpad { static CompleteUploadResult CompleteUpload( wstring& api_url, wstring& api_key, + int* timeout_ms, const wstring& upload_key, const wstring& debug_file, const wstring& debug_id); @@ -80,6 +82,7 @@ namespace google_breakpad { static SymbolStatus CheckSymbolStatus( wstring& api_url, wstring& api_key, + int* timeout_ms, const wstring& debug_file, const wstring& debug_id); }; diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index c774b0e7c..3a26ca89b 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -163,6 +163,7 @@ static bool DumpSymbolsToTempFile(const wchar_t* file, static bool DoSymUploadV2( const wchar_t* api_url, const wchar_t* api_key, + int* timeout_ms, const wstring& debug_file, const wstring& debug_id, const wstring& symbol_file, @@ -174,6 +175,7 @@ static bool DoSymUploadV2( SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus( url, key, + timeout_ms, debug_file, debug_id); if (symbolStatus == SymbolStatus::Found) { @@ -191,6 +193,7 @@ static bool DoSymUploadV2( if (!SymbolCollectorClient::CreateUploadUrl( url, key, + timeout_ms, &uploadUrlResponse)) { wprintf(L"Failed to create upload URL.\n"); return false; @@ -203,7 +206,7 @@ static bool DoSymUploadV2( bool success = HTTPUpload::SendPutRequest( signed_url, symbol_file, - /* timeout = */ NULL, + timeout_ms, &response, &response_code); if (!success) { @@ -228,6 +231,7 @@ static bool DoSymUploadV2( SymbolCollectorClient::CompleteUpload( url, key, + timeout_ms, upload_key, debug_file, debug_id); @@ -339,12 +343,8 @@ int wmain(int argc, wchar_t* argv[]) { api_key = argv[currentarg++]; success = DoSymUploadV2( - api_url, - api_key, - pdb_info.debug_file, - pdb_info.debug_identifier, - symbol_file, - force); + api_url, api_key, timeout == -1 ? nullptr : &timeout, + pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, force); } else { printUsageAndExit(); } From 08bd844599bf04c71707e8f59a8013a941264695 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 28 Jan 2022 16:49:10 -0800 Subject: [PATCH 053/195] Fix corner cases on Windows dump_syms - don't do iter decrement when the map empty. - add dummy file with id equals to 0 to represent unknown file. Change-Id: I3fe55a459c9fa835bbe0c4272e4ac12b1150c034 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425732 Reviewed-by: Joshua Peraza --- src/common/windows/pdb_source_line_writer.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index ca0c6a39a..25a1ca053 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -343,8 +343,10 @@ void PDBSourceLineWriter::Lines::AddLine(const Line& line) { do { auto iter = line_map_.lower_bound(line.rva); if (iter == line_map_.end()) { - --iter; - intercept(iter->second); + if (!line_map_.empty()) { + --iter; + intercept(iter->second); + } break; } is_intercept = false; @@ -570,6 +572,10 @@ bool PDBSourceLineWriter::PrintSourceFiles() { return false; } + // Print a dummy file with id equals 0 to represent unknown file, because + // inline records might have unknown call site. + fwprintf(output_, L"FILE %d unknown file\n", 0); + CComPtr compiland; ULONG count; while (SUCCEEDED(compilands->Next(1, &compiland, &count)) && count == 1) { From 8205b6edb87f74fa1f6cfb861daa5da55253d0ad Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Mon, 31 Jan 2022 19:07:58 +0000 Subject: [PATCH 054/195] The X86 stack walker was doing an illegal down cast from base-class (StackFrame) to derived-class (StackFrameX86). Inline frames are always of the base-class type (StackFrame). Treating them as derived-class and accessing members was causing heap buffer overflows. Change-Id: Id4122ab6a31f016933038a1cb63d45d5c38481f5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425445 Reviewed-by: Joshua Peraza --- src/processor/stackwalker_x86.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc index b11e061d4..c11a04d5c 100644 --- a/src/processor/stackwalker_x86.cc +++ b/src/processor/stackwalker_x86.cc @@ -141,6 +141,9 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo( bool stack_scan_allowed) { StackFrame::FrameTrust trust = StackFrame::FRAME_TRUST_NONE; + // The last frame can never be inline. A sequence of inline frames always + // finishes with a conventional frame. + assert(frames.back()->trust != StackFrame::FRAME_TRUST_INLINE); StackFrameX86* last_frame = static_cast(frames.back()); // Save the stack walking info we found, in case we need it later to @@ -187,9 +190,15 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo( uint32_t last_frame_callee_parameter_size = 0; int frames_already_walked = frames.size(); - if (frames_already_walked >= 2) { + for (int last_frame_callee_id = frames_already_walked - 2; + last_frame_callee_id >= 0; last_frame_callee_id--) { + // Searching for a real callee frame. Skipping inline frames since they + // cannot be downcasted to StackFrameX86. + if (frames[last_frame_callee_id]->trust == StackFrame::FRAME_TRUST_INLINE) { + continue; + } const StackFrameX86* last_frame_callee - = static_cast(frames[frames_already_walked - 2]); + = static_cast(frames[last_frame_callee_id]); WindowsFrameInfo* last_frame_callee_info = last_frame_callee->windows_frame_info; if (last_frame_callee_info && @@ -516,6 +525,9 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo( StackFrameX86* StackwalkerX86::GetCallerByCFIFrameInfo( const vector& frames, CFIFrameInfo* cfi_frame_info) { + // The last frame can never be inline. A sequence of inline frames always + // finishes with a conventional frame. + assert(frames.back()->trust != StackFrame::FRAME_TRUST_INLINE); StackFrameX86* last_frame = static_cast(frames.back()); last_frame->cfi_frame_info = cfi_frame_info; @@ -542,6 +554,9 @@ StackFrameX86* StackwalkerX86::GetCallerByEBPAtBase( const vector& frames, bool stack_scan_allowed) { StackFrame::FrameTrust trust; + // The last frame can never be inline. A sequence of inline frames always + // finishes with a conventional frame. + assert(frames.back()->trust != StackFrame::FRAME_TRUST_INLINE); StackFrameX86* last_frame = static_cast(frames.back()); uint32_t last_esp = last_frame->context.esp; uint32_t last_ebp = last_frame->context.ebp; @@ -634,6 +649,9 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack* stack, const vector& frames = *stack->frames(); StackFrameX86* last_frame = static_cast(frames.back()); + // The last frame can never be inline. A sequence of inline frames always + // finishes with a conventional frame. + assert(last_frame->trust != StackFrame::FRAME_TRUST_INLINE); scoped_ptr new_frame; // If the resolver has Windows stack walking information, use that. From 3123f102ff92755ae5c7a40cd386d17f890124b7 Mon Sep 17 00:00:00 2001 From: Takuto Ikuta Date: Fri, 4 Feb 2022 12:52:34 +0900 Subject: [PATCH 055/195] include memory header when using unique_ptr This is to fix build error on Windows. Bug: chromium:1294084 Change-Id: I8e6a2e46d53d6f5b02343b81cfaa078580a8326d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3438886 Reviewed-by: Joshua Peraza --- src/common/windows/pdb_source_line_writer.h | 1 + src/common/windows/pe_util.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h index 091700a73..42bd94d95 100644 --- a/src/common/windows/pdb_source_line_writer.h +++ b/src/common/windows/pdb_source_line_writer.h @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc index 9c94af05f..dea9b9118 100644 --- a/src/common/windows/pe_util.cc +++ b/src/common/windows/pe_util.cc @@ -35,6 +35,7 @@ #include #include +#include #include "common/windows/string_utils-inl.h" #include "common/windows/guid_string.h" From 7685201906b55d93be6151fa4681e8b24d6c9c74 Mon Sep 17 00:00:00 2001 From: Nathan Scoglio Date: Fri, 4 Feb 2022 14:24:50 -0800 Subject: [PATCH 056/195] Add support for product_name in Mac sym_upload v2 Change-Id: I6fab9f62434fd19eb7aea4a66f0dd809af57e595 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3436859 Reviewed-by: Nelson Billing Reviewed-by: Mark Mentovai --- src/common/mac/SymbolCollectorClient.h | 3 ++- src/common/mac/SymbolCollectorClient.m | 18 +++++++++++------- src/tools/mac/symupload/symupload.mm | 22 +++++++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/common/mac/SymbolCollectorClient.h b/src/common/mac/SymbolCollectorClient.h index 9e955c8e2..8848cca6a 100644 --- a/src/common/mac/SymbolCollectorClient.h +++ b/src/common/mac/SymbolCollectorClient.h @@ -96,7 +96,8 @@ typedef NS_ENUM(NSInteger, SymbolStatus) { withUploadKey:(NSString*)uploadKey withDebugFile:(NSString*)debugFile withDebugID:(NSString*)debugID - withType:(NSString*)type; + withType:(NSString*)type + withProductName:(NSString*)productName; @end diff --git a/src/common/mac/SymbolCollectorClient.m b/src/common/mac/SymbolCollectorClient.m index 5926d2ad2..ae2e2db38 100644 --- a/src/common/mac/SymbolCollectorClient.m +++ b/src/common/mac/SymbolCollectorClient.m @@ -190,18 +190,22 @@ + (CompleteUploadResult)completeUploadOnServer:(NSString*)APIURL withUploadKey:(NSString*)uploadKey withDebugFile:(NSString*)debugFile withDebugID:(NSString*)debugID - withType:(NSString*)type { + withType:(NSString*)type + withProductName:(NSString*)productName { NSURL* URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/v1/uploads/%@:complete?key=%@", APIURL, uploadKey, APIKey]]; - NSDictionary* symbolIdDictionary = - [NSDictionary dictionaryWithObjectsAndKeys:debugFile, @"debug_file", - debugID, @"debug_id", nil]; - NSDictionary* jsonDictionary = [NSDictionary - dictionaryWithObjectsAndKeys:symbolIdDictionary, @"symbol_id", type, - @"symbol_upload_type", nil]; + NSMutableDictionary* jsonDictionary = [@{ + @"symbol_id" : @{@"debug_file" : debugFile, @"debug_id" : debugID}, + @"symbol_upload_type" : type + } mutableCopy]; + + if (productName != nil) { + jsonDictionary[@"metadata"] = @{@"product_name": productName}; + } + NSError* error = nil; NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonDictionary diff --git a/src/tools/mac/symupload/symupload.mm b/src/tools/mac/symupload/symupload.mm index 10cf293df..727834ce5 100644 --- a/src/tools/mac/symupload/symupload.mm +++ b/src/tools/mac/symupload/symupload.mm @@ -73,6 +73,7 @@ NSString* type; NSString* codeFile; NSString* debugID; + NSString* productName; } Options; //============================================================================= @@ -212,7 +213,8 @@ static void StartSymUploadProtocolV2(Options* options, withUploadKey:[URLResponse uploadKey] withDebugFile:debugFile withDebugID:debugID - withType:options->type]; + withType:options->type + withProductName:options->productName]; [URLResponse release]; if (completeUploadResult == CompleteUploadResultError) { fprintf(stdout, "Failed to complete upload.\n"); @@ -271,18 +273,20 @@ static void Usage(int argc, const char* argv[]) { "[Only in sym-upload-v2 protocol mode]\n"); fprintf( stderr, - "-t:\t Explicitly set symbol upload type (" + "\t-t: Explicitly set symbol upload type (" "default is 'breakpad').\n" "\t One of ['breakpad', 'elf', 'pe', 'macho', 'debug_only', 'dwp', " "'dsym', 'pdb'].\n" "\t Note: When this flag is set to anything other than 'breakpad', then " "the '-c' and '-i' flags must also be set.\n"); - fprintf(stderr, "-c:\t Explicitly set 'code_file' for symbol " + fprintf(stderr, "\t-c: Explicitly set 'code_file' for symbol " "upload (basename of executable).\n"); - fprintf(stderr, "-i:\t Explicitly set 'debug_id' for symbol " + fprintf(stderr, "\t-i: Explicitly set 'debug_id' for symbol " "upload (typically build ID of executable). The debug-id for " "symbol-types 'dsym' and 'macho' will be determined " "automatically. \n"); + fprintf(stderr, "\t-n: Optionally set 'product_name' for " + "symbol upload\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); fprintf(stderr, "\n"); @@ -329,11 +333,12 @@ static void SetupOptions(int argc, const char* argv[], Options* options) { options->codeFile = nil; options->debugID = nil; options->force = NO; + options->productName = nil; extern int optind; int ch; - while ((ch = getopt(argc, (char* const*)argv, "p:k:t:c:i:hf?")) != -1) { + while ((ch = getopt(argc, (char* const*)argv, "p:k:t:c:i:n:hf?")) != -1) { switch (ch) { case 'p': if (strcmp(optarg, "sym-upload-v2") == 0) { @@ -362,12 +367,15 @@ static void SetupOptions(int argc, const char* argv[], Options* options) { case 'c': options->codeFile = [NSString stringWithCString:optarg encoding:NSASCIIStringEncoding]; - ; break; case 'i': options->debugID = [NSString stringWithCString:optarg encoding:NSASCIIStringEncoding]; - ; + break; + case 'n': + options->productName = + [NSString stringWithCString:optarg + encoding:NSASCIIStringEncoding]; break; case 'f': options->force = YES; From 4708e6fb8be10fd431237b9b74012816e512ee3f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 7 Feb 2022 13:00:17 -0500 Subject: [PATCH 057/195] github: update to latest coverity scan action This simplifies the action code a bit. Change-Id: Ibd6ce393ab2d09b0b6e91cecb3a78a33a18de7c0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3443961 Reviewed-by: Joshua Peraza --- .github/workflows/coverity.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index cfa0f2ab5..06f8e2763 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -1,7 +1,7 @@ # GitHub actions workflow. # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# https://scan.coverity.com/projects/gentoo-pax-utils +# https://scan.coverity.com/projects/google-breakpad name: Coverity Scan on: @@ -36,9 +36,8 @@ jobs: - run: ./configure --disable-silent-rules working-directory: src - - uses: vapier/coverity-scan-action@v0 + - uses: vapier/coverity-scan-action@v1 with: - project: google%2Fbreakpad command: make -C src -O -j$(getconf _NPROCESSORS_CONF) - email: google-breakpad-dev@googlegroups.com + email: ${{ secrets.COVERITY_SCAN_EMAIL }} token: ${{ secrets.COVERITY_SCAN_TOKEN }} From 34af6bcff113f26e0a27eb98f1b86228b5870844 Mon Sep 17 00:00:00 2001 From: Sunbreak Date: Tue, 16 Nov 2021 10:23:37 +0800 Subject: [PATCH 058/195] Fix missing header for Windows dump_syms Change-Id: Ia58efa4ec5b30f644f8114eab85ef589271291dd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3271972 Reviewed-by: Nelson Billing Reviewed-by: Mark Mentovai --- src/tools/windows/dump_syms/dump_syms.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc index fa4980fc7..672e27d34 100644 --- a/src/tools/windows/dump_syms/dump_syms.cc +++ b/src/tools/windows/dump_syms/dump_syms.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include "common/windows/pdb_source_line_writer.h" From fc1b9d3203ecb505154afdb70702864605c99918 Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Thu, 17 Feb 2022 03:18:03 +0000 Subject: [PATCH 059/195] Populating is_multiple in google_breakpad::StackFrame from symbol files. This is needed in order to properly detect and highlight frames that correspond to multiple functions, for example as the result of identical code folding by the linker. Bug: google-breakpad:751 Change-Id: I2ee7c147fcff6493c2454383ad5422b38269759a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3471034 Reviewed-by: Joshua Peraza --- src/google_breakpad/processor/stack_frame.h | 9 +++++++- src/processor/basic_source_line_resolver.cc | 2 ++ .../basic_source_line_resolver_unittest.cc | 22 ++++++++++++------- src/processor/fast_source_line_resolver.cc | 2 ++ .../fast_source_line_resolver_unittest.cc | 8 ++++++- src/processor/testdata/module1.out | 4 ++-- 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/google_breakpad/processor/stack_frame.h b/src/google_breakpad/processor/stack_frame.h index 5f3932b68..18e95fbcf 100644 --- a/src/google_breakpad/processor/stack_frame.h +++ b/src/google_breakpad/processor/stack_frame.h @@ -63,7 +63,8 @@ struct StackFrame { source_file_name(), source_line(0), source_line_base(), - trust(FRAME_TRUST_NONE){} + trust(FRAME_TRUST_NONE), + is_multiple(false) {} virtual ~StackFrame() {} // Return a string describing how this stack frame was found @@ -140,6 +141,12 @@ struct StackFrame { // Amount of trust the stack walker has in the instruction pointer // of this frame. FrameTrust trust; + + // True if the frame corresponds to multiple functions, for example as the + // result of identical code folding by the linker. In that case the function + // name, filename, etc. information above represents the state of an arbitrary + // one of these functions. + bool is_multiple; }; } // namespace google_breakpad diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index dccbd74bf..e525d4f9e 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -319,6 +319,7 @@ void BasicSourceLineResolver::Module::LookupAddress( address >= function_base && address - function_base < function_size) { frame->function_name = func->name; frame->function_base = frame->module->base_address() + function_base; + frame->is_multiple = func->is_multiple; linked_ptr line; MemAddr line_base; @@ -341,6 +342,7 @@ void BasicSourceLineResolver::Module::LookupAddress( (!func.get() || public_address > function_base)) { frame->function_name = public_symbol->name; frame->function_base = frame->module->base_address() + public_address; + frame->is_multiple = public_symbol->is_multiple; } } diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index e608a5485..a9f1a886a 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -52,7 +52,6 @@ using google_breakpad::CodeModule; using google_breakpad::MemoryRegion; using google_breakpad::StackFrame; using google_breakpad::WindowsFrameInfo; -using google_breakpad::linked_ptr; using google_breakpad::scoped_ptr; using google_breakpad::SymbolParseHelper; @@ -93,12 +92,12 @@ class MockMemoryRegion: public MemoryRegion { } bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const { switch (address) { - case 0x10008: *value = 0x98ecadc3; break; // saved %ebx - case 0x1000c: *value = 0x878f7524; break; // saved %esi - case 0x10010: *value = 0x6312f9a5; break; // saved %edi - case 0x10014: *value = 0x10038; break; // caller's %ebp - case 0x10018: *value = 0xf6438648; break; // return address - default: *value = 0xdeadbeef; break; // junk + case 0x10008: *value = 0x98ecadc3; break; // saved %ebx + case 0x1000c: *value = 0x878f7524; break; // saved %esi + case 0x10010: *value = 0x6312f9a5; break; // saved %edi + case 0x10014: *value = 0x10038; break; // caller's %ebp + case 0x10018: *value = 0xf6438648; break; // return address + default: *value = 0xdeadbeef; break; // junk } return true; } @@ -164,7 +163,7 @@ static void ClearSourceLineInfo(StackFrame* frame) { } class TestBasicSourceLineResolver : public ::testing::Test { -public: + public: void SetUp() { testdata_dir = string(getenv("srcdir") ? getenv("srcdir") : ".") + "/src/processor/testdata"; @@ -196,6 +195,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve) ASSERT_TRUE(frame.source_file_name.empty()); ASSERT_EQ(frame.source_line, 0); ASSERT_EQ(frame.source_line_base, 0U); + EXPECT_EQ(frame.is_multiple, false); frame.module = &module1; resolver.FillSourceLineInfo(&frame, nullptr); @@ -206,6 +206,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve) ASSERT_EQ(frame.source_file_name, "file1_1.cc"); ASSERT_EQ(frame.source_line, 44); ASSERT_EQ(frame.source_line_base, 0x1000U); + EXPECT_EQ(frame.is_multiple, true); windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame)); ASSERT_TRUE(windows_frame_info.get()); ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA); @@ -344,6 +345,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve) frame.module = &module1; resolver.FillSourceLineInfo(&frame, nullptr); ASSERT_EQ(frame.function_name, string("PublicSymbol")); + EXPECT_EQ(frame.is_multiple, true); frame.instruction = 0x4000; frame.module = &module1; @@ -360,6 +362,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve) ASSERT_EQ(frame.source_file_name, "file2_2.cc"); ASSERT_EQ(frame.source_line, 21); ASSERT_EQ(frame.source_line_base, 0x2180U); + EXPECT_EQ(frame.is_multiple, false); windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame)); ASSERT_TRUE(windows_frame_info.get()); ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA); @@ -368,6 +371,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve) frame.instruction = 0x216f; resolver.FillSourceLineInfo(&frame, nullptr); ASSERT_EQ(frame.function_name, "Public2_1"); + EXPECT_EQ(frame.is_multiple, false); ClearSourceLineInfo(&frame); frame.instruction = 0x219f; @@ -431,6 +435,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveOldInlines) { ASSERT_EQ(frame.source_file_name, "linux_inline.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); + EXPECT_EQ(frame.is_multiple, false); ASSERT_EQ(inlined_frames.size(), 3UL); @@ -475,6 +480,7 @@ TEST_F(TestBasicSourceLineResolver, TestLoadAndResolveNewInlines) { ASSERT_EQ(frame.source_file_name, "a.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); + EXPECT_EQ(frame.is_multiple, false); ASSERT_EQ(inlined_frames.size(), 3UL); diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 81a6b7acf..1fbe06fac 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -88,6 +88,7 @@ void FastSourceLineResolver::Module::LookupAddress( func->CopyFrom(func_ptr); frame->function_name = func->name; frame->function_base = frame->module->base_address() + function_base; + frame->is_multiple = func->is_multiple; scoped_ptr line(new Line); const Line* line_ptr = 0; @@ -112,6 +113,7 @@ void FastSourceLineResolver::Module::LookupAddress( public_symbol->CopyFrom(public_symbol_ptr); frame->function_name = public_symbol->name; frame->function_base = frame->module->base_address() + public_address; + frame->is_multiple = public_symbol->is_multiple; } } diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc index a8e224085..6ef443caa 100644 --- a/src/processor/fast_source_line_resolver_unittest.cc +++ b/src/processor/fast_source_line_resolver_unittest.cc @@ -64,7 +64,6 @@ using google_breakpad::CodeModule; using google_breakpad::MemoryRegion; using google_breakpad::StackFrame; using google_breakpad::WindowsFrameInfo; -using google_breakpad::linked_ptr; using google_breakpad::scoped_ptr; class TestCodeModule : public CodeModule { @@ -224,6 +223,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { ASSERT_TRUE(frame.source_file_name.empty()); ASSERT_EQ(frame.source_line, 0); ASSERT_EQ(frame.source_line_base, 0U); + ASSERT_EQ(frame.is_multiple, false); frame.module = &module1; fast_resolver.FillSourceLineInfo(&frame, nullptr); @@ -234,6 +234,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { ASSERT_EQ(frame.source_file_name, "file1_1.cc"); ASSERT_EQ(frame.source_line, 44); ASSERT_EQ(frame.source_line_base, 0x1000U); + ASSERT_EQ(frame.is_multiple, true); windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame)); ASSERT_TRUE(windows_frame_info.get()); ASSERT_FALSE(windows_frame_info->allocates_base_pointer); @@ -371,6 +372,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { frame.module = &module1; fast_resolver.FillSourceLineInfo(&frame, nullptr); ASSERT_EQ(frame.function_name, string("PublicSymbol")); + EXPECT_EQ(frame.is_multiple, true); frame.instruction = 0x4000; frame.module = &module1; @@ -387,6 +389,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { ASSERT_EQ(frame.source_file_name, "file2_2.cc"); ASSERT_EQ(frame.source_line, 21); ASSERT_EQ(frame.source_line_base, 0x2180U); + ASSERT_EQ(frame.is_multiple, false); windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame)); ASSERT_TRUE(windows_frame_info.get()); ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA); @@ -395,6 +398,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) { frame.instruction = 0x216f; fast_resolver.FillSourceLineInfo(&frame, nullptr); ASSERT_EQ(frame.function_name, "Public2_1"); + EXPECT_EQ(frame.is_multiple, false); ClearSourceLineInfo(&frame); frame.instruction = 0x219f; @@ -433,6 +437,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolveOldInlines) { ASSERT_EQ(frame.source_file_name, "linux_inline.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); + ASSERT_EQ(frame.is_multiple, false); ASSERT_EQ(inlined_frames.size(), 3UL); @@ -484,6 +489,7 @@ TEST_F(TestFastSourceLineResolver, TestLoadAndResolveNewInlines) { ASSERT_EQ(frame.source_file_name, "a.cpp"); ASSERT_EQ(frame.source_line, 42); ASSERT_EQ(frame.source_line_base, 0x161b6U); + ASSERT_EQ(frame.is_multiple, false); ASSERT_EQ(inlined_frames.size(), 3UL); diff --git a/src/processor/testdata/module1.out b/src/processor/testdata/module1.out index cd6e18d10..6774e4f1e 100644 --- a/src/processor/testdata/module1.out +++ b/src/processor/testdata/module1.out @@ -3,7 +3,7 @@ INFO CODE_ID FFFFFFFF module1.exe FILE 1 file1_1.cc FILE 2 file1_2.cc FILE 3 file1_3.cc -FUNC 1000 c 0 Function1_1 +FUNC m 1000 c 0 Function1_1 1000 4 44 1 1004 4 45 1 1008 4 46 1 @@ -14,7 +14,7 @@ FUNC 1200 100 8 Function1_3 FUNC 1300 100 c Function1_4 FUNC 2000 0 0 Test_Zero_Size_Function_Is_Ignored 2000 4 88 2 -PUBLIC 2800 0 PublicSymbol +PUBLIC m 2800 0 PublicSymbol FUNC 3000 7000 42 LargeFunction 3000 7000 4098359 3 STACK WIN 4 1000 c 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ = From 8e73e40c8cdf07af91cd5a32f388b2423a8d4f5c Mon Sep 17 00:00:00 2001 From: Deepanjan Roy Date: Wed, 23 Feb 2022 16:39:31 -0500 Subject: [PATCH 060/195] Fix table formatting of symbol_files.md Change-Id: I4c5d2e2d77d27204fdc71d6720ea91abe18fb706 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3485498 Reviewed-by: Lei Zhang --- docs/symbol_files.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/symbol_files.md b/docs/symbol_files.md index 237b6567f..bda4d6b3f 100644 --- a/docs/symbol_files.md +++ b/docs/symbol_files.md @@ -62,16 +62,25 @@ for _name_. * The _operatingsystem_ field names the operating system on which the executable or shared library was intended to run. This field should have one - of the following values: | **Value** | **Meaning** | - |:----------|:--------------------| | Linux | Linux | | mac | Macintosh OSX - | | windows | Microsoft Windows | + of the following values: + + | **Value** | **Meaning** | + |:----------|:--------------------| + | Linux | Linux | + | mac | Macintosh OSX | + | windows | Microsoft Windows | * The _architecture_ field indicates what processor architecture the executable or shared library contains machine code for. This field should - have one of the following values: | **Value** | **Instruction Set - Architecture** | |:----------|:---------------------------------| | x86 | - Intel IA-32 | | x86\_64 | AMD64/Intel 64 | | ppc | 32-bit PowerPC | | ppc64 - | 64-bit PowerPC | | unknown | unknown | + have one of the following values: + + | **Value** | **Instruction Set Architecture** | + |:----------|:---------------------------------| + | x86 | Intel IA-32 | + | x86\_64 | AMD64/Intel 64 | + | ppc | 32-bit PowerPC | + | ppc64 | 64-bit PowerPC | + | unknown | unknown | * The _id_ field is a sequence of hexadecimal digits that identifies the exact executable or library whose contents the symbol file describes. The way in From 1da39e3a902bd5f38bf9927ac777a5384f6c0033 Mon Sep 17 00:00:00 2001 From: Deepanjan Roy Date: Wed, 23 Feb 2022 16:48:53 -0500 Subject: [PATCH 061/195] Fix another table formatting issue in symbol_files.md This looked fine in the source but gitiles is very particular about its table syntax. Change-Id: I9ca8d61a5ca9656bc4f62297861540473485091a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3485499 Reviewed-by: Lei Zhang --- docs/symbol_files.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/symbol_files.md b/docs/symbol_files.md index bda4d6b3f..1a83ce082 100644 --- a/docs/symbol_files.md +++ b/docs/symbol_files.md @@ -405,14 +405,14 @@ func+22: pc = *sp; sp += 4 ; pop return address and jump to it The following table would describe the function above: -**code address** | **.cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **.ra** -:--------------- | :------- | :---------------------- | :---------------------- | :-- | :------- -func+0 | sp | | | | `cfa[0]` -func+1 | sp+16 | | | | `cfa[0]` -func+2 | sp+16 | `cfa[-4]` | | | `cfa[0]` -func+11 | sp+20 | `cfa[-4]` | | | `cfa[0]` -func+21 | sp+20 | | | | `cfa[0]` -func+22 | sp | | | | `cfa[0]` +| **code address** | **.cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **.ra** | +|:-----------------|:---------|:------------------------|:------------------------|:----|:---------| +| func+0 | sp | | | | `cfa[0]` | +| func+1 | sp+16 | | | | `cfa[0]` | +| func+2 | sp+16 | `cfa[-4]` | | | `cfa[0]` | +| func+11 | sp+20 | `cfa[-4]` | | | `cfa[0]` | +| func+21 | sp+20 | | | | `cfa[0]` | +| func+22 | sp | | | | `cfa[0]` | Some things to note here: @@ -447,14 +447,14 @@ To save space, the most common type of CFI record only mentions the table entries at which changes take place. So for the above, the CFI data would only actually mention the non-blank entries here: -**insn** | **cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **ra** -:------- | :------ | :---------------------- | :---------------------- | :-- | :------- -func+0 | sp | | | | `cfa[0]` -func+1 | sp+16 | | | | -func+2 | | `cfa[-4]` | | | -func+11 | sp+20 | | | | -func+21 | | r0 (on Google Code) | | | -func+22 | sp | | | | +| **insn** | **cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **ra** | +|:---------|:--------|:------------------------|:------------------------|:----|:---------| +| func+0 | sp | | | | `cfa[0]` | +| func+1 | sp+16 | | | | | +| func+2 | | `cfa[-4]` | | | | +| func+11 | sp+20 | | | | | +| func+21 | | r0 (on Google Code) | | | | +| func+22 | sp | | | | | A `STACK CFI INIT` record indicates that, at the machine instruction at _address_, belonging to some function, the value that _registern_ had From 88f5fc451ebdede7341cefe349dd63fed886f140 Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Thu, 24 Feb 2022 02:53:01 +0000 Subject: [PATCH 062/195] Never use frame pointer unwinding on a Windows x64 stack. MSVC never generates code that works with frame pointer chasing, and LLVM does the same. Change-Id: I9943160d200509c079fb91394c1a5d789dc188e5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3486523 Reviewed-by: Mark Mentovai --- src/processor/stackwalker_amd64.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index f346a4eee..6e2f86b43 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -289,7 +289,10 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack, new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get())); // If CFI was not available or failed, try using frame pointer recovery. - if (!new_frame.get()) { + // Never try to use frame pointer unwinding on Windows x64 stack. MSVC never + // generates code that works with frame pointer chasing, and LLVM does the + // same. Stack scanning would be better. + if (!new_frame.get() && system_info_->os_short != "windows") { new_frame.reset(GetCallerByFramePointerRecovery(frames)); } From 622a582fa684085811bd34d58494792446b7c98b Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Thu, 24 Feb 2022 20:49:43 +0000 Subject: [PATCH 063/195] Support for leaf functions which don't touch any callee-saved registers for Windows x64 stacks. According to https://reviews.llvm.org/D2474, LLVM does't generate unwind info for leaf function which doesn't touch any callee-saved registers. According to MSDN, leaf functions can be unwound simply by simulating a return. Change-Id: Ic0503e2aca90b0ba5799133ea8439f1b5f2eefda Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3489332 Reviewed-by: Mark Mentovai Reviewed-by: Joshua Peraza --- src/google_breakpad/processor/stack_frame.h | 11 ++++-- src/processor/stackwalker_amd64.cc | 41 ++++++++++++++++++++- src/processor/stackwalker_amd64.h | 5 +++ 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/google_breakpad/processor/stack_frame.h b/src/google_breakpad/processor/stack_frame.h index 18e95fbcf..7d5682a7d 100644 --- a/src/google_breakpad/processor/stack_frame.h +++ b/src/google_breakpad/processor/stack_frame.h @@ -50,9 +50,12 @@ struct StackFrame { FRAME_TRUST_CFI_SCAN, // Found while scanning stack using call frame info FRAME_TRUST_FP, // Derived from frame pointer FRAME_TRUST_CFI, // Derived from call frame info - FRAME_TRUST_PREWALKED, // Explicitly provided by some external stack walker. + // Explicitly provided by some external stack walker. + FRAME_TRUST_PREWALKED, FRAME_TRUST_CONTEXT, // Given as instruction pointer in a context - FRAME_TRUST_INLINE // Found by inline records in symbol files. + FRAME_TRUST_INLINE, // Found by inline records in symbol files. + // Derived from leaf function by simulating a return. + FRAME_TRUST_LEAF, }; StackFrame() @@ -85,7 +88,9 @@ struct StackFrame { return "stack scanning"; case StackFrame::FRAME_TRUST_INLINE: return "inline record"; - default: + case StackFrame::FRAME_TRUST_LEAF: + return "simulating a return from leaf function"; + default: return "unknown"; } } diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index 6e2f86b43..0fc22a4f9 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -221,6 +221,35 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery( return NULL; } +StackFrameAMD64* StackwalkerAMD64::GetCallerBySimulatingReturn( + const vector& frames) { + assert(frames.size() == 1); + StackFrameAMD64* last_frame = static_cast(frames.back()); + uint64_t last_rsp = last_frame->context.rsp; + uint64_t caller_rip_address, caller_rip; + int searchwords = 1; + if (!ScanForReturnAddress(last_rsp, &caller_rip_address, &caller_rip, + searchwords)) { + // No plausible return address at the top of the stack. Unable to simulate + // a return. + return NULL; + } + + // Create a new stack frame (ownership will be transferred to the caller) + // and fill it in. + StackFrameAMD64* frame = new StackFrameAMD64(); + + frame->trust = StackFrame::FRAME_TRUST_LEAF; + frame->context = last_frame->context; + frame->context.rip = caller_rip; + // The caller's %rsp is directly underneath the return address pushed by + // the call. + frame->context.rsp = caller_rip_address + 8; + frame->context_validity = last_frame->context_validity; + + return frame; +} + StackFrameAMD64* StackwalkerAMD64::GetCallerByStackScan( const vector& frames) { StackFrameAMD64* last_frame = static_cast(frames.back()); @@ -282,12 +311,22 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack, StackFrameAMD64* last_frame = static_cast(frames.back()); scoped_ptr new_frame; - // If we have DWARF CFI information, use it. + // If we have CFI information, use it. scoped_ptr cfi_frame_info( frame_symbolizer_->FindCFIFrameInfo(last_frame)); if (cfi_frame_info.get()) new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get())); + // If CFI was not available and this is a Windows x64 stack, check whether + // this is a leaf function which doesn't touch any callee-saved registers. + // According to https://reviews.llvm.org/D24748, LLVM doesn't generate unwind + // info for such functions. According to MSDN, leaf functions can be unwound + // simply by simulating a return. + if (!new_frame.get() && stack->frames()->size() == 1 && + system_info_->os_short == "windows") { + new_frame.reset(GetCallerBySimulatingReturn(frames)); + } + // If CFI was not available or failed, try using frame pointer recovery. // Never try to use frame pointer unwinding on Windows x64 stack. MSVC never // generates code that works with frame pointer chasing, and LLVM does the diff --git a/src/processor/stackwalker_amd64.h b/src/processor/stackwalker_amd64.h index 5e1af6f13..784010388 100644 --- a/src/processor/stackwalker_amd64.h +++ b/src/processor/stackwalker_amd64.h @@ -90,6 +90,11 @@ class StackwalkerAMD64 : public Stackwalker { // of the returned frame. Return NULL on failure. StackFrameAMD64* GetCallerByStackScan(const vector& frames); + // Trying to simulate a return. The caller takes ownership of the returned + // frame. Return NULL on failure. + StackFrameAMD64* GetCallerBySimulatingReturn( + const vector& frames); + // Stores the CPU context corresponding to the innermost stack frame to // be returned by GetContextFrame. const MDRawContextAMD64* context_; From 42d24756174947921d282ee87e2b8e48f6eed3bf Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 8 Nov 2021 14:42:48 -0800 Subject: [PATCH 064/195] Add doc for INLINE and INLINE_ORIGIN records in symbol file Change-Id: Iacf98d4e1a6f4c75e552eaa879f330be7976547e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3268351 Reviewed-by: Joshua Peraza --- docs/symbol_files.md | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/symbol_files.md b/docs/symbol_files.md index 1a83ce082..89cc9d2d6 100644 --- a/docs/symbol_files.md +++ b/docs/symbol_files.md @@ -105,6 +105,22 @@ which other records (line records, in particular) can use to refer to that file name. The _number_ field is a decimal number. The _name_ field is the name of the file; it may contain spaces. +# `INLINE_ORIGIN` records + +An `INLINE_ORIGIN` record holds an inline function name for `INLINE` records to +refer to. It has the form: + +> `INLINE_ORIGIN` _number_ _name_ + +For example: `INLINE_ORIGIN 2 nsQueryInterfaceWithError::operator()(nsID const&, +void**) const +` + +An `INLINE_ORIGIN` record provides the name of an inline function, and assigns +it a number which other records (`INLINE` records, in particular) can use to +refer to that function name. The _number_ field is a decimal number. The _name_ +field is the name of the inline function; it may contain spaces. + # `FUNC` records A `FUNC` record describes a source-language function. It has the form: @@ -136,6 +152,49 @@ The _name_ field is the name of the function. In languages that use linker symbol name mangling like C++, this should be the source language name (the "unmangled" form). This field may contain spaces. +# `INLINE` records + +An `INLINE` record describes the inline function's nest level, call site line +and call site source file to which the given ranges of machine code should be +attributed. It has the form: + +> `INLINE` _inline_nest_level_ _call_site_line_ _call_site_file_num_ +> _origin_num_ [_address_ _size_]+ + +For example: `INLINE 0 10 3 4 d30 2a fa1 b +` + +The _inline_nest_level_ field is a decimal number that means it's inlined at the +function described by a previous `INLINE` record which has _inline_nest_level_ +one less than its. In the example below, first and third `INLINE` records have +_inline_nest_level_ 0, which means they are inlined inside the function +described by the `FUNC` record. The second `INLINE` record has +_inline_nest_level_ 1 means that it's inlined at the inline function described +by first `INLINE` record. +``` +FUNC ... +INLINE 0 ... +INLINE 1 ... +INLINE 0 ... +``` + +The _call_site_line_ and _call_site_file_num_ fields are decimal numbers +indicating where this inline function being called at. + +The _origin_num_ field refers to an `INLINE_ORIGIN` record that has the name +of the inline function. + +The _address_ and _size_ fields are hexadecimal numbers indicating the start +address and length in bytes of the machine code. The address is relative to the +module's load address. There could be more than one [_address_ _size_] range +pair, since inline functions could have discontinuous address ranges. The ranges +of an `INLINE` record are always inside the ranges described by its parent +record (a `FUNC` record or an `INLINE` record). + +The `INLINE` record is assumed to belong to the function described by the last +preceding `FUNC` record. `INLINE` records may not appear before the first `FUNC` +record. + # Line records A line record describes the source file and line number to which a given range From c685fe1153193853cff23e83d6d2b2c577aaa5f6 Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Tue, 1 Mar 2022 21:01:34 +0000 Subject: [PATCH 065/195] Better identification of context frames. Since the introduction of inlined frames, it is not sufficient to check the stack trace length (== 1) in order to identify context frames. Updating all location that were depending on this assumption to check for frame trust level instead. Change-Id: I98f966889367c2270c268b8e78b67418c89c50f1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3499020 Reviewed-by: Mark Mentovai --- src/processor/stackwalker_amd64.cc | 12 ++++++++---- src/processor/stackwalker_arm.cc | 6 ++++-- src/processor/stackwalker_arm64.cc | 6 ++++-- src/processor/stackwalker_mips.cc | 3 ++- src/processor/stackwalker_ppc.cc | 7 +++---- src/processor/stackwalker_ppc64.cc | 7 +++---- src/processor/stackwalker_sparc.cc | 7 +++---- src/processor/stackwalker_x86.cc | 27 +++++++++++++++------------ 8 files changed, 42 insertions(+), 33 deletions(-) diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index 0fc22a4f9..b7628ac38 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -223,7 +223,7 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery( StackFrameAMD64* StackwalkerAMD64::GetCallerBySimulatingReturn( const vector& frames) { - assert(frames.size() == 1); + assert(frames.back()->trust == StackFrame::FRAME_TRUST_CONTEXT); StackFrameAMD64* last_frame = static_cast(frames.back()); uint64_t last_rsp = last_frame->context.rsp; uint64_t caller_rip_address, caller_rip; @@ -257,7 +257,8 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByStackScan( uint64_t caller_rip_address, caller_rip; if (!ScanForReturnAddress(last_rsp, &caller_rip_address, &caller_rip, - frames.size() == 1 /* is_context_frame */)) { + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // No plausible return address was found. return NULL; } @@ -322,7 +323,8 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack, // According to https://reviews.llvm.org/D24748, LLVM doesn't generate unwind // info for such functions. According to MSDN, leaf functions can be unwound // simply by simulating a return. - if (!new_frame.get() && stack->frames()->size() == 1 && + if (!new_frame.get() && + last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT && system_info_->os_short == "windows") { new_frame.reset(GetCallerBySimulatingReturn(frames)); } @@ -356,7 +358,9 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack, // Should we terminate the stack walk? (end-of-stack or broken invariant) if (TerminateWalk(new_frame->context.rip, new_frame->context.rsp, - last_frame->context.rsp, frames.size() == 1)) { + last_frame->context.rsp, + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_arm.cc b/src/processor/stackwalker_arm.cc index f6f2c9bf4..7890cbe3e 100644 --- a/src/processor/stackwalker_arm.cc +++ b/src/processor/stackwalker_arm.cc @@ -168,7 +168,8 @@ StackFrameARM* StackwalkerARM::GetCallerByStackScan( uint32_t caller_sp, caller_pc; if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, - frames.size() == 1 /* is_context_frame */)) { + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // No plausible return address was found. return NULL; } @@ -276,7 +277,8 @@ StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack, if (TerminateWalk(frame->context.iregs[MD_CONTEXT_ARM_REG_PC], frame->context.iregs[MD_CONTEXT_ARM_REG_SP], last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP], - frames.size() == 1)) { + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_arm64.cc b/src/processor/stackwalker_arm64.cc index 9acf8188e..74410c9ab 100644 --- a/src/processor/stackwalker_arm64.cc +++ b/src/processor/stackwalker_arm64.cc @@ -181,7 +181,8 @@ StackFrameARM64* StackwalkerARM64::GetCallerByStackScan( uint64_t caller_sp, caller_pc; if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, - frames.size() == 1 /* is_context_frame */)) { + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // No plausible return address was found. return NULL; } @@ -320,7 +321,8 @@ StackFrame* StackwalkerARM64::GetCallerFrame(const CallStack* stack, if (TerminateWalk(frame->context.iregs[MD_CONTEXT_ARM64_REG_PC], frame->context.iregs[MD_CONTEXT_ARM64_REG_SP], last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP], - frames.size() == 1)) { + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_mips.cc b/src/processor/stackwalker_mips.cc index c33ecdbe9..c4ee21f35 100644 --- a/src/processor/stackwalker_mips.cc +++ b/src/processor/stackwalker_mips.cc @@ -276,7 +276,8 @@ StackFrame* StackwalkerMIPS::GetCallerFrame(const CallStack* stack, if (TerminateWalk(new_frame->context.epc, new_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP], last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP], - frames.size() == 1)) { + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_ppc.cc b/src/processor/stackwalker_ppc.cc index 1e34c3833..b5dab8990 100644 --- a/src/processor/stackwalker_ppc.cc +++ b/src/processor/stackwalker_ppc.cc @@ -132,10 +132,9 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack, frame->trust = StackFrame::FRAME_TRUST_FP; // Should we terminate the stack walk? (end-of-stack or broken invariant) - if (TerminateWalk(instruction, - stack_pointer, - last_frame->context.gpr[1], - stack->frames()->size() == 1)) { + if (TerminateWalk(instruction, stack_pointer, last_frame->context.gpr[1], + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_ppc64.cc b/src/processor/stackwalker_ppc64.cc index fb2bac3c4..f7b24a2b5 100644 --- a/src/processor/stackwalker_ppc64.cc +++ b/src/processor/stackwalker_ppc64.cc @@ -123,10 +123,9 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack, frame->trust = StackFrame::FRAME_TRUST_FP; // Should we terminate the stack walk? (end-of-stack or broken invariant) - if (TerminateWalk(instruction, - stack_pointer, - last_frame->context.gpr[1], - stack->frames()->size() == 1)) { + if (TerminateWalk(instruction, stack_pointer, last_frame->context.gpr[1], + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_sparc.cc b/src/processor/stackwalker_sparc.cc index 4de838afe..df58570d2 100644 --- a/src/processor/stackwalker_sparc.cc +++ b/src/processor/stackwalker_sparc.cc @@ -112,10 +112,9 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack* stack, } // Should we terminate the stack walk? (end-of-stack or broken invariant) - if (TerminateWalk(instruction, - stack_pointer, - last_frame->context.g_r[14], - stack->frames()->size() == 1)) { + if (TerminateWalk(instruction, stack_pointer, last_frame->context.g_r[14], + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc index c11a04d5c..41acaae43 100644 --- a/src/processor/stackwalker_x86.cc +++ b/src/processor/stackwalker_x86.cc @@ -394,9 +394,10 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo( // frame pointer. uint32_t location_start = last_frame->context.esp; uint32_t location, eip; - if (!stack_scan_allowed - || !ScanForReturnAddress(location_start, &location, &eip, - frames.size() == 1 /* is_context_frame */)) { + if (!stack_scan_allowed || + !ScanForReturnAddress(location_start, &location, &eip, + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // if we can't find an instruction pointer even with stack scanning, // give up. return NULL; @@ -438,9 +439,10 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo( // looking one 32-bit word above that location. uint32_t location_start = dictionary[".raSearchStart"] + 4; uint32_t location; - if (stack_scan_allowed - && ScanForReturnAddress(location_start, &location, &eip, - frames.size() == 1 /* is_context_frame */)) { + if (stack_scan_allowed && + ScanForReturnAddress(location_start, &location, &eip, + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // This is a better return address that what program string // evaluation found. Use it, and set %esp to the location above the // one where the return address was found. @@ -596,9 +598,10 @@ StackFrameX86* StackwalkerX86::GetCallerByEBPAtBase( // return address. This can happen if last_frame is executing code // for a module for which we don't have symbols, and that module // is compiled without a frame pointer. - if (!stack_scan_allowed - || !ScanForReturnAddress(last_esp, &caller_esp, &caller_eip, - frames.size() == 1 /* is_context_frame */)) { + if (!stack_scan_allowed || + !ScanForReturnAddress(last_esp, &caller_esp, &caller_eip, + /*is_context_frame=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { // if we can't find an instruction pointer even with stack scanning, // give up. return NULL; @@ -678,10 +681,10 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack* stack, return NULL; // Should we terminate the stack walk? (end-of-stack or broken invariant) - if (TerminateWalk(new_frame->context.eip, - new_frame->context.esp, + if (TerminateWalk(new_frame->context.eip, new_frame->context.esp, last_frame->context.esp, - frames.size() == 1)) { + /*first_unwind=*/last_frame->trust == + StackFrame::FRAME_TRUST_CONTEXT)) { return NULL; } From 59abf117ac7a4b74b422ff27dddb33b819f18f2e Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 14 Mar 2022 14:10:16 -0700 Subject: [PATCH 066/195] Add docs for INLINE and INLINE_ORIGIN in overview Change-Id: I16b2de126efc3a7df5a70086c036f2f77add952a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3523703 Reviewed-by: Joshua Peraza --- docs/symbol_files.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/symbol_files.md b/docs/symbol_files.md index 89cc9d2d6..e05b455bb 100644 --- a/docs/symbol_files.md +++ b/docs/symbol_files.md @@ -33,8 +33,15 @@ restrictions, these may appear in any order. * A `FILE` record gives a source file name, and assigns it a number by which other records can refer to it. +* An `INLINE_ORIGIN` record holds an inline function name for `INLINE` records + to refer to. + * A `FUNC` record describes a function present in the source code. +* An `INLINE` record describes the inline function's nest level, call site + line and call site source file to which the given ranges of machine code + should be attributed. + * A line record indicates to which source file and line a given range of machine code should be attributed. The line is attributed to the function defined by the most recent `FUNC` record. From dccd24278162a1f9d4af0c7e33574b1a2b60830c Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Tue, 29 Mar 2022 16:35:14 -0700 Subject: [PATCH 067/195] Set use_async_processing in mac symupload. Change-Id: I9192aed92cc3ee85c6fdce54cbf51414338d7b99 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3558027 Reviewed-by: Ivan Penkov --- src/common/mac/SymbolCollectorClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/mac/SymbolCollectorClient.m b/src/common/mac/SymbolCollectorClient.m index ae2e2db38..5465056dd 100644 --- a/src/common/mac/SymbolCollectorClient.m +++ b/src/common/mac/SymbolCollectorClient.m @@ -199,7 +199,7 @@ + (CompleteUploadResult)completeUploadOnServer:(NSString*)APIURL NSMutableDictionary* jsonDictionary = [@{ @"symbol_id" : @{@"debug_file" : debugFile, @"debug_id" : debugID}, - @"symbol_upload_type" : type + @"symbol_upload_type" : type, @"use_async_processing" : @"true" } mutableCopy]; if (productName != nil) { From fd72a6c23275b07f0fe503d6458004c331d3c7a2 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Mon, 28 Mar 2022 14:36:22 -0700 Subject: [PATCH 068/195] Set use_async_processing in windows symupload. Change-Id: If9cc629a44b8c05e4be55d765800c239c47e076c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3554917 Reviewed-by: Ivan Penkov --- src/common/windows/symbol_collector_client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 6e871bf0d..558a97b98 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -78,7 +78,8 @@ namespace google_breakpad { L"{ symbol_id: {" L"debug_file: \"" + debug_file + L"\", " L"debug_id: \"" + debug_id + L"\" " - L"} }"; + L"}, " + L"use_async_processing: true }"; wstring response; int response_code; From e09741c609dcd5f5274d40182c5e2cc9a002d5ba Mon Sep 17 00:00:00 2001 From: Yuly Novikov Date: Tue, 29 Mar 2022 18:22:35 -0400 Subject: [PATCH 069/195] Fix build with Windows 10 20348 SDK Bug: chromium:1292528 Change-Id: Iaee784fe3992725086636dddb5f73d7e1373e7d7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3558794 Reviewed-by: Ivan Penkov --- src/common/windows/pe_util.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc index dea9b9118..f8934d27e 100644 --- a/src/common/windows/pe_util.cc +++ b/src/common/windows/pe_util.cc @@ -43,15 +43,19 @@ namespace { /* - * Not defined in WinNT.h for some reason. Definitions taken from: - * http://uninformed.org/index.cgi?v=4&a=1&p=13 + * Not defined in WinNT.h prior to SDK 10.0.20348.0 for some reason. + * Definitions taken from: http://uninformed.org/index.cgi?v=4&a=1&p=13 * */ typedef unsigned char UBYTE; -#if !defined(_WIN64) +#if !defined(UNW_FLAG_EHANDLER) #define UNW_FLAG_EHANDLER 0x01 +#endif +#if !defined(UNW_FLAG_UHANDLER) #define UNW_FLAG_UHANDLER 0x02 +#endif +#if !defined(UNW_FLAG_CHAININFO) #define UNW_FLAG_CHAININFO 0x04 #endif From 8b68c72a3fff2bb687c7f411e5c1c09e356b8603 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 12 Apr 2022 09:59:21 -0700 Subject: [PATCH 070/195] [dump_syms] Fix DW_AT_specification warning on Mac. 1. Visit DW_TAG_class_type when it's inside DW_TAG_subprogram. 2. Only warn when we can't get the name for the DIE and it has DW_AT_specification that is not in the specification map. Bug: 1078932 Change-Id: Id3126aec305658f8f65c01675a8e9e3ea03f3651 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3579855 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 62 ++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 3435e5b1d..bf78fda15 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -286,6 +286,7 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { offset_(offset), declaration_(false), specification_(NULL), + no_specification(false), abstract_origin_(NULL), forward_ref_die_offset_(0), specification_offset_(0) { } @@ -331,6 +332,10 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { // Otherwise, this is NULL. Specification* specification_; + // If this DIE has DW_AT_specification with offset smaller than this DIE and + // we can't find that in the specification map. + bool no_specification; + // If this DIE has a DW_AT_abstract_origin attribute, this is the // AbstractOrigin structure for the DIE the attribute refers to. // Otherwise, this is NULL. @@ -393,7 +398,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( } else if (data > offset_) { forward_ref_die_offset_ = data; } else { - cu_context_->reporter->UnknownSpecification(offset_, data); + no_specification = true; } specification_offset_ = data; break; @@ -479,7 +484,7 @@ StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { // counts; otherwise, use this DIE's context. if (specification_) { enclosing_name = &specification_->enclosing_name; - } else { + } else if (parent_context_) { enclosing_name = &parent_context_->name; } } @@ -601,7 +606,7 @@ DIEHandler* DwarfCUToModule::InlineHandler::FindChildHandler( enum DwarfTag tag) { switch (tag) { case DW_TAG_inlined_subroutine: - return new InlineHandler(cu_context_, new DIEContext(), offset, + return new InlineHandler(cu_context_, nullptr, offset, inline_nest_level_ + 1, child_inlines_); default: return NULL; @@ -672,6 +677,24 @@ void DwarfCUToModule::InlineHandler::Finish() { inlines_.push_back(std::move(in)); } +// A handler for DIEs that contain functions and contribute a +// component to their names: namespaces, classes, etc. +class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler { + public: + NamedScopeHandler(CUContext* cu_context, + DIEContext* parent_context, + uint64_t offset, + bool handle_inline) + : GenericDIEHandler(cu_context, parent_context, offset), + handle_inline_(handle_inline) {} + bool EndAttributes(); + DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); + + private: + DIEContext child_context_; // A context for our children. + bool handle_inline_; +}; + // A handler class for DW_TAG_subprogram DIEs. class DwarfCUToModule::FuncHandler: public GenericDIEHandler { public: @@ -709,6 +732,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { bool inline_; vector> child_inlines_; bool handle_inline_; + DIEContext child_context_; // A context for our children. }; void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( @@ -757,8 +781,13 @@ DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler( switch (tag) { case DW_TAG_inlined_subroutine: if (handle_inline_) - return new InlineHandler(cu_context_, new DIEContext(), offset, 0, + return new InlineHandler(cu_context_, nullptr, offset, 0, child_inlines_); + case DW_TAG_class_type: + case DW_TAG_structure_type: + case DW_TAG_union_type: + return new NamedScopeHandler(cu_context_, &child_context_, offset, + handle_inline_); default: return NULL; } @@ -770,6 +799,10 @@ bool DwarfCUToModule::FuncHandler::EndAttributes() { if (name_.empty() && abstract_origin_) { name_ = abstract_origin_->name; } + child_context_.name = name_; + if (name_.empty() && no_specification) { + cu_context_->reporter->UnknownSpecification(offset_, specification_offset_); + } return true; } @@ -868,26 +901,11 @@ void DwarfCUToModule::FuncHandler::Finish() { } } -// A handler for DIEs that contain functions and contribute a -// component to their names: namespaces, classes, etc. -class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler { - public: - NamedScopeHandler(CUContext* cu_context, - DIEContext* parent_context, - uint64_t offset, - bool handle_inline) - : GenericDIEHandler(cu_context, parent_context, offset), - handle_inline_(handle_inline) {} - bool EndAttributes(); - DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); - - private: - DIEContext child_context_; // A context for our children. - bool handle_inline_; -}; - bool DwarfCUToModule::NamedScopeHandler::EndAttributes() { child_context_.name = ComputeQualifiedName(); + if (child_context_.name.empty() && no_specification) { + cu_context_->reporter->UnknownSpecification(offset_, specification_offset_); + } return true; } From c85eb4a59b618f3beaad5445ceb1f865ffa8efdf Mon Sep 17 00:00:00 2001 From: Adam Duke Date: Fri, 8 Apr 2022 10:47:18 -0400 Subject: [PATCH 071/195] avoid dump_syms crashing if selected arch is not found https://crrev.com/c/3327644 introduced the ability for dump_syms to operate on in memory data, which has the consequence of not going through the same input validation as the dump_syms cli tool. In certain cases, it is possible that architecture info can't be reliably determined, e.g. new architectures that breakpad is unware of. In that case, dump_syms should avoid crashing when calling ReadSymbolData and return false instead. Change-Id: Ie9acdf811300084f1d5916f4778754f8abca10e0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3572251 Reviewed-by: Ivan Penkov --- src/common/mac/dump_syms.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index b1cb1a300..c62caed28 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -413,6 +413,13 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { google_breakpad::BreakpadGetArchInfoFromCpuType( selected_object_file_->cputype, selected_object_file_->cpusubtype); + // In certain cases, it is possible that architecture info can't be reliably + // determined, e.g. new architectures that breakpad is unware of. In that + // case, avoid crashing and return false instead. + if (selected_arch_info == NULL) { + return false; + } + const char* selected_arch_name = selected_arch_info->name; if (strcmp(selected_arch_name, "i386") == 0) selected_arch_name = "x86"; From 0808030bee8bc88a34675cd1dd83b965a2249a08 Mon Sep 17 00:00:00 2001 From: Iryna Shakhova Date: Thu, 12 May 2022 09:32:52 +0000 Subject: [PATCH 072/195] Support PE modules in core files when running core2md Core files generated from `wine` contain both ELF and PE modules. Module format can be guessed by checking the file contents. If the module corresponds to PE-file conditions (has specific fields set up as described in https://code.google.com/archive/p/corkami/wikis/PE.wiki) we'll create a MDCVInfoPDB70 record in the minidump for it, but if the file cannot be opened, is too short or is not a PE file, we'll fall back to ELF procedure. Added /src/client/linux/minidump_writer/pe_file.{cc,h} to src_client_linux_libbreakpad_client_a_SOURCES and src_client_linux_linux_client_unittest_shlib_SOURCES. Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'. Test: build core2md and use it to convert a core file into dmp, validate that the generated dmp file can be opened. Ran './configure & make'. Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189 Reviewed-by: Joshua Peraza --- Makefile.am | 2 + Makefile.in | 51 +++- aclocal.m4 | 76 +++--- .../linux/minidump_writer/minidump_writer.cc | 107 ++++++--- src/client/linux/minidump_writer/pe_file.cc | 148 ++++++++++++ src/client/linux/minidump_writer/pe_file.h | 77 ++++++ src/client/linux/minidump_writer/pe_structs.h | 226 ++++++++++++++++++ 7 files changed, 622 insertions(+), 65 deletions(-) create mode 100644 src/client/linux/minidump_writer/pe_file.cc create mode 100644 src/client/linux/minidump_writer/pe_file.h create mode 100644 src/client/linux/minidump_writer/pe_structs.h diff --git a/Makefile.am b/Makefile.am index e7dc06ac7..2cde86493 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,6 +168,7 @@ src_client_linux_libbreakpad_client_a_SOURCES = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h \ @@ -491,6 +492,7 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ diff --git a/Makefile.in b/Makefile.in index 87377f3ac..aaf791339 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -360,6 +360,7 @@ am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h src/common/convert_UTF.cc \ @@ -387,6 +388,7 @@ am__dirstamp = $(am__leading_dot)dirstamp @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \ @@ -632,6 +634,7 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ @@ -665,6 +668,7 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ @@ -1645,12 +1649,14 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po \ + src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po \ + src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po \ src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po \ src/common/$(DEPDIR)/convert_UTF.Po \ src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po \ @@ -2101,9 +2107,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ @@ -2291,9 +2294,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/autotools/missing \ $(top_srcdir)/autotools/test-driver \ $(top_srcdir)/src/config.h.in AUTHORS ChangeLog INSTALL NEWS \ - autotools/ar-lib autotools/compile autotools/config.guess \ - autotools/config.sub autotools/depcomp autotools/install-sh \ - autotools/ltmain.sh autotools/missing + README.md autotools/ar-lib autotools/compile \ + autotools/config.guess autotools/config.sub autotools/depcomp \ + autotools/install-sh autotools/ltmain.sh autotools/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -2329,6 +2332,8 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ @@ -2339,6 +2344,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ @@ -2513,6 +2519,7 @@ CLEANFILES = $(am__append_12) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \ @@ -2718,6 +2725,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ @LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ @LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \ @@ -4151,6 +4159,9 @@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT): \ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) +src/client/linux/minidump_writer/pe_file.$(OBJEXT): \ + src/client/linux/minidump_writer/$(am__dirstamp) \ + src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/$(am__dirstamp): @$(MKDIR_P) src/client @: > src/client/$(am__dirstamp) @@ -4452,6 +4463,9 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT): \ + src/client/linux/minidump_writer/$(am__dirstamp) \ + src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) @@ -5357,12 +5371,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/convert_UTF.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po@am__quote@ # am--include-marker @@ -5921,6 +5937,20 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; fi` +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o: src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc + +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj: src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` + src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o: src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o `test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po @@ -9131,7 +9161,6 @@ src/processor/minidump_stackwalk_machine_readable_test.log: src/processor/minidu @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -9427,12 +9456,14 @@ distclean: distclean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po @@ -9770,12 +9801,14 @@ maintainer-clean: maintainer-clean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po diff --git a/aclocal.m4 b/aclocal.m4 index be219b421..009cc48ed 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.3], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.3])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ AC_SUBST([AR])dnl # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -138,7 +138,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -190,7 +190,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -221,7 +221,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -412,7 +412,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -480,7 +480,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -508,6 +508,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -544,7 +548,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -596,6 +600,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -677,7 +695,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -698,7 +716,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -720,7 +738,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -755,7 +773,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -798,7 +816,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -834,7 +852,7 @@ fi # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -861,7 +879,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -890,7 +908,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -937,7 +955,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -956,7 +974,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1037,7 +1055,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1097,7 +1115,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1125,7 +1143,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1144,7 +1162,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 72a921664..7ce9ac570 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -71,6 +71,8 @@ #include "client/linux/minidump_writer/line_reader.h" #include "client/linux/minidump_writer/linux_dumper.h" #include "client/linux/minidump_writer/linux_ptrace_dumper.h" +#include "client/linux/minidump_writer/pe_file.h" +#include "client/linux/minidump_writer/pe_structs.h" #include "client/linux/minidump_writer/proc_cpuinfo_reader.h" #include "client/minidump_file_writer.h" #include "common/linux/file_id.h" @@ -95,8 +97,11 @@ using google_breakpad::MappingInfo; using google_breakpad::MappingList; using google_breakpad::MinidumpFileWriter; using google_breakpad::PageAllocator; +using google_breakpad::PEFile; +using google_breakpad::PEFileFormat; using google_breakpad::ProcCpuInfoReader; using google_breakpad::RawContextCPU; +using google_breakpad::RSDS_DEBUG_FORMAT; using google_breakpad::ThreadInfo; using google_breakpad::TypedMDRVA; using google_breakpad::UContextReader; @@ -632,40 +637,88 @@ class MinidumpWriter { mod->base_of_image = mapping.start_addr; mod->size_of_image = mapping.size; - auto_wasteful_vector identifier_bytes( - dumper_->allocator()); + char file_name[NAME_MAX]; + char file_path[NAME_MAX]; - if (identifier) { - // GUID was provided by caller. - identifier_bytes.insert(identifier_bytes.end(), - identifier, - identifier + sizeof(MDGUID)); - } else { - // Note: ElfFileIdentifierForMapping() can manipulate the |mapping.name|. - dumper_->ElfFileIdentifierForMapping(mapping, - member, - mapping_id, - identifier_bytes); - } + dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, + sizeof(file_path), file_name, + sizeof(file_name)); - if (!identifier_bytes.empty()) { - UntypedMDRVA cv(&minidump_writer_); - if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) - return false; + RSDS_DEBUG_FORMAT rsds; + PEFileFormat file_format = PEFile::TryGetDebugInfo(file_path, &rsds); + + if (file_format == PEFileFormat::notPeCoff) { + // The module is not a PE/COFF file, process as an ELF. + auto_wasteful_vector identifier_bytes( + dumper_->allocator()); + + if (identifier) { + // GUID was provided by caller. + identifier_bytes.insert(identifier_bytes.end(), identifier, + identifier + sizeof(MDGUID)); + } else { + // Note: ElfFileIdentifierForMapping() can manipulate the + // |mapping.name|, that is why we need to call the method + // GetMappingEffectiveNameAndPath again. + dumper_->ElfFileIdentifierForMapping(mapping, member, mapping_id, + identifier_bytes); + dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, + sizeof(file_path), file_name, + sizeof(file_name)); + } + + if (!identifier_bytes.empty()) { + UntypedMDRVA cv(&minidump_writer_); + if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) + return false; - const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; - cv.Copy(&cv_signature, sizeof(cv_signature)); - cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], - identifier_bytes.size()); + const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; + cv.Copy(&cv_signature, sizeof(cv_signature)); + cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], + identifier_bytes.size()); + + mod->cv_record = cv.location(); + } + } else { + // The module is a PE/COFF file. Create MDCVInfoPDB70 struct for it. + size_t file_name_length = strlen(file_name); + TypedMDRVA cv(&minidump_writer_); + if (!cv.AllocateObjectAndArray(file_name_length + 1, sizeof(uint8_t))) + return false; + if (!cv.CopyIndexAfterObject(0, file_name, file_name_length)) + return false; + MDCVInfoPDB70* cv_ptr = cv.get(); + cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE; + if (file_format == PEFileFormat::peWithBuildId) { + // Populate BuildId and age using RSDS instance. + cv_ptr->signature.data1 = static_cast(rsds.guid[0]) << 24 | + static_cast(rsds.guid[1]) << 16 | + static_cast(rsds.guid[2]) << 8 | + static_cast(rsds.guid[3]); + cv_ptr->signature.data2 = + static_cast(rsds.guid[4]) << 8 | rsds.guid[5]; + cv_ptr->signature.data3 = + static_cast(rsds.guid[6]) << 8 | rsds.guid[7]; + cv_ptr->signature.data4[0] = rsds.guid[8]; + cv_ptr->signature.data4[1] = rsds.guid[9]; + cv_ptr->signature.data4[2] = rsds.guid[10]; + cv_ptr->signature.data4[3] = rsds.guid[11]; + cv_ptr->signature.data4[4] = rsds.guid[12]; + cv_ptr->signature.data4[5] = rsds.guid[13]; + cv_ptr->signature.data4[6] = rsds.guid[14]; + cv_ptr->signature.data4[7] = rsds.guid[15]; + // The Age field should be reverted as well. + cv_ptr->age = static_cast(rsds.age[0]) << 24 | + static_cast(rsds.age[1]) << 16 | + static_cast(rsds.age[2]) << 8 | + static_cast(rsds.age[3]); + } else { + cv_ptr->age = 0; + } mod->cv_record = cv.location(); } - char file_name[NAME_MAX]; - char file_path[NAME_MAX]; - dumper_->GetMappingEffectiveNameAndPath( - mapping, file_path, sizeof(file_path), file_name, sizeof(file_name)); - MDLocationDescriptor ld; if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld)) return false; diff --git a/src/client/linux/minidump_writer/pe_file.cc b/src/client/linux/minidump_writer/pe_file.cc new file mode 100644 index 000000000..4a8f1936e --- /dev/null +++ b/src/client/linux/minidump_writer/pe_file.cc @@ -0,0 +1,148 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "client/linux/minidump_writer/pe_file.h" +#include "client/linux/minidump_writer/pe_structs.h" +#include "common/linux/memory_mapped_file.h" + +namespace google_breakpad { + +PEFileFormat PEFile::TryGetDebugInfo(const char* filename, + PRSDS_DEBUG_FORMAT debug_info) { + MemoryMappedFile mapped_file(filename, 0); + if (!mapped_file.data()) + return PEFileFormat::notPeCoff; + const void* base = mapped_file.data(); + const size_t file_size = mapped_file.size(); + + const IMAGE_DOS_HEADER* header = + TryReadStruct(base, 0, file_size); + if (!header || (header->e_magic != IMAGE_DOS_SIGNATURE)) { + return PEFileFormat::notPeCoff; + } + + // NTHeader is at position 'e_lfanew'. + DWORD nt_header_offset = header->e_lfanew; + // First, read a common IMAGE_NT_HEADERS structure. It should contain a + // special flag marking whether PE module is x64 (OptionalHeader.Magic) + // and so-called NT_SIGNATURE in Signature field. + const IMAGE_NT_HEADERS* nt_header = + TryReadStruct(base, nt_header_offset, file_size); + if (!nt_header || (nt_header->Signature != IMAGE_NT_SIGNATURE) + || ((nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) + && (nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC))) + return PEFileFormat::notPeCoff; + + bool x64 = nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC; + WORD sections_number = nt_header->FileHeader.NumberOfSections; + DWORD debug_offset; + DWORD debug_size; + DWORD section_offset; + if (x64) { + const IMAGE_NT_HEADERS64* header_64 = + TryReadStruct(base, nt_header_offset, file_size); + if (!header_64) + return PEFileFormat::peWithoutBuildId; + debug_offset = + header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .VirtualAddress; + debug_size = + header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .Size; + section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS64); + } else { + const IMAGE_NT_HEADERS32* header_32 = + TryReadStruct(base, nt_header_offset, file_size); + if (!header_32) + return PEFileFormat::peWithoutBuildId; + debug_offset = + header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .VirtualAddress; + debug_size = + header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .Size; + section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS32); + } + + DWORD debug_end_pos = debug_offset + debug_size; + while (debug_offset < debug_end_pos) { + for (WORD i = 0; i < sections_number; ++i) { + // Section headers are placed sequentially after the NT_HEADER (32/64). + const IMAGE_SECTION_HEADER* section = + TryReadStruct(base, section_offset, file_size); + if (!section) + return PEFileFormat::peWithoutBuildId; + + section_offset += sizeof(IMAGE_SECTION_HEADER); + + // Current `debug_offset` should be inside a section, stop if we find + // a suitable one (we don't consider any malformed sections here). + if ((section->VirtualAddress <= debug_offset) && + (debug_offset < section->VirtualAddress + section->SizeOfRawData)) { + DWORD offset = + section->PointerToRawData + debug_offset - section->VirtualAddress; + // Go to the position of current ImageDebugDirectory (offset). + const IMAGE_DEBUG_DIRECTORY* debug_directory = + TryReadStruct(base, offset, file_size); + if (!debug_directory) + return PEFileFormat::peWithoutBuildId; + // Process ImageDebugDirectory with CodeViewRecord type and skip + // all others. + if (debug_directory->Type == IMAGE_DEBUG_TYPE_CODEVIEW) { + DWORD debug_directory_size = debug_directory->SizeOfData; + if (debug_directory_size < sizeof(RSDS_DEBUG_FORMAT)) + // RSDS section is malformed. + return PEFileFormat::peWithoutBuildId; + // Go to the position of current ImageDebugDirectory Raw Data + // (debug_directory->PointerToRawData) and read the RSDS section. + const RSDS_DEBUG_FORMAT* rsds = + TryReadStruct( + base, debug_directory->PointerToRawData, file_size); + + if (!rsds) + return PEFileFormat::peWithoutBuildId; + + memcpy(debug_info->guid, rsds->guid, sizeof(rsds->guid)); + memcpy(debug_info->age, rsds->age, sizeof(rsds->age)); + return PEFileFormat::peWithBuildId; + } + + break; + } + } + + debug_offset += sizeof(IMAGE_DEBUG_DIRECTORY); + } + + return PEFileFormat::peWithoutBuildId; +} + +} // namespace google_breakpad \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_file.h b/src/client/linux/minidump_writer/pe_file.h new file mode 100644 index 000000000..cc7ed0807 --- /dev/null +++ b/src/client/linux/minidump_writer/pe_file.h @@ -0,0 +1,77 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ +#define CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ + +#include "client/linux/minidump_writer/pe_structs.h" + +namespace google_breakpad { + +typedef enum { + notPeCoff = 0, + peWithoutBuildId = 1, + peWithBuildId = 2 +} PEFileFormat; + +class PEFile { + public: + /** + * Attempts to parse RSDS_DEBUG_FORMAT record from a PE (Portable + * Executable) file. To do this we check whether the loaded file is a PE + * file, and if it is - try to find IMAGE_DEBUG_DIRECTORY structure with + * its type set to IMAGE_DEBUG_TYPE_CODEVIEW. + * + * @param filename Filename for the module to parse. + * @param debug_info RSDS_DEBUG_FORMAT struct to be populated with PE debug + * info (GUID and age). + * @return + * notPeCoff: not PE/COFF file; + * peWithoutBuildId: a PE/COFF file but build-id is not set; + * peWithBuildId: a PE/COFF file and build-id is set. + */ + static PEFileFormat TryGetDebugInfo(const char* filename, + PRSDS_DEBUG_FORMAT debug_info); + + private: + template + static const TStruct* TryReadStruct(const void* base, + const DWORD position, + const size_t file_size) { + if (position + sizeof(TStruct) >= file_size){ + return nullptr; + } + + const void* ptr = static_cast(base) + position; + return reinterpret_cast(ptr); + } +}; + +} // namespace google_breakpad +#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_structs.h b/src/client/linux/minidump_writer/pe_structs.h new file mode 100644 index 000000000..843bd517a --- /dev/null +++ b/src/client/linux/minidump_writer/pe_structs.h @@ -0,0 +1,226 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ +#define CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ + +#include + +namespace google_breakpad { + +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef uint64_t ULONGLONG; + +#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b +#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b + +#define IMAGE_DEBUG_TYPE_CODEVIEW 2 + +#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 + +typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header + WORD e_magic; // Magic number + WORD e_cblp; // Bytes on last page of file + WORD e_cp; // Pages in file + WORD e_crlc; // Relocations + WORD e_cparhdr; // Size of header in paragraphs + WORD e_minalloc; // Minimum extra paragraphs needed + WORD e_maxalloc; // Maximum extra paragraphs needed + WORD e_ss; // Initial (relative) SS value + WORD e_sp; // Initial SP value + WORD e_csum; // Checksum + WORD e_ip; // Initial IP value + WORD e_cs; // Initial (relative) CS value + WORD e_lfarlc; // File address of relocation table + WORD e_ovno; // Overlay number + WORD e_res[4]; // Reserved words + WORD e_oemid; // OEM identifier (for e_oeminfo) + WORD e_oeminfo; // OEM information; e_oemid specific + WORD e_res2[10]; // Reserved words + DWORD e_lfanew; // File address of new exe header +} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; + +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; + +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; + + +typedef struct _IMAGE_DEBUG_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Type; + DWORD SizeOfData; + DWORD AddressOfRawData; + DWORD PointerToRawData; +} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY; + +typedef struct _IMAGE_OPTIONAL_HEADER64 { + // + // Standard fields - Magic. + // + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + // + // NT additional fields. + // + ULONGLONG ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + ULONGLONG SizeOfStackReserve; + ULONGLONG SizeOfStackCommit; + ULONGLONG SizeOfHeapReserve; + ULONGLONG SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; + +typedef struct _IMAGE_OPTIONAL_HEADER { + // + // Standard fields. + // + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + // + // NT additional fields. + // + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32; + +typedef struct _IMAGE_NT_HEADERS64 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER64 OptionalHeader; +} IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64; + +typedef struct _IMAGE_NT_HEADERS32 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER32 OptionalHeader; +} IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32; + +typedef struct _IMAGE_NT_HEADERS { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER32 OptionalHeader; +} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS; + +#define IMAGE_SIZEOF_SHORT_NAME 8 + +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; + +typedef struct _RSDS_DEBUG_FORMAT { + DWORD signature; + BYTE guid[16]; + BYTE age[4]; + char pdbpath[1]; +} RSDS_DEBUG_FORMAT, *PRSDS_DEBUG_FORMAT; + +} // namespace google_breakpad + +#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ \ No newline at end of file From c34fc8697282277d8cf5ec625aa709ff125d5d6d Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Thu, 19 May 2022 15:16:12 -0700 Subject: [PATCH 073/195] Make sym-upload-v2 windows code shareable. Change-Id: I228c93655203977b27052a85705c42bafef1e1ef Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3656055 Reviewed-by: Ivan Penkov --- src/common/windows/sym_upload_v2_protocol.cc | 87 +++++++++++++++ src/common/windows/sym_upload_v2_protocol.h | 52 +++++++++ src/tools/windows/symupload/symupload.cc | 105 ++----------------- 3 files changed, 145 insertions(+), 99 deletions(-) create mode 100644 src/common/windows/sym_upload_v2_protocol.cc create mode 100644 src/common/windows/sym_upload_v2_protocol.h diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc new file mode 100644 index 000000000..4481cc25c --- /dev/null +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -0,0 +1,87 @@ +#include "common/windows/sym_upload_v2_protocol.h" + +#include + +#include "common/windows/http_upload.h" +#include "common/windows/symbol_collector_client.h" + +using google_breakpad::CompleteUploadResult; +using google_breakpad::HTTPUpload; +using google_breakpad::SymbolCollectorClient; +using google_breakpad::SymbolStatus; +using google_breakpad::UploadUrlResponse; +using std::wstring; + +namespace google_breakpad { + +static bool SymUploadV2ProtocolSend(const wchar_t* api_url, + const wchar_t* api_key, + int* timeout_ms, + const wstring& debug_file, + const wstring& debug_id, + const wstring& symbol_filename, + bool force) { + wstring url(api_url); + wstring key(api_key); + + if (!force) { + SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus( + url, key, timeout_ms, debug_file, debug_id); + if (symbolStatus == SymbolStatus::Found) { + wprintf( + L"Symbol file already exists, upload aborted." + L" Use \"-f\" to overwrite.\n"); + return true; + } else if (symbolStatus == SymbolStatus::Unknown) { + wprintf(L"Failed to get check for existing symbol.\n"); + return false; + } + } + + UploadUrlResponse uploadUrlResponse; + if (!SymbolCollectorClient::CreateUploadUrl(url, key, timeout_ms, + &uploadUrlResponse)) { + wprintf(L"Failed to create upload URL.\n"); + return false; + } + + wstring signed_url = uploadUrlResponse.upload_url; + wstring upload_key = uploadUrlResponse.upload_key; + wstring response; + int response_code; + bool success = HTTPUpload::SendPutRequest( + signed_url, symbol_filename, timeout_ms, &response, &response_code); + if (!success) { + wprintf(L"Failed to send symbol file.\n"); + wprintf(L"Response code: %ld\n", response_code); + wprintf(L"Response:\n"); + wprintf(L"%s\n", response.c_str()); + return false; + } else if (response_code == 0) { + wprintf(L"Failed to send symbol file: No response code\n"); + return false; + } else if (response_code != 200) { + wprintf(L"Failed to send symbol file: Response code %ld\n", response_code); + wprintf(L"Response:\n"); + wprintf(L"%s\n", response.c_str()); + return false; + } + + CompleteUploadResult completeUploadResult = + SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, + debug_file, debug_id); + if (completeUploadResult == CompleteUploadResult::Error) { + wprintf(L"Failed to complete upload.\n"); + return false; + } else if (completeUploadResult == CompleteUploadResult::DuplicateData) { + wprintf( + L"Uploaded file checksum matched existing file checksum," + L" no change necessary.\n"); + } else { + wprintf(L"Successfully sent the symbol file.\n"); + } + + return true; +} + +} // namespace google_breakpad \ No newline at end of file diff --git a/src/common/windows/sym_upload_v2_protocol.h b/src/common/windows/sym_upload_v2_protocol.h new file mode 100644 index 000000000..24f31f2c0 --- /dev/null +++ b/src/common/windows/sym_upload_v2_protocol.h @@ -0,0 +1,52 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ +#define COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ + +#include + +namespace google_breakpad { + +// Sends file at |symbol_filename| using the sym-upload-v2 protocol to +// |api_url| using key |api_key|, and using identifiers |debug_file| and +// |debug_id|. |timeout_ms| is the number of milliseconds to wait before +// terminating the upload attempt. If |force| is set then it will overwrite an +// existing file with the same |debug_file| and |debug_id| in the store. +bool SymUploadV2ProtocolSend(const wchar_t* api_url, + const wchar_t* api_key, + int* timeout_ms, + const std::wstring& debug_file, + const std::wstring& debug_id, + const std::wstring& symbol_filename, + bool force); + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ \ No newline at end of file diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 3a26ca89b..6d534e418 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -56,20 +56,17 @@ #include "common/windows/http_upload.h" #include "common/windows/pdb_source_line_writer.h" +#include "common/windows/sym_upload_v2_protocol.h" #include "common/windows/symbol_collector_client.h" -using std::string; -using std::wstring; -using std::vector; -using std::map; using google_breakpad::HTTPUpload; -using google_breakpad::SymbolCollectorClient; -using google_breakpad::SymbolStatus; -using google_breakpad::UploadUrlResponse; -using google_breakpad::CompleteUploadResult; using google_breakpad::PDBModuleInfo; using google_breakpad::PDBSourceLineWriter; using google_breakpad::WindowsStringUtils; +using std::map; +using std::string; +using std::vector; +using std::wstring; // Extracts the file version information for the given filename, // as a string, for example, "1.2.3.4". Returns true on success. @@ -160,96 +157,6 @@ static bool DumpSymbolsToTempFile(const wchar_t* file, return writer.GetModuleInfo(pdb_info); } -static bool DoSymUploadV2( - const wchar_t* api_url, - const wchar_t* api_key, - int* timeout_ms, - const wstring& debug_file, - const wstring& debug_id, - const wstring& symbol_file, - bool force) { - wstring url(api_url); - wstring key(api_key); - - if (!force) { - SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus( - url, - key, - timeout_ms, - debug_file, - debug_id); - if (symbolStatus == SymbolStatus::Found) { - wprintf(L"Symbol file already exists, upload aborted." - L" Use \"-f\" to overwrite.\n"); - return true; - } - else if (symbolStatus == SymbolStatus::Unknown) { - wprintf(L"Failed to get check for existing symbol.\n"); - return false; - } - } - - UploadUrlResponse uploadUrlResponse; - if (!SymbolCollectorClient::CreateUploadUrl( - url, - key, - timeout_ms, - &uploadUrlResponse)) { - wprintf(L"Failed to create upload URL.\n"); - return false; - } - - wstring signed_url = uploadUrlResponse.upload_url; - wstring upload_key = uploadUrlResponse.upload_key; - wstring response; - int response_code; - bool success = HTTPUpload::SendPutRequest( - signed_url, - symbol_file, - timeout_ms, - &response, - &response_code); - if (!success) { - wprintf(L"Failed to send symbol file.\n"); - wprintf(L"Response code: %ld\n", response_code); - wprintf(L"Response:\n"); - wprintf(L"%s\n", response.c_str()); - return false; - } - else if (response_code == 0) { - wprintf(L"Failed to send symbol file: No response code\n"); - return false; - } - else if (response_code != 200) { - wprintf(L"Failed to send symbol file: Response code %ld\n", response_code); - wprintf(L"Response:\n"); - wprintf(L"%s\n", response.c_str()); - return false; - } - - CompleteUploadResult completeUploadResult = - SymbolCollectorClient::CompleteUpload( - url, - key, - timeout_ms, - upload_key, - debug_file, - debug_id); - if (completeUploadResult == CompleteUploadResult::Error) { - wprintf(L"Failed to complete upload.\n"); - return false; - } - else if (completeUploadResult == CompleteUploadResult::DuplicateData) { - wprintf(L"Uploaded file checksum matched existing file checksum," - L" no change necessary.\n"); - } - else { - wprintf(L"Successfully sent the symbol file.\n"); - } - - return true; -} - __declspec(noreturn) void printUsageAndExit() { wprintf(L"Usage:\n\n" L" symupload [--i] [--timeout NN] [--product product_name] ^\n" @@ -342,7 +249,7 @@ int wmain(int argc, wchar_t* argv[]) { api_url = argv[currentarg++]; api_key = argv[currentarg++]; - success = DoSymUploadV2( + success = google_breakpad::SymUploadV2ProtocolSend( api_url, api_key, timeout == -1 ? nullptr : &timeout, pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, force); } else { From bee636cea4390940c7ecbd15135516ce1c50680c Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Fri, 20 May 2022 14:56:42 -0700 Subject: [PATCH 074/195] Migrate google_converter to v2 upload API. Change-Id: If045809cfa3a3601b93725b6b2b45089e7558eb3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3657059 Reviewed-by: Ivan Penkov --- src/tools/windows/converter_exe/converter.cc | 61 ++++++++++++++------ 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index 06bd8ebb3..d1984edaa 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -39,12 +39,13 @@ #include #include -#include "tools/windows/converter_exe/escaping.h" -#include "tools/windows/converter_exe/http_download.h" -#include "tools/windows/converter_exe/tokenizer.h" #include "common/windows/http_upload.h" #include "common/windows/string_utils-inl.h" +#include "common/windows/sym_upload_v2_protocol.h" #include "tools/windows/converter/ms_symbol_server_converter.h" +#include "tools/windows/converter_exe/escaping.h" +#include "tools/windows/converter_exe/http_download.h" +#include "tools/windows/converter_exe/tokenizer.h" using strings::WebSafeBase64Unescape; using strings::WebSafeBase64Escape; @@ -208,28 +209,37 @@ static bool MissingSymbolInfoToParameters(const MissingSymbolInfo& missing_info, // to the symbol server rooted at |upload_symbol_url|. Returns true on // success and false on failure, printing an error message. static bool UploadSymbolFile(const wstring& upload_symbol_url, + const wstring& api_key, const MissingSymbolInfo& missing_info, const string& converted_file) { - map parameters; - if (!MissingSymbolInfoToParameters(missing_info,& parameters)) { - // MissingSymbolInfoToParameters or a callee will have printed an error. + wstring debug_file_w; + if (!WindowsStringUtils::safe_mbstowcs(missing_info.debug_file, + &debug_file_w)) { + FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", + converted_file.c_str()); return false; } - wstring converted_file_w; + wstring debug_id_w; + if (!WindowsStringUtils::safe_mbstowcs(missing_info.debug_identifier, + &debug_id_w)) { + FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", + converted_file.c_str()); + return false; + } - if (!WindowsStringUtils::safe_mbstowcs(converted_file,& converted_file_w)) { + wstring converted_file_w; + if (!WindowsStringUtils::safe_mbstowcs(converted_file, &converted_file_w)) { FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", converted_file.c_str()); return false; } - map files; - files[L"symbol_file"] = converted_file_w; + int timeout_ms = 60 * 1000; FprintfFlush(stderr, "Uploading %s\n", converted_file.c_str()); - if (!HTTPUpload::SendMultipartPostRequest( - upload_symbol_url, parameters, - files, NULL, NULL, NULL)) { + if (!google_breakpad::SymUploadV2ProtocolSend( + upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, + debug_id_w, converted_file_w, true)) { FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed " "for %s %s %s\n", missing_info.debug_file.c_str(), @@ -319,6 +329,9 @@ struct ConverterOptions { // URL for uploading symbols. wstring upload_symbols_url; + // API key to use when uploading symbols. + wstring api_key; + // URL to fetch list of missing symbols. wstring missing_symbols_url; @@ -413,8 +426,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, // If it fails, something will print an error message indicating // the cause of the failure, and the item will remain on the // missing symbol list. - UploadSymbolFile(options.upload_symbols_url, missing_info, - converted_file); + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info, converted_file); remove(converted_file.c_str()); // Note: this does leave some directories behind that could be @@ -495,8 +508,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, // If it fails, something will print an error message indicating // the cause of the failure, and the item will remain on the // missing symbol list. - UploadSymbolFile(options.upload_symbols_url, missing_info, - converted_file); + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info, converted_file); remove(converted_file.c_str()); // Note: this does leave some directories behind that could be @@ -648,12 +661,14 @@ static bool ConvertMissingSymbolsList(const ConverterOptions& options) { // usage prints the usage message. It returns 1 as a convenience, to be used // as a return value from main. static int usage(const char* program_name) { - FprintfFlush(stderr, + FprintfFlush( + stderr, "usage: %s [options]\n" " -f MS servers to ask for all symbols\n" " -n same, but prevent asking for EXEs\n" " -l Temporary local storage for symbols\n" " -s URL for uploading symbols\n" + " -k API key to use when uploading symbols\n" " -m URL to fetch list of missing symbols\n" " -mf File containing the list of missing\n" " symbols. Fetch failures are not\n" @@ -729,6 +744,12 @@ int main(int argc, char** argv) { value.c_str()); return 1; } + } else if (option == "-k") { + if (!WindowsStringUtils::safe_mbstowcs(value, &options.api_key)) { + FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", + value.c_str()); + return 1; + } } else if (option == "-m") { if (!WindowsStringUtils::safe_mbstowcs(value, & options.missing_symbols_url)) { @@ -780,6 +801,10 @@ int main(int argc, char** argv) { FprintfFlush(stderr, "No upload symbols URL specified.\n"); return usage(argv[0]); } + if (options.api_key.empty()) { + FprintfFlush(stderr, "No API key specified.\n"); + return usage(argv[0]); + } if (options.missing_symbols_url.empty() && options.missing_symbols_file.empty()) { FprintfFlush(stderr, "No missing symbols URL or file specified.\n"); From 678d69cd78632b80e55a86e562abdba4f55034f0 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Tue, 31 May 2022 14:04:53 -0700 Subject: [PATCH 075/195] Add symbol type option to SymUploadV2ProtocolSend. Change-Id: Ia2eadae56c7f879ddb2212e4018024a5c04634aa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3670054 Reviewed-by: Ivan Penkov --- src/common/windows/sym_upload_v2_protocol.cc | 3 ++- src/common/windows/sym_upload_v2_protocol.h | 16 ++++++++++++++-- src/common/windows/symbol_collector_client.cc | 14 +++++++++++--- src/common/windows/symbol_collector_client.h | 14 +++++++------- src/tools/windows/converter_exe/converter.cc | 4 +++- src/tools/windows/symupload/symupload.cc | 5 ++++- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc index 4481cc25c..bcc1a1a9b 100644 --- a/src/common/windows/sym_upload_v2_protocol.cc +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -20,6 +20,7 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, const wstring& debug_file, const wstring& debug_id, const wstring& symbol_filename, + const wstring& symbol_type, bool force) { wstring url(api_url); wstring key(api_key); @@ -69,7 +70,7 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, CompleteUploadResult completeUploadResult = SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, - debug_file, debug_id); + debug_file, debug_id, symbol_type); if (completeUploadResult == CompleteUploadResult::Error) { wprintf(L"Failed to complete upload.\n"); return false; diff --git a/src/common/windows/sym_upload_v2_protocol.h b/src/common/windows/sym_upload_v2_protocol.h index 24f31f2c0..389fa586e 100644 --- a/src/common/windows/sym_upload_v2_protocol.h +++ b/src/common/windows/sym_upload_v2_protocol.h @@ -37,14 +37,26 @@ namespace google_breakpad { // Sends file at |symbol_filename| using the sym-upload-v2 protocol to // |api_url| using key |api_key|, and using identifiers |debug_file| and // |debug_id|. |timeout_ms| is the number of milliseconds to wait before -// terminating the upload attempt. If |force| is set then it will overwrite an -// existing file with the same |debug_file| and |debug_id| in the store. +// terminating the upload attempt. |symbol_type| is the type of the symbol +// file, which is one of: +// "BREAKPAD" +// "ELF" +// "PE" +// "MACHO" +// "DEBUG_ONLY" +// "DWP" +// "DSYM" +// "PDB" +// "SOURCE_MAP" +// If |force| is set then it will overwrite an existing file with the +// same |debug_file| and |debug_id| in the store. bool SymUploadV2ProtocolSend(const wchar_t* api_url, const wchar_t* api_key, int* timeout_ms, const std::wstring& debug_file, const std::wstring& debug_id, const std::wstring& symbol_filename, + const std::wstring& symbol_type, bool force); } // namespace google_breakpad diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 558a97b98..0831b22cb 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -70,15 +70,23 @@ namespace google_breakpad { int* timeout_ms, const wstring& upload_key, const wstring& debug_file, - const wstring& debug_id) { + const wstring& debug_id, + const wstring& type) { wstring url = api_url + L"/v1/uploads/" + upload_key + L":complete" L"?key=" + api_key; wstring body = L"{ symbol_id: {" - L"debug_file: \"" + debug_file + L"\", " - L"debug_id: \"" + debug_id + L"\" " + L"debug_file: \"" + + debug_file + + L"\", " + L"debug_id: \"" + + debug_id + + L"\" " L"}, " + L"symbol_upload_type: \"" + + type + + L"\", " L"use_async_processing: true }"; wstring response; int response_code; diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h index 4a85c0529..bdf9f7cb2 100644 --- a/src/common/windows/symbol_collector_client.h +++ b/src/common/windows/symbol_collector_client.h @@ -69,13 +69,13 @@ namespace google_breakpad { // Notify the API that symbol file upload is finished and its contents // are ready to be read and/or used for further processing. - static CompleteUploadResult CompleteUpload( - wstring& api_url, - wstring& api_key, - int* timeout_ms, - const wstring& upload_key, - const wstring& debug_file, - const wstring& debug_id); + static CompleteUploadResult CompleteUpload(wstring& api_url, + wstring& api_key, + int* timeout_ms, + const wstring& upload_key, + const wstring& debug_file, + const wstring& debug_id, + const wstring& type); // Returns whether or not a symbol file corresponding to the debug_file/ // debug_id pair is already present in symbol storage. diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index d1984edaa..e150fc4de 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -66,6 +66,7 @@ using google_breakpad::WindowsStringUtils; const char* kMissingStringDelimiters = "|"; const char* kLocalCachePath = "c:\\symbols"; const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; +const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; // Windows stdio doesn't do line buffering. Use this function to flush after // writing to stdout and stderr so that a log will be available if the @@ -239,7 +240,8 @@ static bool UploadSymbolFile(const wstring& upload_symbol_url, FprintfFlush(stderr, "Uploading %s\n", converted_file.c_str()); if (!google_breakpad::SymUploadV2ProtocolSend( upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, - debug_id_w, converted_file_w, true)) { + debug_id_w, converted_file_w, kSymbolUploadTypeBreakpad, + /*force=*/true)) { FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed " "for %s %s %s\n", missing_info.debug_file.c_str(), diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 6d534e418..6c1d1981e 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -68,6 +68,8 @@ using std::string; using std::vector; using std::wstring; +const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; + // Extracts the file version information for the given filename, // as a string, for example, "1.2.3.4". Returns true on success. static bool GetFileVersionString(const wchar_t* filename, wstring* version) { @@ -251,7 +253,8 @@ int wmain(int argc, wchar_t* argv[]) { success = google_breakpad::SymUploadV2ProtocolSend( api_url, api_key, timeout == -1 ? nullptr : &timeout, - pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, force); + pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, + kSymbolUploadTypeBreakpad, force); } else { printUsageAndExit(); } From 41a11409d6ba04e308adc66f5a33115e2d7c9174 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Tue, 31 May 2022 15:47:15 -0700 Subject: [PATCH 076/195] Upload native symbols from google_converter. Change-Id: I4b636ccb1dc536ad63b0995994057fe1874f4ee6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3681980 Reviewed-by: Ivan Penkov --- src/tools/windows/converter_exe/converter.cc | 102 ++++++++++++------- 1 file changed, 66 insertions(+), 36 deletions(-) diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index e150fc4de..3e0d35d20 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -67,6 +67,8 @@ const char* kMissingStringDelimiters = "|"; const char* kLocalCachePath = "c:\\symbols"; const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; +const wchar_t* kSymbolUploadTypePE = L"PE"; +const wchar_t* kSymbolUploadTypePDB = L"PDB"; // Windows stdio doesn't do line buffering. Use this function to flush after // writing to stdout and stderr so that a log will be available if the @@ -206,47 +208,46 @@ static bool MissingSymbolInfoToParameters(const MissingSymbolInfo& missing_info, return true; } -// UploadSymbolFile sends |converted_file| as identified by |missing_info| -// to the symbol server rooted at |upload_symbol_url|. Returns true on -// success and false on failure, printing an error message. +// UploadSymbolFile sends |converted_file| as identified by |debug_file| and +// |debug_identifier|, to the symbol server rooted at |upload_symbol_url|. +// Returns true on success and false on failure, printing an error message. static bool UploadSymbolFile(const wstring& upload_symbol_url, const wstring& api_key, - const MissingSymbolInfo& missing_info, - const string& converted_file) { + const string& debug_file, + const string& debug_identifier, + const string& symbol_file, + const wstring& symbol_type) { wstring debug_file_w; - if (!WindowsStringUtils::safe_mbstowcs(missing_info.debug_file, - &debug_file_w)) { + if (!WindowsStringUtils::safe_mbstowcs(debug_file, &debug_file_w)) { FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - converted_file.c_str()); + symbol_file.c_str()); return false; } wstring debug_id_w; - if (!WindowsStringUtils::safe_mbstowcs(missing_info.debug_identifier, - &debug_id_w)) { + if (!WindowsStringUtils::safe_mbstowcs(debug_identifier, &debug_id_w)) { FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - converted_file.c_str()); + symbol_file.c_str()); return false; } - wstring converted_file_w; - if (!WindowsStringUtils::safe_mbstowcs(converted_file, &converted_file_w)) { + wstring symbol_file_w; + if (!WindowsStringUtils::safe_mbstowcs(symbol_file, &symbol_file_w)) { FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - converted_file.c_str()); + symbol_file.c_str()); return false; } int timeout_ms = 60 * 1000; - FprintfFlush(stderr, "Uploading %s\n", converted_file.c_str()); + FprintfFlush(stderr, "Uploading %s\n", symbol_file.c_str()); if (!google_breakpad::SymUploadV2ProtocolSend( upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, - debug_id_w, converted_file_w, kSymbolUploadTypeBreakpad, + debug_id_w, symbol_file_w, symbol_type, /*force=*/true)) { - FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed " - "for %s %s %s\n", - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str(), - missing_info.version.c_str()); + FprintfFlush(stderr, + "UploadSymbolFile: HTTPUpload::SendRequest failed " + "for %s %s\n", + debug_file.c_str(), debug_identifier.c_str()); return false; } @@ -408,30 +409,47 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, MSSymbolServerConverter::LocateResult located = MSSymbolServerConverter::LOCATE_FAILURE; string converted_file; + string symbol_file; + string pe_file; if (msss_servers.size() > 0) { // Attempt to fetch the symbol file and convert it. FprintfFlush(stderr, "Making internal request for %s (%s)\n", missing_info.debug_file.c_str(), missing_info.debug_identifier.c_str()); MSSymbolServerConverter converter(options.local_cache_path, msss_servers); - located = converter.LocateAndConvertSymbolFile(missing_info, - false, // keep_symbol_file - false, // keep_pe_file - & converted_file, - NULL, // symbol_file - NULL); // pe_file + located = converter.LocateAndConvertSymbolFile( + missing_info, + /*keep_symbol_file=*/true, + /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); switch (located) { case MSSymbolServerConverter::LOCATE_SUCCESS: FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); - // Upload it. Don't bother checking the return value. If this + // Upload it. Don't bother checking the return value. If this // succeeds, it should disappear from the missing symbol list. // If it fails, something will print an error message indicating // the cause of the failure, and the item will remain on the // missing symbol list. UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info, converted_file); + missing_info.debug_file, missing_info.debug_identifier, + converted_file, kSymbolUploadTypeBreakpad); remove(converted_file.c_str()); + // Upload PDB/PE if we have them + if (!symbol_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, + missing_info.debug_identifier, symbol_file, + kSymbolUploadTypePDB); + remove(symbol_file.c_str()); + } + if (!pe_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.code_file, + missing_info.debug_identifier, pe_file, + kSymbolUploadTypePE); + remove(pe_file.c_str()); + } + // Note: this does leave some directories behind that could be // cleaned up. The directories inside options.local_cache_path for // debug_file/debug_identifier can be removed at this point. @@ -489,11 +507,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, msss_servers); located = external_converter.LocateAndConvertSymbolFile( missing_info, - false, // keep_symbol_file - false, // keep_pe_file - & converted_file, - NULL, // symbol_file - NULL); // pe_file + /*keep_symbol_file=*/true, + /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); } else { FprintfFlush(stderr, "ERROR: No suitable external symbol servers.\n"); } @@ -505,15 +520,30 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, switch (located) { case MSSymbolServerConverter::LOCATE_SUCCESS: FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); - // Upload it. Don't bother checking the return value. If this + // Upload it. Don't bother checking the return value. If this // succeeds, it should disappear from the missing symbol list. // If it fails, something will print an error message indicating // the cause of the failure, and the item will remain on the // missing symbol list. UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info, converted_file); + missing_info.debug_file, missing_info.debug_identifier, + converted_file, kSymbolUploadTypeBreakpad); remove(converted_file.c_str()); + // Upload PDB/PE if we have them + if (!symbol_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, missing_info.debug_identifier, + symbol_file, kSymbolUploadTypePDB); + remove(symbol_file.c_str()); + } + if (!pe_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.code_file, missing_info.debug_identifier, + pe_file, kSymbolUploadTypePE); + remove(pe_file.c_str()); + } + // Note: this does leave some directories behind that could be // cleaned up. The directories inside options.local_cache_path for // debug_file/debug_identifier can be removed at this point. From 737e2cd338d68e25d6757afdd2822ac953f83a7e Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Fri, 3 Jun 2022 15:47:48 -0700 Subject: [PATCH 077/195] Look for http redirection errors from SymSrv in google_converter. Change-Id: Ic793f2a5baceb342154c995c43bf60b6f57612a5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3689705 Reviewed-by: Ivan Penkov --- .../converter/ms_symbol_server_converter.cc | 65 ++++++++++++------- .../converter/ms_symbol_server_converter.h | 16 +++-- src/tools/windows/converter_exe/converter.cc | 38 +++++++++-- 3 files changed, 84 insertions(+), 35 deletions(-) diff --git a/src/tools/windows/converter/ms_symbol_server_converter.cc b/src/tools/windows/converter/ms_symbol_server_converter.cc index 102d06fd4..4645644a1 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.cc +++ b/src/tools/windows/converter/ms_symbol_server_converter.cc @@ -128,11 +128,15 @@ bool GUIDOrSignatureIdentifier::InitializeFromString( #undef SSCANF MSSymbolServerConverter::MSSymbolServerConverter( - const string& local_cache, const vector& symbol_servers) + const string& local_cache, + const vector& symbol_servers, + bool trace_symsrv) : symbol_path_(), fail_dns_(false), fail_timeout_(false), - fail_not_found_(false) { + fail_http_https_redir_(false), + fail_not_found_(false), + trace_symsrv_(trace_symsrv) { // Setting local_cache can be done without verifying that it exists because // SymSrv will create it if it is missing - any creation failures will occur // at that time, so there's nothing to check here, making it safe to @@ -342,6 +346,10 @@ MSSymbolServerConverter::LocateFile(const string& debug_or_code_file, return LOCATE_RETRY; } + if (fail_http_https_redir_) { + return LOCATE_HTTP_HTTPS_REDIR; + } + // This is an authoritiative file-not-found message. if (fail_not_found_) { fprintf(stderr, @@ -425,6 +433,10 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process, // message does not use the entire string but is appended to the URL // that SymSrv attempted to retrieve. string desc(cba_event->desc); + if (self->trace_symsrv_) { + fprintf(stderr, "LocateFile: SymCallback: action desc '%s'\n", + desc.c_str()); + } // desc_action maps strings (in desc) to boolean pointers that are to // be set to true if the string matches. @@ -434,29 +446,32 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process, }; static const desc_action desc_actions[] = { - // When a DNS error occurs, it could be indiciative of network - // problems. - { "SYMSRV: The server name or address could not be resolved\n", - &self->fail_dns_ }, - - // This message is produced if no connection is opened. - { "SYMSRV: A connection with the server could not be established\n", - &self->fail_timeout_ }, - - // This message is produced if a connection is established but the - // server fails to respond to the HTTP request. - { "SYMSRV: The operation timed out\n", - &self->fail_timeout_ }, - - // This message is produced when the requested file is not found, - // even if one or more of the above messages are also produced. - // It's trapped to distinguish between not-found and unknown-failure - // conditions. Note that this message will not be produced if a - // connection is established and the server begins to respond to the - // HTTP request but does not finish transmitting the file. - { " not found\n", - &self->fail_not_found_ } - }; + // When a DNS error occurs, it could be indiciative of network + // problems. + {"SYMSRV: The server name or address could not be resolved\n", + &self->fail_dns_}, + + // This message is produced if no connection is opened. + {"SYMSRV: A connection with the server could not be established\n", + &self->fail_timeout_}, + + // This message is produced if a connection is established but the + // server fails to respond to the HTTP request. + {"SYMSRV: The operation timed out\n", &self->fail_timeout_}, + + // This message is produced if the server is redirecting us from http + // to https. When this happens SymSrv will fail and we need to use + // the https URL in our call-- we've made a mistake. + {"ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR\n", + &self->fail_http_https_redir_}, + + // This message is produced when the requested file is not found, + // even if one or more of the above messages are also produced. + // It's trapped to distinguish between not-found and unknown-failure + // conditions. Note that this message will not be produced if a + // connection is established and the server begins to respond to the + // HTTP request but does not finish transmitting the file. + {" not found\n", &self->fail_not_found_}}; for (int desc_action_index = 0; desc_action_index < diff --git a/src/tools/windows/converter/ms_symbol_server_converter.h b/src/tools/windows/converter/ms_symbol_server_converter.h index 40d65d52a..a41cad165 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.h +++ b/src/tools/windows/converter/ms_symbol_server_converter.h @@ -127,9 +127,10 @@ class MSSymbolServerConverter { public: enum LocateResult { LOCATE_FAILURE = 0, - LOCATE_NOT_FOUND, // Authoritative: the file is not present. - LOCATE_RETRY, // Transient (network?) error, try again later. - LOCATE_SUCCESS + LOCATE_NOT_FOUND, // Authoritative: the file is not present. + LOCATE_RETRY, // Transient (network?) error, try again later. + LOCATE_SUCCESS, + LOCATE_HTTP_HTTPS_REDIR }; // Create a new object. local_cache is the location (pathname) of a local @@ -141,8 +142,11 @@ class MSSymbolServerConverter { // store to try. The vector must contain at least one string. None of the // strings passed to this constructor may contain asterisk ('*') or semicolon // (';') characters, as the symbol engine uses these characters as separators. + // If |trace_symsrv| is set then callbacks from SymSrv will be logged to + // stderr. MSSymbolServerConverter(const string& local_cache, - const vector& symbol_servers); + const vector& symbol_servers, + bool trace_symsrv); // Locates the PE file (DLL or EXE) specified by the identifying information // in |missing|, by checking the symbol stores identified when the object @@ -226,8 +230,12 @@ class MSSymbolServerConverter { // SymFindFileInPath fails for an expected reason. bool fail_dns_; // DNS failures (fail_not_found_ will also be set). bool fail_timeout_; // Timeouts (fail_not_found_ will also be set). + bool fail_http_https_redir_; // Bad URL-- we should be using HTTPS. bool fail_not_found_; // The file could not be found. If this is the only // fail_* member set, then it is authoritative. + + // If set then callbacks from SymSrv will be logged to stderr. + bool trace_symsrv_; }; } // namespace google_breakpad diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index 3e0d35d20..bb0d091ef 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -303,9 +303,7 @@ static bool SafeToMakeExternalRequest(const MissingSymbolInfo& missing_info, // Converter options derived from command line parameters. struct ConverterOptions { - ConverterOptions() - : report_fetch_failures(true) { - } + ConverterOptions() : report_fetch_failures(true), trace_symsrv(false) {} ~ConverterOptions() { } @@ -352,6 +350,9 @@ struct ConverterOptions { // Owned and cleaned up by this struct. std::regex blacklist_regex; + // If set then SymSrv callbacks are logged to stderr. + bool trace_symsrv; + private: // DISABLE_COPY_AND_ASSIGN ConverterOptions(const ConverterOptions&); @@ -416,7 +417,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, FprintfFlush(stderr, "Making internal request for %s (%s)\n", missing_info.debug_file.c_str(), missing_info.debug_identifier.c_str()); - MSSymbolServerConverter converter(options.local_cache_path, msss_servers); + MSSymbolServerConverter converter(options.local_cache_path, msss_servers, + options.trace_symsrv); located = converter.LocateAndConvertSymbolFile( missing_info, /*keep_symbol_file=*/true, @@ -470,6 +472,16 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, // a record. break; + case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: + FprintfFlush( + stderr, + "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" + "One of the specified URLs is using HTTP, which causes a redirect " + "from the server to HTTPS, which causes the SymSrv lookup to " + "fail.\n" + "This URL must be replaced with the correct HTTPS URL.\n"); + break; + case MSSymbolServerConverter::LOCATE_FAILURE: FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); // LocateAndConvertSymbolFile printed an error message. @@ -503,8 +515,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, FprintfFlush(stderr, "Making external request for %s (%s)\n", missing_info.debug_file.c_str(), missing_info.debug_identifier.c_str()); - MSSymbolServerConverter external_converter(options.local_cache_path, - msss_servers); + MSSymbolServerConverter external_converter( + options.local_cache_path, msss_servers, options.trace_symsrv); located = external_converter.LocateAndConvertSymbolFile( missing_info, /*keep_symbol_file=*/true, @@ -577,6 +589,15 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, missing_info.version.c_str()); break; + case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: + FprintfFlush( + stderr, + "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" + "One of the specified URLs is using HTTP, which causes a redirect " + "from the server to HTTPS, which causes the SymSrv lookup to fail.\n" + "This URL must be replaced with the correct HTTPS URL.\n"); + break; + case MSSymbolServerConverter::LOCATE_FAILURE: FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); // LocateAndConvertSymbolFile printed an error message. @@ -708,6 +729,8 @@ static int usage(const char* program_name) { " -t URL to report symbol fetch failure\n" " -b Regex used to blacklist files to\n" " prevent external symbol requests\n" + " -tss If set then SymSrv callbacks will be\n" + " traced to stderr.\n" " Note that any server specified by -f or -n that starts with \\filer\n" " will be treated as internal, and all others as external.\n", program_name); @@ -794,6 +817,9 @@ int main(int argc, char** argv) { printf("Getting the list of missing symbols from a file. Fetch failures" " will not be reported.\n"); options.report_fetch_failures = false; + } else if (option == "-tss") { + printf("Tracing SymSrv callbacks to stderr.\n"); + options.trace_symsrv = true; } else if (option == "-t") { if (!WindowsStringUtils::safe_mbstowcs( value, From 4d85225467d47f3e9245543543b9a9d4e265067a Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 6 Jun 2022 19:01:15 -0600 Subject: [PATCH 078/195] [breakpad] Add MINIDUMP_THREAD_NAME_LIST support Change-Id: I84205358ae48e757fa3b836747eadc32c2671756 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3690389 Reviewed-by: Joshua Peraza Reviewed-by: Ivan Penkov --- src/google_breakpad/common/minidump_format.h | 24 ++ src/google_breakpad/processor/minidump.h | 81 ++++++ .../processor/process_result.h | 6 +- src/google_breakpad/processor/process_state.h | 7 + src/processor/minidump.cc | 230 ++++++++++++++++++ src/processor/minidump_dump.cc | 6 + src/processor/minidump_processor.cc | 33 +++ src/processor/process_state.cc | 1 + src/processor/testdata/thread_name_list.dmp | Bin 0 -> 18011 bytes src/tools/mac/crash_report/crash_report.mm | 14 +- 10 files changed, 399 insertions(+), 3 deletions(-) create mode 100644 src/processor/testdata/thread_name_list.dmp diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 7b36d1127..e23666358 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -239,6 +239,15 @@ typedef struct { MDRVA rva; } MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */ +/* An MDRVA64 is an 64-bit offset into the minidump file. The beginning of the + * MDRawHeader is at offset 0. */ +typedef uint64_t MDRVA64; /* RVA64 */ + +typedef struct { + uint64_t data_size; + MDRVA64 rva; +} MDLocationDescriptor64; /* MINIDUMP_LOCATION_DESCRIPTOR64 */ + typedef struct { /* The base address of the memory range on the host that produced the @@ -332,6 +341,7 @@ typedef enum { MD_JAVASCRIPT_DATA_STREAM = 20, MD_SYSTEM_MEMORY_INFO_STREAM = 21, MD_PROCESS_VM_COUNTERS_STREAM = 22, + MD_THREAD_NAME_LIST_STREAM = 24, /* MDRawThreadNameList */ MD_LAST_RESERVED_STREAM = 0x0000ffff, /* Breakpad extension types. 0x4767 = "Gg" */ @@ -382,6 +392,20 @@ typedef struct { static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList, threads[0]); +#pragma pack(push, 4) +typedef struct { + uint32_t thread_id; + MDRVA64 thread_name_rva; /* MDString */ +} MDRawThreadName; /* MINIDUMP_THREAD_NAME */ + +typedef struct { + uint32_t number_of_thread_names; + MDRawThreadName thread_names[1]; +} MDRawThreadNameList; /* MINIDUMP_THREAD_NAME_LIST */ +#pragma pack(pop) + +static const size_t MDRawThreadNameList_minsize = + offsetof(MDRawThreadNameList, thread_names[0]); typedef struct { uint64_t base_of_image; diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 1c40a821a..200a7e82d 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -370,6 +370,86 @@ class MinidumpThreadList : public MinidumpStream { DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList); }; +// MinidumpThreadName contains the name of a thread. +class MinidumpThreadName : public MinidumpObject { + public: + virtual ~MinidumpThreadName(); + + const MDRawThreadName* thread_name() const { + return valid_ ? &thread_name_ : NULL; + } + + // Gets the thread ID. + virtual bool GetThreadID(uint32_t* thread_id) const; + + // Print a human-readable representation of the object to stdout. + void Print(); + + // Returns the name of the thread. + virtual std::string GetThreadName() const; + + protected: + explicit MinidumpThreadName(Minidump* minidump); + + private: + // These objects are managed by MinidumpThreadNameList. + friend class MinidumpThreadNameList; + + // This works like MinidumpStream::Read, but is driven by + // MinidumpThreadNameList. No size checking is done, because + // MinidumpThreadNameList handles that directly. + bool Read(); + + // Reads indirectly-referenced data, including the thread name. + bool ReadAuxiliaryData(); + + // True after a successful Read. This is different from valid_, which is not + // set true until ReadAuxiliaryData also completes successfully. + // thread_name_valid_ is only used by ReadAuxiliaryData and the functions it + // calls to determine whether the object is ready for auxiliary data to be + // read. + bool thread_name_valid_; + + MDRawThreadName thread_name_; + + // Cached thread name. + const string* name_; +}; + +// MinidumpThreadNameList contains all of the names of the threads (as +// MinidumpThreadNames) in a process. +class MinidumpThreadNameList : public MinidumpStream { + public: + virtual ~MinidumpThreadNameList(); + + virtual unsigned int thread_name_count() const { + return valid_ ? thread_name_count_ : 0; + } + + // Sequential access to thread names. + virtual MinidumpThreadName* GetThreadNameAtIndex(unsigned int index) const; + + // Print a human-readable representation of the object to stdout. + void Print(); + + protected: + explicit MinidumpThreadNameList(Minidump* aMinidump); + + private: + friend class Minidump; + + typedef vector MinidumpThreadNames; + + static const uint32_t kStreamType = MD_THREAD_NAME_LIST_STREAM; + + bool Read(uint32_t aExpectedSize) override; + + // The list of thread names. + MinidumpThreadNames* thread_names_; + uint32_t thread_name_count_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpThreadNameList); +}; // MinidumpModule wraps MDRawModule, which contains information about loaded // code modules. Access is provided to various data referenced indirectly @@ -1188,6 +1268,7 @@ class Minidump { // to avoid exposing an ugly API (GetStream needs to accept a garbage // parameter). virtual MinidumpThreadList* GetThreadList(); + virtual MinidumpThreadNameList* GetThreadNameList(); virtual MinidumpModuleList* GetModuleList(); virtual MinidumpMemoryList* GetMemoryList(); virtual MinidumpException* GetException(); diff --git a/src/google_breakpad/processor/process_result.h b/src/google_breakpad/processor/process_result.h index 15c7213e9..9317e98e1 100644 --- a/src/google_breakpad/processor/process_result.h +++ b/src/google_breakpad/processor/process_result.h @@ -56,9 +56,13 @@ enum ProcessResult { PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS, // There was more than one // requesting thread. - PROCESS_SYMBOL_SUPPLIER_INTERRUPTED // The dump processing was + PROCESS_SYMBOL_SUPPLIER_INTERRUPTED, // The dump processing was // interrupted by the // SymbolSupplier(not fatal). + + PROCESS_ERROR_GETTING_THREAD_NAME, // There was an error getting one + // thread's name from the dump. + }; } // namespace google_breakpad diff --git a/src/google_breakpad/processor/process_state.h b/src/google_breakpad/processor/process_state.h index 9bc44c450..c13246fda 100644 --- a/src/google_breakpad/processor/process_state.h +++ b/src/google_breakpad/processor/process_state.h @@ -111,6 +111,7 @@ class ProcessState { const vector* thread_memory_regions() const { return &thread_memory_regions_; } + const vector* thread_names() const { return &thread_names_; } const SystemInfo* system_info() const { return &system_info_; } const CodeModules* modules() const { return modules_; } const CodeModules* unloaded_modules() const { return unloaded_modules_; } @@ -176,6 +177,12 @@ class ProcessState { vector threads_; vector thread_memory_regions_; + // Names of each thread at the time of the crash, one for each entry in + // threads_. Note that a thread's name might be empty if there was no + // corresponding ThreadNamesStream in the minidump, or if a particular thread + // ID was not present in the THREAD_NAME_LIST. + vector thread_names_; + // OS and CPU information. SystemInfo system_info_; diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 572c717cd..db7a4a16a 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1843,6 +1843,229 @@ void MinidumpThreadList::Print() { } } +// +// MinidumpThreadName +// + +MinidumpThreadName::MinidumpThreadName(Minidump* minidump) + : MinidumpObject(minidump), + thread_name_valid_(false), + thread_name_(), + name_(NULL) {} + +MinidumpThreadName::~MinidumpThreadName() { + delete name_; +} + +bool MinidumpThreadName::Read() { + // Invalidate cached data. + delete name_; + name_ = NULL; + + valid_ = false; + + if (!minidump_->ReadBytes(&thread_name_, sizeof(thread_name_))) { + BPLOG(ERROR) << "MinidumpThreadName cannot read thread name"; + return false; + } + + if (minidump_->swap()) { + Swap(&thread_name_.thread_id); + Swap(&thread_name_.thread_name_rva); + } + + thread_name_valid_ = true; + return true; +} + +bool MinidumpThreadName::ReadAuxiliaryData() { + if (!thread_name_valid_) { + BPLOG(ERROR) << "Invalid MinidumpThreadName for ReadAuxiliaryData"; + return false; + } + + // On 32-bit systems, check that the RVA64 is within range (off_t is 32 bits). + if (thread_name_.thread_name_rva > numeric_limits::max()) { + BPLOG(ERROR) << "MinidumpThreadName RVA64 out of range"; + return false; + } + + // Read the thread name. + const off_t thread_name_rva_offset = + static_cast(thread_name_.thread_name_rva); + name_ = minidump_->ReadString(thread_name_rva_offset); + if (!name_) { + BPLOG(ERROR) << "MinidumpThreadName could not read name"; + return false; + } + + // At this point, we have enough info for the thread name to be valid. + valid_ = true; + return true; +} + +bool MinidumpThreadName::GetThreadID(uint32_t* thread_id) const { + BPLOG_IF(ERROR, !thread_id) << "MinidumpThreadName::GetThreadID requires " + "|thread_id|"; + assert(thread_id); + *thread_id = 0; + + if (!valid_) { + BPLOG(ERROR) << "Invalid MinidumpThreadName for GetThreadID"; + return false; + } + + *thread_id = thread_name_.thread_id; + return true; +} + +string MinidumpThreadName::GetThreadName() const { + if (!valid_) { + BPLOG(ERROR) << "Invalid MinidumpThreadName for GetThreadName"; + return ""; + } + + return *name_; +} + +void MinidumpThreadName::Print() { + if (!valid_) { + BPLOG(ERROR) << "MinidumpThreadName cannot print invalid data"; + return; + } + + printf("MDRawThreadName\n"); + printf(" thread_id = 0x%x\n", thread_name_.thread_id); + printf(" thread_name_rva = 0x%" PRIx64 "\n", + thread_name_.thread_name_rva); + printf(" thread_name = \"%s\"\n", GetThreadName().c_str()); + printf("\n"); +} + +// +// MinidumpThreadNameList +// + +MinidumpThreadNameList::MinidumpThreadNameList(Minidump* minidump) + : MinidumpStream(minidump), thread_names_(NULL), thread_name_count_(0) {} + +MinidumpThreadNameList::~MinidumpThreadNameList() { + delete thread_names_; +} + +bool MinidumpThreadNameList::Read(uint32_t expected_size) { + // Invalidate cached data. + delete thread_names_; + thread_names_ = NULL; + thread_name_count_ = 0; + + valid_ = false; + + uint32_t thread_name_count; + if (expected_size < sizeof(thread_name_count)) { + BPLOG(ERROR) << "MinidumpThreadNameList count size mismatch, " + << expected_size << " < " << sizeof(thread_name_count); + return false; + } + if (!minidump_->ReadBytes(&thread_name_count, sizeof(thread_name_count))) { + BPLOG(ERROR) << "MinidumpThreadNameList cannot read thread name count"; + return false; + } + + if (minidump_->swap()) + Swap(&thread_name_count); + + if (thread_name_count > + numeric_limits::max() / sizeof(MDRawThreadName)) { + BPLOG(ERROR) << "MinidumpThreadNameList thread name count " + << thread_name_count << " would cause multiplication overflow"; + return false; + } + + if (expected_size != + sizeof(thread_name_count) + thread_name_count * sizeof(MDRawThreadName)) { + BPLOG(ERROR) << "MinidumpThreadNameList size mismatch, " << expected_size + << " != " + << sizeof(thread_name_count) + + thread_name_count * sizeof(MDRawThreadName); + return false; + } + + if (thread_name_count > MinidumpThreadList::max_threads()) { + BPLOG(ERROR) << "MinidumpThreadNameList count " << thread_name_count + << " exceeds maximum " << MinidumpThreadList::max_threads(); + return false; + } + + if (thread_name_count != 0) { + scoped_ptr thread_names(new MinidumpThreadNames( + thread_name_count, MinidumpThreadName(minidump_))); + + for (unsigned int thread_name_index = 0; + thread_name_index < thread_name_count; ++thread_name_index) { + MinidumpThreadName* thread_name = &(*thread_names)[thread_name_index]; + + // Assume that the file offset is correct after the last read. + if (!thread_name->Read()) { + BPLOG(ERROR) << "MinidumpThreadNameList cannot read thread name " + << thread_name_index << "/" << thread_name_count; + return false; + } + } + + for (unsigned int thread_name_index = 0; + thread_name_index < thread_name_count; ++thread_name_index) { + MinidumpThreadName* thread_name = &(*thread_names)[thread_name_index]; + + if (!thread_name->ReadAuxiliaryData() && !thread_name->valid()) { + BPLOG(ERROR) << "MinidumpThreadNameList cannot read thread name " + << thread_name_index << "/" << thread_name_count; + return false; + } + } + + thread_names_ = thread_names.release(); + } + + thread_name_count_ = thread_name_count; + + valid_ = true; + return true; +} + +MinidumpThreadName* MinidumpThreadNameList::GetThreadNameAtIndex( + unsigned int index) const { + if (!valid_) { + BPLOG(ERROR) << "Invalid MinidumpThreadNameList for GetThreadNameAtIndex"; + return NULL; + } + + if (index >= thread_name_count_) { + BPLOG(ERROR) << "MinidumpThreadNameList index out of range: " << index + << "/" << thread_name_count_; + return NULL; + } + + return &(*thread_names_)[index]; +} + +void MinidumpThreadNameList::Print() { + if (!valid_) { + BPLOG(ERROR) << "MinidumpThreadNameList cannot print invalid data"; + return; + } + + printf("MinidumpThreadNameList\n"); + printf(" thread_name_count = %d\n", thread_name_count_); + printf("\n"); + + for (unsigned int thread_name_index = 0; + thread_name_index < thread_name_count_; ++thread_name_index) { + printf("thread_name[%d]\n", thread_name_index); + + (*thread_names_)[thread_name_index].Print(); + } +} // // MinidumpModule @@ -5280,6 +5503,7 @@ bool Minidump::Read() { unsigned int stream_type = directory_entry->stream_type; switch (stream_type) { case MD_THREAD_LIST_STREAM: + case MD_THREAD_NAME_LIST_STREAM: case MD_MODULE_LIST_STREAM: case MD_MEMORY_LIST_STREAM: case MD_EXCEPTION_STREAM: @@ -5318,6 +5542,10 @@ MinidumpThreadList* Minidump::GetThreadList() { return GetStream(&thread_list); } +MinidumpThreadNameList* Minidump::GetThreadNameList() { + MinidumpThreadNameList* thread_name_list; + return GetStream(&thread_name_list); +} MinidumpModuleList* Minidump::GetModuleList() { MinidumpModuleList* module_list; @@ -5417,6 +5645,8 @@ static const char* get_stream_name(uint32_t stream_type) { return "MD_RESERVED_STREAM_1"; case MD_THREAD_LIST_STREAM: return "MD_THREAD_LIST_STREAM"; + case MD_THREAD_NAME_LIST_STREAM: + return "MD_THREAD_NAME_LIST_STREAM"; case MD_MODULE_LIST_STREAM: return "MD_MODULE_LIST_STREAM"; case MD_MEMORY_LIST_STREAM: diff --git a/src/processor/minidump_dump.cc b/src/processor/minidump_dump.cc index ed2edaf0f..ce7432e56 100644 --- a/src/processor/minidump_dump.cc +++ b/src/processor/minidump_dump.cc @@ -45,6 +45,7 @@ namespace { using google_breakpad::Minidump; using google_breakpad::MinidumpThreadList; +using google_breakpad::MinidumpThreadNameList; using google_breakpad::MinidumpModuleList; using google_breakpad::MinidumpMemoryInfoList; using google_breakpad::MinidumpMemoryList; @@ -122,6 +123,11 @@ static bool PrintMinidumpDump(const Options& options) { thread_list->Print(); } + MinidumpThreadNameList *thread_name_list = minidump.GetThreadNameList(); + if (thread_name_list) { + thread_name_list->Print(); + } + // It's useful to be able to see the full list of modules here even if it // would cause minidump_stackwalk to fail. MinidumpModuleList::set_max_modules(UINT32_MAX); diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index ac86fbd39..fd4b28e2f 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -32,7 +32,9 @@ #include #include +#include #include +#include #include "common/scoped_ptr.h" #include "common/stdio_wrapper.h" @@ -199,6 +201,28 @@ ProcessResult MinidumpProcessor::Process( // Reset frame_symbolizer_ at the beginning of stackwalk for each minidump. frame_symbolizer_->Reset(); + + MinidumpThreadNameList* thread_names = dump->GetThreadNameList(); + std::map thread_id_to_name; + if (thread_names) { + const unsigned int thread_name_count = thread_names->thread_name_count(); + for (unsigned int thread_name_index = 0; + thread_name_index < thread_name_count; + ++thread_name_index) { + MinidumpThreadName* thread_name = thread_names->GetThreadNameAtIndex(thread_name_index); + if (!thread_name) { + BPLOG(ERROR) << "Could not get thread name for thread at index " << thread_name_index; + return PROCESS_ERROR_GETTING_THREAD_NAME; + } + uint32_t thread_id; + if (!thread_name->GetThreadID(&thread_id)) { + BPLOG(ERROR) << "Could not get thread ID for thread at index " << thread_name_index; + return PROCESS_ERROR_GETTING_THREAD_NAME; + } + thread_id_to_name.insert(std::make_pair(thread_id, thread_name->GetThreadName())); + } + } + for (unsigned int thread_index = 0; thread_index < thread_count; ++thread_index) { @@ -220,6 +244,14 @@ ProcessResult MinidumpProcessor::Process( } thread_string += " id " + HexString(thread_id); + auto thread_name_iter = thread_id_to_name.find(thread_id); + string thread_name; + if (thread_name_iter != thread_id_to_name.end()) { + thread_name = thread_name_iter->second; + } + if (!thread_name.empty()) { + thread_string += " name [" + thread_name + "]"; + } BPLOG(INFO) << "Looking at thread " << thread_string; // If this thread is the thread that produced the minidump, don't process @@ -311,6 +343,7 @@ ProcessResult MinidumpProcessor::Process( stack->set_tid(thread_id); process_state->threads_.push_back(stack.release()); process_state->thread_memory_regions_.push_back(thread_memory); + process_state->thread_names_.push_back(thread_name); } if (interrupted) { diff --git a/src/processor/process_state.cc b/src/processor/process_state.cc index c9269e418..52e484d9a 100644 --- a/src/processor/process_state.cc +++ b/src/processor/process_state.cc @@ -58,6 +58,7 @@ void ProcessState::Clear() { } threads_.clear(); system_info_.Clear(); + thread_names_.clear(); // modules_without_symbols_ and modules_with_corrupt_symbols_ DO NOT own // the underlying CodeModule pointers. Just clear the vectors. modules_without_symbols_.clear(); diff --git a/src/processor/testdata/thread_name_list.dmp b/src/processor/testdata/thread_name_list.dmp new file mode 100644 index 0000000000000000000000000000000000000000..fbe84b6378f09b9140e935276fa147758e19666d GIT binary patch literal 18011 zcmeHO3wTsTmOhpS%Rf8D;F+Z__fj1Sz8 zlhmy`Rj1B5b?VgP)~%kFJ}vX!U)rjBiij0~@ad4;TrDLMjzpqKq$N_sjC67o=qw@; zNI!xwDMTIY5N3h!Q^fHIr@$u@nU^BH6=BT9A_<5GBfO4u*CA56 z?XZ}-`zzWeh=d{i4S7M+-U@JELVr`4;rArCd~I-s~+jC$+ha@tB0x7(QooqJQ!2y z<=2a_PIe!WGCWVuKk93WG|3Hy41cFsP@yOHYkDlIbV%A_hKe$PwUw|{xoaSaF44%2$%pFX36_4|4 zX2z}y-4X;>0JHwIEi3KDwzQV=`8OVI?Yc8W*7XsZEXJM58U%*pJC!xvqhwYOkU5*I za&pgu&%O{MYo1>gtTXi&hMY?!%}NQWQF_M#}wviIiEM%RfrT3zV_He&_c?#ztA8HpCP!#|*OC`+UnHCA;1%E3S%= zZv775`XFD{z7t5-Y*;CBAlf9q`oMSMvygUmWW&&Q(KouYaein&zAn?uj)lC($!M_* z%*`E*y+E4{!?8Q&9HGUuA!V2mLi>wbhoMGUz>Q$STkkCkQ9D-T&l|?6`o0fu0tq>3 z+9 zwlDc}x2Xz09X(pb6AwT4@}&?RwdBnt?z(mjytFUdHg(3FYRdlAs@`Ew%z9q-{!@53 zd65r!u>O|j*xu{r&y}z4`miUN-PG^t?#JGlCY!S`$@^jA8k5`u{ylC8lW7qm+b4y| z!*5eUFg&wvpURknJ(UsGeEkQBz1k!$QWY za?o=nqDf*OyYV+3{OBjNR&Xo3Vk>&D2bw#2-aP41!8*Rlct_1PMORkR+^xoIjH=9?k~IU;BJ`T@%KQ*jBZmLZeCK zH1>sk2d?sBcTjKSaXy^6X**w|R&8nBH@+`F2=!&FUll#pHOpwtmpzfIy!7QTjJJ1j z9(ci*b?bB-Z-#HieBkrtJ={m`?l1RM_(>a)&$KfvBAoe*t9nF)=dI|YX1cY$0jB!( ztGrSDhUC(htN%E_6g%-w?^?uf#J%?Q{K|FrnZ%{mmzQ?n%O@_?d^z?qOZZrc zIcHxczb{Z%P|t#JzWeggoi^F}P^d3Ah4^yQ1z+yKe~sDn<#7o5yga~P$az`M*JIAf z*?lbE>b!hM2fn-%a=6E+Mtn!)x%)Ettw)_IgstRp9?#2tecE?rJ*MfaFG-U$TisW&QJ)HO*Acvv8hc(ERD2H<e4RsbQ6q2lS-!M1E^U9T1k9;%Z?fZN2#;kZ3+g&C0 zq7f+pswbXEniEr6xZw5H6^~k`Jnb`3EzEb@19U&xn7I7`)BKya-t)+T#C<>Kw>wE6 zopZarWU-^fo#QQaEp|KeZT1|mqa?r3UQ(9ivKQIGAt^N}B`qbVw7kq&UY4`aQIa!L zE6ADaC>fEGGo>WcRcf=l-Q$ZKs1^{I+OIfuZP{*D-r=pesqguEQDA<7C*SEXXul@q zplwI?`p;$^K3Z*G{=qLvRP6THTy1<7zxK&%&rW>xi-aSqwtT%JX9h{!cH5#-cN@*{ zH%jAX|J#bnUGoozdlMX1(s*4?ut^Q*^YQJOFaP_!sjtm^D)!5UN3ypl8n@f&uoXE1 zM6)M7kS$MMS^QApxYaifda;m1HrFy|S&%Ki8uRp3wr2+ps;${E^0@_llr0x3GN;Q? z>?m`1?Ct=|la9pXeVH@t!ye2w^}Ks(Iazw_F1Mq!BtSEDOm)=*|5MV^?UTlv$G^3$ zm^8SwgCmEK>r^XoEUEw$m*Y$A5F9N9@R68$uyh9SQMi7Eqr3o)u@rh8E%drs=ykHt z>t8jkO^TguFyu0!|`V^ReDR2Ix&mO72Ex}ZaG^fNw)KCplH9L6h8}lwdNwYpF z$d7fIF8HFsRO8C`L@gWeDDiC2{Q75_%)F18gLWbB<-!CL>oJc9F_h0T!XBjY1y}at zc*pf#p2s?{!b|>EYlU||%1E1by{UXJ;s~rfryx`E5>Wp#6TfVdpMK?yWmZh*iU#>? zYZ>xhdCK8o-r~oeJ%Vi9^7#$llvUdYf2HZ7eU{g*43btqFiMZomJF$JcvvR^Wo)pLKpDVM3&@q2n#`9&A*$mw&w+4B%*INYx9_10(e&BEH{B0TK)f?)Q_HqQh zUBpeTdlZk@zwI%-0QxasHkkf*p{B#TIEH^|*jg|7q-3n}5+{GwGlQ;rg5TGe0brY# zB2;d<+e@ZS#K&J;E{UK$jw8A}+a_<#Rja(DYXC3O?nT*Tgqbr}x63Du6Zwo|L7R96 z8Xo%AMjzDW z^5`Azrr__r;#$$k2>hXs&h@^y@EJ(&@qaA-|Na>$wbkc4go%?euNU*fcRfbyEjY%n zS#rDQt#PZpnHX2JA|ITi4ytv+f2|aGTnhk|>UrVuqp`qb^eflU{$iC=nQ7`%@u!#{ z*~i34~d37whlhgUO>31{D_TWnAyLF7qb| z%-aMW%xgx>wPcrRu)2hG3i#vT4OM(kX06utU7+XursN|%t!B+Bv+vc7)AqcSo~Rc8 z4d%oR8HpBO{GlajvgTCuM^B(FoA>e#r)(}8BvrFF{CC!xQ*pldJs^0=oOlS$+;Gqr zU#sZN*^iA|Nt~q7dIKi^<)^9eZ#T`CiR*d(l(xWFD zFpN&VuS@jE?AksMtqI*Y+p_LR*@Q02PNMAS8GhNd+{Z!zD0rf!0Wf>xsX24AHhwyy z-d7&yE06V+NBd@5HvVaT?t)tn#7b3VH#tZ;9cpQceaC04_WF(-uu4^}33n=W+zgzH zqmCy4569M7$D@IprDqV1jt;^jrB47)1bq~?MSA_gz%3!=-7tOV<#8zQjyu*mPI)~H z{L!A;XajBmo)n`0&=CH-ajEko|6~JBe#7CadO7)}7|PlH5g~Z0Li8KVLH7 zeSse`;B4<A$tF8F1?RdK<34FIiy{9kQN`d#&+OQ+ag+-bav`h=3ZM!tSr~B^y@@bg&}9 zIq<-jxt<1Jz8K$^@<7M;CDL$iLL`}>xjrFH^gQDn#qx6nj!n*O_1AEYyGVU@;1O2< zoOEUl(o)k@q7nPuE0E%Kh!*JaV?Po*{APt$Yhm!yR(xbq+w)N(kSNb0-Wh8jb8HIYi zmX)&(fjkN1%YNM)e}^i&59Q=d8BXN4AjT1Z>T}X7K>x7366IVch5e=0$$a5DNj#?L z;6$BVl?RZ{6Pv)3(2O{Eoy?art&_?>{Qkmg27{t1yhl-=R}o?nPd>d<;&26FSJ4d< ztIQQ%23}QAKb>nFru>QYxYQ(Cj3n|y0bj_)%6ex3(&>P$rNlyy06coLd*S%H1m&NKQ`z&}vO=uf;3p!riB{HYH9)Gyed z)K4pu&+JeBpIs_N{14jWT>MG58>^{0&?5kTf1+-LdW6pXsYxm^9@d|3LeT8OpNMwF zo|N-Lf_^1KA7$)^hSoZzQUm%W*q`b`{Hf01PyHt9?dVGTH$euWS(g>?r@FKH6F*Vj zJSxw_`uv2M`}naV{Cvr9BK+Le@JdG^r)M8|obdn5wgJ4jc2_Ld&N?%Je=;)9L!JaD z@L&67XgR^pN|bZlDS9>TcB}Ut;xR?t1MfRJzu?+u#x{W`OPUb}&*Qt#_`ajtfOU-H zj#n47ao2=#*MxDmGI-qaC&~!i7qpwlSr!5jn4iyO+>uTP&P`6}5diuK1m*^aDQh>m%y*6MC>88d{r_Mh)nf;BnU!GVYoT<8I~OIqo!B O&AP0>xNAD=xcfh>9~->@ literal 0 HcmV?d00001 diff --git a/src/tools/mac/crash_report/crash_report.mm b/src/tools/mac/crash_report/crash_report.mm index f68200c7c..40b36252b 100644 --- a/src/tools/mac/crash_report/crash_report.mm +++ b/src/tools/mac/crash_report/crash_report.mm @@ -271,10 +271,15 @@ static void ProcessSingleReport(Options *options, NSString *file_path) { int requesting_thread = process_state.requesting_thread(); if (requesting_thread != -1) { printf("\n"); - printf("Thread %d (%s)\n", + printf("Thread %d (%s)", requesting_thread, process_state.crashed() ? "crashed" : "requested dump, did not crash"); + string requesting_thread_name = process_state.thread_names()->at(requesting_thread); + if (!requesting_thread_name.empty()) { + printf(" (name: %s)", requesting_thread_name.c_str()); + } + printf("\n"); PrintStack(process_state.threads()->at(requesting_thread), cpu); } @@ -287,7 +292,12 @@ static void ProcessSingleReport(Options *options, NSString *file_path) { if (thread_index != requesting_thread) { // Don't print the crash thread again, it was already printed. printf("\n"); - printf("Thread %d\n", thread_index); + printf("Thread %d", thread_index); + string thread_name = process_state.thread_names()->at(thread_index); + if (!thread_name.empty()) { + printf(" (name: %s)", thread_name.c_str()); + } + printf("\n"); PrintStack(process_state.threads()->at(thread_index), cpu); google_breakpad::MemoryRegion *thread_stack_bytes = thread_memory_regions->at(thread_index); From 0f1f43edd235f42ddbfab4fdec87bd043ef32508 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Wed, 8 Jun 2022 18:08:18 +0000 Subject: [PATCH 079/195] Revert "Support PE modules in core files when running core2md" This reverts commit 0808030bee8bc88a34675cd1dd83b965a2249a08. Reason for revert: Breaks Android Compile ld.lld: error: undefined symbol: google_breakpad::PEFile::TryGetDebugInfo(char const*, google_breakpad::_RSDS_DEBUG_FORMAT*) >>> referenced by minidump_writer.cc >>> client/minidump_writer.o:((anonymous namespace)::MinidumpWriter::FillRawModule(google_breakpad::MappingInfo const&, bool, unsigned int, MDRawModule*, unsigned char const*)) in archive obj/third_party/breakpad/libclient.a https://ci.chromium.org/ui/p/chromium/builders/try/android-marshmallow-arm64-rel/1188618/overview Original change's description: > Support PE modules in core files when running core2md > > Core files generated from `wine` contain both ELF and PE modules. Module > format can be guessed by checking the file contents. If the module > corresponds to PE-file conditions (has specific fields set up as > described in https://code.google.com/archive/p/corkami/wikis/PE.wiki) > we'll create a MDCVInfoPDB70 record in the minidump for it, but if > the file cannot be opened, is too short or is not a PE file, we'll > fall back to ELF procedure. > > Added /src/client/linux/minidump_writer/pe_file.{cc,h} to > src_client_linux_libbreakpad_client_a_SOURCES and > src_client_linux_linux_client_unittest_shlib_SOURCES. > Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'. > > Test: build core2md and use it to convert a core file into dmp, validate > that the generated dmp file can be opened. Ran './configure & make'. > > Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe > Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189 > Reviewed-by: Joshua Peraza Change-Id: I7105ed615a338263f112243bd8dc9e86b906fcb1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3695862 Reviewed-by: Ivan Penkov --- Makefile.am | 2 - Makefile.in | 51 +--- aclocal.m4 | 76 +++--- .../linux/minidump_writer/minidump_writer.cc | 107 +++------ src/client/linux/minidump_writer/pe_file.cc | 148 ------------ src/client/linux/minidump_writer/pe_file.h | 77 ------ src/client/linux/minidump_writer/pe_structs.h | 226 ------------------ 7 files changed, 65 insertions(+), 622 deletions(-) delete mode 100644 src/client/linux/minidump_writer/pe_file.cc delete mode 100644 src/client/linux/minidump_writer/pe_file.h delete mode 100644 src/client/linux/minidump_writer/pe_structs.h diff --git a/Makefile.am b/Makefile.am index 2cde86493..e7dc06ac7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,7 +168,6 @@ src_client_linux_libbreakpad_client_a_SOURCES = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ - src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h \ @@ -492,7 +491,6 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ - src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ diff --git a/Makefile.in b/Makefile.in index aaf791339..87377f3ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2021 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -360,7 +360,6 @@ am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ - src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h src/common/convert_UTF.cc \ @@ -388,7 +387,6 @@ am__dirstamp = $(am__leading_dot)dirstamp @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \ @@ -634,7 +632,6 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ - src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ @@ -668,7 +665,6 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ @@ -1649,14 +1645,12 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po \ - src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po \ - src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po \ src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po \ src/common/$(DEPDIR)/convert_UTF.Po \ src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po \ @@ -2107,6 +2101,9 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ @@ -2294,9 +2291,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/autotools/missing \ $(top_srcdir)/autotools/test-driver \ $(top_srcdir)/src/config.h.in AUTHORS ChangeLog INSTALL NEWS \ - README.md autotools/ar-lib autotools/compile \ - autotools/config.guess autotools/config.sub autotools/depcomp \ - autotools/install-sh autotools/ltmain.sh autotools/missing + autotools/ar-lib autotools/compile autotools/config.guess \ + autotools/config.sub autotools/depcomp autotools/install-sh \ + autotools/ltmain.sh autotools/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -2332,8 +2329,6 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ @@ -2344,7 +2339,6 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ @@ -2519,7 +2513,6 @@ CLEANFILES = $(am__append_12) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \ @@ -2725,7 +2718,6 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ @LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ @LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \ @@ -4159,9 +4151,6 @@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT): \ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) -src/client/linux/minidump_writer/pe_file.$(OBJEXT): \ - src/client/linux/minidump_writer/$(am__dirstamp) \ - src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/$(am__dirstamp): @$(MKDIR_P) src/client @: > src/client/$(am__dirstamp) @@ -4463,9 +4452,6 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) -src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT): \ - src/client/linux/minidump_writer/$(am__dirstamp) \ - src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) @@ -5371,14 +5357,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/convert_UTF.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po@am__quote@ # am--include-marker @@ -5937,20 +5921,6 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; fi` -src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o: src/client/linux/minidump_writer/pe_file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc - -src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj: src/client/linux/minidump_writer/pe_file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` - src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o: src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o `test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po @@ -9161,6 +9131,7 @@ src/processor/minidump_stackwalk_machine_readable_test.log: src/processor/minidu @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -9456,14 +9427,12 @@ distclean: distclean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po - -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po - -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po @@ -9801,14 +9770,12 @@ maintainer-clean: maintainer-clean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po - -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po - -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po diff --git a/aclocal.m4 b/aclocal.m4 index 009cc48ed..be219b421 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.5 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.5], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.5])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2021 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ AC_SUBST([AR])dnl # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -138,7 +138,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -190,7 +190,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -221,7 +221,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -412,7 +412,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -480,7 +480,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -508,10 +508,6 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl -m4_ifdef([_$0_ALREADY_INIT], - [m4_fatal([$0 expanded multiple times -]m4_defn([_$0_ALREADY_INIT]))], - [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -548,7 +544,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -600,20 +596,6 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi -AC_SUBST([CTAGS]) -if test -z "$ETAGS"; then - ETAGS=etags -fi -AC_SUBST([ETAGS]) -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi -AC_SUBST([CSCOPE]) - AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -695,7 +677,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -716,7 +698,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -738,7 +720,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -773,7 +755,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -816,7 +798,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -852,7 +834,7 @@ fi # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -879,7 +861,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -908,7 +890,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -955,7 +937,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -974,7 +956,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1055,7 +1037,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1115,7 +1097,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1143,7 +1125,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1162,7 +1144,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 7ce9ac570..72a921664 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -71,8 +71,6 @@ #include "client/linux/minidump_writer/line_reader.h" #include "client/linux/minidump_writer/linux_dumper.h" #include "client/linux/minidump_writer/linux_ptrace_dumper.h" -#include "client/linux/minidump_writer/pe_file.h" -#include "client/linux/minidump_writer/pe_structs.h" #include "client/linux/minidump_writer/proc_cpuinfo_reader.h" #include "client/minidump_file_writer.h" #include "common/linux/file_id.h" @@ -97,11 +95,8 @@ using google_breakpad::MappingInfo; using google_breakpad::MappingList; using google_breakpad::MinidumpFileWriter; using google_breakpad::PageAllocator; -using google_breakpad::PEFile; -using google_breakpad::PEFileFormat; using google_breakpad::ProcCpuInfoReader; using google_breakpad::RawContextCPU; -using google_breakpad::RSDS_DEBUG_FORMAT; using google_breakpad::ThreadInfo; using google_breakpad::TypedMDRVA; using google_breakpad::UContextReader; @@ -637,88 +632,40 @@ class MinidumpWriter { mod->base_of_image = mapping.start_addr; mod->size_of_image = mapping.size; - char file_name[NAME_MAX]; - char file_path[NAME_MAX]; - - dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, - sizeof(file_path), file_name, - sizeof(file_name)); - - RSDS_DEBUG_FORMAT rsds; - PEFileFormat file_format = PEFile::TryGetDebugInfo(file_path, &rsds); - - if (file_format == PEFileFormat::notPeCoff) { - // The module is not a PE/COFF file, process as an ELF. - auto_wasteful_vector identifier_bytes( - dumper_->allocator()); - - if (identifier) { - // GUID was provided by caller. - identifier_bytes.insert(identifier_bytes.end(), identifier, - identifier + sizeof(MDGUID)); - } else { - // Note: ElfFileIdentifierForMapping() can manipulate the - // |mapping.name|, that is why we need to call the method - // GetMappingEffectiveNameAndPath again. - dumper_->ElfFileIdentifierForMapping(mapping, member, mapping_id, - identifier_bytes); - dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, - sizeof(file_path), file_name, - sizeof(file_name)); - } - - if (!identifier_bytes.empty()) { - UntypedMDRVA cv(&minidump_writer_); - if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) - return false; - - const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; - cv.Copy(&cv_signature, sizeof(cv_signature)); - cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], - identifier_bytes.size()); + auto_wasteful_vector identifier_bytes( + dumper_->allocator()); - mod->cv_record = cv.location(); - } + if (identifier) { + // GUID was provided by caller. + identifier_bytes.insert(identifier_bytes.end(), + identifier, + identifier + sizeof(MDGUID)); } else { - // The module is a PE/COFF file. Create MDCVInfoPDB70 struct for it. - size_t file_name_length = strlen(file_name); - TypedMDRVA cv(&minidump_writer_); - if (!cv.AllocateObjectAndArray(file_name_length + 1, sizeof(uint8_t))) - return false; - if (!cv.CopyIndexAfterObject(0, file_name, file_name_length)) + // Note: ElfFileIdentifierForMapping() can manipulate the |mapping.name|. + dumper_->ElfFileIdentifierForMapping(mapping, + member, + mapping_id, + identifier_bytes); + } + + if (!identifier_bytes.empty()) { + UntypedMDRVA cv(&minidump_writer_); + if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) return false; - MDCVInfoPDB70* cv_ptr = cv.get(); - cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE; - if (file_format == PEFileFormat::peWithBuildId) { - // Populate BuildId and age using RSDS instance. - cv_ptr->signature.data1 = static_cast(rsds.guid[0]) << 24 | - static_cast(rsds.guid[1]) << 16 | - static_cast(rsds.guid[2]) << 8 | - static_cast(rsds.guid[3]); - cv_ptr->signature.data2 = - static_cast(rsds.guid[4]) << 8 | rsds.guid[5]; - cv_ptr->signature.data3 = - static_cast(rsds.guid[6]) << 8 | rsds.guid[7]; - cv_ptr->signature.data4[0] = rsds.guid[8]; - cv_ptr->signature.data4[1] = rsds.guid[9]; - cv_ptr->signature.data4[2] = rsds.guid[10]; - cv_ptr->signature.data4[3] = rsds.guid[11]; - cv_ptr->signature.data4[4] = rsds.guid[12]; - cv_ptr->signature.data4[5] = rsds.guid[13]; - cv_ptr->signature.data4[6] = rsds.guid[14]; - cv_ptr->signature.data4[7] = rsds.guid[15]; - // The Age field should be reverted as well. - cv_ptr->age = static_cast(rsds.age[0]) << 24 | - static_cast(rsds.age[1]) << 16 | - static_cast(rsds.age[2]) << 8 | - static_cast(rsds.age[3]); - } else { - cv_ptr->age = 0; - } + + const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; + cv.Copy(&cv_signature, sizeof(cv_signature)); + cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], + identifier_bytes.size()); mod->cv_record = cv.location(); } + char file_name[NAME_MAX]; + char file_path[NAME_MAX]; + dumper_->GetMappingEffectiveNameAndPath( + mapping, file_path, sizeof(file_path), file_name, sizeof(file_name)); + MDLocationDescriptor ld; if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld)) return false; diff --git a/src/client/linux/minidump_writer/pe_file.cc b/src/client/linux/minidump_writer/pe_file.cc deleted file mode 100644 index 4a8f1936e..000000000 --- a/src/client/linux/minidump_writer/pe_file.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "client/linux/minidump_writer/pe_file.h" -#include "client/linux/minidump_writer/pe_structs.h" -#include "common/linux/memory_mapped_file.h" - -namespace google_breakpad { - -PEFileFormat PEFile::TryGetDebugInfo(const char* filename, - PRSDS_DEBUG_FORMAT debug_info) { - MemoryMappedFile mapped_file(filename, 0); - if (!mapped_file.data()) - return PEFileFormat::notPeCoff; - const void* base = mapped_file.data(); - const size_t file_size = mapped_file.size(); - - const IMAGE_DOS_HEADER* header = - TryReadStruct(base, 0, file_size); - if (!header || (header->e_magic != IMAGE_DOS_SIGNATURE)) { - return PEFileFormat::notPeCoff; - } - - // NTHeader is at position 'e_lfanew'. - DWORD nt_header_offset = header->e_lfanew; - // First, read a common IMAGE_NT_HEADERS structure. It should contain a - // special flag marking whether PE module is x64 (OptionalHeader.Magic) - // and so-called NT_SIGNATURE in Signature field. - const IMAGE_NT_HEADERS* nt_header = - TryReadStruct(base, nt_header_offset, file_size); - if (!nt_header || (nt_header->Signature != IMAGE_NT_SIGNATURE) - || ((nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) - && (nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC))) - return PEFileFormat::notPeCoff; - - bool x64 = nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC; - WORD sections_number = nt_header->FileHeader.NumberOfSections; - DWORD debug_offset; - DWORD debug_size; - DWORD section_offset; - if (x64) { - const IMAGE_NT_HEADERS64* header_64 = - TryReadStruct(base, nt_header_offset, file_size); - if (!header_64) - return PEFileFormat::peWithoutBuildId; - debug_offset = - header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] - .VirtualAddress; - debug_size = - header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] - .Size; - section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS64); - } else { - const IMAGE_NT_HEADERS32* header_32 = - TryReadStruct(base, nt_header_offset, file_size); - if (!header_32) - return PEFileFormat::peWithoutBuildId; - debug_offset = - header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] - .VirtualAddress; - debug_size = - header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] - .Size; - section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS32); - } - - DWORD debug_end_pos = debug_offset + debug_size; - while (debug_offset < debug_end_pos) { - for (WORD i = 0; i < sections_number; ++i) { - // Section headers are placed sequentially after the NT_HEADER (32/64). - const IMAGE_SECTION_HEADER* section = - TryReadStruct(base, section_offset, file_size); - if (!section) - return PEFileFormat::peWithoutBuildId; - - section_offset += sizeof(IMAGE_SECTION_HEADER); - - // Current `debug_offset` should be inside a section, stop if we find - // a suitable one (we don't consider any malformed sections here). - if ((section->VirtualAddress <= debug_offset) && - (debug_offset < section->VirtualAddress + section->SizeOfRawData)) { - DWORD offset = - section->PointerToRawData + debug_offset - section->VirtualAddress; - // Go to the position of current ImageDebugDirectory (offset). - const IMAGE_DEBUG_DIRECTORY* debug_directory = - TryReadStruct(base, offset, file_size); - if (!debug_directory) - return PEFileFormat::peWithoutBuildId; - // Process ImageDebugDirectory with CodeViewRecord type and skip - // all others. - if (debug_directory->Type == IMAGE_DEBUG_TYPE_CODEVIEW) { - DWORD debug_directory_size = debug_directory->SizeOfData; - if (debug_directory_size < sizeof(RSDS_DEBUG_FORMAT)) - // RSDS section is malformed. - return PEFileFormat::peWithoutBuildId; - // Go to the position of current ImageDebugDirectory Raw Data - // (debug_directory->PointerToRawData) and read the RSDS section. - const RSDS_DEBUG_FORMAT* rsds = - TryReadStruct( - base, debug_directory->PointerToRawData, file_size); - - if (!rsds) - return PEFileFormat::peWithoutBuildId; - - memcpy(debug_info->guid, rsds->guid, sizeof(rsds->guid)); - memcpy(debug_info->age, rsds->age, sizeof(rsds->age)); - return PEFileFormat::peWithBuildId; - } - - break; - } - } - - debug_offset += sizeof(IMAGE_DEBUG_DIRECTORY); - } - - return PEFileFormat::peWithoutBuildId; -} - -} // namespace google_breakpad \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_file.h b/src/client/linux/minidump_writer/pe_file.h deleted file mode 100644 index cc7ed0807..000000000 --- a/src/client/linux/minidump_writer/pe_file.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ -#define CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ - -#include "client/linux/minidump_writer/pe_structs.h" - -namespace google_breakpad { - -typedef enum { - notPeCoff = 0, - peWithoutBuildId = 1, - peWithBuildId = 2 -} PEFileFormat; - -class PEFile { - public: - /** - * Attempts to parse RSDS_DEBUG_FORMAT record from a PE (Portable - * Executable) file. To do this we check whether the loaded file is a PE - * file, and if it is - try to find IMAGE_DEBUG_DIRECTORY structure with - * its type set to IMAGE_DEBUG_TYPE_CODEVIEW. - * - * @param filename Filename for the module to parse. - * @param debug_info RSDS_DEBUG_FORMAT struct to be populated with PE debug - * info (GUID and age). - * @return - * notPeCoff: not PE/COFF file; - * peWithoutBuildId: a PE/COFF file but build-id is not set; - * peWithBuildId: a PE/COFF file and build-id is set. - */ - static PEFileFormat TryGetDebugInfo(const char* filename, - PRSDS_DEBUG_FORMAT debug_info); - - private: - template - static const TStruct* TryReadStruct(const void* base, - const DWORD position, - const size_t file_size) { - if (position + sizeof(TStruct) >= file_size){ - return nullptr; - } - - const void* ptr = static_cast(base) + position; - return reinterpret_cast(ptr); - } -}; - -} // namespace google_breakpad -#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_structs.h b/src/client/linux/minidump_writer/pe_structs.h deleted file mode 100644 index 843bd517a..000000000 --- a/src/client/linux/minidump_writer/pe_structs.h +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ -#define CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ - -#include - -namespace google_breakpad { - -typedef uint8_t BYTE; -typedef uint16_t WORD; -typedef uint32_t DWORD; -typedef uint64_t ULONGLONG; - -#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b -#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b - -#define IMAGE_DEBUG_TYPE_CODEVIEW 2 - -#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 - -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 -#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 - -typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header - WORD e_magic; // Magic number - WORD e_cblp; // Bytes on last page of file - WORD e_cp; // Pages in file - WORD e_crlc; // Relocations - WORD e_cparhdr; // Size of header in paragraphs - WORD e_minalloc; // Minimum extra paragraphs needed - WORD e_maxalloc; // Maximum extra paragraphs needed - WORD e_ss; // Initial (relative) SS value - WORD e_sp; // Initial SP value - WORD e_csum; // Checksum - WORD e_ip; // Initial IP value - WORD e_cs; // Initial (relative) CS value - WORD e_lfarlc; // File address of relocation table - WORD e_ovno; // Overlay number - WORD e_res[4]; // Reserved words - WORD e_oemid; // OEM identifier (for e_oeminfo) - WORD e_oeminfo; // OEM information; e_oemid specific - WORD e_res2[10]; // Reserved words - DWORD e_lfanew; // File address of new exe header -} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; - -typedef struct _IMAGE_FILE_HEADER { - WORD Machine; - WORD NumberOfSections; - DWORD TimeDateStamp; - DWORD PointerToSymbolTable; - DWORD NumberOfSymbols; - WORD SizeOfOptionalHeader; - WORD Characteristics; -} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; - -typedef struct _IMAGE_DATA_DIRECTORY { - DWORD VirtualAddress; - DWORD Size; -} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; - - -typedef struct _IMAGE_DEBUG_DIRECTORY { - DWORD Characteristics; - DWORD TimeDateStamp; - WORD MajorVersion; - WORD MinorVersion; - DWORD Type; - DWORD SizeOfData; - DWORD AddressOfRawData; - DWORD PointerToRawData; -} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY; - -typedef struct _IMAGE_OPTIONAL_HEADER64 { - // - // Standard fields - Magic. - // - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - // - // NT additional fields. - // - ULONGLONG ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - ULONGLONG SizeOfStackReserve; - ULONGLONG SizeOfStackCommit; - ULONGLONG SizeOfHeapReserve; - ULONGLONG SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; - -typedef struct _IMAGE_OPTIONAL_HEADER { - // - // Standard fields. - // - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - DWORD BaseOfData; - // - // NT additional fields. - // - DWORD ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - DWORD SizeOfStackReserve; - DWORD SizeOfStackCommit; - DWORD SizeOfHeapReserve; - DWORD SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32; - -typedef struct _IMAGE_NT_HEADERS64 { - DWORD Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER64 OptionalHeader; -} IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64; - -typedef struct _IMAGE_NT_HEADERS32 { - DWORD Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER32 OptionalHeader; -} IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32; - -typedef struct _IMAGE_NT_HEADERS { - DWORD Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER32 OptionalHeader; -} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS; - -#define IMAGE_SIZEOF_SHORT_NAME 8 - -typedef struct _IMAGE_SECTION_HEADER { - BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; - union { - DWORD PhysicalAddress; - DWORD VirtualSize; - } Misc; - DWORD VirtualAddress; - DWORD SizeOfRawData; - DWORD PointerToRawData; - DWORD PointerToRelocations; - DWORD PointerToLinenumbers; - WORD NumberOfRelocations; - WORD NumberOfLinenumbers; - DWORD Characteristics; -} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; - -typedef struct _RSDS_DEBUG_FORMAT { - DWORD signature; - BYTE guid[16]; - BYTE age[4]; - char pdbpath[1]; -} RSDS_DEBUG_FORMAT, *PRSDS_DEBUG_FORMAT; - -} // namespace google_breakpad - -#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ \ No newline at end of file From 82b16055af1d0654de4202d80e2d41d5120a23f9 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Wed, 8 Jun 2022 13:37:42 -0400 Subject: [PATCH 080/195] Remove usage of sprintf in dwarf_cfi_to_module. sprintf is marked as deprecated with Xcode 14. Bug: 1331345 Change-Id: Ic301134ec0c5e7b9ee9d590ab1423491aad5ccf7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3692036 Reviewed-by: Ivan Penkov Reviewed-by: Mike Frysinger --- src/common/dwarf_cfi_to_module.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index d7d19834b..739b9fe0d 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -184,9 +184,7 @@ string DwarfCFIToModule::RegisterName(int i) { return register_names_[reg]; reporter_->UnnamedRegister(entry_offset_, reg); - char buf[30]; - sprintf(buf, "unnamed_register%u", reg); - return buf; + return string("unnamed_register") + std::to_string(reg); } void DwarfCFIToModule::Record(Module::Address address, int reg, From c4c43b80ea8854c57a4374ac32579b577172dc23 Mon Sep 17 00:00:00 2001 From: Iryna Shakhova Date: Thu, 12 May 2022 09:32:52 +0000 Subject: [PATCH 081/195] Reland "Support PE modules in core files when running core2md" This is a reland of commit 0808030bee8bc88a34675cd1dd83b965a2249a08 Original change's description: > Support PE modules in core files when running core2md > > Core files generated from `wine` contain both ELF and PE modules. Module > format can be guessed by checking the file contents. If the module > corresponds to PE-file conditions (has specific fields set up as > described in https://code.google.com/archive/p/corkami/wikis/PE.wiki) > we'll create a MDCVInfoPDB70 record in the minidump for it, but if > the file cannot be opened, is too short or is not a PE file, we'll > fall back to ELF procedure. > > Added /src/client/linux/minidump_writer/pe_file.{cc,h} to > src_client_linux_libbreakpad_client_a_SOURCES and > src_client_linux_linux_client_unittest_shlib_SOURCES. > Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'. > > Test: build core2md and use it to convert a core file into dmp, validate > that the generated dmp file can be opened. Ran './configure & make'. > > Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe > Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189 > Reviewed-by: Joshua Peraza Change-Id: I09dd067a39a95f81f48656595e811c263561ebf2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3695863 Reviewed-by: Joshua Peraza --- Makefile.am | 2 + Makefile.in | 51 +++- aclocal.m4 | 76 +++--- .../linux/minidump_writer/minidump_writer.cc | 107 ++++++--- src/client/linux/minidump_writer/pe_file.cc | 148 ++++++++++++ src/client/linux/minidump_writer/pe_file.h | 77 ++++++ src/client/linux/minidump_writer/pe_structs.h | 226 ++++++++++++++++++ 7 files changed, 622 insertions(+), 65 deletions(-) create mode 100644 src/client/linux/minidump_writer/pe_file.cc create mode 100644 src/client/linux/minidump_writer/pe_file.h create mode 100644 src/client/linux/minidump_writer/pe_structs.h diff --git a/Makefile.am b/Makefile.am index e7dc06ac7..2cde86493 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,6 +168,7 @@ src_client_linux_libbreakpad_client_a_SOURCES = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h \ @@ -491,6 +492,7 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ diff --git a/Makefile.in b/Makefile.in index 87377f3ac..aaf791339 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -360,6 +360,7 @@ am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer-inl.h \ src/client/minidump_file_writer.cc \ src/client/minidump_file_writer.h src/common/convert_UTF.cc \ @@ -387,6 +388,7 @@ am__dirstamp = $(am__leading_dot)dirstamp @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \ @@ -632,6 +634,7 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ @@ -665,6 +668,7 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ @@ -1645,12 +1649,14 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po \ + src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po \ src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po \ + src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po \ src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po \ src/common/$(DEPDIR)/convert_UTF.Po \ src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po \ @@ -2101,9 +2107,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ @@ -2291,9 +2294,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/autotools/missing \ $(top_srcdir)/autotools/test-driver \ $(top_srcdir)/src/config.h.in AUTHORS ChangeLog INSTALL NEWS \ - autotools/ar-lib autotools/compile autotools/config.guess \ - autotools/config.sub autotools/depcomp autotools/install-sh \ - autotools/ltmain.sh autotools/missing + README.md autotools/ar-lib autotools/compile \ + autotools/config.guess autotools/config.sub autotools/depcomp \ + autotools/install-sh autotools/ltmain.sh autotools/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -2329,6 +2332,8 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ @@ -2339,6 +2344,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ @@ -2513,6 +2519,7 @@ CLEANFILES = $(am__append_12) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \ @LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \ @@ -2718,6 +2725,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ +@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ @LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ @LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ @LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \ @@ -4151,6 +4159,9 @@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT): \ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) +src/client/linux/minidump_writer/pe_file.$(OBJEXT): \ + src/client/linux/minidump_writer/$(am__dirstamp) \ + src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/$(am__dirstamp): @$(MKDIR_P) src/client @: > src/client/$(am__dirstamp) @@ -4452,6 +4463,9 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT): \ + src/client/linux/minidump_writer/$(am__dirstamp) \ + src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT): \ src/client/linux/minidump_writer/$(am__dirstamp) \ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp) @@ -5357,12 +5371,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/convert_UTF.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po@am__quote@ # am--include-marker @@ -5921,6 +5937,20 @@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_uni @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; fi` +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o: src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.o `test -f 'src/client/linux/minidump_writer/pe_file.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/pe_file.cc + +src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj: src/client/linux/minidump_writer/pe_file.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/pe_file.cc' object='src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.obj `if test -f 'src/client/linux/minidump_writer/pe_file.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/pe_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/pe_file.cc'; fi` + src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o: src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o `test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po @@ -9131,7 +9161,6 @@ src/processor/minidump_stackwalk_machine_readable_test.log: src/processor/minidu @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -9427,12 +9456,14 @@ distclean: distclean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po @@ -9770,12 +9801,14 @@ maintainer-clean: maintainer-clean-am -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-minidump_writer_unittest_utils.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-pe_file.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po -rm -f src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po + -rm -f src/client/linux/minidump_writer/$(DEPDIR)/pe_file.Po -rm -f src/common/$(DEPDIR)/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po -rm -f src/common/$(DEPDIR)/convert_UTF.Po -rm -f src/common/$(DEPDIR)/dumper_unittest-byte_cursor_unittest.Po diff --git a/aclocal.m4 b/aclocal.m4 index be219b421..009cc48ed 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.3], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.3])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ AC_SUBST([AR])dnl # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -138,7 +138,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -190,7 +190,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -221,7 +221,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -412,7 +412,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -480,7 +480,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -508,6 +508,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -544,7 +548,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -596,6 +600,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -677,7 +695,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -698,7 +716,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -720,7 +738,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -755,7 +773,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -798,7 +816,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -834,7 +852,7 @@ fi # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -861,7 +879,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -890,7 +908,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -937,7 +955,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -956,7 +974,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1037,7 +1055,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1097,7 +1115,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1125,7 +1143,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1144,7 +1162,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 72a921664..7ce9ac570 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -71,6 +71,8 @@ #include "client/linux/minidump_writer/line_reader.h" #include "client/linux/minidump_writer/linux_dumper.h" #include "client/linux/minidump_writer/linux_ptrace_dumper.h" +#include "client/linux/minidump_writer/pe_file.h" +#include "client/linux/minidump_writer/pe_structs.h" #include "client/linux/minidump_writer/proc_cpuinfo_reader.h" #include "client/minidump_file_writer.h" #include "common/linux/file_id.h" @@ -95,8 +97,11 @@ using google_breakpad::MappingInfo; using google_breakpad::MappingList; using google_breakpad::MinidumpFileWriter; using google_breakpad::PageAllocator; +using google_breakpad::PEFile; +using google_breakpad::PEFileFormat; using google_breakpad::ProcCpuInfoReader; using google_breakpad::RawContextCPU; +using google_breakpad::RSDS_DEBUG_FORMAT; using google_breakpad::ThreadInfo; using google_breakpad::TypedMDRVA; using google_breakpad::UContextReader; @@ -632,40 +637,88 @@ class MinidumpWriter { mod->base_of_image = mapping.start_addr; mod->size_of_image = mapping.size; - auto_wasteful_vector identifier_bytes( - dumper_->allocator()); + char file_name[NAME_MAX]; + char file_path[NAME_MAX]; - if (identifier) { - // GUID was provided by caller. - identifier_bytes.insert(identifier_bytes.end(), - identifier, - identifier + sizeof(MDGUID)); - } else { - // Note: ElfFileIdentifierForMapping() can manipulate the |mapping.name|. - dumper_->ElfFileIdentifierForMapping(mapping, - member, - mapping_id, - identifier_bytes); - } + dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, + sizeof(file_path), file_name, + sizeof(file_name)); - if (!identifier_bytes.empty()) { - UntypedMDRVA cv(&minidump_writer_); - if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) - return false; + RSDS_DEBUG_FORMAT rsds; + PEFileFormat file_format = PEFile::TryGetDebugInfo(file_path, &rsds); + + if (file_format == PEFileFormat::notPeCoff) { + // The module is not a PE/COFF file, process as an ELF. + auto_wasteful_vector identifier_bytes( + dumper_->allocator()); + + if (identifier) { + // GUID was provided by caller. + identifier_bytes.insert(identifier_bytes.end(), identifier, + identifier + sizeof(MDGUID)); + } else { + // Note: ElfFileIdentifierForMapping() can manipulate the + // |mapping.name|, that is why we need to call the method + // GetMappingEffectiveNameAndPath again. + dumper_->ElfFileIdentifierForMapping(mapping, member, mapping_id, + identifier_bytes); + dumper_->GetMappingEffectiveNameAndPath(mapping, file_path, + sizeof(file_path), file_name, + sizeof(file_name)); + } + + if (!identifier_bytes.empty()) { + UntypedMDRVA cv(&minidump_writer_); + if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size())) + return false; - const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; - cv.Copy(&cv_signature, sizeof(cv_signature)); - cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], - identifier_bytes.size()); + const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE; + cv.Copy(&cv_signature, sizeof(cv_signature)); + cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0], + identifier_bytes.size()); + + mod->cv_record = cv.location(); + } + } else { + // The module is a PE/COFF file. Create MDCVInfoPDB70 struct for it. + size_t file_name_length = strlen(file_name); + TypedMDRVA cv(&minidump_writer_); + if (!cv.AllocateObjectAndArray(file_name_length + 1, sizeof(uint8_t))) + return false; + if (!cv.CopyIndexAfterObject(0, file_name, file_name_length)) + return false; + MDCVInfoPDB70* cv_ptr = cv.get(); + cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE; + if (file_format == PEFileFormat::peWithBuildId) { + // Populate BuildId and age using RSDS instance. + cv_ptr->signature.data1 = static_cast(rsds.guid[0]) << 24 | + static_cast(rsds.guid[1]) << 16 | + static_cast(rsds.guid[2]) << 8 | + static_cast(rsds.guid[3]); + cv_ptr->signature.data2 = + static_cast(rsds.guid[4]) << 8 | rsds.guid[5]; + cv_ptr->signature.data3 = + static_cast(rsds.guid[6]) << 8 | rsds.guid[7]; + cv_ptr->signature.data4[0] = rsds.guid[8]; + cv_ptr->signature.data4[1] = rsds.guid[9]; + cv_ptr->signature.data4[2] = rsds.guid[10]; + cv_ptr->signature.data4[3] = rsds.guid[11]; + cv_ptr->signature.data4[4] = rsds.guid[12]; + cv_ptr->signature.data4[5] = rsds.guid[13]; + cv_ptr->signature.data4[6] = rsds.guid[14]; + cv_ptr->signature.data4[7] = rsds.guid[15]; + // The Age field should be reverted as well. + cv_ptr->age = static_cast(rsds.age[0]) << 24 | + static_cast(rsds.age[1]) << 16 | + static_cast(rsds.age[2]) << 8 | + static_cast(rsds.age[3]); + } else { + cv_ptr->age = 0; + } mod->cv_record = cv.location(); } - char file_name[NAME_MAX]; - char file_path[NAME_MAX]; - dumper_->GetMappingEffectiveNameAndPath( - mapping, file_path, sizeof(file_path), file_name, sizeof(file_name)); - MDLocationDescriptor ld; if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld)) return false; diff --git a/src/client/linux/minidump_writer/pe_file.cc b/src/client/linux/minidump_writer/pe_file.cc new file mode 100644 index 000000000..4a8f1936e --- /dev/null +++ b/src/client/linux/minidump_writer/pe_file.cc @@ -0,0 +1,148 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "client/linux/minidump_writer/pe_file.h" +#include "client/linux/minidump_writer/pe_structs.h" +#include "common/linux/memory_mapped_file.h" + +namespace google_breakpad { + +PEFileFormat PEFile::TryGetDebugInfo(const char* filename, + PRSDS_DEBUG_FORMAT debug_info) { + MemoryMappedFile mapped_file(filename, 0); + if (!mapped_file.data()) + return PEFileFormat::notPeCoff; + const void* base = mapped_file.data(); + const size_t file_size = mapped_file.size(); + + const IMAGE_DOS_HEADER* header = + TryReadStruct(base, 0, file_size); + if (!header || (header->e_magic != IMAGE_DOS_SIGNATURE)) { + return PEFileFormat::notPeCoff; + } + + // NTHeader is at position 'e_lfanew'. + DWORD nt_header_offset = header->e_lfanew; + // First, read a common IMAGE_NT_HEADERS structure. It should contain a + // special flag marking whether PE module is x64 (OptionalHeader.Magic) + // and so-called NT_SIGNATURE in Signature field. + const IMAGE_NT_HEADERS* nt_header = + TryReadStruct(base, nt_header_offset, file_size); + if (!nt_header || (nt_header->Signature != IMAGE_NT_SIGNATURE) + || ((nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) + && (nt_header->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC))) + return PEFileFormat::notPeCoff; + + bool x64 = nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC; + WORD sections_number = nt_header->FileHeader.NumberOfSections; + DWORD debug_offset; + DWORD debug_size; + DWORD section_offset; + if (x64) { + const IMAGE_NT_HEADERS64* header_64 = + TryReadStruct(base, nt_header_offset, file_size); + if (!header_64) + return PEFileFormat::peWithoutBuildId; + debug_offset = + header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .VirtualAddress; + debug_size = + header_64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .Size; + section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS64); + } else { + const IMAGE_NT_HEADERS32* header_32 = + TryReadStruct(base, nt_header_offset, file_size); + if (!header_32) + return PEFileFormat::peWithoutBuildId; + debug_offset = + header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .VirtualAddress; + debug_size = + header_32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] + .Size; + section_offset = nt_header_offset + sizeof(IMAGE_NT_HEADERS32); + } + + DWORD debug_end_pos = debug_offset + debug_size; + while (debug_offset < debug_end_pos) { + for (WORD i = 0; i < sections_number; ++i) { + // Section headers are placed sequentially after the NT_HEADER (32/64). + const IMAGE_SECTION_HEADER* section = + TryReadStruct(base, section_offset, file_size); + if (!section) + return PEFileFormat::peWithoutBuildId; + + section_offset += sizeof(IMAGE_SECTION_HEADER); + + // Current `debug_offset` should be inside a section, stop if we find + // a suitable one (we don't consider any malformed sections here). + if ((section->VirtualAddress <= debug_offset) && + (debug_offset < section->VirtualAddress + section->SizeOfRawData)) { + DWORD offset = + section->PointerToRawData + debug_offset - section->VirtualAddress; + // Go to the position of current ImageDebugDirectory (offset). + const IMAGE_DEBUG_DIRECTORY* debug_directory = + TryReadStruct(base, offset, file_size); + if (!debug_directory) + return PEFileFormat::peWithoutBuildId; + // Process ImageDebugDirectory with CodeViewRecord type and skip + // all others. + if (debug_directory->Type == IMAGE_DEBUG_TYPE_CODEVIEW) { + DWORD debug_directory_size = debug_directory->SizeOfData; + if (debug_directory_size < sizeof(RSDS_DEBUG_FORMAT)) + // RSDS section is malformed. + return PEFileFormat::peWithoutBuildId; + // Go to the position of current ImageDebugDirectory Raw Data + // (debug_directory->PointerToRawData) and read the RSDS section. + const RSDS_DEBUG_FORMAT* rsds = + TryReadStruct( + base, debug_directory->PointerToRawData, file_size); + + if (!rsds) + return PEFileFormat::peWithoutBuildId; + + memcpy(debug_info->guid, rsds->guid, sizeof(rsds->guid)); + memcpy(debug_info->age, rsds->age, sizeof(rsds->age)); + return PEFileFormat::peWithBuildId; + } + + break; + } + } + + debug_offset += sizeof(IMAGE_DEBUG_DIRECTORY); + } + + return PEFileFormat::peWithoutBuildId; +} + +} // namespace google_breakpad \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_file.h b/src/client/linux/minidump_writer/pe_file.h new file mode 100644 index 000000000..cc7ed0807 --- /dev/null +++ b/src/client/linux/minidump_writer/pe_file.h @@ -0,0 +1,77 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ +#define CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ + +#include "client/linux/minidump_writer/pe_structs.h" + +namespace google_breakpad { + +typedef enum { + notPeCoff = 0, + peWithoutBuildId = 1, + peWithBuildId = 2 +} PEFileFormat; + +class PEFile { + public: + /** + * Attempts to parse RSDS_DEBUG_FORMAT record from a PE (Portable + * Executable) file. To do this we check whether the loaded file is a PE + * file, and if it is - try to find IMAGE_DEBUG_DIRECTORY structure with + * its type set to IMAGE_DEBUG_TYPE_CODEVIEW. + * + * @param filename Filename for the module to parse. + * @param debug_info RSDS_DEBUG_FORMAT struct to be populated with PE debug + * info (GUID and age). + * @return + * notPeCoff: not PE/COFF file; + * peWithoutBuildId: a PE/COFF file but build-id is not set; + * peWithBuildId: a PE/COFF file and build-id is set. + */ + static PEFileFormat TryGetDebugInfo(const char* filename, + PRSDS_DEBUG_FORMAT debug_info); + + private: + template + static const TStruct* TryReadStruct(const void* base, + const DWORD position, + const size_t file_size) { + if (position + sizeof(TStruct) >= file_size){ + return nullptr; + } + + const void* ptr = static_cast(base) + position; + return reinterpret_cast(ptr); + } +}; + +} // namespace google_breakpad +#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_FILE_H_ \ No newline at end of file diff --git a/src/client/linux/minidump_writer/pe_structs.h b/src/client/linux/minidump_writer/pe_structs.h new file mode 100644 index 000000000..843bd517a --- /dev/null +++ b/src/client/linux/minidump_writer/pe_structs.h @@ -0,0 +1,226 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ +#define CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ + +#include + +namespace google_breakpad { + +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef uint64_t ULONGLONG; + +#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b +#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b + +#define IMAGE_DEBUG_TYPE_CODEVIEW 2 + +#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 + +typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header + WORD e_magic; // Magic number + WORD e_cblp; // Bytes on last page of file + WORD e_cp; // Pages in file + WORD e_crlc; // Relocations + WORD e_cparhdr; // Size of header in paragraphs + WORD e_minalloc; // Minimum extra paragraphs needed + WORD e_maxalloc; // Maximum extra paragraphs needed + WORD e_ss; // Initial (relative) SS value + WORD e_sp; // Initial SP value + WORD e_csum; // Checksum + WORD e_ip; // Initial IP value + WORD e_cs; // Initial (relative) CS value + WORD e_lfarlc; // File address of relocation table + WORD e_ovno; // Overlay number + WORD e_res[4]; // Reserved words + WORD e_oemid; // OEM identifier (for e_oeminfo) + WORD e_oeminfo; // OEM information; e_oemid specific + WORD e_res2[10]; // Reserved words + DWORD e_lfanew; // File address of new exe header +} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; + +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; + +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; + + +typedef struct _IMAGE_DEBUG_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Type; + DWORD SizeOfData; + DWORD AddressOfRawData; + DWORD PointerToRawData; +} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY; + +typedef struct _IMAGE_OPTIONAL_HEADER64 { + // + // Standard fields - Magic. + // + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + // + // NT additional fields. + // + ULONGLONG ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + ULONGLONG SizeOfStackReserve; + ULONGLONG SizeOfStackCommit; + ULONGLONG SizeOfHeapReserve; + ULONGLONG SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; + +typedef struct _IMAGE_OPTIONAL_HEADER { + // + // Standard fields. + // + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + // + // NT additional fields. + // + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32; + +typedef struct _IMAGE_NT_HEADERS64 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER64 OptionalHeader; +} IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64; + +typedef struct _IMAGE_NT_HEADERS32 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER32 OptionalHeader; +} IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32; + +typedef struct _IMAGE_NT_HEADERS { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER32 OptionalHeader; +} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS; + +#define IMAGE_SIZEOF_SHORT_NAME 8 + +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; + +typedef struct _RSDS_DEBUG_FORMAT { + DWORD signature; + BYTE guid[16]; + BYTE age[4]; + char pdbpath[1]; +} RSDS_DEBUG_FORMAT, *PRSDS_DEBUG_FORMAT; + +} // namespace google_breakpad + +#endif // CLIENT_LINUX_MINIDUMP_WRITER_PE_STRUCTS_H_ \ No newline at end of file From 467ac5701f5fc0e77ffa463219cb706c95b0af6a Mon Sep 17 00:00:00 2001 From: Dangyi Liu Date: Fri, 10 Jun 2022 21:17:53 -0700 Subject: [PATCH 082/195] Ignore failure in recovering optional registers Evaluating CFI rules may fail due to e.g. the unavailability of the memory or some register values. Failures in recovering registers other than CFA or return address can be ignored because they are optional. Bug: fuchsia:102034 Change-Id: Ia1d8bdb12766e32b5445b49d353fc71c63ab73e7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3701260 Reviewed-by: Joshua Peraza --- src/processor/cfi_frame_info.cc | 2 +- src/processor/cfi_frame_info_unittest.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc index 280620f23..258a1194a 100644 --- a/src/processor/cfi_frame_info.cc +++ b/src/processor/cfi_frame_info.cc @@ -81,7 +81,7 @@ bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap& registers, working = registers; working[".cfa"] = cfa; if (!evaluator.EvaluateForValue(it->second, &value)) - return false; + continue; (*caller_registers)[it->first] = value; } diff --git a/src/processor/cfi_frame_info_unittest.cc b/src/processor/cfi_frame_info_unittest.cc index 8111437a6..919aafac1 100644 --- a/src/processor/cfi_frame_info_unittest.cc +++ b/src/processor/cfi_frame_info_unittest.cc @@ -254,8 +254,9 @@ TEST_F(Scope, RegsLackRA) { cfi.SetCFARule("42740329"); cfi.SetRARule("27045204"); cfi.SetRegisterRule("$r1", ".ra"); - ASSERT_FALSE(cfi.FindCallerRegs(registers, memory, - &caller_registers)); + ASSERT_TRUE(cfi.FindCallerRegs(registers, memory, + &caller_registers)); + ASSERT_EQ(caller_registers.end(), caller_registers.find("$r1")); } // Register rules can see the current frame's register values. @@ -439,6 +440,7 @@ TEST_F(ParseHandler, RegisterRules) { handler.RARule("reg-for-ra"); handler.RegisterRule("reg1", "reg-for-reg1"); handler.RegisterRule("reg2", "reg-for-reg2"); + handler.RegisterRule("reg3", "reg3"); registers["reg-for-cfa"] = 0x268a9a4a3821a797ULL; registers["reg-for-ra"] = 0x6301b475b8b91c02ULL; registers["reg-for-reg1"] = 0x06cde8e2ff062481ULL; @@ -449,6 +451,7 @@ TEST_F(ParseHandler, RegisterRules) { ASSERT_EQ(0x6301b475b8b91c02ULL, caller_registers[".ra"]); ASSERT_EQ(0x06cde8e2ff062481ULL, caller_registers["reg1"]); ASSERT_EQ(0xff0c4f76403173e2ULL, caller_registers["reg2"]); + ASSERT_EQ(caller_registers.end(), caller_registers.find("reg3")); } struct SimpleCFIWalkerFixture { From ad8a43f367e7f131f0306540a6f88db4d4c9c906 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 24 Jun 2022 12:19:32 -0700 Subject: [PATCH 083/195] dwarf_cu_to_module_unittest: fix tests https://crrev.com/7933ec0a69bac134b7cee4b60a5dc80743b2b1a9 removed warnings about unknown abstract origins, which caused these tests to fail on ChromeOS. Update these tests to reflect the code changes in said CL. Bug: b:235999011 Change-Id: Ifa450d33080d955d33b3aadb951c2e75c0aa1c85 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3723686 Reviewed-by: Mike Frysinger --- src/common/dwarf_cu_to_module_unittest.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index 499ec49bb..cbe317f97 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -781,9 +781,6 @@ TEST_F(SimpleCU, AbstractOriginNotInlined) { } TEST_F(SimpleCU, UnknownAbstractOrigin) { - EXPECT_CALL(reporter_, UnknownAbstractOrigin(_, 1ULL)).WillOnce(Return()); - EXPECT_CALL(reporter_, UnnamedFunction(0x11c70f94c6e87ccdLL)) - .WillOnce(Return()); PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118); StartCU(); @@ -799,8 +796,6 @@ TEST_F(SimpleCU, UnknownAbstractOrigin) { } TEST_F(SimpleCU, UnnamedFunction) { - EXPECT_CALL(reporter_, UnnamedFunction(0xe34797c7e68590a8LL)) - .WillOnce(Return()); PushLine(0x72b80e41a0ac1d40ULL, 0x537174f231ee181cULL, "line-file", 14044850); StartCU(); @@ -1622,7 +1617,6 @@ TEST_F(Specifications, UnhandledInterCU) { google_breakpad::DW_TAG_compile_unit)); ASSERT_TRUE(root3_handler.EndAttributes()); EXPECT_CALL(reporter_, UnhandledInterCUReference(_, _)).Times(1); - EXPECT_CALL(reporter_, UnnamedFunction(_)).Times(1); DefinitionDIE(&root3_handler, google_breakpad::DW_TAG_subprogram, 0xb01fef8b380bd1a2ULL, "", 0x2618f00a1a711e53ULL, 0x4fd94b76d7c2caf5ULL); From a8e8a695919679c9aac83541b01953ee9f2439dd Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 24 Jun 2022 12:03:52 -0700 Subject: [PATCH 084/195] elf_core_dump_unittest: skip test if setrlimit will fail Some systems have constrained rlimits for core files (the CrOS chroot is an example of this). Fail gracefully in this case, rather than breaking the user's tests. Bug: b:235999011 Change-Id: I5649b42d3e6fd9b4f9b11e1fd9d0d4a1083d300f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3722724 Reviewed-by: Mark Mentovai Reviewed-by: Mike Frysinger --- src/common/linux/elf_core_dump_unittest.cc | 10 +++++++--- src/common/linux/tests/crash_generator.cc | 9 +++++++++ src/common/linux/tests/crash_generator.h | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc index 2399c12fd..7854f31cc 100644 --- a/src/common/linux/elf_core_dump_unittest.cc +++ b/src/common/linux/elf_core_dump_unittest.cc @@ -130,9 +130,13 @@ TEST(ElfCoreDumpTest, TestElfHeader) { TEST(ElfCoreDumpTest, ValidCoreFile) { CrashGenerator crash_generator; if (!crash_generator.HasDefaultCorePattern()) { - fprintf(stderr, "ElfCoreDumpTest.ValidCoreFile test is skipped " - "due to non-default core pattern"); - return; + GTEST_SKIP() << "ElfCoreDumpTest.ValidCoreFile test is skipped " + "due to non-default core pattern"; + } + + if (!crash_generator.HasResourceLimitsAmenableToCrashCollection()) { + GTEST_SKIP() << "ElfCoreDumpTest.ValidCoreFile test is skipped " + "due to inadequate system resource limits"; } const unsigned kNumOfThreads = 3; diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc index a70df28ad..976f5e456 100644 --- a/src/common/linux/tests/crash_generator.cc +++ b/src/common/linux/tests/crash_generator.cc @@ -169,6 +169,15 @@ bool CrashGenerator::SetCoreFileSizeLimit(rlim_t limit) const { return true; } +bool CrashGenerator::HasResourceLimitsAmenableToCrashCollection() const { + struct rlimit limits; + if (getrlimit(RLIMIT_CORE, &limits) == -1) { + perror("CrashGenerator: Failed to get core file size limit"); + return false; + } + return limits.rlim_max >= kCoreSizeLimit; +} + bool CrashGenerator::CreateChildCrash( unsigned num_threads, unsigned crash_thread, int crash_signal, pid_t* child_pid) { diff --git a/src/common/linux/tests/crash_generator.h b/src/common/linux/tests/crash_generator.h index 7e2fcbf98..6d1c2eae4 100644 --- a/src/common/linux/tests/crash_generator.h +++ b/src/common/linux/tests/crash_generator.h @@ -65,6 +65,10 @@ class CrashGenerator { // Returns the directory of a copy of proc files of the child process. string GetDirectoryOfProcFilesCopy() const; + // Returns whether current resource limits would prevent `CreateChildCrash` + // from operating. + bool HasResourceLimitsAmenableToCrashCollection() const; + // Creates a crash (and a core dump file) by creating a child process with // |num_threads| threads, and the terminating the child process by sending // a signal with number |crash_signal| to the |crash_thread|-th thread. From 0c816d2d127525f489b30ce101653a6c4478b516 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Jun 2022 13:11:00 -0700 Subject: [PATCH 085/195] module_unittest: fix use-after-free `Construct.FunctionsWithSameAddress` started failing at ff5892c5. It looks like the cause of this is in the calls to `generate_duplicate_function`: ``` generate_duplicate_function("_without_form"); generate_duplicate_function("_and_void"); ``` `generate_duplicate_function` directly calls `new Module::Function(...);`, which stores the `StringView` it's given. `generate_duplicate_function` currently takes a `const string &`; in the above statements, these strings get `free()`d at the `;`. Making the parameter a `StringView` means the `Module::Function` will store pointers to the string literal, which lives for the whole program. All calls to `generate_duplicate_function` are given literals. Bug: b:235999011 Change-Id: Ied04c1307a2467b9816a83f0c4d84d47779ec610 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3726855 Reviewed-by: Mike Frysinger --- src/common/module_unittest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 26964a560..393e41514 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -45,11 +45,12 @@ #include "common/using_std_string.h" using google_breakpad::Module; +using google_breakpad::StringView; using std::stringstream; using std::vector; using testing::ContainerEq; -static Module::Function* generate_duplicate_function(const string& name) { +static Module::Function* generate_duplicate_function(StringView name) { const Module::Address DUP_ADDRESS = 0xd35402aac7a7ad5cULL; const Module::Address DUP_SIZE = 0x200b26e605f99071ULL; const Module::Address DUP_PARAMETER_SIZE = 0xf14ac4fed48c4a99ULL; From dee16d9b30176f2e859938af3880bd5641a67237 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Jun 2022 14:46:44 -0700 Subject: [PATCH 086/195] dwarf_cu_to_module_unittest: remove expectation This expectation started failing at 8b68c72a3fff2bb687c7f411e5c1c09e356b8603. Remove it. This is the only expectation that exists in this test, but the test may be useful for internal asserts performed in the code under test. Bug: b:235999011 Change-Id: Iab5c073161ce66fdf362b7da31c19f471c7a79bf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3727478 Reviewed-by: Mike Frysinger --- src/common/dwarf_cu_to_module_unittest.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index cbe317f97..2ec4cc975 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -1626,8 +1626,6 @@ TEST_F(Specifications, UnhandledInterCU) { TEST_F(Specifications, BadOffset) { PushLine(0xa0277efd7ce83771ULL, 0x149554a184c730c1ULL, "line-file", 56636272); - EXPECT_CALL(reporter_, UnknownSpecification(_, 0x2be953efa6f9a996ULL)) - .WillOnce(Return()); StartCU(); DeclarationDIE(&root_handler_, 0xefd7f7752c27b7e4ULL, From 2e161431bccb74f8252ecb9acaa5d06a22b8ee9e Mon Sep 17 00:00:00 2001 From: priettt Date: Fri, 24 Jun 2022 12:30:59 -0300 Subject: [PATCH 087/195] Added a missing dependency on android/google_breakpad/Android.mk pe_file.cc, used in minidump_writer.cc, was not included in LOCAL_SRC_FILES. This caused breakpad to fail in build time, as it didn't find the file. Tested using ndk 21.4.7075529, building on an arm64 device. Change-Id: I192539a52c1344eba9999c6780bcd8b83ea7e772 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3723683 Reviewed-by: Joshua Peraza --- android/google_breakpad/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/android/google_breakpad/Android.mk b/android/google_breakpad/Android.mk index 861849277..af7aa9201 100644 --- a/android/google_breakpad/Android.mk +++ b/android/google_breakpad/Android.mk @@ -80,6 +80,7 @@ LOCAL_SRC_FILES := \ src/client/linux/minidump_writer/linux_dumper.cc \ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ src/client/minidump_file_writer.cc \ src/common/convert_UTF.cc \ src/common/md5.cc \ From ae1530a4f4864f6ed918f6d64655241381b2a25f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 28 Jun 2022 21:45:37 -0400 Subject: [PATCH 088/195] update autotool minimum versions We're using autoconf-2.69 (from 2012) now and not testing anything older, so raise the min version to that. Also bump to automake-1.13 (from 2012) to keep a bit inline. Change-Id: I903144f214fef835364474e1607a26e846c99ff6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3734168 Reviewed-by: George Burgess --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 20fb07532..72b1bd0f2 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_PREREQ(2.64) +AC_PREREQ(2.69) AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com) dnl Sanity check: the argument is just a file that should exist. @@ -37,7 +37,7 @@ AC_CONFIG_AUX_DIR(autotools) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.11.1) +AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.13) AM_CONFIG_HEADER(src/config.h) AM_MAINTAINER_MODE From 593196225d754f2d4ab77bb4cd779da1c9c1a447 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 28 Jun 2022 21:26:47 -0400 Subject: [PATCH 089/195] regen autotools Previous updates to these were partially done. Rerun with the right versions of autoconf-2.69 & automake-1.16.5. Change-Id: Ifd6c8405b0b50c5d3cf4ea536a7db5762d62644e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3734167 Reviewed-by: George Burgess --- aclocal.m4 | 4 +- autotools/ar-lib | 19 +- autotools/compile | 17 +- autotools/config.guess | 1034 ++++++++++------ autotools/config.sub | 2643 ++++++++++++++++++++-------------------- autotools/depcomp | 10 +- autotools/install-sh | 174 ++- autotools/missing | 16 +- autotools/test-driver | 27 +- configure | 24 +- 10 files changed, 2154 insertions(+), 1814 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 009cc48ed..f0d013ba0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/autotools/ar-lib b/autotools/ar-lib index 463b9ec02..c349042c3 100755 --- a/autotools/ar-lib +++ b/autotools/ar-lib @@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2012-03-01.08; # UTC +scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -65,7 +65,7 @@ func_file_conv () mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin) + cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) @@ -224,10 +224,11 @@ elif test -n "$extract"; then esac done else - $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member - do - $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? - done + $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \ + | while read member + do + $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? + done fi elif test -n "$quick$replace"; then diff --git a/autotools/compile b/autotools/compile index a85b723c7..df363c8fb 100755 --- a/autotools/compile +++ b/autotools/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/autotools/config.guess b/autotools/config.guess index 1000e2bd9..f7727026b 100755 --- a/autotools/config.guess +++ b/autotools/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2017-02-07' +timestamp='2021-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2017-02-07' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,19 +27,19 @@ timestamp='2017-02-07' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,66 +94,89 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -168,31 +189,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ - echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)) + case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +230,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") ;; esac # The OS release @@ -219,60 +241,75 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -310,28 +347,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -343,7 +371,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -353,7 +381,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then + if test "$( (/bin/universe) 2>/dev/null)" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd @@ -366,28 +394,28 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in + case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -395,40 +423,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case "$(/usr/bin/arch -k)" in Series*|S4*) - UNAME_RELEASE=`uname -v` + UNAME_RELEASE=$(uname -v) ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "$(/bin/arch)" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -439,44 +467,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,23 +513,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -526,18 +554,18 @@ EOF exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -554,26 +582,26 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -584,7 +612,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then echo "$SYSTEM_NAME" else @@ -597,28 +625,28 @@ EOF fi exit ;; *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -633,28 +661,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + if test -x /usr/bin/getconf; then + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -687,13 +715,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +740,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -745,11 +773,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -758,17 +786,17 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -793,130 +821,123 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=$(uname -p) + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + fi exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + UNAME_PROCESSOR=$(/usr/bin/uname -p) + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -927,140 +948,181 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1074,51 +1136,51 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in + case $(/bin/uname -X | grep "^Machine") in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1126,9 +1188,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1148,9 +1210,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1168,41 +1230,41 @@ EOF 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1212,8 +1274,8 @@ EOF exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1233,23 +1295,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1268,83 +1330,97 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=$(uname -p) + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; - NSX-?:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk${UNAME_RELEASE} + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1353,18 +1429,19 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. + # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1385,14 +1462,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1401,32 +1478,190 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` +uname -m = $( (uname -m) 2>/dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/autotools/config.sub b/autotools/config.sub index 87abeab6c..4d89efe3b 100755 --- a/autotools/config.sub +++ b/autotools/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2017-02-07' +timestamp='2021-01-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2017-02-07' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2017-02-07' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,14 +50,14 @@ timestamp='2017-02-07' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +89,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1247 +110,1190 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola + cpu=m68k + vendor=motorola ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + cpu=m68000 + vendor=convergent ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux + mipsEE* | ee) + cpu=mips64r5900el + vendor=scei + case $os in + linux*) + ;; + *) + os=elf + ;; + esac ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos + iop) + cpu=mipsel + vendor=scei + os=irx ;; - news1000) - basic_machine=m68030-sony - os=-newsos + dvp) + cpu=dvp + vendor=scei + os=elf ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti + cpu=m68k + vendor=tti ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sei) - basic_machine=mips-sei - os=-seiux + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sequent) - basic_machine=i386-sequent + w65) + cpu=w65 + vendor=wdc ;; - sh) - basic_machine=sh-hitachi - os=-hms + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - sh5el) - basic_machine=sh5le-unknown + none) + cpu=none + vendor=none ;; - sh64) - basic_machine=sh64-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + leon-*|leon[3-9]-*) + cpu=sparc + vendor=$(echo "$basic_machine" | sed 's/-.*//') ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx | dvp \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1358,203 +1301,213 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') + ;; + os2-emx) + kernel=os2 + os=$(echo $basic_os | sed -e 's|os2-emx|emx|') + ;; + nto-qnx*) + kernel=nto + os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1567,264 +1520,356 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-abi", so those need to count as OSes. + musl* | newlib* | uclibc*) + ;; + # Likewise for "kernel-libc" + eabi* | gnueabi*) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/autotools/depcomp b/autotools/depcomp index fc98710e2..715e34311 100755 --- a/autotools/depcomp +++ b/autotools/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,9 +783,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/autotools/install-sh b/autotools/install-sh index 0b0fdcbba..ec298b537 100755 --- a/autotools/install-sh +++ b/autotools/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ while test $# -ne 0; do -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -271,15 +295,18 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,27 +315,16 @@ do fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -318,43 +334,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -365,7 +387,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -394,7 +416,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -427,14 +449,25 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -460,6 +493,13 @@ do then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -474,9 +514,9 @@ do # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 @@ -493,9 +533,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/autotools/missing b/autotools/missing index f62bbae30..1fe1611f1 100755 --- a/autotools/missing +++ b/autotools/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/autotools/test-driver b/autotools/test-driver index 8e575b017..be73b80ad 100755 --- a/autotools/test-driver +++ b/autotools/test-driver @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -42,11 +42,13 @@ print_usage () { cat <$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ esac # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" @@ -140,9 +145,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/configure b/configure index b6a86c72d..5695da74e 100755 --- a/configure +++ b/configure @@ -698,6 +698,9 @@ AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -2587,12 +2590,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -3063,6 +3061,20 @@ $as_echo "$am_cv_prog_tar_ustar" >&6; } +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile From f9fcba812c128f3e8ccee923913508dfab9c16e6 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 28 Jun 2022 22:12:34 -0400 Subject: [PATCH 090/195] simplify enable & with configure flags Leverage the existing default logic & argument parsing that turn the values yes/no into true/false to simplify the code so we don't create duplicate variables. This kills a lot of boilerplate. Change-Id: Ib7c8e00f7b23e67ed05f3b35e523c235aed41129 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3734169 Reviewed-by: George Burgess --- configure | 161 +++++++++++++++------------------------------------ configure.ac | 138 +++++++++++-------------------------------- 2 files changed, 81 insertions(+), 218 deletions(-) diff --git a/configure b/configure index 5695da74e..7a17b443f 100755 --- a/configure +++ b/configure @@ -5832,23 +5832,15 @@ fi # Check whether --enable-m32 was given. if test "${enable_m32+set}" = set; then : - enableval=$enable_m32; case "${enableval}" in - yes) - CFLAGS="${CFLAGS} -m32" - CXXFLAGS="${CXXFLAGS} -m32" - usem32=true - ;; - no) - usem32=false - ;; - *) - as_fn_error $? "bad value ${enableval} for --enable-m32" "$LINENO" 5 - ;; - esac + enableval=$enable_m32; else - usem32=false + enable_m32=no fi +if test "x$enable_m32" = xyes; then + CFLAGS="${CFLAGS} -m32" + CXXFLAGS="${CXXFLAGS} -m32" +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 @@ -7584,22 +7576,12 @@ fi # Check whether --enable-processor was given. if test "${enable_processor+set}" = set; then : - enableval=$enable_processor; case "${enableval}" in - yes) - disable_processor=false - ;; - no) - disable_processor=true - ;; - *) - as_fn_error $? "bad value ${enableval} for --disable-processor" "$LINENO" 5 - ;; - esac -else - disable_processor=false -fi - - if test x$disable_processor = xtrue; then + enableval=$enable_processor; +else + enable_processor=yes +fi + + if test "x$enable_processor" != xyes; then DISABLE_PROCESSOR_TRUE= DISABLE_PROCESSOR_FALSE='#' else @@ -7610,22 +7592,12 @@ fi # Check whether --enable-tools was given. if test "${enable_tools+set}" = set; then : - enableval=$enable_tools; case "${enableval}" in - yes) - disable_tools=false - ;; - no) - disable_tools=true - ;; - *) - as_fn_error $? "bad value ${enableval} for --disable-tools" "$LINENO" 5 - ;; - esac -else - disable_tools=false -fi - - if test x$disable_tools = xtrue; then + enableval=$enable_tools; +else + enable_tools=yes +fi + + if test "x$enable_tools" != xyes; then DISABLE_TOOLS_TRUE= DISABLE_TOOLS_FALSE='#' else @@ -7634,28 +7606,18 @@ else fi -if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then - as_fn_error $? "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5 +if test x$LINUX_HOST = xfalse -a "x$enable_processor" != xyes -a "x$enable_tools" != xyes; then + as_fn_error $? "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5 fi # Check whether --enable-system-test-libs was given. if test "${enable_system_test_libs+set}" = set; then : - enableval=$enable_system_test_libs; case "${enableval}" in - yes) - system_test_libs=true - ;; - no) - system_test_libs=false - ;; - *) - as_fn_error $? "bad value ${enableval} for --enable-system-test-libs" "$LINENO" 5 - ;; - esac -else - system_test_libs=false -fi - - if test x$system_test_libs = xtrue; then + enableval=$enable_system_test_libs; +else + enable_system_test_libs=no +fi + + if test "x$enable_system_test_libs" = xyes; then SYSTEM_TEST_LIBS_TRUE= SYSTEM_TEST_LIBS_FALSE='#' else @@ -7668,7 +7630,7 @@ fi -if test x$system_test_libs = xtrue; then +if test "x$enable_system_test_libs" = xyes; then : "${GMOCK_CFLAGS:=-pthread}" : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}" : "${GTEST_CFLAGS:=-pthread}" @@ -7677,22 +7639,12 @@ fi # Check whether --enable-selftest was given. if test "${enable_selftest+set}" = set; then : - enableval=$enable_selftest; case "${enableval}" in - yes) - selftest=true - ;; - no) - selftest=false - ;; - *) - as_fn_error $? "bad value ${enableval} for --enable-selftest" "$LINENO" 5 - ;; - esac -else - selftest=false -fi - - if test x$selftest = xtrue; then + enableval=$enable_selftest; +else + enable_selftest=no +fi + + if test "x$enable_selftest" = xyes; then SELFTEST_TRUE= SELFTEST_FALSE='#' else @@ -7704,47 +7656,30 @@ fi # Check whether --with-rustc-demangle was given. if test "${with_rustc_demangle+set}" = set; then : - withval=$with_rustc_demangle; case "${withval}" in - yes) - as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 - ;; - no) - rustc_demangle=false - ;; - *) - if ! test -f "${withval}/Cargo.toml"; then - as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 - fi - RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${withval}/crates/capi/include" - RUSTC_DEMANGLE_LIBS="-L${withval}/target/release -lrustc_demangle -lpthread -ldl" - ;; - esac + withval=$with_rustc_demangle; else - rustc_demangle=false + with_rustc_demangle=no fi +if test "x${with_rustc_demangle}" != xno; then + if ! test -f "${with_rustc_demangle}/Cargo.toml"; then + as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 + fi + RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${with_rustc_demangle}/crates/capi/include" + RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release -lrustc_demangle -lpthread -ldl" +fi # Check whether --with-tests-as-root was given. if test "${with_tests_as_root+set}" = set; then : - withval=$with_tests_as_root; case "${withval}" in - yes) - tests_as_root=true - ;; - no) - tests_as_root=false - ;; - *) - as_fn_error $? "--with-tests-as-root can only be \"yes\" or \"no\"" "$LINENO" 5 - ;; - esac -else - tests_as_root=false -fi - - if test x$tests_as_root = xtrue; then + withval=$with_tests_as_root; +else + with_tests_as_root=no +fi + + if test "x$with_tests_as_root" = xyes; then TESTS_AS_ROOT_TRUE= TESTS_AS_ROOT_FALSE='#' else diff --git a/configure.ac b/configure.ac index 72b1bd0f2..d00407231 100644 --- a/configure.ac +++ b/configure.ac @@ -53,21 +53,12 @@ dnl This must come before all the feature tests below. AC_ARG_ENABLE(m32, AS_HELP_STRING([--enable-m32], [Compile/build with -m32] - [(default is no)]), - [case "${enableval}" in - yes) - CFLAGS="${CFLAGS} -m32" - CXXFLAGS="${CXXFLAGS} -m32" - usem32=true - ;; - no) - usem32=false - ;; - *) - AC_MSG_ERROR(bad value ${enableval} for --enable-m32) - ;; - esac], - [usem32=false]) + [(default is no)]),, + [enable_m32=no]) +if test "x$enable_m32" = xyes; then + CFLAGS="${CFLAGS} -m32" + CXXFLAGS="${CXXFLAGS} -m32" +fi AC_HEADER_STDC AC_SYS_LARGEFILE @@ -134,66 +125,33 @@ AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue) AC_ARG_ENABLE(processor, AS_HELP_STRING([--disable-processor], [Don't build processor library] - [(default is no)]), - [case "${enableval}" in - yes) - disable_processor=false - ;; - no) - disable_processor=true - ;; - *) - AC_MSG_ERROR(bad value ${enableval} for --disable-processor) - ;; - esac], - [disable_processor=false]) -AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue) + [(default is no)]),, + [enable_processor=yes]) +AM_CONDITIONAL(DISABLE_PROCESSOR, test "x$enable_processor" != xyes) AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools], [Don't build tool binaries] - [(default is no)]), - [case "${enableval}" in - yes) - disable_tools=false - ;; - no) - disable_tools=true - ;; - *) - AC_MSG_ERROR(bad value ${enableval} for --disable-tools) - ;; - esac], - [disable_tools=false]) -AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue) + [(default is no)]),, + [enable_tools=yes]) +AM_CONDITIONAL(DISABLE_TOOLS, test "x$enable_tools" != xyes) -if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then - AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!]) +if test x$LINUX_HOST = xfalse -a "x$enable_processor" != xyes -a "x$enable_tools" != xyes; then + AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!]) fi AC_ARG_ENABLE(system-test-libs, AS_HELP_STRING([--enable-system-test-libs], [Use gtest/gmock/etc... from the system instead ] - [of the local copies (default is local)]), - [case "${enableval}" in - yes) - system_test_libs=true - ;; - no) - system_test_libs=false - ;; - *) - AC_MSG_ERROR(bad value ${enableval} for --enable-system-test-libs) - ;; - esac], - [system_test_libs=false]) -AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue) + [of the local copies (default is local)]),, + [enable_system_test_libs=no]) +AM_CONDITIONAL(SYSTEM_TEST_LIBS, test "x$enable_system_test_libs" = xyes) AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock]) AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock]) AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest]) AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest]) -if test x$system_test_libs = xtrue; then +if test "x$enable_system_test_libs" = xyes; then : "${GMOCK_CFLAGS:=-pthread}" : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}" : "${GTEST_CFLAGS:=-pthread}" @@ -204,43 +162,24 @@ AC_ARG_ENABLE(selftest, AS_HELP_STRING([--enable-selftest], [Run extra tests with "make check" ] [(may conflict with optimizations) ] - [(default is no)]), - [case "${enableval}" in - yes) - selftest=true - ;; - no) - selftest=false - ;; - *) - AC_MSG_ERROR(bad value ${enableval} for --enable-selftest) - ;; - esac], - [selftest=false]) -AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue) + [(default is no)]),, + [enable_selftest=no]) +AM_CONDITIONAL(SELFTEST, test "x$enable_selftest" = xyes) AC_ARG_WITH(rustc-demangle, AS_HELP_STRING([--with-rustc-demangle=/path/to/rustc-demangle], [Link against the rustc-demangle library] [to demangle Rust language symbols during] [symbol dumping (default is no)] - [Pass the path to the crate root.]), - [case "${withval}" in - yes) - AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) - ;; - no) - rustc_demangle=false - ;; - *) - if ! test -f "${withval}/Cargo.toml"; then - AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) - fi - RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${withval}/crates/capi/include" - RUSTC_DEMANGLE_LIBS="-L${withval}/target/release -lrustc_demangle -lpthread -ldl" - ;; - esac], - [rustc_demangle=false]) + [Pass the path to the crate root.]),, + [with_rustc_demangle=no]) +if test "x${with_rustc_demangle}" != xno; then + if ! test -f "${with_rustc_demangle}/Cargo.toml"; then + AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) + fi + RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${with_rustc_demangle}/crates/capi/include" + RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release -lrustc_demangle -lpthread -ldl" +fi AC_ARG_VAR([RUSTC_DEMANGLE_CFLAGS], [Compiler flags for rustc-demangle]) AC_ARG_VAR([RUSTC_DEMANGLE_LIBS], [Linker flags for rustc-demangle]) @@ -248,20 +187,9 @@ AC_ARG_WITH(tests-as-root, AS_HELP_STRING([--with-tests-as-root], [Run the tests as root. Use this on platforms] [like travis-ci.org that require root privileges] - [to use ptrace (default is no)]), - [case "${withval}" in - yes) - tests_as_root=true - ;; - no) - tests_as_root=false - ;; - *) - AC_MSG_ERROR(--with-tests-as-root can only be "yes" or "no") - ;; - esac], - [tests_as_root=false]) -AM_CONDITIONAL(TESTS_AS_ROOT, test x$tests_as_root = xtrue) + [to use ptrace (default is no)]),, + [with_tests_as_root=no]) +AM_CONDITIONAL(TESTS_AS_ROOT, test "x$with_tests_as_root" = xyes) AC_CONFIG_FILES(m4_flatten([ breakpad.pc From 3e2a34116833ec0a01cc2c3d4353834aef7a693a Mon Sep 17 00:00:00 2001 From: Konstantin Mandrika Date: Thu, 30 Jun 2022 14:29:08 -0400 Subject: [PATCH 091/195] Handle abbrev entities being out of order. There are cases where the debug_abbrev entities are not sequential, for example, in Xamarin system dlls. This change gracefully handles such a case. Change-Id: Ib270393d3cf9fd18efd99d15d0fba4f96748188a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3738879 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2reader.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index bf6758d8a..11854b4b0 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -129,10 +129,13 @@ void CompilationUnit::ReadAbbrevs() { const uint64_t abbrev_length = iter->second.second - header_.abbrev_offset; #endif + uint64_t highest_number = 0; + while (1) { CompilationUnit::Abbrev abbrev; size_t len; const uint64_t number = reader_->ReadUnsignedLEB128(abbrevptr, &len); + highest_number = std::max(highest_number, number); if (number == 0) break; @@ -170,9 +173,17 @@ void CompilationUnit::ReadAbbrevs() { value); abbrev.attributes.push_back(abbrev_attr); } - assert(abbrev.number == abbrevs_->size()); abbrevs_->push_back(abbrev); } + + // Account of cases where entries are out of order. + std::sort(abbrevs_->begin(), abbrevs_->end(), + [](const CompilationUnit::Abbrev& lhs, const CompilationUnit::Abbrev& rhs) { + return lhs.number < rhs.number; + }); + + // Ensure that there are no missing sections. + assert(abbrevs_->size() == highest_number + 1); } // Skips a single DIE's attributes. From 90a0d9a9ffa2f7a50a452092412422e3c691b32d Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 30 Jun 2022 14:30:14 -0700 Subject: [PATCH 092/195] configure: support rustc-demangle installations in the sysroot Currently, `./configure` supports `--with-rustc-demangle=${path_to_crate_root}` as the only mechanism to enable rustc-demangle support. This CL adds support for cases where keeping or synthesizing a full `cargo` build tree is hacky in comparison to simply installing `rustc_demangle.h` in e.g., /usr/include, and putting `librustc_demangle.a` in e.g., `/usr/lib64`. Bug: b:235999011 Change-Id: Id5fe2a24c4b6e33c4df0e10c86ba99c7cf890ab2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3733672 Reviewed-by: Mike Frysinger --- configure | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 35 +++++++++++++++++-- 2 files changed, 126 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 7a17b443f..787b1b259 100755 --- a/configure +++ b/configure @@ -785,6 +785,7 @@ enable_tools enable_system_test_libs enable_selftest with_rustc_demangle +enable_system_rustc_demangle with_tests_as_root ' ac_precious_vars='build_alias @@ -1454,6 +1455,12 @@ Optional Features: the local copies (default is local) --enable-selftest Run extra tests with "make check" (may conflict with optimizations) (default is no) + --enable-system-rustc-demangle + Link against the rustc-demangle library to demangle + Rust language symbols during symbol dumping (default + is no). This assumes that rustc-demangle is + installed in your sysroot, and all headers from it + are available in your standard include path Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -7661,13 +7668,97 @@ else with_rustc_demangle=no fi + +RUSTC_DEMANGLE_BASE_CFLAGS="-DHAVE_RUSTC_DEMANGLE" +RUSTC_DEMANGLE_BASE_LIBS="-lrustc_demangle -lpthread -ldl" + if test "x${with_rustc_demangle}" != xno; then if ! test -f "${with_rustc_demangle}/Cargo.toml"; then as_fn_error $? "You must pass the path to the rustc-demangle crate for --with-rustc-demangle" "$LINENO" 5 fi - RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${with_rustc_demangle}/crates/capi/include" - RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release -lrustc_demangle -lpthread -ldl" + RUSTC_DEMANGLE_CFLAGS="-I${with_rustc_demangle}/crates/capi/include ${RUSTC_DEMANGLE_BASE_CFLAGS}" + RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release ${RUSTC_DEMANGLE_BASE_LIBS}" +fi + +# Check whether --enable-system-rustc-demangle was given. +if test "${enable_system_rustc_demangle+set}" = set; then : + enableval=$enable_system_rustc_demangle; +else + enable_system_rustc_demangle=no +fi + + +if test "x${enable_system_rustc_demangle}" != xno; then + if test "x${with_rustc_demangle}" != xno; then + as_fn_error $? "--enable-system-rustc-demangle and --with-rustc-demangle are mutually exclusive." "$LINENO" 5 + fi + + RUSTC_DEMANGLE_CFLAGS="${RUSTC_DEMANGLE_BASE_CFLAGS}" + RUSTC_DEMANGLE_LIBS="${RUSTC_DEMANGLE_BASE_LIBS}" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rustc_demangle in -lrustc_demangle" >&5 +$as_echo_n "checking for rustc_demangle in -lrustc_demangle... " >&6; } +if ${ac_cv_lib_rustc_demangle_rustc_demangle+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrustc_demangle $RUSTC_DEMANGLE_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rustc_demangle (); +int +main () +{ +return rustc_demangle (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rustc_demangle_rustc_demangle=yes +else + ac_cv_lib_rustc_demangle_rustc_demangle=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rustc_demangle_rustc_demangle" >&5 +$as_echo "$ac_cv_lib_rustc_demangle_rustc_demangle" >&6; } +if test "x$ac_cv_lib_rustc_demangle_rustc_demangle" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRUSTC_DEMANGLE 1 +_ACEOF + + LIBS="-lrustc_demangle $LIBS" + +else + as_fn_error $? "librustc_demangle.a must be present when --enable-system-rustc-demangle is specified" "$LINENO" 5 +fi + + for ac_header in rustc_demangle.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rustc_demangle.h" "ac_cv_header_rustc_demangle_h" "$ac_includes_default" +if test "x$ac_cv_header_rustc_demangle_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RUSTC_DEMANGLE_H 1 +_ACEOF + +else + as_fn_error $? "rustc_demangle.h must be present when --enable-system-rustc-demangle is specified" "$LINENO" 5 +fi + +done + +fi + diff --git a/configure.ac b/configure.ac index d00407231..28b81d47f 100644 --- a/configure.ac +++ b/configure.ac @@ -173,13 +173,44 @@ AC_ARG_WITH(rustc-demangle, [symbol dumping (default is no)] [Pass the path to the crate root.]),, [with_rustc_demangle=no]) + +RUSTC_DEMANGLE_BASE_CFLAGS="-DHAVE_RUSTC_DEMANGLE" +RUSTC_DEMANGLE_BASE_LIBS="-lrustc_demangle -lpthread -ldl" + if test "x${with_rustc_demangle}" != xno; then if ! test -f "${with_rustc_demangle}/Cargo.toml"; then AC_MSG_ERROR(You must pass the path to the rustc-demangle crate for --with-rustc-demangle) fi - RUSTC_DEMANGLE_CFLAGS="-DHAVE_RUSTC_DEMANGLE -I${with_rustc_demangle}/crates/capi/include" - RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release -lrustc_demangle -lpthread -ldl" + RUSTC_DEMANGLE_CFLAGS="-I${with_rustc_demangle}/crates/capi/include ${RUSTC_DEMANGLE_BASE_CFLAGS}" + RUSTC_DEMANGLE_LIBS="-L${with_rustc_demangle}/target/release ${RUSTC_DEMANGLE_BASE_LIBS}" +fi + +AC_ARG_ENABLE(system-rustc-demangle, + AS_HELP_STRING([--enable-system-rustc-demangle], + [Link against the rustc-demangle library] + [to demangle Rust language symbols during] + [symbol dumping (default is no). This assumes] + [that rustc-demangle is installed in your sysroot,] + [and all headers from it are available in your] + [standard include path] + ),, + [enable_system_rustc_demangle=no]) + +if test "x${enable_system_rustc_demangle}" != xno; then + if test "x${with_rustc_demangle}" != xno; then + AC_MSG_ERROR([--enable-system-rustc-demangle and --with-rustc-demangle are mutually exclusive.]) + fi + + RUSTC_DEMANGLE_CFLAGS="${RUSTC_DEMANGLE_BASE_CFLAGS}" + RUSTC_DEMANGLE_LIBS="${RUSTC_DEMANGLE_BASE_LIBS}" + + AC_CHECK_LIB([rustc_demangle], [rustc_demangle], [], + [AC_MSG_ERROR(librustc_demangle.a must be present when --enable-system-rustc-demangle is specified)], + [$RUSTC_DEMANGLE_LIBS]) + AC_CHECK_HEADERS(rustc_demangle.h, [], + [AC_MSG_ERROR(rustc_demangle.h must be present when --enable-system-rustc-demangle is specified)]) fi + AC_ARG_VAR([RUSTC_DEMANGLE_CFLAGS], [Compiler flags for rustc-demangle]) AC_ARG_VAR([RUSTC_DEMANGLE_LIBS], [Linker flags for rustc-demangle]) From c161459d7e94d7ef5840ba90aa26a4d5f955c976 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Sun, 3 Jul 2022 08:33:37 -0700 Subject: [PATCH 093/195] dwarf2reader: include On CrOS, a breakpad update is breaking: ``` google-breakpad-2022.07.03.054510-r210: no member named 'sort' in namespace 'std' google-breakpad-2022.07.03.054510-r210: std::sort(abbrevs_->begin(), abbrevs_->end(), google-breakpad-2022.07.03.054510-r210: ~~~~~^ ``` Looks like we're missing the include for `sort`. Bug: 235999011 Change-Id: I917389c12b370357fd1fc7cb08af0b9d7f315c84 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3741510 Reviewed-by: Mike Frysinger --- src/common/dwarf/dwarf2reader.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 11854b4b0..6bd2614b4 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -37,6 +37,7 @@ #include #include +#include #include #include #include From 4d7cd098001bdd1b25fd3539a76dcf16863e43c1 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 11 Jul 2022 12:37:19 -0700 Subject: [PATCH 094/195] exploitability: fix buffer overflow exploitability_linux assumed a 15 byte buffer to always be passed in as `raw_bytes` for `DisassembleBytes`. This test was passing in a 6 byte buffer. Make `DisassembleBytes` accept a length. Bug: b:235999011 Change-Id: I696c66357faa1c7d762c64009864123897f03488 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756170 Reviewed-by: Mike Frysinger --- src/processor/exploitability_linux.cc | 8 +++++--- src/processor/exploitability_linux.h | 1 + src/processor/exploitability_unittest.cc | 9 ++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 3ec39dd0a..7a0fb71a9 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -232,6 +232,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { char objdump_output_buffer[MAX_OBJDUMP_BUFFER_LEN] = {0}; DisassembleBytes(architecture, raw_memory + offset, + MAX_INSTRUCTION_LEN, MAX_OBJDUMP_BUFFER_LEN, objdump_output_buffer); @@ -483,9 +484,11 @@ bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string& line, bool ExploitabilityLinux::DisassembleBytes(const string& architecture, const uint8_t* raw_bytes, + const unsigned int raw_bytes_len, const unsigned int buffer_len, char* objdump_output_buffer) { - if (!raw_bytes || !objdump_output_buffer) { + if (!raw_bytes || !objdump_output_buffer || + raw_bytes_len > MAX_INSTRUCTION_LEN) { BPLOG(ERROR) << "Bad input parameters."; return false; } @@ -499,8 +502,7 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture, unlink(raw_bytes_tmpfile); return false; } - if (write(raw_bytes_fd, raw_bytes, MAX_INSTRUCTION_LEN) - != MAX_INSTRUCTION_LEN) { + if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != raw_bytes_len) { BPLOG(ERROR) << "Writing of raw bytes failed."; unlink(raw_bytes_tmpfile); return false; diff --git a/src/processor/exploitability_linux.h b/src/processor/exploitability_linux.h index 366479591..84197bb6b 100644 --- a/src/processor/exploitability_linux.h +++ b/src/processor/exploitability_linux.h @@ -83,6 +83,7 @@ class ExploitabilityLinux : public Exploitability { // was a success, and the caller owns all pointers. static bool DisassembleBytes(const string& architecture, const uint8_t* raw_bytes, + const unsigned int raw_bytes_len, const unsigned int MAX_OBJDUMP_BUFFER_LEN, char* objdump_output_buffer); diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index 528ee5f21..2baff327b 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -30,6 +30,7 @@ #include #include +#include #include #include "breakpad_googletest_includes.h" @@ -187,13 +188,11 @@ TEST(ExploitabilityTest, TestLinuxEngine) { #ifndef _WIN32 TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) { - ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL)); + ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 0, 5, NULL)); uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0}; char buffer[1024] = {0}; - ASSERT_TRUE(ExploitabilityLinuxTest::DisassembleBytes("i386:x86-64", - bytes, - 1024, - buffer)); + ASSERT_TRUE(ExploitabilityLinuxTest::DisassembleBytes( + "i386:x86-64", bytes, std::extent::value, 1024, buffer)); std::stringstream objdump_stream; objdump_stream.str(string(buffer)); string line = ""; From 9a1941fab908dc0e80ace4b8650001920abd891b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 11 Jul 2022 14:08:38 -0700 Subject: [PATCH 095/195] crashdump_uploader: fix memory leaks & use-after-frees These `GoogleCrashdumpUploader` instances need to be cleaned up; place them on the stack. Doing this unmasks another bug in this code: the `MockLibcurlWrapper` instance we're passing into these `GoogleCrashdumpUploader`s becomes owned by the `GoogleCrashdumpUploader` in question. Putting them on the stack makes `free()` unhappy when the `GoogleCrashdumpUploader` they're given to gets destructed. Bug: b:235999011 Change-Id: I5d0424a1c09d32ea34a8fa6f5e52d3695ee6e857 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756172 Reviewed-by: Mike Frysinger --- src/common/linux/google_crashdump_uploader.cc | 36 +++++----- src/common/linux/google_crashdump_uploader.h | 10 +-- .../linux/google_crashdump_uploader_test.cc | 72 ++++++------------- 3 files changed, 47 insertions(+), 71 deletions(-) diff --git a/src/common/linux/google_crashdump_uploader.cc b/src/common/linux/google_crashdump_uploader.cc index a0d940b61..814c4cae5 100644 --- a/src/common/linux/google_crashdump_uploader.cc +++ b/src/common/linux/google_crashdump_uploader.cc @@ -35,6 +35,7 @@ #include #include +#include #include "common/using_std_string.h" @@ -51,7 +52,7 @@ GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product, const string& crash_server, const string& proxy_host, const string& proxy_userpassword) { - LibcurlWrapper* http_layer = new LibcurlWrapper(); + std::unique_ptr http_layer{new LibcurlWrapper()}; Init(product, version, guid, @@ -63,21 +64,22 @@ GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product, crash_server, proxy_host, proxy_userpassword, - http_layer); + std::move(http_layer)); } -GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product, - const string& version, - const string& guid, - const string& ptime, - const string& ctime, - const string& email, - const string& comments, - const string& minidump_pathname, - const string& crash_server, - const string& proxy_host, - const string& proxy_userpassword, - LibcurlWrapper* http_layer) { +GoogleCrashdumpUploader::GoogleCrashdumpUploader( + const string& product, + const string& version, + const string& guid, + const string& ptime, + const string& ctime, + const string& email, + const string& comments, + const string& minidump_pathname, + const string& crash_server, + const string& proxy_host, + const string& proxy_userpassword, + std::unique_ptr http_layer) { Init(product, version, guid, @@ -89,7 +91,7 @@ GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product, crash_server, proxy_host, proxy_userpassword, - http_layer); + std::move(http_layer)); } void GoogleCrashdumpUploader::Init(const string& product, @@ -103,7 +105,7 @@ void GoogleCrashdumpUploader::Init(const string& product, const string& crash_server, const string& proxy_host, const string& proxy_userpassword, - LibcurlWrapper* http_layer) { + std::unique_ptr http_layer) { product_ = product; version_ = version; guid_ = guid; @@ -111,7 +113,7 @@ void GoogleCrashdumpUploader::Init(const string& product, ctime_ = ctime; email_ = email; comments_ = comments; - http_layer_.reset(http_layer); + http_layer_ = std::move(http_layer); crash_server_ = crash_server; proxy_host_ = proxy_host; diff --git a/src/common/linux/google_crashdump_uploader.h b/src/common/linux/google_crashdump_uploader.h index a2d0575b5..9358afd88 100644 --- a/src/common/linux/google_crashdump_uploader.h +++ b/src/common/linux/google_crashdump_uploader.h @@ -31,11 +31,11 @@ #ifndef COMMON_LINUX_GOOGLE_CRASHDUMP_UPLOADER_H_ #define COMMON_LINUX_GOOGLE_CRASHDUMP_UPLOADER_H_ -#include #include +#include +#include #include "common/linux/libcurl_wrapper.h" -#include "common/scoped_ptr.h" #include "common/using_std_string.h" namespace google_breakpad { @@ -65,7 +65,7 @@ class GoogleCrashdumpUploader { const string& crash_server, const string& proxy_host, const string& proxy_userpassword, - LibcurlWrapper* http_layer); + std::unique_ptr http_layer); void Init(const string& product, const string& version, @@ -78,7 +78,7 @@ class GoogleCrashdumpUploader { const string& crash_server, const string& proxy_host, const string& proxy_userpassword, - LibcurlWrapper* http_layer); + std::unique_ptr http_layer); bool Upload(int* http_status_code, string* http_response_header, string* http_response_body); @@ -86,7 +86,7 @@ class GoogleCrashdumpUploader { private: bool CheckRequiredParametersArePresent(); - scoped_ptr http_layer_; + std::unique_ptr http_layer_; string product_; string version_; string guid_; diff --git a/src/common/linux/google_crashdump_uploader_test.cc b/src/common/linux/google_crashdump_uploader_test.cc index 3d6612e82..e463f2c86 100644 --- a/src/common/linux/google_crashdump_uploader_test.cc +++ b/src/common/linux/google_crashdump_uploader_test.cc @@ -59,21 +59,12 @@ class GoogleCrashdumpUploaderTest : public ::testing::Test { }; TEST_F(GoogleCrashdumpUploaderTest, InitFailsCausesUploadFailure) { - MockLibcurlWrapper m; - EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(false)); - GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar", - "1.0", - "AAA-BBB", - "", - "", - "test@test.com", - "none", - "/tmp/foo.dmp", - "http://foo.com", - "", - "", - &m); - ASSERT_FALSE(uploader->Upload(NULL, NULL, NULL)); + std::unique_ptr m{new MockLibcurlWrapper()}; + EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(false)); + GoogleCrashdumpUploader uploader("foobar", "1.0", "AAA-BBB", "", "", + "test@test.com", "none", "/tmp/foo.dmp", + "http://foo.com", "", "", std::move(m)); + ASSERT_FALSE(uploader.Upload(NULL, NULL, NULL)); } TEST_F(GoogleCrashdumpUploaderTest, TestSendRequestHappensWithValidParameters) { @@ -83,44 +74,27 @@ TEST_F(GoogleCrashdumpUploaderTest, TestSendRequestHappensWithValidParameters) { ASSERT_NE(fd, -1); close(fd); - MockLibcurlWrapper m; - EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(true)); - EXPECT_CALL(m, AddFile(tempfn, _)).WillOnce(Return(true)); - EXPECT_CALL(m, - SendRequest("http://foo.com",_,_,_,_)).Times(1).WillOnce(Return(true)); - GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar", - "1.0", - "AAA-BBB", - "", - "", - "test@test.com", - "none", - tempfn, - "http://foo.com", - "", - "", - &m); - ASSERT_TRUE(uploader->Upload(NULL, NULL, NULL)); + std::unique_ptr m{new MockLibcurlWrapper()}; + EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); + EXPECT_CALL(*m, AddFile(tempfn, _)).WillOnce(Return(true)); + EXPECT_CALL(*m, SendRequest("http://foo.com", _, _, _, _)) + .Times(1) + .WillOnce(Return(true)); + GoogleCrashdumpUploader uploader("foobar", "1.0", "AAA-BBB", "", "", + "test@test.com", "none", tempfn, + "http://foo.com", "", "", std::move(m)); + ASSERT_TRUE(uploader.Upload(NULL, NULL, NULL)); } TEST_F(GoogleCrashdumpUploaderTest, InvalidPathname) { - MockLibcurlWrapper m; - EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(true)); - EXPECT_CALL(m, SendRequest(_,_,_,_,_)).Times(0); - GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar", - "1.0", - "AAA-BBB", - "", - "", - "test@test.com", - "none", - "/tmp/foo.dmp", - "http://foo.com", - "", - "", - &m); - ASSERT_FALSE(uploader->Upload(NULL, NULL, NULL)); + std::unique_ptr m{new MockLibcurlWrapper()}; + EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); + EXPECT_CALL(*m, SendRequest(_,_,_,_,_)).Times(0); + GoogleCrashdumpUploader uploader("foobar", "1.0", "AAA-BBB", "", "", + "test@test.com", "none", "/tmp/foo.dmp", + "http://foo.com", "", "", std::move(m)); + ASSERT_FALSE(uploader.Upload(NULL, NULL, NULL)); } TEST_F(GoogleCrashdumpUploaderTest, TestRequiredParametersMustBePresent) { From 4b7984b351ea928d7da882450454fe7234801674 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 11 Jul 2022 15:23:41 -0700 Subject: [PATCH 096/195] stabs_to_module: fix memory leak Everything in `functions_` is owned by the current `StabsToModule`. If we fail to add something from `functions_`, we need to be sure to dispose of it properly, since `module_` will not take ownership. Bug: b:235999011 Change-Id: I3b965709ea2016a065b50588f4132d14a1de7725 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756733 Reviewed-by: Mike Frysinger --- src/common/stabs_to_module.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index cbddd33db..d8209eb5f 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -192,9 +192,11 @@ void StabsToModule::Finalize() { } } // Now that everything has a size, add our functions to the module, and - // dispose of our private list. + // dispose of our private list. Delete the functions that we fail to add, so + // they aren't leaked. for (Module::Function* func: functions_) - module_->AddFunction(func); + if (!module_->AddFunction(func)) + delete func; functions_.clear(); } From 0b1ffaa1533bdfcf2d3e764f57720a4148b2763d Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 11 Jul 2022 15:06:10 -0700 Subject: [PATCH 097/195] module_unittest: fix memory leak `AddFunction` only takes ownership of the pointer passed to it if it returns true. Since it returns false when adding `function2`, we need to free it. Bug: b:235999011 Change-Id: I11984103c2c153ff0daf2c9690f9c88d04a2131b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756732 Reviewed-by: Mike Frysinger --- src/common/module_unittest.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 393e41514..eba24e667 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -418,7 +418,10 @@ TEST(Construct, DuplicateFunctions) { Module::Function* function2 = generate_duplicate_function("_without_form"); m.AddFunction(function1); - m.AddFunction(function2); + // If this succeeds, we'll have a double-free with the `delete` below. Avoid + // that. + ASSERT_FALSE(m.AddFunction(function2)); + delete function2; m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); From e9057e2d5e9515f38fb06ff4ad968a6845f10fd3 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 11 Jul 2022 21:02:22 -0700 Subject: [PATCH 098/195] stackwalker_mips64_unittest: default-init MIPS context This test's constructor fails to fully initialize this raw context. As a result, we have at least one use of uninitialized memory in CFI.At4004. This causes said test to fail under ASAN. Bug: b:235999011 Change-Id: I3279da8ac3414eb8c90f3949a1db47a03e750a94 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756749 Reviewed-by: Mike Frysinger --- src/processor/stackwalker_mips64_unittest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/processor/stackwalker_mips64_unittest.cc b/src/processor/stackwalker_mips64_unittest.cc index c3c3011a9..e1bf5086c 100644 --- a/src/processor/stackwalker_mips64_unittest.cc +++ b/src/processor/stackwalker_mips64_unittest.cc @@ -645,8 +645,10 @@ struct CFIFixture: public StackwalkerMIPSFixture { EXPECT_EQ(0x00405000U, frame1->function_base); } - // The values we expect to find for the caller's registers. - MDRawContextMIPS expected; + // The values we expect to find for the caller's registers. Forcibly + // default-init it, since it's POD and not all bits are always overwritten by + // the constructor. + MDRawContextMIPS expected{}; // The validity mask for expected. int expected_validity; From eb087c33835da15af4449b18e1c27448fda6e156 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 12 Jul 2022 13:13:14 -0700 Subject: [PATCH 099/195] exploitability_linux: fix mismatched comparison warning On ARM, this write fails to build: comparison of integers of different signs: 'ssize_t' (aka 'int') and 'const unsigned int' [-Werror,-Wsign-compare] Since we check that it's <= 15 above, we can simply cast it without issue. Bug: b:235999011 Change-Id: Id75fc0df74e88b347df615df06567e96c6b59a1d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3758800 Reviewed-by: Mike Frysinger --- src/processor/exploitability_linux.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 7a0fb71a9..d4900bb0c 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -502,7 +502,9 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture, unlink(raw_bytes_tmpfile); return false; } - if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != raw_bytes_len) { + // Casting raw_bytes_len to `ssize_t` won't cause a sign flip, since we check + // its bounds above. + if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != (ssize_t)raw_bytes_len) { BPLOG(ERROR) << "Writing of raw bytes failed."; unlink(raw_bytes_tmpfile); return false; From 335e61656fa6034fabc3431a91e5800ba6fc3dc9 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 12 Jul 2022 21:35:52 -0700 Subject: [PATCH 100/195] {static_,}range_map: fix overflows under ubsan Explicitly call out where overflows are expected, and add appropriate checking for them. BUG=b:235999011 TEST=Unittests on CrOS and Linux Change-Id: I999a6996183c2f4afc16a1c0188dee3bd64d7f09 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3759630 Reviewed-by: Mike Frysinger --- Makefile.am | 10 +++ Makefile.in | 57 ++++++++++++++- src/common/common.gyp | 2 + src/common/safe_math.h | 82 ++++++++++++++++++++++ src/common/safe_math_unittest.cc | 73 +++++++++++++++++++ src/processor/range_map-inl.h | 12 +++- src/processor/range_map_unittest.cc | 13 ++-- src/processor/static_range_map_unittest.cc | 8 +-- 8 files changed, 242 insertions(+), 15 deletions(-) create mode 100644 src/common/safe_math.h create mode 100644 src/common/safe_math_unittest.cc diff --git a/Makefile.am b/Makefile.am index 2cde86493..514a7ff4d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -130,6 +130,7 @@ EXTRA_PROGRAMS = CLEANFILES = check_LIBRARIES += src/testing/libtesting.a +check_PROGRAMS += src/common/safe_math_unittest if !SYSTEM_TEST_LIBS src_testing_libtesting_a_SOURCES = \ @@ -690,6 +691,15 @@ src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \ src_tools_mac_dump_syms_dump_syms_mac_LDADD= \ $(RUSTC_DEMANGLE_LIBS) +src_common_safe_math_unittest_SOURCES = \ + src/common/safe_math.h \ + src/common/safe_math_unittest.cc +src_common_safe_math_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_safe_math_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_common_dumper_unittest_SOURCES = \ src/common/byte_cursor_unittest.cc \ src/common/convert_UTF.cc \ diff --git a/Makefile.in b/Makefile.in index aaf791339..ab0c822d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -134,7 +134,8 @@ host_triplet = @host@ @LINUX_HOST_TRUE@am__append_3 = -fPIC libexec_PROGRAMS = $(am__EXEEXT_10) bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) -check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ +check_PROGRAMS = src/common/safe_math_unittest$(EXEEXT) \ + $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ $(am__EXEEXT_8) $(am__EXEEXT_9) EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@am__append_4 = src/libbreakpad.a @@ -888,6 +889,15 @@ src_common_mac_macho_reader_unittest_OBJECTS = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) +am__src_common_safe_math_unittest_SOURCES_DIST = \ + src/common/safe_math.h src/common/safe_math_unittest.cc +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_safe_math_unittest_OBJECTS = src/common/safe_math_unittest-safe_math_unittest.$(OBJEXT) +src_common_safe_math_unittest_OBJECTS = \ + $(am_src_common_safe_math_unittest_OBJECTS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_DEPENDENCIES = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) am__src_common_test_assembler_unittest_SOURCES_DIST = \ src/common/test_assembler.cc src/common/test_assembler.h \ src/common/test_assembler_unittest.cc @@ -1701,6 +1711,7 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po \ + src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po \ src/common/$(DEPDIR)/string_conversion.Po \ src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Po \ src/common/$(DEPDIR)/test_assembler_unittest-test_assembler_unittest.Po \ @@ -1970,6 +1981,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ + $(src_common_safe_math_unittest_SOURCES) \ $(src_common_test_assembler_unittest_SOURCES) \ $(src_processor_address_map_unittest_SOURCES) \ $(src_processor_basic_source_line_resolver_unittest_SOURCES) \ @@ -2026,6 +2038,7 @@ DIST_SOURCES = \ $(am__src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES_DIST) \ $(am__src_common_linux_google_crashdump_uploader_test_SOURCES_DIST) \ $(am__src_common_mac_macho_reader_unittest_SOURCES_DIST) \ + $(am__src_common_safe_math_unittest_SOURCES_DIST) \ $(am__src_common_test_assembler_unittest_SOURCES_DIST) \ $(am__src_processor_address_map_unittest_SOURCES_DIST) \ $(am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST) \ @@ -2909,6 +2922,17 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_LDADD = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_SOURCES = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/safe_math.h \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/safe_math_unittest.cc + +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_CPPFLAGS = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) + +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_LDADD = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_SOURCES = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/byte_cursor_unittest.cc \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/convert_UTF.cc \ @@ -4800,6 +4824,13 @@ src/common/tests/mac_macho_reader_unittest-file_utils.$(OBJEXT): \ src/common/mac/macho_reader_unittest$(EXEEXT): $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_DEPENDENCIES) $(EXTRA_src_common_mac_macho_reader_unittest_DEPENDENCIES) src/common/mac/$(am__dirstamp) @rm -f src/common/mac/macho_reader_unittest$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_LDADD) $(LIBS) +src/common/safe_math_unittest-safe_math_unittest.$(OBJEXT): \ + src/common/$(am__dirstamp) \ + src/common/$(DEPDIR)/$(am__dirstamp) + +src/common/safe_math_unittest$(EXEEXT): $(src_common_safe_math_unittest_OBJECTS) $(src_common_safe_math_unittest_DEPENDENCIES) $(EXTRA_src_common_safe_math_unittest_DEPENDENCIES) src/common/$(am__dirstamp) + @rm -f src/common/safe_math_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_common_safe_math_unittest_OBJECTS) $(src_common_safe_math_unittest_LDADD) $(LIBS) src/common/test_assembler_unittest-test_assembler.$(OBJEXT): \ src/common/$(am__dirstamp) \ src/common/$(DEPDIR)/$(am__dirstamp) @@ -5423,6 +5454,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/string_conversion.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/test_assembler_unittest-test_assembler_unittest.Po@am__quote@ # am--include-marker @@ -7253,6 +7285,20 @@ src/common/tests/mac_macho_reader_unittest-file_utils.obj: src/common/tests/file @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/mac_macho_reader_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi` +src/common/safe_math_unittest-safe_math_unittest.o: src/common/safe_math_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_safe_math_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/safe_math_unittest-safe_math_unittest.o -MD -MP -MF src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Tpo -c -o src/common/safe_math_unittest-safe_math_unittest.o `test -f 'src/common/safe_math_unittest.cc' || echo '$(srcdir)/'`src/common/safe_math_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Tpo src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/safe_math_unittest.cc' object='src/common/safe_math_unittest-safe_math_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_safe_math_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/safe_math_unittest-safe_math_unittest.o `test -f 'src/common/safe_math_unittest.cc' || echo '$(srcdir)/'`src/common/safe_math_unittest.cc + +src/common/safe_math_unittest-safe_math_unittest.obj: src/common/safe_math_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_safe_math_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/safe_math_unittest-safe_math_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Tpo -c -o src/common/safe_math_unittest-safe_math_unittest.obj `if test -f 'src/common/safe_math_unittest.cc'; then $(CYGPATH_W) 'src/common/safe_math_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/safe_math_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Tpo src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/safe_math_unittest.cc' object='src/common/safe_math_unittest-safe_math_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_safe_math_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/safe_math_unittest-safe_math_unittest.obj `if test -f 'src/common/safe_math_unittest.cc'; then $(CYGPATH_W) 'src/common/safe_math_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/safe_math_unittest.cc'; fi` + src/common/test_assembler_unittest-test_assembler.o: src/common/test_assembler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/test_assembler_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Tpo -c -o src/common/test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Po @@ -8846,6 +8892,13 @@ recheck: all $(check_PROGRAMS) $(check_LIBRARIES) $(check_SCRIPTS) am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? +src/common/safe_math_unittest.log: src/common/safe_math_unittest$(EXEEXT) + @p='src/common/safe_math_unittest$(EXEEXT)'; \ + b='src/common/safe_math_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/common/test_assembler_unittest.log: src/common/test_assembler_unittest$(EXEEXT) @p='src/common/test_assembler_unittest$(EXEEXT)'; \ b='src/common/test_assembler_unittest'; \ @@ -9508,6 +9561,7 @@ distclean: distclean-am -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po -rm -f src/common/$(DEPDIR)/string_conversion.Po -rm -f src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/test_assembler_unittest-test_assembler_unittest.Po @@ -9853,6 +9907,7 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po -rm -f src/common/$(DEPDIR)/string_conversion.Po -rm -f src/common/$(DEPDIR)/test_assembler_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/test_assembler_unittest-test_assembler_unittest.Po diff --git a/src/common/common.gyp b/src/common/common.gyp index c1dbb0feb..6fd769520 100644 --- a/src/common/common.gyp +++ b/src/common/common.gyp @@ -163,6 +163,7 @@ 'memory_range.h', 'module.cc', 'module.h', + 'safe_math.h', 'scoped_ptr.h', 'simple_string_dictionary.cc', 'simple_string_dictionary.h', @@ -233,6 +234,7 @@ 'memory_allocator_unittest.cc', 'memory_range_unittest.cc', 'module_unittest.cc', + 'safe_math_unittest.cc', 'simple_string_dictionary_unittest.cc', 'stabs_reader_unittest.cc', 'stabs_to_module_unittest.cc', diff --git a/src/common/safe_math.h b/src/common/safe_math.h new file mode 100644 index 000000000..879e2878b --- /dev/null +++ b/src/common/safe_math.h @@ -0,0 +1,82 @@ +// Copyright (c) 2022, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// safe_math.h: Helpful math functions. +#ifndef SAFE_MATH_H__ +#define SAFE_MATH_H__ + +#include + +namespace google_breakpad { + +// Adds `a` and `b`, returning a pair of: +// - The result after any truncation. +// - Whether an overflow/underflow occurred. +template +std::pair AddWithOverflowCheck(T a, T b) { +#ifdef _WIN32 + // Since C++11, unsigned overflow is well-defined; do everything unsigned, + // assuming 2's complement. + if (std::is_unsigned::value) { + T result = a + b; + // Since we're adding two values >= 0, having a smaller value implies + // overflow. + bool overflow = result < a; + return {result, overflow}; + } + + using TUnsigned = typename std::make_unsigned::type; + T result = TUnsigned(a) + TUnsigned(b); + bool overflow; + if ((a >= 0) == (b >= 0)) { + if (a >= 0) { + overflow = result < a; + } else { + overflow = result > a; + } + } else { + // If signs are different, it's impossible for overflow to happen. + overflow = false; + } + return {result, overflow}; +#else + T result; + bool overflow = __builtin_add_overflow(a, b, &result); + return {result, overflow}; +#endif +} + +template +T AddIgnoringOverflow(T a, T b) { + return AddWithOverflowCheck(a, b).first; +} + +} // namespace google_breakpad + +#endif // SAFE_MATH_H__ diff --git a/src/common/safe_math_unittest.cc b/src/common/safe_math_unittest.cc new file mode 100644 index 000000000..417d96d4c --- /dev/null +++ b/src/common/safe_math_unittest.cc @@ -0,0 +1,73 @@ +// Copyright (c) 2022 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// safe_math_unittest.cc: Unit tests for SafeMath + +#include "safe_math.h" +#include "breakpad_googletest_includes.h" + +namespace { + +using google_breakpad::AddIgnoringOverflow; +using google_breakpad::AddWithOverflowCheck; + +TEST(SafeMath, AddOverflowWorksAsIntended) { + EXPECT_EQ(AddWithOverflowCheck(0, 0), + std::make_pair(0, false)); + EXPECT_EQ(AddWithOverflowCheck(0, 255), + std::make_pair(255, false)); + EXPECT_EQ(AddWithOverflowCheck(1, 255), + std::make_pair(0, true)); + + EXPECT_EQ(AddWithOverflowCheck(-128, 127), + std::make_pair(-1, false)); + EXPECT_EQ(AddWithOverflowCheck(127, -128), + std::make_pair(-1, false)); + EXPECT_EQ(AddWithOverflowCheck(1, -128), + std::make_pair(-127, false)); + EXPECT_EQ(AddWithOverflowCheck(127, -1), + std::make_pair(126, false)); + + EXPECT_EQ(AddWithOverflowCheck(-128, -1), + std::make_pair(127, true)); + EXPECT_EQ(AddWithOverflowCheck(-128, -128), + std::make_pair(0, true)); + EXPECT_EQ(AddWithOverflowCheck(127, 1), + std::make_pair(-128, true)); + EXPECT_EQ(AddWithOverflowCheck(127, 127), + std::make_pair(-2, true)); +} + +TEST(SafeMath, AddIgnoringOverflowWorksAsIntended) { + EXPECT_EQ(AddIgnoringOverflow(0, 0), 0); + EXPECT_EQ(AddIgnoringOverflow(0, 255), 255); + EXPECT_EQ(AddIgnoringOverflow(1, 255), 0); +} + +} // namespace diff --git a/src/processor/range_map-inl.h b/src/processor/range_map-inl.h index 6bfc72554..ba47893c5 100644 --- a/src/processor/range_map-inl.h +++ b/src/processor/range_map-inl.h @@ -39,6 +39,7 @@ #include +#include "common/safe_math.h" #include "processor/range_map.h" #include "processor/linked_ptr.h" #include "processor/logging.h" @@ -57,10 +58,15 @@ template bool RangeMap::StoreRangeInternal( const AddressType& base, const AddressType& delta, const AddressType& size, const EntryType& entry) { - AddressType high = base + (size - 1); - + AddressType high; + bool high_ok = false; + if (size > 0) { + std::pair result = AddWithOverflowCheck(base, size - 1); + high = result.first; + high_ok = !result.second; + } // Check for undersize or overflow. - if (size <= 0 || high < base) { + if (!high_ok) { // The processor will hit this case too frequently with common symbol // files in the size == 0 case, which is more suited to a DEBUG channel. // Filter those out since there's no DEBUG channel at the moment. diff --git a/src/processor/range_map_unittest.cc b/src/processor/range_map_unittest.cc index 0f1c71319..38369bfbf 100644 --- a/src/processor/range_map_unittest.cc +++ b/src/processor/range_map_unittest.cc @@ -43,11 +43,10 @@ namespace { - +using google_breakpad::AddIgnoringOverflow; using google_breakpad::linked_ptr; -using google_breakpad::scoped_ptr; using google_breakpad::RangeMap; - +using google_breakpad::scoped_ptr; // A CountedObject holds an int. A global (not thread safe!) count of // allocated CountedObjects is maintained to help test memory management. @@ -148,10 +147,10 @@ static bool RetrieveTest(TestMap* range_map, const RangeTest* range_test) { } for (AddressType offset = low_offset; offset <= high_offset; ++offset) { - AddressType address = - offset + - (!side ? range_test->address : - range_test->address + range_test->size - 1); + AddressType address = AddIgnoringOverflow( + offset, (!side ? range_test->address + : AddIgnoringOverflow(range_test->address, + range_test->size - 1))); bool expected_result = false; // This is correct for tests not stored. if (range_test->expect_storable) { diff --git a/src/processor/static_range_map_unittest.cc b/src/processor/static_range_map_unittest.cc index 1593ed004..22384253d 100644 --- a/src/processor/static_range_map_unittest.cc +++ b/src/processor/static_range_map_unittest.cc @@ -228,10 +228,10 @@ void TestStaticRangeMap::RetrieveTest(TestMap* range_map, } for (AddressType offset = low_offset; offset <= high_offset; ++offset) { - AddressType address = - offset + - (!side ? range_test->address : - range_test->address + range_test->size - 1); + AddressType address = AddIgnoringOverflow( + offset, (!side ? range_test->address + : AddIgnoringOverflow(range_test->address, + range_test->size - 1))); bool expected_result = false; // This is correct for tests not stored. if (range_test->expect_storable) { From e467c59c689d176ad0f311935022ed18110748fb Mon Sep 17 00:00:00 2001 From: Alex Gough Date: Tue, 19 Jul 2022 05:23:55 -0700 Subject: [PATCH 101/195] Adds fastfail subcodes as distinct failure reasons Previously these all resulted in EXCEPTION_STACK_BUFFER_OVERRUN but this hides various specific fast fail crash types, which are now provided based on the exception's subcode. Tests: added to minidump_process_unittest.cc Bug: 865632 Change-Id: Ic6693de247da55cf6d132d108c6e20c635f366b1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3771437 Reviewed-by: Robert Sesek --- .../common/minidump_exception_win32.h | 73 ++++++ src/processor/minidump_processor.cc | 215 +++++++++++++++++- src/processor/minidump_processor_unittest.cc | 16 ++ src/processor/testdata/tiny-exe-fastfail.dmp | Bin 0 -> 98722 bytes 4 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 src/processor/testdata/tiny-exe-fastfail.dmp diff --git a/src/google_breakpad/common/minidump_exception_win32.h b/src/google_breakpad/common/minidump_exception_win32.h index 4b5d57c85..9f734d5b7 100644 --- a/src/google_breakpad/common/minidump_exception_win32.h +++ b/src/google_breakpad/common/minidump_exception_win32.h @@ -2266,4 +2266,77 @@ typedef enum { MD_IN_PAGE_ERROR_WIN_EXEC = 8 } MDInPageErrorTypeWin; +// These constants are defined in winnt.h and are used with the +// STATUS_STACK_BUFFER_OVERRUN exception as exception subcodes. +typedef enum { + MD_FAST_FAIL_LEGACY_GS_VIOLATION = 0, + MD_FAST_FAIL_VTGUARD_CHECK_FAILURE = 1, + MD_FAST_FAIL_STACK_COOKIE_CHECK_FAILURE = 2, + MD_FAST_FAIL_CORRUPT_LIST_ENTRY = 3, + MD_FAST_FAIL_INCORRECT_STACK = 4, + MD_FAST_FAIL_INVALID_ARG = 5, + MD_FAST_FAIL_GS_COOKIE_INIT = 6, + MD_FAST_FAIL_FATAL_APP_EXIT = 7, + MD_FAST_FAIL_RANGE_CHECK_FAILURE = 8, + MD_FAST_FAIL_UNSAFE_REGISTRY_ACCESS = 9, + MD_FAST_FAIL_GUARD_ICALL_CHECK_FAILURE = 10, + MD_FAST_FAIL_GUARD_WRITE_CHECK_FAILURE = 11, + MD_FAST_FAIL_INVALID_FIBER_SWITCH = 12, + MD_FAST_FAIL_INVALID_SET_OF_CONTEXT = 13, + MD_FAST_FAIL_INVALID_REFERENCE_COUNT = 14, + MD_FAST_FAIL_INVALID_JUMP_BUFFER = 18, + MD_FAST_FAIL_MRDATA_MODIFIED = 19, + MD_FAST_FAIL_CERTIFICATION_FAILURE = 20, + MD_FAST_FAIL_INVALID_EXCEPTION_CHAIN = 21, + MD_FAST_FAIL_CRYPTO_LIBRARY = 22, + MD_FAST_FAIL_INVALID_CALL_IN_DLL_CALLOUT = 23, + MD_FAST_FAIL_INVALID_IMAGE_BASE = 24, + MD_FAST_FAIL_DLOAD_PROTECTION_FAILURE = 25, + MD_FAST_FAIL_UNSAFE_EXTENSION_CALL = 26, + MD_FAST_FAIL_DEPRECATED_SERVICE_INVOKED = 27, + MD_FAST_FAIL_INVALID_BUFFER_ACCESS = 28, + MD_FAST_FAIL_INVALID_BALANCED_TREE = 29, + MD_FAST_FAIL_INVALID_NEXT_THREAD = 30, + MD_FAST_FAIL_GUARD_ICALL_CHECK_SUPPRESSED = 31, + MD_FAST_FAIL_APCS_DISABLED = 32, + MD_FAST_FAIL_INVALID_IDLE_STATE = 33, + MD_FAST_FAIL_MRDATA_PROTECTION_FAILURE = 34, + MD_FAST_FAIL_UNEXPECTED_HEAP_EXCEPTION = 35, + MD_FAST_FAIL_INVALID_LOCK_STATE = 36, + MD_FAST_FAIL_GUARD_JUMPTABLE = 37, + MD_FAST_FAIL_INVALID_LONGJUMP_TARGET = 38, + MD_FAST_FAIL_INVALID_DISPATCH_CONTEXT = 39, + MD_FAST_FAIL_INVALID_THREAD = 40, + MD_FAST_FAIL_INVALID_SYSCALL_NUMBER = 41, + MD_FAST_FAIL_INVALID_FILE_OPERATION = 42, + MD_FAST_FAIL_LPAC_ACCESS_DENIED = 43, + MD_FAST_FAIL_GUARD_SS_FAILURE = 44, + MD_FAST_FAIL_LOADER_CONTINUITY_FAILURE = 45, + MD_FAST_FAIL_GUARD_EXPORT_SUPPRESSION_FAILURE = 46, + MD_FAST_FAIL_INVALID_CONTROL_STACK = 47, + MD_FAST_FAIL_SET_CONTEXT_DENIED = 48, + MD_FAST_FAIL_INVALID_IAT = 49, + MD_FAST_FAIL_HEAP_METADATA_CORRUPTION = 50, + MD_FAST_FAIL_PAYLOAD_RESTRICTION_VIOLATION = 51, + MD_FAST_FAIL_LOW_LABEL_ACCESS_DENIED = 52, + MD_FAST_FAIL_ENCLAVE_CALL_FAILURE = 53, + MD_FAST_FAIL_UNHANDLED_LSS_EXCEPTON = 54, + MD_FAST_FAIL_ADMINLESS_ACCESS_DENIED = 55, + MD_FAST_FAIL_UNEXPECTED_CALL = 56, + MD_FAST_FAIL_CONTROL_INVALID_RETURN_ADDRESS = 57, + MD_FAST_FAIL_UNEXPECTED_HOST_BEHAVIOR = 58, + MD_FAST_FAIL_FLAGS_CORRUPTION = 59, + MD_FAST_FAIL_VEH_CORRUPTION = 60, + MD_FAST_FAIL_ETW_CORRUPTION = 61, + MD_FAST_FAIL_RIO_ABORT = 62, + MD_FAST_FAIL_INVALID_PFN = 63, + MD_FAST_FAIL_GUARD_ICALL_CHECK_FAILURE_XFG = 64, + MD_FAST_FAIL_CAST_GUARD = 65, + MD_FAST_FAIL_HOST_VISIBILITY_CHANGE = 66, + MD_FAST_FAIL_KERNEL_CET_SHADOW_STACK_ASSIST = 67, + MD_FAST_FAIL_PATCH_CALLBACK_FAILED = 68, + MD_FAST_FAIL_NTDLL_PATCH_FAILED = 69, + MD_FAST_FAIL_INVALID_FLS_DATA = 70 +} MDFastFailSubcodeTypeWin; + #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ */ diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index fd4b28e2f..e6875c9ea 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -1330,7 +1330,220 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address) { reason = "EXCEPTION_POSSIBLE_DEADLOCK"; break; case MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN: - reason = "EXCEPTION_STACK_BUFFER_OVERRUN"; + if (raw_exception->exception_record.number_parameters >= 1) { + MDFastFailSubcodeTypeWin subcode = + static_cast( + raw_exception->exception_record.exception_information[0]); + switch (subcode) { + // Note - we skip the '0'/GS case as it exists for legacy reasons. + case MD_FAST_FAIL_VTGUARD_CHECK_FAILURE: + reason = "FAST_FAIL_VTGUARD_CHECK_FAILURE"; + break; + case MD_FAST_FAIL_STACK_COOKIE_CHECK_FAILURE: + reason = "FAST_FAIL_STACK_COOKIE_CHECK_FAILURE"; + break; + case MD_FAST_FAIL_CORRUPT_LIST_ENTRY: + reason = "FAST_FAIL_CORRUPT_LIST_ENTRY"; + break; + case MD_FAST_FAIL_INCORRECT_STACK: + reason = "FAST_FAIL_INCORRECT_STACK"; + break; + case MD_FAST_FAIL_INVALID_ARG: + reason = "FAST_FAIL_INVALID_ARG"; + break; + case MD_FAST_FAIL_GS_COOKIE_INIT: + reason = "FAST_FAIL_GS_COOKIE_INIT"; + break; + case MD_FAST_FAIL_FATAL_APP_EXIT: + reason = "FAST_FAIL_FATAL_APP_EXIT"; + break; + case MD_FAST_FAIL_RANGE_CHECK_FAILURE: + reason = "FAST_FAIL_RANGE_CHECK_FAILURE"; + break; + case MD_FAST_FAIL_UNSAFE_REGISTRY_ACCESS: + reason = "FAST_FAIL_UNSAFE_REGISTRY_ACCESS"; + break; + case MD_FAST_FAIL_GUARD_ICALL_CHECK_FAILURE: + reason = "FAST_FAIL_GUARD_ICALL_CHECK_FAILURE"; + break; + case MD_FAST_FAIL_GUARD_WRITE_CHECK_FAILURE: + reason = "FAST_FAIL_GUARD_WRITE_CHECK_FAILURE"; + break; + case MD_FAST_FAIL_INVALID_FIBER_SWITCH: + reason = "FAST_FAIL_INVALID_FIBER_SWITCH"; + break; + case MD_FAST_FAIL_INVALID_SET_OF_CONTEXT: + reason = "FAST_FAIL_INVALID_SET_OF_CONTEXT"; + break; + case MD_FAST_FAIL_INVALID_REFERENCE_COUNT: + reason = "FAST_FAIL_INVALID_REFERENCE_COUNT"; + break; + case MD_FAST_FAIL_INVALID_JUMP_BUFFER: + reason = "FAST_FAIL_INVALID_JUMP_BUFFER"; + break; + case MD_FAST_FAIL_MRDATA_MODIFIED: + reason = "FAST_FAIL_MRDATA_MODIFIED"; + break; + case MD_FAST_FAIL_CERTIFICATION_FAILURE: + reason = "FAST_FAIL_CERTIFICATION_FAILURE"; + break; + case MD_FAST_FAIL_INVALID_EXCEPTION_CHAIN: + reason = "FAST_FAIL_INVALID_EXCEPTION_CHAIN"; + break; + case MD_FAST_FAIL_CRYPTO_LIBRARY: + reason = "FAST_FAIL_CRYPTO_LIBRARY"; + break; + case MD_FAST_FAIL_INVALID_CALL_IN_DLL_CALLOUT: + reason = "FAST_FAIL_INVALID_CALL_IN_DLL_CALLOUT"; + break; + case MD_FAST_FAIL_INVALID_IMAGE_BASE: + reason = "FAST_FAIL_INVALID_IMAGE_BASE"; + break; + case MD_FAST_FAIL_DLOAD_PROTECTION_FAILURE: + reason = "FAST_FAIL_DLOAD_PROTECTION_FAILURE"; + break; + case MD_FAST_FAIL_UNSAFE_EXTENSION_CALL: + reason = "FAST_FAIL_UNSAFE_EXTENSION_CALL"; + break; + case MD_FAST_FAIL_DEPRECATED_SERVICE_INVOKED: + reason = "FAST_FAIL_DEPRECATED_SERVICE_INVOKED"; + break; + case MD_FAST_FAIL_INVALID_BUFFER_ACCESS: + reason = "FAST_FAIL_INVALID_BUFFER_ACCESS"; + break; + case MD_FAST_FAIL_INVALID_BALANCED_TREE: + reason = "FAST_FAIL_INVALID_BALANCED_TREE"; + break; + case MD_FAST_FAIL_INVALID_NEXT_THREAD: + reason = "FAST_FAIL_INVALID_NEXT_THREAD"; + break; + case MD_FAST_FAIL_GUARD_ICALL_CHECK_SUPPRESSED: + reason = "FAST_FAIL_GUARD_ICALL_CHECK_SUPPRESSED"; + break; + case MD_FAST_FAIL_APCS_DISABLED: + reason = "FAST_FAIL_APCS_DISABLED"; + break; + case MD_FAST_FAIL_INVALID_IDLE_STATE: + reason = "FAST_FAIL_INVALID_IDLE_STATE"; + break; + case MD_FAST_FAIL_MRDATA_PROTECTION_FAILURE: + reason = "FAST_FAIL_MRDATA_PROTECTION_FAILURE"; + break; + case MD_FAST_FAIL_UNEXPECTED_HEAP_EXCEPTION: + reason = "FAST_FAIL_UNEXPECTED_HEAP_EXCEPTION"; + break; + case MD_FAST_FAIL_INVALID_LOCK_STATE: + reason = "FAST_FAIL_INVALID_LOCK_STATE"; + break; + case MD_FAST_FAIL_GUARD_JUMPTABLE: + reason = "FAST_FAIL_GUARD_JUMPTABLE"; + break; + case MD_FAST_FAIL_INVALID_LONGJUMP_TARGET: + reason = "FAST_FAIL_INVALID_LONGJUMP_TARGET"; + break; + case MD_FAST_FAIL_INVALID_DISPATCH_CONTEXT: + reason = "FAST_FAIL_INVALID_DISPATCH_CONTEXT"; + break; + case MD_FAST_FAIL_INVALID_THREAD: + reason = "FAST_FAIL_INVALID_THREAD"; + break; + case MD_FAST_FAIL_INVALID_SYSCALL_NUMBER: + reason = "FAST_FAIL_INVALID_SYSCALL_NUMBER"; + break; + case MD_FAST_FAIL_INVALID_FILE_OPERATION: + reason = "FAST_FAIL_INVALID_FILE_OPERATION"; + break; + case MD_FAST_FAIL_LPAC_ACCESS_DENIED: + reason = "FAST_FAIL_LPAC_ACCESS_DENIED"; + break; + case MD_FAST_FAIL_GUARD_SS_FAILURE: + reason = "FAST_FAIL_GUARD_SS_FAILURE"; + break; + case MD_FAST_FAIL_LOADER_CONTINUITY_FAILURE: + reason = "FAST_FAIL_LOADER_CONTINUITY_FAILURE"; + break; + case MD_FAST_FAIL_GUARD_EXPORT_SUPPRESSION_FAILURE: + reason = "FAST_FAIL_GUARD_EXPORT_SUPPRESSION_FAILURE"; + break; + case MD_FAST_FAIL_INVALID_CONTROL_STACK: + reason = "FAST_FAIL_INVALID_CONTROL_STACK"; + break; + case MD_FAST_FAIL_SET_CONTEXT_DENIED: + reason = "FAST_FAIL_SET_CONTEXT_DENIED"; + break; + case MD_FAST_FAIL_INVALID_IAT: + reason = "FAST_FAIL_INVALID_IAT"; + break; + case MD_FAST_FAIL_HEAP_METADATA_CORRUPTION: + reason = "FAST_FAIL_HEAP_METADATA_CORRUPTION"; + break; + case MD_FAST_FAIL_PAYLOAD_RESTRICTION_VIOLATION: + reason = "FAST_FAIL_PAYLOAD_RESTRICTION_VIOLATION"; + break; + case MD_FAST_FAIL_LOW_LABEL_ACCESS_DENIED: + reason = "FAST_FAIL_LOW_LABEL_ACCESS_DENIED"; + break; + case MD_FAST_FAIL_ENCLAVE_CALL_FAILURE: + reason = "FAST_FAIL_ENCLAVE_CALL_FAILURE"; + break; + case MD_FAST_FAIL_UNHANDLED_LSS_EXCEPTON: + reason = "FAST_FAIL_UNHANDLED_LSS_EXCEPTON"; + break; + case MD_FAST_FAIL_ADMINLESS_ACCESS_DENIED: + reason = "FAST_FAIL_ADMINLESS_ACCESS_DENIED"; + break; + case MD_FAST_FAIL_UNEXPECTED_CALL: + reason = "FAST_FAIL_UNEXPECTED_CALL"; + break; + case MD_FAST_FAIL_CONTROL_INVALID_RETURN_ADDRESS: + reason = "FAST_FAIL_CONTROL_INVALID_RETURN_ADDRESS"; + break; + case MD_FAST_FAIL_UNEXPECTED_HOST_BEHAVIOR: + reason = "FAST_FAIL_UNEXPECTED_HOST_BEHAVIOR"; + break; + case MD_FAST_FAIL_FLAGS_CORRUPTION: + reason = "FAST_FAIL_FLAGS_CORRUPTION"; + break; + case MD_FAST_FAIL_VEH_CORRUPTION: + reason = "FAST_FAIL_VEH_CORRUPTION"; + break; + case MD_FAST_FAIL_ETW_CORRUPTION: + reason = "FAST_FAIL_ETW_CORRUPTION"; + break; + case MD_FAST_FAIL_RIO_ABORT: + reason = "FAST_FAIL_RIO_ABORT"; + break; + case MD_FAST_FAIL_INVALID_PFN: + reason = "FAST_FAIL_INVALID_PFN"; + break; + case MD_FAST_FAIL_GUARD_ICALL_CHECK_FAILURE_XFG: + reason = "FAST_FAIL_GUARD_ICALL_CHECK_FAILURE_XFG"; + break; + case MD_FAST_FAIL_CAST_GUARD: + reason = "FAST_FAIL_CAST_GUARD"; + break; + case MD_FAST_FAIL_HOST_VISIBILITY_CHANGE: + reason = "FAST_FAIL_HOST_VISIBILITY_CHANGE"; + break; + case MD_FAST_FAIL_KERNEL_CET_SHADOW_STACK_ASSIST: + reason = "FAST_FAIL_KERNEL_CET_SHADOW_STACK_ASSIST"; + break; + case MD_FAST_FAIL_PATCH_CALLBACK_FAILED: + reason = "FAST_FAIL_PATCH_CALLBACK_FAILED"; + break; + case MD_FAST_FAIL_NTDLL_PATCH_FAILED: + reason = "FAST_FAIL_NTDLL_PATCH_FAILED"; + break; + case MD_FAST_FAIL_INVALID_FLS_DATA: + reason = "FAST_FAIL_INVALID_FLS_DATA"; + break; + default: + reason = "EXCEPTION_STACK_BUFFER_OVERRUN"; + break; + } + } else { + reason = "EXCEPTION_STACK_BUFFER_OVERRUN"; + } break; case MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION: reason = "EXCEPTION_HEAP_CORRUPTION"; diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 775a48ea3..3af000d0a 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -784,6 +784,22 @@ TEST_F(MinidumpProcessorTest, TestXStateAmd64ContextMinidump) { // breakpad. } +TEST_F(MinidumpProcessorTest, TestFastFailException) { + // This tests if we can understand fastfail exception subcodes. + // Dump is captured from a toy executable and is readable by windbg. + MinidumpProcessor processor(nullptr, nullptr /*&supplier, &resolver*/); + + string minidump_file = GetTestDataPath() + + "tiny-exe-fastfail.dmp"; + + ProcessState state; + ASSERT_EQ(processor.Process(minidump_file, &state), + google_breakpad::PROCESS_OK); + ASSERT_TRUE(state.crashed()); + ASSERT_EQ(state.threads()->size(), size_t(4)); + ASSERT_EQ(state.crash_reason(), "FAST_FAIL_FATAL_APP_EXIT"); +} + } // namespace int main(int argc, char* argv[]) { diff --git a/src/processor/testdata/tiny-exe-fastfail.dmp b/src/processor/testdata/tiny-exe-fastfail.dmp new file mode 100644 index 0000000000000000000000000000000000000000..f7a0a502ba9b0707fa835cca00699f117c6b85ab GIT binary patch literal 98722 zcmeG_33ycHwI>UZuns$-$Y?=9g=S+_bV3$_CNLo^Vn?$MNn|#XNg&TEW7Suvf>W1@ zEv?bl#oAiqd+l@iY>oR;wNa~5tu_6xKq|gZ8IM1RzjX8cw)cr?^{8wJK0ZeOkv~=WQ{i`w0N{VZL;qk07)1~ta(5#V zCsac%G{Oe_uf+%z5JVpz)ZuRv{@P(RhIqj(QpNf~Ldc-NuY%1u3lUcvco0uLG$8)| zaZ*N8BRC)I?d{EmMUVw~kPUOie>L({2lLTq1M=xc-&UxBO7ZSNcQrH%UrLt^Ihb}n z%)z%j@fIr|mfzPw0(Dr*^{A+PbiL)I)F4+9Cz9dh(_ zTPh_Znd#7pO=RR*dfS?ckGG2ESol$&a44QG?64l6BKs}o)y|A`&Hmdn_-_ArrGV70 z-E=nqrTO7BfQ%iI|495E8UO74l_LJl*w^JWrHJ_F9}n<(y(zx!BoVLSBfo&VG6BBx zfW*J}MC^yQnc`>3_)|XHD&p@&KJNalj6eJoW?Dk(OR;AaG6oxVsQBFCeZJ;c>H`Py z%)~S=W2Tt*>2TN2z~(_(zfXVffXu~k7(J{SdtwRCP|4GA z#Gvo*$Qwlky?R>tDslwm3>UPzM!;|9jD)9~yk);0BrVFhn7TXAY7U>yPq)FnB`=)({2*zO9u_C0mHO$YTQO1~6?X4Qh0Svwzw;Oz{Oijro*tU>MeWAM zgtT6hwGO8()3wRhNm@D?_9V2_}*u>Bf$Pv?fWNx2M9-H>JY()F(&%#6&Az zyAi8?btI&9y3AL5D&(G-2BDo>Z|gSETCM6A!9@8Y89tkk)-I_V9X2Sw$OhpnesY6- zva!5wQM3pqqD6Z6VM1E-r3~B0!EaWMhxbc=a!-Sa)_cT>Mc_U!C71 zX*uS>&zIBGGF!#IPiQ1O#bt;Zv{=XzN_jN!9+5g zgZcWUj#js+Urs^G!8tY90^rc5BlKx1$)&e9ElrL!q?CGl5A^nKCI8-DvNKS*K;Wnf z0+3Z&O`xlzX%^j?-cHv?%4Xy z1$P2GcHz)d3NYsA;(1p$V90+yQdClcuyl8dZT&On4Viz|p4opvT!e>kQ2M9tTh>|s zqz0}3e0(_}dwuMD=Y%iTrfeBTnrnQvmal-}D4_T9N5D;|^&L4+di(bxK|7ffbkFXK zH>F>fJp}H&ZaAFyX>TtD{c!wiqX}O8hrW2o{|~Q^LCr)Nznub=BR_;=FqMf7?VC_k1V|u0nY&n{w3~>9g0>BQG&M{+WgKumpjQr$ZDc{<3K1{1znfmgT zcPx-G03O+S!GB(%>=_~&WTZ;C zr%-r z+D)3!*M)v9XsdCVEGjPaYef4{8_u%bum%4C@creyf3 z#$2?bwJCr(H}Z2@68v~kO06jMCX`MzN2e!&fvjCrmVP1cD2`;fXu@1b9`XjwMT00A zbJ;9SA}1`109x}l3w?^_CYh3HQF*C}*aD^AC8w{F125`tl#66!+Jfal8asI1kQ`9@ z799`C)VX@pQL}a?QzFsy8;}QM-A#rMKc;n?B$14clhx0Q_CL1ma(O0`mjbN!>(T1H zT37E2u@xvq4NWF5WD}QdT2wEbNoaYE(9SljaY5v!3Co9CU}{@iQAW+Wl18LSJ=1Y` z(LNne&L`tvh4?K_O$vn}GWW6LmGACbs)U7xElfNRaj?bd;uByo_M*K9#B~BF!0+s|0KM8Ps{jwmnC)}nG&Lgco+Zv}WrZ!v7 zZ@w%^T6hL40loeW6o)>I{(Ye7zq)vF6fOb5gXLeJUjLqeq#8D>I?~aMUT13`h1=te6tE*$nlOFpt@X> zIZdpd#cR(fk5+reQa!X#uYUvOM4v|gKG5`EUAzG*sE&byJz&aC^q#((Vcn4ytwzBuvrdP6bXE4}QJcv*=cXhHu^|R!g$> z?NX~I@p5?N_z$K&=+o%m54}{Z_G}fs7zpm}so|+fM&VX%G{-}07#LnN5GkjZQtPR=DN4I=LYI(fFh-x`{t8F zuU>jd+S_~n{N{6MjTFfjtn+vxG48oX+daC>nRZ&k8;zg-{I6G2jE(LlpWBn06N#ib zmlhAXciKtQe*9F<*z$)qMI+TzH%Fp3T1k=jXPM&zoc?Y^TKH$4y%*nQY zP^=cDWypQSZ*R@MtvBsAxtn(W=iVt}|3r}xiPsxJ^YdHQe((L_?>+kIw_p9B{_4!# z0!_2KNhh6IbC20ved{l#zx&VcocQ8~$L1*{xj8KnEN?#k`vVTgTOTbvw{FLu?@m9J zqSV*vMO-s%?l~Db7vFt(dEw75NX>mA5@SP)uH;X?UVCZO+?T$ezv7?QE&G>-QRR{rCK>4>q5B%I>VcKVK8LH50c5VVtJ6 zfKfK<|M;yFwtaNv`8SlDbmsE3RTogKMz2>#>x)(MKRETI>hs^b{Edh1o$=IAicupF z1)3VYjlsrNce4bYV{|x2!ylh?&%)RLKzH{w(jDH4 z^w7 zED2Z=uq0qfz>@~0_P0mVSNx+hTB>_tUmIN#b9KjL@sP%u-{blC$fAvK+76h*|(3jg{KGynwOtDy= zi6yXWoU|J-?05ZN#gB*8TK|tH8Oz_2fF*$=O#=P)%ST#KB%gH@U<-PpLC8F5-|CM~2 zND6!8&3dsUU`fD|fF%J-0+s|U2|!4$|MzS)-pgfP|Iaec=XjlAwATOQ2*&bG zB!OKyYW-iqe%Jq1ym&aR_5XO1vHUFwSQ0qWB+zfae57UA%8w-hO9GYzED2Z=uq0qf zz>>frmVjFSUuv`$9b%>|@`sHC)On-Bh98R&O9F$FKni4-Kcm+#BFFN;LR-KU?A}QuO*82Ti$Be@{}DiDJ~bOT99Th9vpM z`y1lHIOxI;$ouL$K9=_{+y7&HA+;a7V3(|2~E zVttf8Gb8Q5)|8gCF+edfzjb( zZ08q#yi)G(YLM+}`^3ch{A$OV3QE`2sBeb>y1S(N&QBCRCGGIvjPu${Z>bXLN2_q+ z;}(3@Du41OzejF;Ow`{@e1C>K`*}j$lFseRCW`)x(*qd!><0}7j~D5G|0~HS$LDK{3td(J}!_rjcNkw1z-a^iGTR1Idl4i%5XIbDD9-(GQ!#P9e9EKVaT>Uq#^ zbSv+Y4Jy8JKW1`s@_5i{593M3^0y>lNx+hTC4s|H0z8j3^TzWm+cG&`xbqV^KfCcG z2?slm4Hrm!#Z0iD^L+pIc`V=47Y{PuCRp{koZq*9S}Def0p;#cZjR3P{jq%6--1R7 zu-?%acOdiFJAVC^HIFrl&~jN4uq0qfz>>h%Py$O}G5*P47xKRZ3WS?}UEqW!@IyWR zR)ZJpxC+q-9&kf5zR!X!un^|MY>Zci{Qijl=rzt2p-g!6Ap@fj)z|)M8MT{p zoDAJ{DC0aK?f$7H&e=*V87G$TYN6q=ONvUQLdd>0qQ&d5bXTChu7q_M=0bgG6FTF@ zxTFOx)KxE*;9M-DEux$X@wXMJ`0%$7^|~p7%UEi9*(YE3NsDp>eTj7gQf_YiFt5~y68s@j4kVE4WnH3O-)#vFod+V3EySw zz_`|72x+<>HX}tB%F--HeQJuKcQZCX{tGc5tFb&*A)m)%9;uycMvAovsZ^@*jndZ$ zih93Vlu9GU@nIghypBg{6rpb9Bc=+J!*cOkEbv#NUx{c5%g}!f#-iL9eJJ%7(PB_r zETvz8`P_(n4y^2rwIo&_P=UD45_vL8(T={7X8VM`_5>o9B;hLY|t!(3;hl!~$bkc23utPRvxRANkO{VVZb-)9ic)#$?* zsIQ`SwF#jc-|T|d0G5a!{bb)2j{^5g{n4PBw*kw)1+fMN$Fj$Dqs|ePjo6lCVUJ4G zxU80-zUHAeP@7zg{?r#m;~UG+DE(MNKFLPG(Y|= zL-_|$bLhSQwn(3bFswv9q;W`;cIIE@0< zAQnz<9xK_g)OpMoOK%d7^9It^uf>|{!hDm|JfcM?!x|`kvxSCJ=~7u`;~$kZjm1_Y z-(|=frKR?nT1XmSy5UsxOFVWxeDaYj=f)P-SgZAIs;tY!a5hSkT2YsfB_d;m@C=BQ#&aA6tcdY@xaB<2E|c=rkYG*C7T!VyZ)pI}?95BBXhn zamHGSAv9wRA_cz~OZ#x{N3knK`?FB=wWP!IkQV;k6m+S)MqOl!W2>NfMlB;oR5VM^1mLYz! z2TBWCHPVk)1HNn?Rv~3`KKrL`9QVa4(f;RHvFAXgIIAeYKDHG92X7fI#d54gd3r=Y zxf16#dD!n(;%J?0A7rthc@~ZGmmyq%zLiLECH|d-a}k=WFTwI?!qFjF4=IFZM`VSh zc{|N@$b#a+zXI%oi(w9qaSQNwA;vbh;>LM!{C;|%x?{#49a$4?va~D}{8b{y#h5Q? zTPQ%k3jCw|Q|@ww1$HHBpc{E-+Y^sxV$b``u>r9WE~7S(JXfO}*fPvGRjTOOnNN9XrZ8Y70BGBhtb0 z-M^fT{cYbCJaJn~{S;eljH^X193Rjsu#_y-1nL3Y*b=cW>!sU@nn5;7vL4fTVxZDK z9JwEy%u9#i2n+vH95`ser$mCtuT#Czn1Y_OB|t6BpetV?yiuO#C{+GtP=X^rdS-2q z@k()gLQj)&J8a3F2Vs1jD*ds@2|dH>8INEKPKvliu=Qg}z>)w;;0Ls|10VfSC34%y zs5yv7?$)85D`aCOtE#k;@wzsRC4$(pQol^?Fzs8R89uefKJ1fuH5+h6{L8{cE8|}l zE>I&q8hKZXH4EcfZGUvCe6n5YyjsFgP{MWv9j($m>)F}joEt;OwbFkOMPf*D(Y|@M z-J77#{Wnz^>pJQDIHcUE&dbSUfh*;{`R;Gm$a8I-vCpv?h$P`?-ZyXB)yPl#50o4f z94HFP&rdditxL%#9yH^R7jLls%rEE1jHgD_2ih@0BM|`XV#UL7h;nb(H!p+o({b(s zSsu#2D#KX*E#LmZk^9dkL#!?8=|{}jbz`);K#?M8Tp3U@^E5@IjmL*;V=>RaeXGM)2P2_w<_c_DtN ze1f7JsePk8O5~#5N@Ojm#@SFUx@hjvg6}-ejE$K2>3l@;VS8P|kjgKo;`8Oxl?PW~ zN>BXA_K4QDXdGOJbgBI%zM>=DW=5uiDt$(el85bO#mDtVxr|q7ChOADE7K=yX)Dr} z*4gCgSE=%J4wH1l{m@TQd@y~IIIZ?mc~Gutk1FjbYQs0$b4oIa^>F?jk4m}`IsDL= z|8XiY=UnST{|l!9XvWcp06 zMrbF|@`_p#o0^m_(Q~SNIh9^?n&^!*(c=%iF}()VhI&yyNk6D=1Y+iq^T*}brRZfT z{ZwRt^Tm+mI)C51vq_#Tmw2%2Eva7&S^t<`ymayWJC*)13_Y&&SLq`>q1*~~{Y|ViSZf^IxRJ(7+*U9ClXv+) z<8eDd?a523f2JOZdSkLxQBN)HP&8&ByLhbL8SgyVwwuZ$ECai4}c9EFb*-{-o%uQ6!gUq5dW9rJHQ+Gzf`=DONNLS^^>o6hmkQV{@uea?9FRGVGTP$~2c9e*ED2Z=uq0qfz>_tUmIN#bSQ4-#U`fD|z?Urn`!>rS{$d~NRt5VUn&oPty}H8>Q?)EM_@)f zySjU}e{jKhbSm#ymGSO}fag(>QV_lr+b?&02Y%{c_ZatEy3HBMXvP!_F%3);DC+&9iR z36A!z(F%sbHr`hk*(zW2 zu#NYbG9Qj-jQQt%xeR&#`lsG%tuhno^FB(oKQN^B&oX`9=gn}e3OL|(YyRQ-@}rX4 zjO9hTNadEe3^i|?<{g3bd4H~|7vX1({L^=}=wbdRN+*2ey-=$kiTbC~f!gQT$@o+} zv;0|}`@EYp*C^P=`)+xEC)Z1r9PH}lLCXf2~r{%Zd)5(jU$*(`R}9%{xSMjl=XTccnKDl>Tj@4WfnSQ;H9kn;X0n&fU zJ5lpZf^B?G!@>FI{mF_^E^p2^w}1D0XKSv>sQ;?{;&!z2X=C}bzHHxBZ0T58jzt#Z;_6D!;s+ z8BF?bE`RFp==pE&BF%d=@~_&TNIPiapY@&d&;0+dcZs(87^KhbmEyy0YCmR4a_~(B zxjx?F&DNTyVfm?g$Nh*y@uQ;SPGb3R`7u8Sb0aX_OtWC$l5*U?WXpg};(QxJS-yNf zZXt9|k>MR`JivTKp-p_BFq1IJWJzv`bxy^i7;33Ntf0&*ew zmv>q(7h{+pz|k_j?Lh4G8DcLue&tX>^Nk6eDt*^-d44lWSH2BH?ib^02Htc){F`sx zX8O*}vD2r)RB>i_Hqxi`^4@*A(VFgJDuB>2lK-sC*y*W%qds{QY8s_Ce<8pzP04R- z?DWJr^~s}g-#f{VZYYv>&47Sh{@pWU&r_!&RVx1+l!GikBfdPesk6bVuVq(WhI!==Ns5+m`8@zt4$L#gmPaqm6t^5DTR@ z-*C(FYd<4){)a=Rkl!?vAEh^ck%9GB5R3Ce`a2t?NPNhfGU>*i#CP@5`N6WBNJSds_HjqbRiTi0aY#yDu?AFIbBPI*36 zC+0@vCT`3;>nW2we~k2KCc)=h%yS`qe3}oEJnc`(cFmC?A#(n$H+nzKzrTLo) z6|f%ln{J*j!o~_=E{7} zIa(vmAN3kVBVhXC2J22ezV|)-YtE^3&+(LNbJO99f$~?6xoi}9-yrnaqvMih(ss{k zt$0X$`I+-ey66`8qPgWe7U&xbCwew&6+;J(ZyDb7u-t@?>Y@BvgB_-Nd|GfA&HuSx zkmgdYB`ue=n(lp;x2*NA|6@IF%|-Lk7o;9nT`l1!>z|R|DL+TTJvA>1_qHj2)P27^ z3!G`Pf1oy$Br(CWMVplg;enP1)oL$tEAP>W%8+i=rh8*Yc(!WmhQ}{ovpyGK|GggX zOInR*#qv?tix5j8+F(kNKa$~SPm@+Sg6uEU=FxdJI=x0`-l^@NnU`#x%(XAJ_5lp> zWNKS*KHIrR$}Rl7gwC6OEbcKlTfv5J-YDEz`*!K>H^_pnu~L3yZ=o9giD#r%G)iB- zvTxDP7pZ)C=0$a<3EOb$4U8?b)-u^2G$TgRp=f&(JI9)5 zsI~#;zddewzX$6Le5+98D?`DO14Y8!QD0!lZ&gs{m&TrSGuT_6X*3_+IZ%D!8`k@3 zOan?F2=91o+TyVg4lhgl^wX^Xp_e4&+`R23DJ^k9PVK8Tk+$7z)l243IjTM+bhky29|vkL1CeSM+JGecWGF@AkBw|`#Lx>n44 z0B0cbcJpW*Ci}(R5pr2gw0-9#bBP63oDNzyGdZu))PbGp_xdEot#DkXTU9XEw zqn2}d(~S#M<4HR!QKJ^%@6SAIw7Q`XqA$us>2eAuwhqy;4}Uw!h4XX%zRLBUMy&w* z^C`cU?P>TGneV_y+eN#%@C?~+upByTjq{-&d%Rj8146R>G}6<5>%@4&-%=qBx+C!W zo@%WL`)ktWsOGFfNm0*2{X`+Y(`YUBb1jY^>V~5|SJ|=HF4ko#zmrvRw&%=H?(Lp7 z%{c-tFGjUPP9Q@b-5d-5iKiWbEF zQa`?kZ;z&XQd_WoM4uM_5Y2=3WWHa4?-j89*;s$MzH_~`D-?}>X;0?)5y2?-=v&t? zF-?zps5h^Fnr26PGT&dod^prNj1%yDjOl+v1yuXTYE2U%WVD`e4V80am#Fj9`_nf! zExUf1>7^1lQ?X&RJU)&Y#_<`Lqjf=7-^W|7^`U8A8!kLSJjme9-OR#_zqI z>z|{YiuUAAwnr+T+ocUtx8y+Ep8gz*!Qo$Ujf3 zJ=WBJuA85io1;UJp#NOte@ydFNB(z7e)&Eac+SYbx&P$#<|Y0owGDRoo@y;C>Zk$j zLt5${H>vis8iUQQ>?~?Pv;FsJg~vho=Jm4uB%7YR=^lXY(+mAows+*Oe`w@HU+$Xc ze@OEj4_HKzt!k9r(k(d?=o(fMJv|1X;V8?YnNt}FHj z*7^g?@xQFOXJGsDs+1S&VZhY?nAcN|Q<*u=|Fnk680Necnlq{bO5*s>^gpM;2}u9% zl0Mf%Fs)~fS9nsd;H1IR&-Cxt;N<@22Q=TMku~*s z`e&5?3k^<*%5Sye&;Ac%{W;sjH{(e0zpvq-FvRX;;Sm3a8Y=Xl)9?3h*Km<*(CNSM z@6d44GU)X0`!CjTLNMs`ANnuTa44*6KTE5dgU;$;!TV)Ak@UFtsc35sy1ltME*adcAVo_;Mv0=*`pl1T zf0?x3M%N(ZY>d8JD{sK0`&Z@dlnvOgk}uh@qjzJ*qe1v-eI{xz*4wP;>*jRBr@Yme zzI0C3M4EdHbYB^**ARXh7t`#7=8$rPthewtqp!4%QNHNLFj{LN`&rcTFRhXBcW%iX z@_J2lzP?e-yXB4<9*p5I2GjZgN5ooVjJ7@7&5(ZkEF}~44Dsx>_1q@ z`JnYFypPz{Zn7`&`qcVYzI7hO<^338WpCv97vo`gwZBZm_i$&b90xMwaBfa%te}6g zdS$+O9~g(3<8AjBXn^|}t4^2r8Jgp#D~~Ra@!HkC0yBP&$LX*1uh(!O6YeNc={8Bo z;cS1UwP5k2$nd}g5}NTx;;HDD`75;@xSjb`f0uQquvfhT& zdXS11S_$o(5T)+tw-0Z8?aHB}L(<9}>kfX8w3}X)kd*bMiIiA;7ui*xO zh&`R_o9#^_f9Cy6fsc*hd5W%?|61RL8XDijjF;n8fp&pwd0`Qk zaiuR)16)5V+7fj8C|cqfV#L^HuP8jLnft-WgfWT*Lq(3(_{L~30ip8u z!sV;_=w%XFSX;oHOM#u`8=}F;fv*qMV4p}S<_qFj<7>VoxMjxh4L5 z-_aUwMG3EBki%(@5Iqc~3!vk|*!-L0<@)AmxWy(M7$@U1WIWuS^Zvkg zg||BnevZfKXZyaP;YOaY%_i|P06}X7Om^nR(v`7$#@yg z^qryMMzC=EcqM-YIh^g8X1+MQKmIx1VByw%^TyKpR0U3QX+CmosaPM5VrL5J%mdYf=ozrFs{QHl04{p z2wfM;{AZ1kayf3au|M7OvitM*p08Pc$#Xu}f!(i`gw7c))??a-PS))|>6_DS%4@jT z-PtGHo{wHBy?y)-nFq_m%z*iO8Q&_-y7#oVz9`=P$_K}6Pj8>@yg_Y*zsxQ-=4uZfzP)JXo}v)xm)?P zD>&up8RC0C)X(vlKm{4VC!Z_23U*JOFrajd{j#jaI?fu^FZ1UGW$;>#C)CY zhYmIG)%JfPrtDG7@@=r~@Pc60dmeJjNL8`OByrs7w{iGP(3=j*8u zs%nyW?aD5|>vg;zkoS3A=PT5(DGv20zI&8Cgy(l=ezy5=zMf9&5lSzWeS+-?uu;-w z{&)D!5%brO;+Oen`#{gXjPZB+D#d)1$Jx#gWVlVyGsnNg=M?ixr%4_*H4f$YJs|O1 ziu3jPG+!KGe%s2|()_PadD%hc-z=a1D98Ewa0r?Cfi@YR`C<8NE%(s;EF4zzl`d7j zY=1DzGfO0jbBE=RAIAES@`5eKf;p+|}YcYd?Kf_6NJpm-rr4cDJ)P ztNNz;ogS61taO=A&PU_z?`^O7(Vi5oxq?kMG5Zyg*LIXw=MtH|O7(kP${kSd9<|Rl zJcj9b#W=ES{6%s+=?ID}oDL2Foyxv5Nm;(ODEB)zWuQ5$w>NyB+OMTxeST*kDud`7 z>#G??V;JRCvPsHk*7qe`_&o`o3WBmDRI7LZG9N6jnYX?knFht`hs*ZO`v%D?O5b|3 zBw$J4-z|ZVYVT;AsIQD0_T^=^ZvyC1>mlK#s{Q}hO5?cvJCb8tkM!s97M~~RY?kSI z9+2%6=g)DJ^k;iCbgAx|12-lu%!=m zJ*ecO>~-DBZBuR@zuQgrJm>9&3GELPKz3IRd2+tG6Z;Fm{-Rs;6AUNb^7K2LM?DNp zlMB>_i_Jb40$z@k9@)Z?}9y|fBoKpIp0gCsKjQB=h^b}w8ben-b7n^ zygiEMv%6-Qo6lyN&%l|_?$Z9&0;J}}KUy_jfNpuZ*yvx>=hhV3@!gjj7oIaA+ka4f z`&RCckG)6Rxcjm%uEgJQ&w&TaYqcDlA4z%rdvZo==*1|h7P0ysJ;5XMO`&!?+d=nD z(7rp`JJ2Nd{+rL-n)kpapL?>F(y7Auxu^5BOOaD~0?7rxEDvf;I6sto26*4I3sxbg z^!>&*%+ps>QvLHvS|g>m8o8m9exzScA;0KJO!>u7I?EJ|vqe~=zY4y8Sbmh2gXbL* z$#}4Q_s_5K6hX53QGq)@XnzUqT`|^VI{RJ`ku24HTBDOYUmDTnGf1};%YoVuvctRZ zFOjsbEI&zW#Pw}Z?O)YI**yT7v3x6MXP94O_)x}wJ) zs~?Hg_Pd>(S|jd1V7=mTSVXVXdB>1~tY-k5gnl_zg#-jOp5pmuw>rPT^Un;mAA{$g zooYP6@S~sHdz-!-`MpEgx6F{kahJECA6LIj`&l^MST%p=e6;S7`t|6P@fUC$9y_v| z;9BQ%S~c3oc>EPm^Kl-3g_OHTjmJW&egfPj&i7PZevkaVyIl@goY+&)lcnr@vv4yq zJ!dQT6KLO{6D4+K-(WcT&(FRkBAR}>RDCqVXte2qemr?S=7>H1Vmk-t8lj{KA-!EYbJsep<{d^^ozH_#ipRk+fH_KF-_7>UBnNUTXQ?As9XGQ$Y zFT9??&>TKscaP*3;=wqGIzIM`e1;#8={woYa#ZOucE}f&M;vsPx6(V(F<#?JB$QwL z*I!=FD^C<7c355@H{ra^oT~hU*!9I6FIjiiXT809u>&U9g^d>1Z_ii&ZNp10FP&lE`^F9FP_kpx37-vzyJyF<->6E#uq$Rzr-4!Te>xoU@1z~8dyl?! z7{%WEKkgK`i}sd2Ir|CSv$o`tckCtGpBnSO`I9g0Y_peKz9OS!(bG+HmS6HoZ*UT& z+@6EDxA&A>@}T{^2THcz_x39oaa_seLrb==&3HK725-N*x9FuIu)S->)@{X;G3wiI zMJVL2UAwLVX_S<0f4F4(3nknCh%5+mOw^tx*9SV)c&NKl-%ny}weHy6X|(fEi2e!K z-Zr&=$B1<$j^j}Hd$)3Lf0p-y3po_epABPorT;_ppOsoApmS)ofF%@_I1l}3n0GIY zxYQ`YP66~Nyvm!#I`rzemHEEKz|RCqg3qJso)O*`U2~?~UqI<;uOg2zNnU)ml+yiw zd+e(GxbzNH{<%E*(w}Z9UoN@FBYI^{ajYr6IsB_~AK0eX`*yW2rfPuuV!kS_EWDNk QED0RW5;#xvgUsRo0oGHxT>t<8 literal 0 HcmV?d00001 From afc8daa2de3d9ef5da015ceb5e7436ed8adb5f47 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Thu, 21 Jul 2022 17:09:21 -0700 Subject: [PATCH 102/195] arm64: don't interpret DW_CFA_GNU_window_save DW_CFA_AARCH64_negate_ra_state uses the same encoding as DW_CFA_GNU_window_save. It is meant to indicate that x30/LR has been signed, but breakpad does not require this information. Bug: b/239086293 Change-Id: I5a17bd5e0673a3ff80a8c6e347013d66054314e8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3781136 Reviewed-by: Mark Mentovai --- src/common/dwarf/dwarf2reader.cc | 41 +++++++++++-------- src/common/dwarf/dwarf2reader.h | 3 ++ src/common/dwarf/dwarf2reader_cfi_unittest.cc | 3 ++ src/common/dwarf_cfi_to_module.cc | 4 ++ src/common/dwarf_cfi_to_module.h | 2 + 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 6bd2614b4..33a63fc47 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -2721,23 +2721,32 @@ bool CallFrameInfo::State::DoInstruction() { case DW_CFA_nop: break; - // A SPARC register window save: Registers 8 through 15 (%o0-%o7) - // are saved in registers 24 through 31 (%i0-%i7), and registers - // 16 through 31 (%l0-%l7 and %i0-%i7) are saved at CFA offsets - // (0-15 * the register size). The register numbers must be - // hard-coded. A GNU extension, and not a pretty one. + // case DW_CFA_AARCH64_negate_ra_state case DW_CFA_GNU_window_save: { - // Save %o0-%o7 in %i0-%i7. - for (int i = 8; i < 16; i++) - if (!DoRule(i, new RegisterRule(i + 16))) - return false; - // Save %l0-%l7 and %i0-%i7 at the CFA. - for (int i = 16; i < 32; i++) - // Assume that the byte reader's address size is the same as - // the architecture's register size. !@#%*^ hilarious. - if (!DoRule(i, new OffsetRule(Handler::kCFARegister, - (i - 16) * reader_->AddressSize()))) - return false; + if (handler_->Architecture() == "arm64") { + // Indicates that the return address, x30 has been signed. + // Breakpad will speculatively remove pointer-authentication codes when + // interpreting return addresses, regardless of this bit. + } else if (handler_->Architecture() == "sparc" || + handler_->Architecture() == "sparcv9") { + // A SPARC register window save: Registers 8 through 15 (%o0-%o7) + // are saved in registers 24 through 31 (%i0-%i7), and registers + // 16 through 31 (%l0-%l7 and %i0-%i7) are saved at CFA offsets + // (0-15 * the register size). The register numbers must be + // hard-coded. A GNU extension, and not a pretty one. + + // Save %o0-%o7 in %i0-%i7. + for (int i = 8; i < 16; i++) + if (!DoRule(i, new RegisterRule(i + 16))) + return false; + // Save %l0-%l7 and %i0-%i7 at the CFA. + for (int i = 16; i < 32; i++) + // Assume that the byte reader's address size is the same as + // the architecture's register size. !@#%*^ hilarious. + if (!DoRule(i, new OffsetRule(Handler::kCFARegister, + (i - 16) * reader_->AddressSize()))) + return false; + } break; } diff --git a/src/common/dwarf/dwarf2reader.h b/src/common/dwarf/dwarf2reader.h index 97e5fea90..0526ee721 100644 --- a/src/common/dwarf/dwarf2reader.h +++ b/src/common/dwarf/dwarf2reader.h @@ -1332,6 +1332,9 @@ class CallFrameInfo::Handler { // should stop. virtual bool End() = 0; + // The target architecture for the data. + virtual string Architecture() = 0; + // Handler functions for Linux C++ exception handling data. These are // only called if the data includes 'z' augmentation strings. diff --git a/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/src/common/dwarf/dwarf2reader_cfi_unittest.cc index 5f7037941..686ecb14c 100644 --- a/src/common/dwarf/dwarf2reader_cfi_unittest.cc +++ b/src/common/dwarf/dwarf2reader_cfi_unittest.cc @@ -114,6 +114,7 @@ class MockCallFrameInfoHandler: public CallFrameInfo::Handler { MOCK_METHOD3(ValExpressionRule, bool(uint64_t address, int reg, const string& expression)); MOCK_METHOD0(End, bool()); + MOCK_METHOD0(Architecture, string()); MOCK_METHOD2(PersonalityRoutine, bool(uint64_t address, bool indirect)); MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64_t address, bool indirect)); MOCK_METHOD0(SignalHandler, bool()); @@ -1539,6 +1540,8 @@ TEST_F(CFIInsn, DW_CFA_GNU_window_save) { .D8(google_breakpad::DW_CFA_GNU_window_save) .FinishEntry(); + EXPECT_CALL(handler, Architecture()).WillRepeatedly(Return("sparc")); + // Don't include all the rules in any particular sequence. // The caller's %o0-%o7 have become the callee's %i0-%i7. This is diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index 739b9fe0d..794bab530 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -264,6 +264,10 @@ bool DwarfCFIToModule::End() { return true; } +string DwarfCFIToModule::Architecture() { + return module_->architecture(); +} + void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) { fprintf(stderr, "%s, section '%s': " "the call frame entry at offset 0x%zx refers to register %d," diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index 3e2e6ffec..b6d5fceba 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -152,6 +152,8 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { const string& expression); virtual bool End(); + virtual string Architecture(); + private: // Return the name to use for register REG. string RegisterName(int i); From 86ea554601d4938e9a6707c8b277f81fa469ba3d Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Tue, 26 Jul 2022 14:23:54 -0400 Subject: [PATCH 103/195] Mac dump_syms: Fix -a on arm64 - Resets `selected_object_file_` when a new file is read. This was a dangling pointer previously. - When `-a` is provided, ensures that both parts of a split module use the given architecture. Bug: None Change-Id: I581d41b0eee4ec2b0d598fb80b9065e7ebde0e0d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3788222 Reviewed-by: Mark Mentovai --- src/common/mac/dump_syms.cc | 1 + src/tools/mac/dump_syms/dump_syms_tool.cc | 61 +++++++++++++---------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index c62caed28..ed5e65f9b 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -121,6 +121,7 @@ vector list_directory(const string& directory) { namespace google_breakpad { bool DumpSymbols::Read(const string& filename) { + selected_object_file_ = nullptr; struct stat st; if (stat(filename.c_str(), &st) == -1) { fprintf(stderr, "Could not access object file %s: %s\n", diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 9ff5140bd..0f43d1633 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -107,6 +107,35 @@ static void CopyCFIDataBetweenModules(Module* to_module, } } +static bool SetArchitecture(DumpSymbols& dump_symbols, + const NXArchInfo* arch, + const std::string& filename) { + if (!dump_symbols.SetArchitecture(arch->cputype, arch->cpusubtype)) { + fprintf(stderr, "%s: no architecture '%s' is present in file.\n", + filename.c_str(), arch->name); + size_t available_size; + const SuperFatArch* available = + dump_symbols.AvailableArchitectures(&available_size); + if (available_size == 1) + fprintf(stderr, "the file's architecture is: "); + else + fprintf(stderr, "architectures present in the file are:\n"); + for (size_t i = 0; i < available_size; i++) { + const SuperFatArch* arch = &available[i]; + const NXArchInfo* arch_info = + google_breakpad::BreakpadGetArchInfoFromCpuType(arch->cputype, + arch->cpusubtype); + if (arch_info) + fprintf(stderr, "%s (%s)\n", arch_info->name, arch_info->description); + else + fprintf(stderr, "unrecognized cpu type 0x%x, subtype 0x%x\n", + arch->cputype, arch->cpusubtype); + } + return false; + } + return true; +} + static bool Start(const Options& options) { SymbolData symbol_data = (options.handle_inlines ? INLINES : NO_DATA) | @@ -129,31 +158,9 @@ static bool Start(const Options& options) { if (!dump_symbols.Read(primary_file)) return false; - if (options.arch) { - if (!dump_symbols.SetArchitecture(options.arch->cputype, - options.arch->cpusubtype)) { - fprintf(stderr, "%s: no architecture '%s' is present in file.\n", - primary_file.c_str(), options.arch->name); - size_t available_size; - const SuperFatArch *available = - dump_symbols.AvailableArchitectures(&available_size); - if (available_size == 1) - fprintf(stderr, "the file's architecture is: "); - else - fprintf(stderr, "architectures present in the file are:\n"); - for (size_t i = 0; i < available_size; i++) { - const SuperFatArch *arch = &available[i]; - const NXArchInfo *arch_info = - google_breakpad::BreakpadGetArchInfoFromCpuType( - arch->cputype, arch->cpusubtype); - if (arch_info) - fprintf(stderr, "%s (%s)\n", arch_info->name, arch_info->description); - else - fprintf(stderr, "unrecognized cpu type 0x%x, subtype 0x%x\n", - arch->cputype, arch->cpusubtype); - } - return false; - } + if (options.arch && + !SetArchitecture(dump_symbols, options.arch, primary_file)) { + return false; } if (options.header_only) @@ -171,6 +178,10 @@ static bool Start(const Options& options) { if (!dump_symbols.Read(options.srcPath)) return false; + if (options.arch && + !SetArchitecture(dump_symbols, options.arch, options.srcPath)) { + return false; + } Module* cfi_module = NULL; if (!dump_symbols.ReadSymbolData(&cfi_module)) return false; From defdcb714e0c8113ade899e416d3024ac8024548 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Tue, 26 Jul 2022 19:20:10 -0700 Subject: [PATCH 104/195] arm64: strip PACs from return addresses found from CFI Bug: b/239086293 Change-Id: I8b514e8640f0f2496cea8d0b516124c0e3a3b81a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3788698 Reviewed-by: Mark Mentovai --- src/processor/stackwalker_arm64.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/processor/stackwalker_arm64.cc b/src/processor/stackwalker_arm64.cc index 74410c9ab..71814c2da 100644 --- a/src/processor/stackwalker_arm64.cc +++ b/src/processor/stackwalker_arm64.cc @@ -170,6 +170,8 @@ StackFrameARM64* StackwalkerARM64::GetCallerByCFIFrameInfo( if ((frame->context_validity & essentials) != essentials) return NULL; + frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] = + PtrauthStrip(frame->context.iregs[MD_CONTEXT_ARM64_REG_PC]); frame->trust = StackFrame::FRAME_TRUST_CFI; return frame.release(); } From 7e4ea04094ff7f1da7a97a3f984f92480c64d2a8 Mon Sep 17 00:00:00 2001 From: Lorenzo Alberto Maria Ambrosi Date: Wed, 10 Aug 2022 03:55:31 +0200 Subject: [PATCH 105/195] Add error messages on pdb Open function This implements the error messages from https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/idiadatasource-loaddataforexe?view=vs-2022 and https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/idiadatasource-loaddatafrompdb?view=vs-2022 instead of having just a generic error message. Signed-off-by: Lorenzo Alberto Maria Ambrosi Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=866 Change-Id: I23c0e80d31afb402a70cb0cdded78d3d34ac5fff Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3810512 Reviewed-by: Mark Mentovai Reviewed-by: Mike Frysinger --- src/common/windows/pdb_source_line_writer.cc | 56 +++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index 25a1ca053..ac3deda77 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -209,6 +209,39 @@ void StripLlvmSuffixAndUndecorate(BSTR* name) { } } +// Prints the error message related to the error code as seen in +// Microsoft's MSVS documentation for loadDataFromPdb and loadDataForExe. +void PrintOpenError(HRESULT hr, const char* fn_name, const wchar_t* file) { + switch (hr) { + case E_PDB_NOT_FOUND: + fprintf(stderr, "%s: Failed to open %ws, or the file has an " + "invalid format.\n", fn_name, file); + break; + case E_PDB_FORMAT: + fprintf(stderr, "%s: Attempted to access %ws with an obsolete " + "format.\n", fn_name, file); + break; + case E_PDB_INVALID_SIG: + fprintf(stderr, "%s: Signature does not match for %ws.\n", fn_name, + file); + break; + case E_PDB_INVALID_AGE: + fprintf(stderr, "%s: Age does not match for %ws.\n", fn_name, file); + break; + case E_INVALIDARG: + fprintf(stderr, "%s: Invalid parameter for %ws.\n", fn_name, file); + break; + case E_UNEXPECTED: + fprintf(stderr, "%s: Data source has already been prepared for %ws.\n", + fn_name, file); + break; + default: + fprintf(stderr, "%s: Unexpected error 0x%lx, file: %ws.\n", + fn_name, hr, file); + break; + } +} + } // namespace PDBSourceLineWriter::Inline::Inline(int inline_nest_level) @@ -400,25 +433,32 @@ bool PDBSourceLineWriter::Open(const wstring& file, FileFormat format) { return false; } + HRESULT from_pdb_result; + HRESULT for_exe_result; + const wchar_t* file_name = file.c_str(); switch (format) { case PDB_FILE: - if (FAILED(data_source->loadDataFromPdb(file.c_str()))) { - fprintf(stderr, "loadDataFromPdb failed for %ws\n", file.c_str()); + from_pdb_result = data_source->loadDataFromPdb(file_name); + if (FAILED(from_pdb_result)) { + PrintOpenError(from_pdb_result, "loadDataFromPdb", file_name); return false; } break; case EXE_FILE: - if (FAILED(data_source->loadDataForExe(file.c_str(), NULL, NULL))) { - fprintf(stderr, "loadDataForExe failed for %ws\n", file.c_str()); + for_exe_result = data_source->loadDataForExe(file_name, NULL, NULL); + if (FAILED(for_exe_result)) { + PrintOpenError(for_exe_result, "loadDataForExe", file_name); return false; } code_file_ = file; break; case ANY_FILE: - if (FAILED(data_source->loadDataFromPdb(file.c_str()))) { - if (FAILED(data_source->loadDataForExe(file.c_str(), NULL, NULL))) { - fprintf(stderr, "loadDataForPdb and loadDataFromExe failed for %ws\n", - file.c_str()); + from_pdb_result = data_source->loadDataFromPdb(file_name); + if (FAILED(from_pdb_result)) { + for_exe_result = data_source->loadDataForExe(file_name, NULL, NULL); + if (FAILED(for_exe_result)) { + PrintOpenError(from_pdb_result, "loadDataFromPdb", file_name); + PrintOpenError(for_exe_result, "loadDataForExe", file_name); return false; } code_file_ = file; From f1f7b5272fdf105592fc262a9adaab55a3621122 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 10 Aug 2022 10:55:51 -0700 Subject: [PATCH 106/195] Check sh_type for symbol table and finish ProcessDIEs if any DIE processing goes wrong - If symbol table section is malformed, skip them. - SkipDIE and ProcessDIE return nullptr when processing goes wrong due to malformed debug info, stop processing in this case. Bug: 1349354 Change-Id: Ia1d3e3591bbd2dad8b9eb351c1882cfc03bfad4b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3821448 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2reader.cc | 40 +++++++++++++++++++++----------- src/common/dwarf/elf_reader.cc | 13 ++++++++++- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 33a63fc47..9cd513da6 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -927,7 +927,7 @@ void CompilationUnit::ProcessDIEs() { lengthstart += 4; std::stack die_stack; - + while (dieptr < (lengthstart + header_.length)) { // We give the user the absolute offset from the beginning of // debug_info, since they need it to deal with ref_addr forms. @@ -953,8 +953,22 @@ void CompilationUnit::ProcessDIEs() { const enum DwarfTag tag = abbrev.tag; if (!handler_->StartDIE(absolute_offset, tag)) { dieptr = SkipDIE(dieptr, abbrev); + if (!dieptr) { + fprintf(stderr, + "An error happens when skipping a DIE's attributes at offset " + "%lx. Stopped processing following DIEs in this CU.\n", + absolute_offset); + exit(1); + } } else { dieptr = ProcessDIE(absolute_offset, dieptr, abbrev); + if (!dieptr) { + fprintf(stderr, + "An error happens when processing a DIE at offset %lx. Stopped " + "processing following DIEs in this CU.\n", + absolute_offset); + exit(1); + } } if (abbrev.has_children) { @@ -1718,7 +1732,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, oplen += templen; if (handler) { - handler->DefineFile(filename, -1, static_cast(dirindex), + handler->DefineFile(filename, -1, static_cast(dirindex), mod_time, filelength); } } @@ -1780,7 +1794,7 @@ void LineInfo::ReadLines() { pending_file_num, pending_line_num, pending_column_num); if (lsm.end_sequence) { - lsm.Reset(header_.default_is_stmt); + lsm.Reset(header_.default_is_stmt); have_pending_line = false; } else { pending_address = lsm.address; @@ -2267,7 +2281,7 @@ class CallFrameInfo::State { // report the problem to reporter_ and return false. bool InterpretFDE(const FDE& fde); - private: + private: // The operands of a CFI instruction, for ParseOperands. struct Operands { unsigned register_number; // A register number. @@ -2528,19 +2542,19 @@ bool CallFrameInfo::State::DoInstruction() { if (!ParseOperands("1", &ops)) return false; address_ += ops.offset * cie->code_alignment_factor; break; - + // Advance the address. case DW_CFA_advance_loc2: if (!ParseOperands("2", &ops)) return false; address_ += ops.offset * cie->code_alignment_factor; break; - + // Advance the address. case DW_CFA_advance_loc4: if (!ParseOperands("4", &ops)) return false; address_ += ops.offset * cie->code_alignment_factor; break; - + // Advance the address. case DW_CFA_MIPS_advance_loc8: if (!ParseOperands("8", &ops)) return false; @@ -2850,7 +2864,7 @@ bool CallFrameInfo::ReadEntryPrologue(const uint8_t* cursor, Entry* entry) { // Validate the length. if (length > size_t(buffer_end - cursor)) return ReportIncomplete(entry); - + // The length is the number of bytes after the initial length field; // we have that position handy at this point, so compute the end // now. (If we're parsing 64-bit-offset DWARF on a 32-bit machine, @@ -2892,7 +2906,7 @@ bool CallFrameInfo::ReadEntryPrologue(const uint8_t* cursor, Entry* entry) { // Now advance cursor past the id. cursor += offset_size; - + // The fields specific to this kind of entry start here. entry->fields = cursor; @@ -3120,7 +3134,7 @@ bool CallFrameInfo::ReadFDEFields(FDE* fde) { if (size_t(fde->end - cursor) < size + data_size) return ReportIncomplete(fde); cursor += size; - + // In the abstract, we should walk the augmentation string, and extract // items from the FDE's augmentation data as we encounter augmentation // string characters that specify their presence: the ordering of items @@ -3158,7 +3172,7 @@ bool CallFrameInfo::ReadFDEFields(FDE* fde) { return true; } - + bool CallFrameInfo::Start() { const uint8_t* buffer_end = buffer_ + buffer_length_; const uint8_t* cursor; @@ -3215,7 +3229,7 @@ bool CallFrameInfo::Start() { reporter_->CIEPointerOutOfRange(fde.offset, fde.id); continue; } - + CIE cie; // Parse this FDE's CIE header. @@ -3254,7 +3268,7 @@ bool CallFrameInfo::Start() { ok = true; continue; } - + if (cie.has_z_augmentation) { // Report the personality routine address, if we have one. if (cie.has_z_personality) { diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index c6d9f08a9..9a7b09f7d 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -196,6 +196,17 @@ class ElfSectionReader { // to process its contents. if (header_.sh_type == SHT_NOBITS || header_.sh_size == 0) return; + // extra sh_type check for string table. + if ((std::strcmp(name, ".strtab") == 0 || + std::strcmp(name, ".shstrtab") == 0) && + header_.sh_type != SHT_STRTAB) { + fprintf(stderr, + "Invalid sh_type for string table section: expected " + "SHT_STRTAB or SHT_DYNSYM, but got %d\n", + header_.sh_type); + return; + } + contents_aligned_ = mmap(NULL, size_aligned_, PROT_READ, MAP_SHARED, fd, offset_aligned); // Set where the offset really should begin. @@ -877,7 +888,7 @@ class ElfReaderImpl { if (reader == NULL) reader = new ElfSectionReader(name, path_, fd_, section_headers_[num]); - return reader; + return reader->contents() ? reader : nullptr; } // Parse out the overall header information from the file and assert From c44d14ac8965b1b84c89cffc14954c2946ed0bdc Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Wed, 10 Aug 2022 13:07:29 -0700 Subject: [PATCH 107/195] Fix garbage header being prepended to native symbol uploads. Change-Id: I96887504ad9dc47dda6ebc5be7c193a1eb1f94d1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3825137 Reviewed-by: Zequan Wu --- src/common/windows/http_upload.cc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index af6f8d9ce..2d92fba96 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -357,10 +357,10 @@ namespace { return header; } - bool AppendFileToRequestBody( - const wstring& file_part_name, - const wstring& filename, - string* request_body) { + bool AppendFileToRequestBody(const wstring& file_part_name, + const wstring& filename, + string* request_body, + bool set_content_type = true) { string file_part_name_utf8 = WideToUTF8(file_part_name); if (file_part_name_utf8.empty()) { return false; @@ -371,11 +371,17 @@ namespace { return false; } - request_body->append("Content-Disposition: form-data; " - "name=\"" + file_part_name_utf8 + "\"; " - "filename=\"" + filename_utf8 + "\"\r\n"); - request_body->append("Content-Type: application/octet-stream\r\n"); - request_body->append("\r\n"); + if (set_content_type) { + request_body->append( + "Content-Disposition: form-data; " + "name=\"" + + file_part_name_utf8 + + "\"; " + "filename=\"" + + filename_utf8 + "\"\r\n"); + request_body->append("Content-Type: application/octet-stream\r\n"); + request_body->append("\r\n"); + } vector contents; if (!GetFileContents(filename, &contents)) { @@ -432,7 +438,11 @@ namespace google_breakpad { wstring* response_body, int* response_code) { string request_body; - if (!AppendFileToRequestBody(L"symbol_file", path, &request_body)) { + // Turn off content-type in the body. If content-type is set then binary + // files uploaded to GCS end up with the it prepended to the file + // contents. + if (!AppendFileToRequestBody(L"symbol_file", path, &request_body, + /*set_content_type=*/false)) { return false; } From a7a8b9c3002dc4027708f6a644496496877a4b62 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 11 Aug 2022 15:00:12 -0700 Subject: [PATCH 108/195] Fix int64_t format in fprintf by using PRIx64. Change-Id: Ic03ecc055c4eb097fbaaf8c8cd2c0a68d5aea8a0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3826785 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2reader.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 9cd513da6..e3d360a3a 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -956,7 +956,8 @@ void CompilationUnit::ProcessDIEs() { if (!dieptr) { fprintf(stderr, "An error happens when skipping a DIE's attributes at offset " - "%lx. Stopped processing following DIEs in this CU.\n", + "0x%" PRIx64 + ". Stopped processing following DIEs in this CU.\n", absolute_offset); exit(1); } @@ -964,8 +965,8 @@ void CompilationUnit::ProcessDIEs() { dieptr = ProcessDIE(absolute_offset, dieptr, abbrev); if (!dieptr) { fprintf(stderr, - "An error happens when processing a DIE at offset %lx. Stopped " - "processing following DIEs in this CU.\n", + "An error happens when processing a DIE at offset 0x%" PRIx64 + ". Stopped processing following DIEs in this CU.\n", absolute_offset); exit(1); } From e085b3b50bde862d0cf3ce4594e3f391bcf5faec Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 12 Aug 2022 17:07:53 +0000 Subject: [PATCH 109/195] Fix -Wdeprecated-declarations when macOS 13 SDK is used. This CL fixes the following error detected on a WebRTC bot: FAILED: obj/third_party/breakpad/utilities/ConfigFile.o /opt/s/w/ir/cache/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/breakpad/utilities/ConfigFile.o.d -DCR_XCODE_VERSION=1400 -DCR_CLANG_REVISION=\"llvmorg-16-init-907-g8b740747-1\" -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_ABI_VERSION=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=9f503bebdb9a89f5ee82b82142109b26d688f40c -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/breakpad/breakpad/src -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -femit-dwarf-unwind=no-compact-unwind -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -fcomplete-member-pointers -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fno-omit-frame-pointer -g2 -gdwarf-aranges -Xclang -debug-info-kind=limited -isysroot sdk/xcode_links/MacOSX13.0.sdk -mmacos-version-min=10.13 -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ref-template-as-trivial-member -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -std=c++17 -Wno-trigraphs -fobjc-call-cxx-cdtors -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm -o obj/third_party/breakpad/utilities/ConfigFile.o ../../third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm:108:5: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations] sprintf(processUptimeString, "%llu", ^ sdk/xcode_links/MacOSX13.0.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ sdk/xcode_links/MacOSX13.0.sdk/usr/include/sys/cdefs.h:214:48: note: expanded from macro '__deprecated_msg' #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg))) ^ ../../third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm:114:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations] sprintf(processCrashtimeString, "%zd", tv.tv_sec); ^ sdk/xcode_links/MacOSX13.0.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ sdk/xcode_links/MacOSX13.0.sdk/usr/include/sys/cdefs.h:214:48: note: expanded from macro '__deprecated_msg' #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg))) Bug: webrtc:14342 Change-Id: I923ab3f9155eb36aa2edf9b1d38c123e3e6ad029 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3829529 Reviewed-by: Mark Mentovai --- src/client/mac/crash_generation/ConfigFile.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/mac/crash_generation/ConfigFile.mm b/src/client/mac/crash_generation/ConfigFile.mm index 57d07590a..564256836 100644 --- a/src/client/mac/crash_generation/ConfigFile.mm +++ b/src/client/mac/crash_generation/ConfigFile.mm @@ -105,13 +105,14 @@ BOOL EnsureDirectoryPathExists(NSString* dirPath) { time_t processStartTime = strtol(processStartTimeString, NULL, 10); time_t processUptime = tv.tv_sec - processStartTime; // Store the uptime in milliseconds. - sprintf(processUptimeString, "%llu", - static_cast(processUptime) * 1000); + snprintf(processUptimeString, sizeof(processUptimeString), "%llu", + static_cast(processUptime) * 1000); if (!AppendConfigString(BREAKPAD_PROCESS_UP_TIME, processUptimeString)) return false; } - sprintf(processCrashtimeString, "%zd", tv.tv_sec); + snprintf(processCrashtimeString, sizeof(processCrashtimeString), "%llu", + static_cast(tv.tv_sec)); return AppendConfigString(BREAKPAD_PROCESS_CRASH_TIME, processCrashtimeString); } From cb55d48154af1c1c747af51d9351dd639754fe50 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Wed, 10 Aug 2022 13:01:24 -0700 Subject: [PATCH 110/195] Add product name metadata to converter and symupload. Change-Id: Iefea0aea13deb86d71d663c8344a2d3c658caf4a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3756171 Reviewed-by: Ivan Penkov --- src/common/windows/sym_upload_v2_protocol.cc | 4 +++- src/common/windows/sym_upload_v2_protocol.h | 3 +++ src/common/windows/symbol_collector_client.cc | 20 +++++++++++++------ src/common/windows/symbol_collector_client.h | 3 ++- src/tools/windows/converter_exe/converter.cc | 5 +++-- src/tools/windows/symupload/symupload.cc | 3 ++- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc index bcc1a1a9b..ad2b83a3f 100644 --- a/src/common/windows/sym_upload_v2_protocol.cc +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -21,6 +21,7 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, const wstring& debug_id, const wstring& symbol_filename, const wstring& symbol_type, + const wstring& product_name, bool force) { wstring url(api_url); wstring key(api_key); @@ -70,7 +71,8 @@ static bool SymUploadV2ProtocolSend(const wchar_t* api_url, CompleteUploadResult completeUploadResult = SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, - debug_file, debug_id, symbol_type); + debug_file, debug_id, symbol_type, + product_name); if (completeUploadResult == CompleteUploadResult::Error) { wprintf(L"Failed to complete upload.\n"); return false; diff --git a/src/common/windows/sym_upload_v2_protocol.h b/src/common/windows/sym_upload_v2_protocol.h index 389fa586e..3c345a4d2 100644 --- a/src/common/windows/sym_upload_v2_protocol.h +++ b/src/common/windows/sym_upload_v2_protocol.h @@ -48,6 +48,8 @@ namespace google_breakpad { // "DSYM" // "PDB" // "SOURCE_MAP" +// If |product_name| is non-empty then it will be sent as part of the symbol +// metadata. // If |force| is set then it will overwrite an existing file with the // same |debug_file| and |debug_id| in the store. bool SymUploadV2ProtocolSend(const wchar_t* api_url, @@ -57,6 +59,7 @@ bool SymUploadV2ProtocolSend(const wchar_t* api_url, const std::wstring& debug_id, const std::wstring& symbol_filename, const std::wstring& symbol_type, + const std::wstring& product_name, bool force); } // namespace google_breakpad diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 0831b22cb..187b100ec 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -71,7 +71,8 @@ namespace google_breakpad { const wstring& upload_key, const wstring& debug_file, const wstring& debug_id, - const wstring& type) { + const wstring& type, + const wstring& product_name) { wstring url = api_url + L"/v1/uploads/" + upload_key + L":complete" L"?key=" + api_key; @@ -83,11 +84,18 @@ namespace google_breakpad { L"debug_id: \"" + debug_id + L"\" " - L"}, " - L"symbol_upload_type: \"" + - type + - L"\", " - L"use_async_processing: true }"; + L"}, "; + if (!product_name.empty()) { + body += + L"metadata: {" + L"product_name: \"" + + product_name + + L"\"" + L"},"; + } + body += L"symbol_upload_type: \"" + type + + L"\", " + L"use_async_processing: true }"; wstring response; int response_code; diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h index bdf9f7cb2..61ee997dc 100644 --- a/src/common/windows/symbol_collector_client.h +++ b/src/common/windows/symbol_collector_client.h @@ -75,7 +75,8 @@ namespace google_breakpad { const wstring& upload_key, const wstring& debug_file, const wstring& debug_id, - const wstring& type); + const wstring& type, + const wstring& product_name); // Returns whether or not a symbol file corresponding to the debug_file/ // debug_id pair is already present in symbol storage. diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index bb0d091ef..b433dff04 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -69,6 +69,7 @@ const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; const wchar_t* kSymbolUploadTypePE = L"PE"; const wchar_t* kSymbolUploadTypePDB = L"PDB"; +const wchar_t* kConverterProductName = L"WinSymConv"; // Windows stdio doesn't do line buffering. Use this function to flush after // writing to stdout and stderr so that a log will be available if the @@ -242,7 +243,7 @@ static bool UploadSymbolFile(const wstring& upload_symbol_url, FprintfFlush(stderr, "Uploading %s\n", symbol_file.c_str()); if (!google_breakpad::SymUploadV2ProtocolSend( upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, - debug_id_w, symbol_file_w, symbol_type, + debug_id_w, symbol_file_w, symbol_type, kConverterProductName, /*force=*/true)) { FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed " @@ -647,7 +648,7 @@ static bool ReadFile(string file_name, string* contents) { static bool ConvertMissingSymbolsList(const ConverterOptions& options) { // Set param to indicate requesting for encoded response. map parameters; - parameters[L"product"] = L"WinSymConv"; + parameters[L"product"] = kConverterProductName; parameters[L"encoded"] = L"true"; // Get the missing symbol list. string missing_symbol_list; diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 6c1d1981e..11e38438e 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -250,11 +250,12 @@ int wmain(int argc, wchar_t* argv[]) { if (argc >= currentarg + 2) { api_url = argv[currentarg++]; api_key = argv[currentarg++]; + wstring product_name = product ? wstring(product) : L""; success = google_breakpad::SymUploadV2ProtocolSend( api_url, api_key, timeout == -1 ? nullptr : &timeout, pdb_info.debug_file, pdb_info.debug_identifier, symbol_file, - kSymbolUploadTypeBreakpad, force); + kSymbolUploadTypeBreakpad, product_name, force); } else { printUsageAndExit(); } From 46e00d30cdac971230d1db3692e0cd4987f47466 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 29 Aug 2022 14:31:21 -0700 Subject: [PATCH 111/195] fix includes Change-Id: Ibfe719c3ed303cd45884863746cf07ec22dba45d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3863388 Reviewed-by: Nelson Billing --- src/common/dwarf/elf_reader.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 9a7b09f7d..97572a39e 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -39,6 +39,7 @@ #include #include +#include #include #include #include From 5d6d250150aacfe88ab63c1fb1e532b834fab386 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Tue, 6 Sep 2022 14:15:25 +0200 Subject: [PATCH 112/195] Update LSS dep to the last commit Change-Id: I35f35d9d31d97c8237f0d90170be04716d820028 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3873644 Reviewed-by: Mike Frysinger --- DEPS | 2 +- default.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a5b53aa9c..32f0a738d 100644 --- a/DEPS +++ b/DEPS @@ -51,7 +51,7 @@ deps = { # Linux syscall support. "src/src/third_party/lss": "https://chromium.googlesource.com/linux-syscall-support/" + - "@e1e7b0ad8ee99a875b272c8e33e308472e897660", + "@ce877209e11aa69dcfffbd53ef90ea1d07136521", } hooks = [ diff --git a/default.xml b/default.xml index 3c157012a..b5215113e 100644 --- a/default.xml +++ b/default.xml @@ -32,7 +32,7 @@ Date: Tue, 6 Sep 2022 08:00:52 -0700 Subject: [PATCH 113/195] Fix some Coverity defects. Fix a few issues Coverity detected in exploitability_linux.cc: CID 277681, 277682, 277683 Change-Id: I8ad0581f075da7346b9be8100b3690555a358b16 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3872234 Reviewed-by: Mike Frysinger --- src/processor/exploitability_linux.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index d4900bb0c..c54cb0468 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -518,18 +518,17 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture, raw_bytes_tmpfile); FILE* objdump_fp = popen(cmd, "r"); if (!objdump_fp) { - fclose(objdump_fp); unlink(raw_bytes_tmpfile); BPLOG(ERROR) << "Failed to call objdump."; return false; } - if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) { - fclose(objdump_fp); + if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) != buffer_len) { + pclose(objdump_fp); unlink(raw_bytes_tmpfile); BPLOG(ERROR) << "Failed to read objdump output."; return false; } - fclose(objdump_fp); + pclose(objdump_fp); unlink(raw_bytes_tmpfile); return true; } From e69677e93d73e3477fa716c004803b6aec8fbd90 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Wed, 7 Sep 2022 14:22:20 +0200 Subject: [PATCH 114/195] Added crash context float state flag Instead of listing everywhere the set of architectures that do not require/support explicit float state in their crash context, a new GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE preprocessor macro has been defined. Adding novel architectures will only require to manage the macro definition in a single place. Change-Id: I2732982f2cdfc9fcd2f71d6e5e122617faff9e82 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3876345 Reviewed-by: Mike Frysinger --- src/client/linux/handler/exception_handler.cc | 4 ++-- src/client/linux/handler/exception_handler.h | 14 ++++++++++---- .../linux/microdump_writer/microdump_writer.cc | 6 +++--- .../linux/minidump_writer/minidump_writer.cc | 6 +++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 499be0a98..0055d27a8 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -461,7 +461,7 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { memcpy(&g_crash_context_.float_state, fp_ptr, sizeof(g_crash_context_.float_state)); } -#elif !defined(__ARM_EABI__) && !defined(__mips__) +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE // FP state is not part of user ABI on ARM Linux. // In case of MIPS Linux FP state is already part of ucontext_t // and 'float_state' is not a member of CrashContext. @@ -701,7 +701,7 @@ bool ExceptionHandler::WriteMinidump() { } #endif -#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__) // FPU state is not part of ARM EABI ucontext_t. memcpy(&context.float_state, context.context.uc_mcontext.fpregs, sizeof(context.float_state)); diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index f80843ea7..03b80d392 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -44,6 +44,15 @@ #include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" +#if !defined(__ARM_EABI__) && !defined(__mips__) +// FP state is not part of user ABI for Linux ARM. +// In case of MIPS and RISCV Linux FP state is already part of ucontext_t +// so 'float_state' is not required. +# define GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE 1 +#else +# define GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE 0 +#endif + namespace google_breakpad { // ExceptionHandler @@ -192,10 +201,7 @@ class ExceptionHandler { siginfo_t siginfo; pid_t tid; // the crashing thread. ucontext_t context; -#if !defined(__ARM_EABI__) && !defined(__mips__) - // #ifdef this out because FP state is not part of user ABI for Linux ARM. - // In case of MIPS Linux FP state is already part of ucontext_t so - // 'float_state' is not required. +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE fpstate_t float_state; #endif }; diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc index 22edb1b8d..bcd31e6bd 100644 --- a/src/client/linux/microdump_writer/microdump_writer.cc +++ b/src/client/linux/microdump_writer/microdump_writer.cc @@ -138,7 +138,7 @@ class MicrodumpWriter { const MicrodumpExtraInfo& microdump_extra_info, LinuxDumper* dumper) : ucontext_(context ? &context->context : NULL), -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE float_state_(context ? &context->float_state : NULL), #endif dumper_(dumper), @@ -409,7 +409,7 @@ class MicrodumpWriter { void DumpCPUState() { RawContextCPU cpu; my_memset(&cpu, 0, sizeof(RawContextCPU)); -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE UContextReader::FillCPUContext(&cpu, ucontext_, float_state_); #else UContextReader::FillCPUContext(&cpu, ucontext_); @@ -605,7 +605,7 @@ class MicrodumpWriter { void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } const ucontext_t* const ucontext_; -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE const google_breakpad::fpstate_t* const float_state_; #endif LinuxDumper* dumper_; diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 7ce9ac570..0c5ef3fb8 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -141,7 +141,7 @@ class MinidumpWriter { : fd_(minidump_fd), path_(minidump_path), ucontext_(context ? &context->context : NULL), -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE float_state_(context ? &context->float_state : NULL), #endif dumper_(dumper), @@ -473,7 +473,7 @@ class MinidumpWriter { if (!cpu.Allocate()) return false; my_memset(cpu.get(), 0, sizeof(RawContextCPU)); -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_); #else UContextReader::FillCPUContext(cpu.get(), ucontext_); @@ -1386,7 +1386,7 @@ class MinidumpWriter { const char* path_; // Path to the file where the minidum should be written. const ucontext_t* const ucontext_; // also from the signal handler -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE const google_breakpad::fpstate_t* const float_state_; // ditto #endif LinuxDumper* dumper_; From 00f76018ccb4d27265d92a993f5443ae2a8d043c Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 7 Sep 2022 09:38:41 -0700 Subject: [PATCH 115/195] Fix fread() check in ExploitabilityLinux. This fread() call did not intend to always fill the buffer, so the change in https://crrev.com/c/3872234 is incorrect. Revert that one line change. Change-Id: I3fbe38fce11c24aa77b39dc229c7c5ed2a8d6960 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3879289 Reviewed-by: Mike Frysinger --- src/processor/exploitability_linux.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index c54cb0468..bc1b0b08c 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -522,7 +522,7 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture, BPLOG(ERROR) << "Failed to call objdump."; return false; } - if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) != buffer_len) { + if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) { pclose(objdump_fp); unlink(raw_bytes_tmpfile); BPLOG(ERROR) << "Failed to read objdump output."; From 4febb34583d421e06b8007891d41c6980e29a684 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 7 Sep 2022 10:34:05 -0400 Subject: [PATCH 116/195] Update copyright boilerplate, 2022 edition (Breakpad) sed -i '' -E -e 's/Copyright (\(c\) )?([0-9-]+),? (Google|The Chromium Authors).*(\r)?$/Copyright \2 Google LLC\4/' -e '/^((\/\/|#| \*) )?All rights reserved\.?\r?$/d' -e 's/name of Google Inc\. nor the/name of Google LLC nor the/' -e 's/POSSIBILITY OF SUCH DAMAGE$/POSSIBILITY OF SUCH DAMAGE./' $(git grep -El 'Copyright (\(c\) )?([0-9-]+),? (Google|The Chromium Authors).*$') Plus manual fixes for src/processor/disassembler_x86.{cc,h}. Plus some conversions from CRLF to LF line endings in .cc and .h files. Bug: chromium:1098010 Change-Id: I8030e804eecd9f5a1ec9d66ae166efd8418c2a67 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3878302 Reviewed-by: Mike Frysinger --- .gitignore | 4 +- DEPS | 4 +- LICENSE | 5 +- Makefile.am | 5 +- Makefile.in | 5 +- android/common-functions.sh | 5 +- android/google_breakpad/Android.mk | 5 +- android/run-checks.sh | 5 +- android/sample_app/jni/Android.mk | 5 +- android/sample_app/jni/Application.mk | 5 +- android/sample_app/jni/test_breakpad.cpp | 5 +- android/test-shell.sh | 5 +- configure.ac | 5 +- src/breakpad_googletest_includes.h | 5 +- src/build/all.gyp | 4 +- src/build/common.gypi | 4 +- src/build/filename_rules.gypi | 4 +- src/build/gyp_breakpad | 4 +- src/build/testing.gyp | 4 +- src/client/apple/Framework/BreakpadDefines.h | 5 +- src/client/ios/Breakpad.h | 5 +- src/client/ios/Breakpad.mm | 5 +- src/client/ios/BreakpadController.h | 5 +- src/client/ios/BreakpadController.mm | 5 +- src/client/ios/exception_handler_no_mach.cc | 5 +- src/client/ios/exception_handler_no_mach.h | 5 +- .../ios_exception_minidump_generator.h | 5 +- .../ios_exception_minidump_generator.mm | 5 +- .../linux/crash_generation/client_info.h | 5 +- .../crash_generation_client.cc | 5 +- .../crash_generation_client.h | 5 +- .../crash_generation_server.cc | 5 +- .../crash_generation_server.h | 5 +- .../linux/dump_writer_common/mapping_info.h | 5 +- .../dump_writer_common/raw_context_cpu.h | 5 +- .../linux/dump_writer_common/thread_info.cc | 5 +- .../linux/dump_writer_common/thread_info.h | 5 +- .../dump_writer_common/ucontext_reader.cc | 5 +- .../dump_writer_common/ucontext_reader.h | 5 +- src/client/linux/handler/exception_handler.cc | 5 +- src/client/linux/handler/exception_handler.h | 5 +- .../handler/exception_handler_unittest.cc | 5 +- .../linux/handler/microdump_extra_info.h | 5 +- .../linux/handler/minidump_descriptor.cc | 5 +- .../linux/handler/minidump_descriptor.h | 5 +- src/client/linux/log/log.cc | 5 +- src/client/linux/log/log.h | 5 +- .../microdump_writer/microdump_writer.cc | 5 +- .../linux/microdump_writer/microdump_writer.h | 5 +- .../microdump_writer_unittest.cc | 5 +- src/client/linux/minidump_writer/cpu_set.h | 5 +- .../linux/minidump_writer/cpu_set_unittest.cc | 5 +- .../linux/minidump_writer/directory_reader.h | 5 +- .../directory_reader_unittest.cc | 5 +- .../linux/minidump_writer/line_reader.h | 5 +- .../minidump_writer/line_reader_unittest.cc | 5 +- .../minidump_writer/linux_core_dumper.cc | 5 +- .../linux/minidump_writer/linux_core_dumper.h | 5 +- .../linux_core_dumper_unittest.cc | 5 +- .../linux/minidump_writer/linux_dumper.cc | 5 +- .../linux/minidump_writer/linux_dumper.h | 5 +- .../linux_dumper_unittest_helper.cc | 5 +- .../minidump_writer/linux_ptrace_dumper.cc | 5 +- .../minidump_writer/linux_ptrace_dumper.h | 5 +- .../linux_ptrace_dumper_unittest.cc | 5 +- .../linux/minidump_writer/minidump_writer.cc | 5 +- .../linux/minidump_writer/minidump_writer.h | 5 +- .../minidump_writer_unittest.cc | 5 +- .../minidump_writer_unittest_utils.cc | 5 +- .../minidump_writer_unittest_utils.h | 5 +- src/client/linux/minidump_writer/pe_file.cc | 5 +- src/client/linux/minidump_writer/pe_file.h | 5 +- src/client/linux/minidump_writer/pe_structs.h | 5 +- .../minidump_writer/proc_cpuinfo_reader.h | 5 +- .../proc_cpuinfo_reader_unittest.cc | 5 +- .../sender/google_crash_report_sender.cc | 5 +- src/client/mac/Framework/Breakpad.h | 5 +- src/client/mac/Framework/Breakpad.mm | 5 +- src/client/mac/Framework/OnDemandServer.h | 5 +- src/client/mac/Framework/OnDemandServer.mm | 5 +- src/client/mac/crash_generation/ConfigFile.h | 5 +- src/client/mac/crash_generation/ConfigFile.mm | 5 +- src/client/mac/crash_generation/Inspector.h | 5 +- src/client/mac/crash_generation/Inspector.mm | 5 +- .../mac/crash_generation/InspectorMain.mm | 5 +- src/client/mac/crash_generation/client_info.h | 5 +- .../crash_generation_client.cc | 5 +- .../crash_generation_client.h | 5 +- .../crash_generation_server.cc | 5 +- .../crash_generation_server.h | 5 +- src/client/mac/handler/breakpad_nlist_64.h | 5 +- src/client/mac/handler/dynamic_images.cc | 5 +- src/client/mac/handler/dynamic_images.h | 5 +- src/client/mac/handler/exception_handler.cc | 5 +- src/client/mac/handler/exception_handler.h | 5 +- src/client/mac/handler/mach_vm_compat.h | 5 +- src/client/mac/handler/minidump_generator.cc | 5 +- src/client/mac/handler/minidump_generator.h | 5 +- .../mac/handler/protected_memory_allocator.cc | 5 +- .../mac/handler/protected_memory_allocator.h | 5 +- .../handler/testcases/DynamicImagesTests.cc | 7 +- .../handler/testcases/DynamicImagesTests.h | 7 +- .../handler/testcases/breakpad_nlist_test.cc | 7 +- .../handler/testcases/breakpad_nlist_test.h | 7 +- src/client/mac/handler/testcases/dwarftests.h | 7 +- .../mac/handler/testcases/dwarftests.mm | 7 +- src/client/mac/handler/ucontext_compat.h | 5 +- src/client/mac/sender/crash_report_sender.h | 5 +- src/client/mac/sender/crash_report_sender.m | 5 +- src/client/mac/sender/uploader.h | 5 +- src/client/mac/sender/uploader.mm | 5 +- src/client/mac/testapp/Controller.h | 5 +- src/client/mac/testapp/Controller.m | 5 +- src/client/mac/testapp/TestClass.h | 5 +- src/client/mac/testapp/TestClass.mm | 5 +- src/client/mac/testapp/main.m | 5 +- .../mac/tests/BreakpadFramework_Test.mm | 5 +- .../mac/tests/crash_generation_server_test.cc | 5 +- .../mac/tests/exception_handler_test.cc | 5 +- .../mac/tests/minidump_generator_test.cc | 5 +- .../tests/minidump_generator_test_helper.cc | 5 +- src/client/mac/tests/spawn_child_process.h | 5 +- src/client/minidump_file_writer-inl.h | 5 +- src/client/minidump_file_writer.cc | 5 +- src/client/minidump_file_writer.h | 5 +- src/client/minidump_file_writer_unittest.cc | 5 +- src/client/solaris/handler/Makefile | 5 +- .../solaris/handler/exception_handler.cc | 5 +- .../solaris/handler/exception_handler.h | 5 +- .../solaris/handler/exception_handler_test.cc | 5 +- .../solaris/handler/minidump_generator.cc | 5 +- .../solaris/handler/minidump_generator.h | 5 +- src/client/solaris/handler/minidump_test.cc | 5 +- src/client/solaris/handler/solaris_lwp.cc | 5 +- src/client/solaris/handler/solaris_lwp.h | 5 +- src/client/windows/breakpad_client.gyp | 4 +- .../windows/common/auto_critical_section.h | 5 +- src/client/windows/common/ipc_protocol.h | 5 +- .../windows/crash_generation/client_info.cc | 5 +- .../windows/crash_generation/client_info.h | 5 +- .../crash_generation/crash_generation.gyp | 4 +- .../crash_generation_client.cc | 5 +- .../crash_generation_client.h | 5 +- .../crash_generation_server.cc | 5 +- .../crash_generation_server.h | 5 +- .../crash_generation/minidump_generator.cc | 5 +- .../crash_generation/minidump_generator.h | 5 +- .../windows/handler/exception_handler.cc | 5 +- .../windows/handler/exception_handler.gyp | 4 +- .../windows/handler/exception_handler.h | 5 +- .../windows/sender/crash_report_sender.cc | 5 +- .../windows/sender/crash_report_sender.gyp | 4 +- .../windows/sender/crash_report_sender.h | 5 +- .../crash_generation_app/abstract_class.cc | 5 +- .../crash_generation_app/abstract_class.h | 5 +- .../crash_generation_app.cc | 5 +- .../crash_generation_app.gyp | 4 +- .../crash_generation_app.h | 5 +- .../tests/crash_generation_app/resource.h | 5 +- src/client/windows/unittests/client_tests.gyp | 4 +- .../unittests/crash_generation_server_test.cc | 5 +- src/client/windows/unittests/dump_analysis.cc | 5 +- src/client/windows/unittests/dump_analysis.h | 5 +- .../unittests/exception_handler_death_test.cc | 5 +- .../exception_handler_nesting_test.cc | 5 +- .../unittests/exception_handler_test.cc | 5 +- .../unittests/exception_handler_test.h | 5 +- src/client/windows/unittests/minidump_test.cc | 5 +- src/client/windows/unittests/testing.gyp | 4 +- src/common/android/include/elf.h | 5 +- src/common/android/include/link.h | 5 +- src/common/android/include/stab.h | 5 +- src/common/android/include/sys/procfs.h | 5 +- src/common/android/include/sys/user.h | 5 +- src/common/android/testing/include/wchar.h | 5 +- src/common/android/testing/mkdtemp.h | 5 +- src/common/android/testing/pthread_fixes.h | 5 +- src/common/basictypes.h | 5 +- src/common/byte_cursor.h | 5 +- src/common/byte_cursor_unittest.cc | 5 +- src/common/common.gyp | 4 +- src/common/dwarf/bytereader-inl.h | 4 +- src/common/dwarf/bytereader.cc | 4 +- src/common/dwarf/bytereader.h | 4 +- src/common/dwarf/bytereader_unittest.cc | 5 +- src/common/dwarf/cfi_assembler.cc | 5 +- src/common/dwarf/cfi_assembler.h | 5 +- src/common/dwarf/dwarf2diehandler.cc | 4 +- src/common/dwarf/dwarf2diehandler.h | 4 +- src/common/dwarf/dwarf2diehandler_unittest.cc | 4 +- src/common/dwarf/dwarf2enums.h | 4 +- src/common/dwarf/dwarf2reader.cc | 4 +- src/common/dwarf/dwarf2reader.h | 4 +- src/common/dwarf/dwarf2reader_cfi_unittest.cc | 5 +- src/common/dwarf/dwarf2reader_die_unittest.cc | 5 +- .../dwarf/dwarf2reader_lineinfo_unittest.cc | 5 +- .../dwarf2reader_splitfunctions_unittest.cc | 5 +- src/common/dwarf/dwarf2reader_test_common.h | 5 +- src/common/dwarf/elf_reader.cc | 2 +- src/common/dwarf/elf_reader.h | 2 +- src/common/dwarf/functioninfo.cc | 4 +- src/common/dwarf/functioninfo.h | 4 +- src/common/dwarf/line_state_machine.h | 4 +- src/common/dwarf/types.h | 4 +- src/common/dwarf_cfi_to_module.cc | 5 +- src/common/dwarf_cfi_to_module.h | 5 +- src/common/dwarf_cfi_to_module_unittest.cc | 5 +- src/common/dwarf_cu_to_module.cc | 5 +- src/common/dwarf_cu_to_module.h | 5 +- src/common/dwarf_cu_to_module_unittest.cc | 5 +- src/common/dwarf_line_to_module.cc | 5 +- src/common/dwarf_line_to_module.h | 5 +- src/common/dwarf_line_to_module_unittest.cc | 5 +- src/common/dwarf_range_list_handler.cc | 5 +- src/common/dwarf_range_list_handler.h | 5 +- src/common/language.cc | 5 +- src/common/language.h | 5 +- src/common/linux/breakpad_getcontext.S | 5 +- src/common/linux/breakpad_getcontext.h | 5 +- .../linux/breakpad_getcontext_unittest.cc | 5 +- src/common/linux/crc32.cc | 5 +- src/common/linux/crc32.h | 5 +- src/common/linux/dump_symbols.cc | 5 +- src/common/linux/dump_symbols.h | 5 +- src/common/linux/dump_symbols_unittest.cc | 5 +- src/common/linux/eintr_wrapper.h | 5 +- src/common/linux/elf_core_dump.cc | 5 +- src/common/linux/elf_core_dump.h | 5 +- src/common/linux/elf_core_dump_unittest.cc | 5 +- src/common/linux/elf_gnu_compat.h | 5 +- src/common/linux/elf_symbols_to_module.cc | 4 +- src/common/linux/elf_symbols_to_module.h | 4 +- .../linux/elf_symbols_to_module_unittest.cc | 5 +- src/common/linux/elfutils-inl.h | 5 +- src/common/linux/elfutils.cc | 5 +- src/common/linux/elfutils.h | 5 +- src/common/linux/file_id.cc | 5 +- src/common/linux/file_id.h | 5 +- src/common/linux/file_id_unittest.cc | 5 +- src/common/linux/google_crashdump_uploader.cc | 5 +- src/common/linux/google_crashdump_uploader.h | 5 +- .../linux/google_crashdump_uploader_test.cc | 5 +- src/common/linux/guid_creator.cc | 5 +- src/common/linux/guid_creator.h | 5 +- src/common/linux/http_upload.cc | 5 +- src/common/linux/http_upload.h | 5 +- src/common/linux/ignore_ret.h | 5 +- src/common/linux/libcurl_wrapper.cc | 5 +- src/common/linux/libcurl_wrapper.h | 5 +- src/common/linux/linux_libc_support.cc | 5 +- src/common/linux/linux_libc_support.h | 5 +- .../linux/linux_libc_support_unittest.cc | 5 +- src/common/linux/memory_mapped_file.cc | 5 +- src/common/linux/memory_mapped_file.h | 5 +- .../linux/memory_mapped_file_unittest.cc | 5 +- src/common/linux/safe_readlink.cc | 5 +- src/common/linux/safe_readlink.h | 5 +- src/common/linux/safe_readlink_unittest.cc | 5 +- src/common/linux/symbol_collector_client.cc | 5 +- src/common/linux/symbol_collector_client.h | 5 +- src/common/linux/symbol_upload.cc | 5 +- src/common/linux/symbol_upload.h | 5 +- src/common/linux/synth_elf.h | 5 +- src/common/linux/synth_elf_unittest.cc | 5 +- src/common/linux/tests/auto_testfile.h | 5 +- src/common/linux/tests/crash_generator.cc | 5 +- src/common/linux/tests/crash_generator.h | 5 +- src/common/linux/ucontext_constants.h | 5 +- src/common/long_string_dictionary.cc | 5 +- src/common/long_string_dictionary.h | 5 +- src/common/long_string_dictionary_unittest.cc | 5 +- src/common/mac/Breakpad.xcconfig | 5 +- src/common/mac/BreakpadDebug.xcconfig | 5 +- src/common/mac/BreakpadRelease.xcconfig | 5 +- src/common/mac/GTMDefines.h | 2 +- src/common/mac/GTMLogger.h | 2 +- src/common/mac/GTMLogger.m | 2 +- src/common/mac/HTTPGetRequest.h | 5 +- src/common/mac/HTTPGetRequest.m | 5 +- src/common/mac/HTTPMultipartUpload.h | 5 +- src/common/mac/HTTPMultipartUpload.m | 5 +- src/common/mac/HTTPPutRequest.h | 5 +- src/common/mac/HTTPPutRequest.m | 5 +- src/common/mac/HTTPRequest.h | 5 +- src/common/mac/HTTPRequest.m | 5 +- src/common/mac/HTTPSimplePostRequest.h | 5 +- src/common/mac/HTTPSimplePostRequest.m | 5 +- src/common/mac/MachIPC.h | 5 +- src/common/mac/MachIPC.mm | 5 +- src/common/mac/SymbolCollectorClient.h | 5 +- src/common/mac/SymbolCollectorClient.m | 5 +- src/common/mac/arch_utilities.cc | 5 +- src/common/mac/arch_utilities.h | 5 +- src/common/mac/bootstrap_compat.cc | 5 +- src/common/mac/bootstrap_compat.h | 5 +- src/common/mac/byteswap.h | 5 +- src/common/mac/dump_syms.cc | 5 +- src/common/mac/dump_syms.h | 5 +- src/common/mac/encoding_util.h | 5 +- src/common/mac/encoding_util.m | 5 +- src/common/mac/file_id.cc | 5 +- src/common/mac/file_id.h | 5 +- src/common/mac/launch_reporter.cc | 5 +- src/common/mac/launch_reporter.h | 5 +- src/common/mac/macho_id.cc | 5 +- src/common/mac/macho_id.h | 5 +- src/common/mac/macho_reader.cc | 5 +- src/common/mac/macho_reader.h | 5 +- src/common/mac/macho_reader_unittest.cc | 5 +- src/common/mac/macho_utilities.cc | 5 +- src/common/mac/macho_utilities.h | 5 +- src/common/mac/macho_walker.cc | 5 +- src/common/mac/macho_walker.h | 5 +- src/common/mac/minidump_upload.m | 5 +- src/common/mac/scoped_task_suspend-inl.h | 5 +- src/common/mac/string_utilities.cc | 5 +- src/common/mac/string_utilities.h | 5 +- src/common/mac/super_fat_arch.h | 5 +- src/common/mac/testing/GTMSenTestCase.h | 2 +- src/common/mac/testing/GTMSenTestCase.m | 2 +- src/common/macros.h | 5 +- src/common/md5.h | 2 +- src/common/memory_allocator.h | 5 +- src/common/memory_allocator_unittest.cc | 5 +- src/common/memory_range.h | 5 +- src/common/memory_range_unittest.cc | 5 +- src/common/minidump_type_helper.h | 5 +- src/common/module.cc | 5 +- src/common/module.h | 5 +- src/common/module_unittest.cc | 5 +- src/common/path_helper.cc | 5 +- src/common/path_helper.h | 5 +- src/common/safe_math.h | 5 +- src/common/safe_math_unittest.cc | 5 +- src/common/scoped_ptr.h | 4 +- src/common/simple_string_dictionary.cc | 5 +- src/common/simple_string_dictionary.h | 5 +- .../simple_string_dictionary_unittest.cc | 5 +- src/common/solaris/dump_symbols.cc | 5 +- src/common/solaris/dump_symbols.h | 5 +- src/common/solaris/file_id.cc | 5 +- src/common/solaris/file_id.h | 5 +- src/common/solaris/guid_creator.cc | 5 +- src/common/solaris/guid_creator.h | 5 +- src/common/solaris/message_output.h | 5 +- src/common/stabs_reader.cc | 4 +- src/common/stabs_reader.h | 4 +- src/common/stabs_reader_unittest.cc | 5 +- src/common/stabs_to_module.cc | 5 +- src/common/stabs_to_module.h | 5 +- src/common/stabs_to_module_unittest.cc | 5 +- src/common/stdio_wrapper.h | 5 +- src/common/string_conversion.cc | 5 +- src/common/string_conversion.h | 5 +- src/common/string_conversion_unittest.cc | 5 +- src/common/string_view.h | 5 +- src/common/symbol_data.h | 5 +- src/common/test_assembler.cc | 5 +- src/common/test_assembler.h | 5 +- src/common/test_assembler_unittest.cc | 5 +- src/common/tests/auto_tempdir.h | 5 +- src/common/tests/file_utils.cc | 5 +- src/common/tests/file_utils.h | 5 +- src/common/unordered.h | 5 +- src/common/using_std_string.h | 5 +- src/common/windows/common_windows.gyp | 4 +- src/common/windows/dia_util.cc | 182 +- src/common/windows/dia_util.h | 4 +- src/common/windows/guid_string.cc | 5 +- src/common/windows/guid_string.h | 5 +- src/common/windows/http_upload.cc | 5 +- src/common/windows/http_upload.h | 5 +- src/common/windows/module_info.h | 149 +- src/common/windows/omap.cc | 4 +- src/common/windows/omap.h | 4 +- src/common/windows/omap_internal.h | 4 +- src/common/windows/omap_unittest.cc | 658 +++--- src/common/windows/pdb_source_line_writer.cc | 5 +- src/common/windows/pdb_source_line_writer.h | 5 +- src/common/windows/pe_source_line_writer.cc | 153 +- src/common/windows/pe_source_line_writer.h | 135 +- src/common/windows/pe_util.cc | 823 ++++---- src/common/windows/pe_util.h | 155 +- src/common/windows/string_utils-inl.h | 5 +- src/common/windows/string_utils.cc | 5 +- src/common/windows/sym_upload_v2_protocol.cc | 208 +- src/common/windows/sym_upload_v2_protocol.h | 131 +- src/common/windows/symbol_collector_client.h | 5 +- src/google_breakpad/common/breakpad_types.h | 5 +- .../common/minidump_cpu_amd64.h | 5 +- src/google_breakpad/common/minidump_cpu_arm.h | 5 +- .../common/minidump_cpu_arm64.h | 5 +- .../common/minidump_cpu_mips.h | 5 +- src/google_breakpad/common/minidump_cpu_ppc.h | 5 +- .../common/minidump_cpu_ppc64.h | 5 +- .../common/minidump_cpu_sparc.h | 5 +- src/google_breakpad/common/minidump_cpu_x86.h | 5 +- .../common/minidump_exception_fuchsia.h | 5 +- .../common/minidump_exception_linux.h | 5 +- .../common/minidump_exception_mac.h | 5 +- .../common/minidump_exception_ps3.h | 5 +- .../common/minidump_exception_solaris.h | 5 +- .../common/minidump_exception_win32.h | 5 +- src/google_breakpad/common/minidump_format.h | 5 +- src/google_breakpad/common/minidump_size.h | 5 +- .../processor/basic_source_line_resolver.h | 5 +- src/google_breakpad/processor/call_stack.h | 5 +- src/google_breakpad/processor/code_module.h | 5 +- src/google_breakpad/processor/code_modules.h | 5 +- src/google_breakpad/processor/dump_context.h | 5 +- src/google_breakpad/processor/dump_object.h | 5 +- .../processor/exception_record.h | 5 +- .../processor/exploitability.h | 5 +- .../processor/fast_source_line_resolver.h | 5 +- src/google_breakpad/processor/memory_region.h | 5 +- src/google_breakpad/processor/microdump.h | 5 +- .../processor/microdump_processor.h | 5 +- src/google_breakpad/processor/minidump.h | 5 +- .../processor/minidump_processor.h | 5 +- .../processor/proc_maps_linux.h | 2 +- .../processor/process_result.h | 5 +- src/google_breakpad/processor/process_state.h | 5 +- .../processor/source_line_resolver_base.h | 5 +- .../source_line_resolver_interface.h | 5 +- src/google_breakpad/processor/stack_frame.h | 5 +- .../processor/stack_frame_cpu.h | 5 +- .../processor/stack_frame_symbolizer.h | 5 +- src/google_breakpad/processor/stackwalker.h | 5 +- .../processor/symbol_supplier.h | 5 +- src/google_breakpad/processor/system_info.h | 5 +- src/processor/address_map-inl.h | 5 +- src/processor/address_map.h | 5 +- src/processor/address_map_unittest.cc | 5 +- src/processor/basic_code_module.h | 5 +- src/processor/basic_code_modules.cc | 5 +- src/processor/basic_code_modules.h | 5 +- src/processor/basic_source_line_resolver.cc | 5 +- .../basic_source_line_resolver_types.h | 5 +- .../basic_source_line_resolver_unittest.cc | 5 +- src/processor/call_stack.cc | 5 +- src/processor/cfi_frame_info-inl.h | 5 +- src/processor/cfi_frame_info.cc | 5 +- src/processor/cfi_frame_info.h | 5 +- src/processor/cfi_frame_info_unittest.cc | 5 +- src/processor/contained_range_map-inl.h | 5 +- src/processor/contained_range_map.h | 5 +- src/processor/contained_range_map_unittest.cc | 5 +- src/processor/convert_old_arm64_context.cc | 5 +- src/processor/convert_old_arm64_context.h | 5 +- src/processor/disassembler_x86.cc | 11 +- src/processor/disassembler_x86.h | 4 +- src/processor/disassembler_x86_unittest.cc | 7 +- src/processor/dump_context.cc | 5 +- src/processor/dump_object.cc | 5 +- src/processor/exploitability.cc | 5 +- src/processor/exploitability_linux.cc | 5 +- src/processor/exploitability_linux.h | 5 +- src/processor/exploitability_unittest.cc | 7 +- src/processor/exploitability_win.cc | 5 +- src/processor/exploitability_win.h | 5 +- src/processor/fast_source_line_resolver.cc | 5 +- .../fast_source_line_resolver_types.h | 5 +- .../fast_source_line_resolver_unittest.cc | 5 +- src/processor/linked_ptr.h | 5 +- src/processor/logging.cc | 5 +- src/processor/logging.h | 5 +- src/processor/map_serializers-inl.h | 5 +- src/processor/map_serializers.h | 5 +- src/processor/map_serializers_unittest.cc | 5 +- src/processor/microdump.cc | 5 +- src/processor/microdump_processor.cc | 5 +- src/processor/microdump_processor_unittest.cc | 5 +- src/processor/microdump_stackwalk.cc | 5 +- .../microdump_stackwalk_machine_readable_test | 5 +- src/processor/microdump_stackwalk_test | 5 +- src/processor/minidump.cc | 5 +- src/processor/minidump_dump.cc | 5 +- src/processor/minidump_dump_test | 5 +- src/processor/minidump_processor.cc | 5 +- src/processor/minidump_processor_unittest.cc | 5 +- src/processor/minidump_stackwalk.cc | 5 +- .../minidump_stackwalk_machine_readable_test | 5 +- src/processor/minidump_stackwalk_test | 5 +- src/processor/minidump_unittest.cc | 5 +- src/processor/module_comparer.cc | 5 +- src/processor/module_comparer.h | 5 +- src/processor/module_factory.h | 5 +- src/processor/module_serializer.cc | 5 +- src/processor/module_serializer.h | 5 +- src/processor/pathname_stripper.cc | 5 +- src/processor/pathname_stripper.h | 5 +- src/processor/pathname_stripper_unittest.cc | 5 +- src/processor/postfix_evaluator-inl.h | 5 +- src/processor/postfix_evaluator.h | 5 +- src/processor/postfix_evaluator_unittest.cc | 5 +- src/processor/proc_maps_linux.cc | 2 +- src/processor/proc_maps_linux_unittest.cc | 2 +- src/processor/process_state.cc | 5 +- src/processor/processor.gyp | 4 +- src/processor/processor_tools.gypi | 4 +- src/processor/proto/process_state.proto | 5 +- src/processor/range_map-inl.h | 5 +- src/processor/range_map.h | 5 +- .../range_map_truncate_lower_unittest.cc | 7 +- .../range_map_truncate_upper_unittest.cc | 7 +- src/processor/range_map_unittest.cc | 5 +- src/processor/simple_serializer-inl.h | 5 +- src/processor/simple_serializer.h | 5 +- src/processor/simple_symbol_supplier.cc | 5 +- src/processor/simple_symbol_supplier.h | 5 +- src/processor/source_line_resolver_base.cc | 5 +- .../source_line_resolver_base_types.h | 5 +- src/processor/stack_frame_cpu.cc | 5 +- src/processor/stack_frame_symbolizer.cc | 5 +- src/processor/stackwalk_common.cc | 5 +- src/processor/stackwalk_common.h | 5 +- src/processor/stackwalker.cc | 5 +- src/processor/stackwalker_address_list.cc | 5 +- src/processor/stackwalker_address_list.h | 5 +- .../stackwalker_address_list_unittest.cc | 5 +- src/processor/stackwalker_amd64.cc | 5 +- src/processor/stackwalker_amd64.h | 5 +- src/processor/stackwalker_amd64_unittest.cc | 5 +- src/processor/stackwalker_arm.cc | 5 +- src/processor/stackwalker_arm.h | 5 +- src/processor/stackwalker_arm64.cc | 5 +- src/processor/stackwalker_arm64.h | 5 +- src/processor/stackwalker_arm64_unittest.cc | 5 +- src/processor/stackwalker_arm_unittest.cc | 5 +- src/processor/stackwalker_mips.cc | 5 +- src/processor/stackwalker_mips.h | 5 +- src/processor/stackwalker_mips64_unittest.cc | 5 +- src/processor/stackwalker_mips_unittest.cc | 5 +- src/processor/stackwalker_ppc.cc | 5 +- src/processor/stackwalker_ppc.h | 5 +- src/processor/stackwalker_ppc64.cc | 5 +- src/processor/stackwalker_ppc64.h | 5 +- src/processor/stackwalker_selftest.cc | 5 +- src/processor/stackwalker_selftest_sol.s | 5 +- src/processor/stackwalker_sparc.cc | 5 +- src/processor/stackwalker_sparc.h | 5 +- src/processor/stackwalker_unittest_utils.h | 5 +- src/processor/stackwalker_x86.cc | 5 +- src/processor/stackwalker_x86.h | 5 +- src/processor/stackwalker_x86_unittest.cc | 5 +- src/processor/static_address_map-inl.h | 5 +- src/processor/static_address_map.h | 5 +- src/processor/static_address_map_unittest.cc | 5 +- .../static_contained_range_map-inl.h | 5 +- src/processor/static_contained_range_map.h | 5 +- .../static_contained_range_map_unittest.cc | 5 +- src/processor/static_map-inl.h | 4 +- src/processor/static_map.h | 4 +- src/processor/static_map_iterator-inl.h | 4 +- src/processor/static_map_iterator.h | 4 +- src/processor/static_map_unittest.cc | 5 +- src/processor/static_range_map-inl.h | 5 +- src/processor/static_range_map.h | 5 +- src/processor/static_range_map_unittest.cc | 5 +- src/processor/symbolic_constants_win.cc | 5 +- src/processor/symbolic_constants_win.h | 5 +- src/processor/synth_minidump.cc | 5 +- src/processor/synth_minidump.h | 5 +- src/processor/synth_minidump_unittest.cc | 5 +- src/processor/testdata/linux_test_app.cc | 5 +- src/processor/testdata/test_app.cc | 5 +- src/processor/tokenize.cc | 5 +- src/processor/tokenize.h | 5 +- src/processor/windows_frame_info.h | 5 +- src/third_party/libdisasm/libdisasm.gyp | 4 +- .../linux/include/gflags/gflags_completions.h | 5 +- src/tools/linux/core2md/core2md.cc | 5 +- src/tools/linux/core_handler/core_handler.cc | 5 +- src/tools/linux/dump_syms/dump_syms.cc | 5 +- src/tools/linux/md2core/minidump-2-core.cc | 5 +- .../linux/md2core/minidump_memory_range.h | 5 +- .../md2core/minidump_memory_range_unittest.cc | 5 +- src/tools/linux/pid2md/pid2md.cc | 5 +- src/tools/linux/symupload/minidump_upload.cc | 5 +- src/tools/linux/symupload/sym_upload.cc | 5 +- src/tools/linux/tools_linux.gypi | 4 +- src/tools/mac/crash_report/crash_report.mm | 5 +- .../crash_report/on_demand_symbol_supplier.h | 5 +- .../crash_report/on_demand_symbol_supplier.mm | 5 +- src/tools/mac/dump_syms/dump_syms_tool.cc | 5 +- src/tools/mac/dump_syms/macho_dump.cc | 5 +- src/tools/mac/symupload/symupload.mm | 5 +- src/tools/mac/tools_mac.gypi | 4 +- .../upload_system_symbols/arch_constants.h | 5 +- .../mac/upload_system_symbols/arch_reader.go | 5 +- .../upload_system_symbols.go | 5 +- src/tools/python/deps-to-manifest.py | 5 +- src/tools/python/filter_syms.py | 5 +- .../python/tests/filter_syms_unittest.py | 5 +- src/tools/solaris/dump_syms/Makefile | 5 +- src/tools/solaris/dump_syms/dump_syms.cc | 5 +- src/tools/solaris/dump_syms/run_regtest.sh | 5 +- .../dump_syms/testdata/dump_syms_regtest.cc | 5 +- src/tools/tools.gyp | 4 +- .../converter/ms_symbol_server_converter.cc | 5 +- .../converter/ms_symbol_server_converter.gyp | 4 +- .../converter/ms_symbol_server_converter.h | 5 +- src/tools/windows/converter_exe/converter.cc | 1782 ++++++++--------- src/tools/windows/converter_exe/converter.gyp | 4 +- src/tools/windows/converter_exe/escaping.cc | 1514 +++++++------- src/tools/windows/converter_exe/escaping.h | 198 +- src/tools/windows/converter_exe/http_client.h | 192 +- .../windows/converter_exe/http_download.cc | 652 +++--- .../windows/converter_exe/http_download.h | 124 +- src/tools/windows/converter_exe/tokenizer.cc | 122 +- src/tools/windows/converter_exe/tokenizer.h | 102 +- .../windows/converter_exe/winhttp_client.cc | 614 +++--- .../windows/converter_exe/winhttp_client.h | 80 +- .../windows/converter_exe/wininet_client.cc | 556 ++--- .../windows/converter_exe/wininet_client.h | 80 +- src/tools/windows/dump_syms/dump_syms.cc | 5 +- src/tools/windows/dump_syms/dump_syms.gyp | 4 +- .../windows/dump_syms/dump_syms_unittest.cc | 488 ++--- src/tools/windows/dump_syms/run_regtest.sh | 5 +- .../dump_syms/testdata/dump_syms_regtest.cc | 5 +- src/tools/windows/symupload/symupload.cc | 5 +- src/tools/windows/symupload/symupload.gyp | 4 +- src/tools/windows/tools_windows.gyp | 4 +- 623 files changed, 5769 insertions(+), 6273 deletions(-) diff --git a/.gitignore b/.gitignore index d6140d8c1..efa0851af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/DEPS b/DEPS index 32f0a738d..797ceeb8c 100644 --- a/DEPS +++ b/DEPS @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/LICENSE b/LICENSE index a840b2647..832b4efb5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,4 @@ -Copyright (c) 2006, Google Inc. -All rights reserved. +Copyright 2006 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/Makefile.am b/Makefile.am index 514a7ff4d..fd89ea51f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to produce Makefile.in -# Copyright (c) 2011, Google Inc. -# All rights reserved. +# Copyright 2011 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/Makefile.in b/Makefile.in index ab0c822d4..abe7daaee 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,8 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2011, Google Inc. -# All rights reserved. +# Copyright 2011 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -27,7 +26,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/common-functions.sh b/android/common-functions.sh index c00e34f99..8a017178f 100755 --- a/android/common-functions.sh +++ b/android/common-functions.sh @@ -1,5 +1,4 @@ -# Copyright (c) 2012 Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/google_breakpad/Android.mk b/android/google_breakpad/Android.mk index af7aa9201..63243655f 100644 --- a/android/google_breakpad/Android.mk +++ b/android/google_breakpad/Android.mk @@ -1,5 +1,4 @@ -# Copyright (c) 2012, Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/run-checks.sh b/android/run-checks.sh index 51d2d5023..0a41a655c 100755 --- a/android/run-checks.sh +++ b/android/run-checks.sh @@ -1,6 +1,5 @@ #!/bin/sh -# Copyright (c) 2012 Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/sample_app/jni/Android.mk b/android/sample_app/jni/Android.mk index 61487b52c..419352751 100644 --- a/android/sample_app/jni/Android.mk +++ b/android/sample_app/jni/Android.mk @@ -1,5 +1,4 @@ -# Copyright (c) 2012, Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/sample_app/jni/Application.mk b/android/sample_app/jni/Application.mk index 9728017d3..29e4a4aad 100644 --- a/android/sample_app/jni/Application.mk +++ b/android/sample_app/jni/Application.mk @@ -1,5 +1,4 @@ -# Copyright (c) 2012, Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/android/sample_app/jni/test_breakpad.cpp b/android/sample_app/jni/test_breakpad.cpp index 9c4ebbb14..481cbe762 100644 --- a/android/sample_app/jni/test_breakpad.cpp +++ b/android/sample_app/jni/test_breakpad.cpp @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/android/test-shell.sh b/android/test-shell.sh index 3677d8755..abdf36ab7 100755 --- a/android/test-shell.sh +++ b/android/test-shell.sh @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2012 Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/configure.ac b/configure.ac index 28b81d47f..cc153f33d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,4 @@ -# Copyright (c) 2006, Google Inc. -# All rights reserved. +# Copyright 2006 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/breakpad_googletest_includes.h b/src/breakpad_googletest_includes.h index 19a3e9807..4bc44a83b 100644 --- a/src/breakpad_googletest_includes.h +++ b/src/breakpad_googletest_includes.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/build/all.gyp b/src/build/all.gyp index 4b59d917b..63b3333e9 100644 --- a/src/build/all.gyp +++ b/src/build/all.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/build/common.gypi b/src/build/common.gypi index 29990c659..b65908c8c 100644 --- a/src/build/common.gypi +++ b/src/build/common.gypi @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/build/filename_rules.gypi b/src/build/filename_rules.gypi index 78cd1808a..b34f19bda 100644 --- a/src/build/filename_rules.gypi +++ b/src/build/filename_rules.gypi @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/build/gyp_breakpad b/src/build/gyp_breakpad index 0b8077d2f..219d47328 100755 --- a/src/build/gyp_breakpad +++ b/src/build/gyp_breakpad @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/build/testing.gyp b/src/build/testing.gyp index 6a459a646..d03246657 100644 --- a/src/build/testing.gyp +++ b/src/build/testing.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/apple/Framework/BreakpadDefines.h b/src/client/apple/Framework/BreakpadDefines.h index 410a5a6f3..1946534ec 100644 --- a/src/client/apple/Framework/BreakpadDefines.h +++ b/src/client/apple/Framework/BreakpadDefines.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/Breakpad.h b/src/client/ios/Breakpad.h index 6c9b8bd64..950c03887 100644 --- a/src/client/ios/Breakpad.h +++ b/src/client/ios/Breakpad.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/Breakpad.mm b/src/client/ios/Breakpad.mm index 11c517466..e2497461b 100644 --- a/src/client/ios/Breakpad.mm +++ b/src/client/ios/Breakpad.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/BreakpadController.h b/src/client/ios/BreakpadController.h index 6c70c202f..40334592d 100644 --- a/src/client/ios/BreakpadController.h +++ b/src/client/ios/BreakpadController.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index 01fb5f13a..d03833e92 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/exception_handler_no_mach.cc b/src/client/ios/exception_handler_no_mach.cc index cb26449d0..6bb410210 100644 --- a/src/client/ios/exception_handler_no_mach.cc +++ b/src/client/ios/exception_handler_no_mach.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/exception_handler_no_mach.h b/src/client/ios/exception_handler_no_mach.h index ec598dcf3..57247e617 100644 --- a/src/client/ios/exception_handler_no_mach.h +++ b/src/client/ios/exception_handler_no_mach.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/handler/ios_exception_minidump_generator.h b/src/client/ios/handler/ios_exception_minidump_generator.h index e48444a72..cf72f00bb 100644 --- a/src/client/ios/handler/ios_exception_minidump_generator.h +++ b/src/client/ios/handler/ios_exception_minidump_generator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/ios/handler/ios_exception_minidump_generator.mm b/src/client/ios/handler/ios_exception_minidump_generator.mm index 2a5d76d7b..053e36711 100644 --- a/src/client/ios/handler/ios_exception_minidump_generator.mm +++ b/src/client/ios/handler/ios_exception_minidump_generator.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/crash_generation/client_info.h b/src/client/linux/crash_generation/client_info.h index d0a184a63..6c4ecc3f7 100644 --- a/src/client/linux/crash_generation/client_info.h +++ b/src/client/linux/crash_generation/client_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/crash_generation/crash_generation_client.cc b/src/client/linux/crash_generation/crash_generation_client.cc index d8bfbbad2..5a8c6b4c9 100644 --- a/src/client/linux/crash_generation/crash_generation_client.cc +++ b/src/client/linux/crash_generation/crash_generation_client.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/crash_generation/crash_generation_client.h b/src/client/linux/crash_generation/crash_generation_client.h index 4e68424ae..915b5700f 100644 --- a/src/client/linux/crash_generation/crash_generation_client.h +++ b/src/client/linux/crash_generation/crash_generation_client.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc index 8332f59d4..56cc0cd7b 100644 --- a/src/client/linux/crash_generation/crash_generation_server.cc +++ b/src/client/linux/crash_generation/crash_generation_server.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/crash_generation/crash_generation_server.h b/src/client/linux/crash_generation/crash_generation_server.h index 483fb709b..5f4cb3a7a 100644 --- a/src/client/linux/crash_generation/crash_generation_server.h +++ b/src/client/linux/crash_generation/crash_generation_server.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/mapping_info.h b/src/client/linux/dump_writer_common/mapping_info.h index c09e48ab0..759e7338e 100644 --- a/src/client/linux/dump_writer_common/mapping_info.h +++ b/src/client/linux/dump_writer_common/mapping_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/raw_context_cpu.h b/src/client/linux/dump_writer_common/raw_context_cpu.h index 07d9171a0..58243dfee 100644 --- a/src/client/linux/dump_writer_common/raw_context_cpu.h +++ b/src/client/linux/dump_writer_common/raw_context_cpu.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/thread_info.cc b/src/client/linux/dump_writer_common/thread_info.cc index aae1dc13b..5f32c031b 100644 --- a/src/client/linux/dump_writer_common/thread_info.cc +++ b/src/client/linux/dump_writer_common/thread_info.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/thread_info.h b/src/client/linux/dump_writer_common/thread_info.h index fb216fa6d..9e1b454b4 100644 --- a/src/client/linux/dump_writer_common/thread_info.h +++ b/src/client/linux/dump_writer_common/thread_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc index 6eec1be24..7de824579 100644 --- a/src/client/linux/dump_writer_common/ucontext_reader.cc +++ b/src/client/linux/dump_writer_common/ucontext_reader.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/dump_writer_common/ucontext_reader.h b/src/client/linux/dump_writer_common/ucontext_reader.h index 7d4100881..60cbf9004 100644 --- a/src/client/linux/dump_writer_common/ucontext_reader.h +++ b/src/client/linux/dump_writer_common/ucontext_reader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 0055d27a8..36de9be32 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index 03b80d392..670415482 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 35dcbfd4d..01ec2ef96 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/microdump_extra_info.h b/src/client/linux/handler/microdump_extra_info.h index bf01f0c7b..1da69d090 100644 --- a/src/client/linux/handler/microdump_extra_info.h +++ b/src/client/linux/handler/microdump_extra_info.h @@ -1,5 +1,4 @@ -// Copyright 2015 Google Inc. -// All rights reserved. +// Copyright 2015 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/minidump_descriptor.cc b/src/client/linux/handler/minidump_descriptor.cc index bd94474e9..517fce975 100644 --- a/src/client/linux/handler/minidump_descriptor.cc +++ b/src/client/linux/handler/minidump_descriptor.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h index c7e4f2b37..4349b88f3 100644 --- a/src/client/linux/handler/minidump_descriptor.h +++ b/src/client/linux/handler/minidump_descriptor.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/log/log.cc b/src/client/linux/log/log.cc index 318794095..c45de64b7 100644 --- a/src/client/linux/log/log.cc +++ b/src/client/linux/log/log.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/log/log.h b/src/client/linux/log/log.h index f94bbd5fb..93aeffcf4 100644 --- a/src/client/linux/log/log.h +++ b/src/client/linux/log/log.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc index bcd31e6bd..ea161b6dc 100644 --- a/src/client/linux/microdump_writer/microdump_writer.cc +++ b/src/client/linux/microdump_writer/microdump_writer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/microdump_writer/microdump_writer.h b/src/client/linux/microdump_writer/microdump_writer.h index a1e53df62..47b03e8f2 100644 --- a/src/client/linux/microdump_writer/microdump_writer.h +++ b/src/client/linux/microdump_writer/microdump_writer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc index 6339ac0cd..848656643 100644 --- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc +++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/cpu_set.h b/src/client/linux/minidump_writer/cpu_set.h index 1cca9aa5a..70c1c7582 100644 --- a/src/client/linux/minidump_writer/cpu_set.h +++ b/src/client/linux/minidump_writer/cpu_set.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/cpu_set_unittest.cc b/src/client/linux/minidump_writer/cpu_set_unittest.cc index e2274bd17..1db74410d 100644 --- a/src/client/linux/minidump_writer/cpu_set_unittest.cc +++ b/src/client/linux/minidump_writer/cpu_set_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/directory_reader.h b/src/client/linux/minidump_writer/directory_reader.h index a4bde1803..62bba8779 100644 --- a/src/client/linux/minidump_writer/directory_reader.h +++ b/src/client/linux/minidump_writer/directory_reader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/directory_reader_unittest.cc b/src/client/linux/minidump_writer/directory_reader_unittest.cc index 7292a6368..ffc5fbfd9 100644 --- a/src/client/linux/minidump_writer/directory_reader_unittest.cc +++ b/src/client/linux/minidump_writer/directory_reader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/line_reader.h b/src/client/linux/minidump_writer/line_reader.h index 9fc4b7cc8..d54a67d04 100644 --- a/src/client/linux/minidump_writer/line_reader.h +++ b/src/client/linux/minidump_writer/line_reader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/line_reader_unittest.cc b/src/client/linux/minidump_writer/line_reader_unittest.cc index e1ac445ae..3062c39f7 100644 --- a/src/client/linux/minidump_writer/line_reader_unittest.cc +++ b/src/client/linux/minidump_writer/line_reader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc index 92e3a8444..9420e051e 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_core_dumper.h b/src/client/linux/minidump_writer/linux_core_dumper.h index 8a7c924b6..3fc712236 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper.h +++ b/src/client/linux/minidump_writer/linux_core_dumper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc index 774480319..157e4f897 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc index 44430c4e9..01b06facf 100644 --- a/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/client/linux/minidump_writer/linux_dumper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h index 7bee160f1..db8f36eee 100644 --- a/src/client/linux/minidump_writer/linux_dumper.h +++ b/src/client/linux/minidump_writer/linux_dumper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc index 331f4bb34..1cd86faf3 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc index e3ddb81a6..28d77b8ad 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.h b/src/client/linux/minidump_writer/linux_ptrace_dumper.h index cee581784..7828934fa 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper.h +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index 11c392d83..7e760e992 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 0c5ef3fb8..d722be946 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/minidump_writer.h b/src/client/linux/minidump_writer/minidump_writer.h index e3b0b16da..24e3c7bdc 100644 --- a/src/client/linux/minidump_writer/minidump_writer.h +++ b/src/client/linux/minidump_writer/minidump_writer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index b7a2c61e1..ab37a88b0 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc index 8e2319e76..92cae92e2 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h index f16cc086b..f93885ee3 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h +++ b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/pe_file.cc b/src/client/linux/minidump_writer/pe_file.cc index 4a8f1936e..960b978b6 100644 --- a/src/client/linux/minidump_writer/pe_file.cc +++ b/src/client/linux/minidump_writer/pe_file.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. +// Copyright 2022 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/pe_file.h b/src/client/linux/minidump_writer/pe_file.h index cc7ed0807..97984ab5d 100644 --- a/src/client/linux/minidump_writer/pe_file.h +++ b/src/client/linux/minidump_writer/pe_file.h @@ -1,5 +1,4 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. +// Copyright 2022 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/pe_structs.h b/src/client/linux/minidump_writer/pe_structs.h index 843bd517a..122cc2956 100644 --- a/src/client/linux/minidump_writer/pe_structs.h +++ b/src/client/linux/minidump_writer/pe_structs.h @@ -1,5 +1,4 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. +// Copyright 2022 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/proc_cpuinfo_reader.h b/src/client/linux/minidump_writer/proc_cpuinfo_reader.h index d9461bf30..5ae16dfbc 100644 --- a/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +++ b/src/client/linux/minidump_writer/proc_cpuinfo_reader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc index d9b1203e4..f6d3e2859 100644 --- a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc +++ b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/linux/sender/google_crash_report_sender.cc b/src/client/linux/sender/google_crash_report_sender.cc index 6bf337a8d..6f45d831a 100644 --- a/src/client/linux/sender/google_crash_report_sender.cc +++ b/src/client/linux/sender/google_crash_report_sender.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/Framework/Breakpad.h b/src/client/mac/Framework/Breakpad.h index 9e191ce27..e2b48aa15 100644 --- a/src/client/mac/Framework/Breakpad.h +++ b/src/client/mac/Framework/Breakpad.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm index 1a46b5977..def43b7da 100644 --- a/src/client/mac/Framework/Breakpad.mm +++ b/src/client/mac/Framework/Breakpad.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/Framework/OnDemandServer.h b/src/client/mac/Framework/OnDemandServer.h index be0d2b79a..e7a52e7d2 100644 --- a/src/client/mac/Framework/OnDemandServer.h +++ b/src/client/mac/Framework/OnDemandServer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/Framework/OnDemandServer.mm b/src/client/mac/Framework/OnDemandServer.mm index ee934ec93..d2f3a283c 100644 --- a/src/client/mac/Framework/OnDemandServer.mm +++ b/src/client/mac/Framework/OnDemandServer.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/ConfigFile.h b/src/client/mac/crash_generation/ConfigFile.h index 11bc2e434..4a4ed9844 100644 --- a/src/client/mac/crash_generation/ConfigFile.h +++ b/src/client/mac/crash_generation/ConfigFile.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/ConfigFile.mm b/src/client/mac/crash_generation/ConfigFile.mm index 564256836..fe89e8586 100644 --- a/src/client/mac/crash_generation/ConfigFile.mm +++ b/src/client/mac/crash_generation/ConfigFile.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/Inspector.h b/src/client/mac/crash_generation/Inspector.h index c96711363..fb9240c26 100644 --- a/src/client/mac/crash_generation/Inspector.h +++ b/src/client/mac/crash_generation/Inspector.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/Inspector.mm b/src/client/mac/crash_generation/Inspector.mm index d5fc29e02..8d4e3e98b 100644 --- a/src/client/mac/crash_generation/Inspector.mm +++ b/src/client/mac/crash_generation/Inspector.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/InspectorMain.mm b/src/client/mac/crash_generation/InspectorMain.mm index 137c6a1e1..fb3199d3f 100644 --- a/src/client/mac/crash_generation/InspectorMain.mm +++ b/src/client/mac/crash_generation/InspectorMain.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/client_info.h b/src/client/mac/crash_generation/client_info.h index a3a95dcac..30870f179 100644 --- a/src/client/mac/crash_generation/client_info.h +++ b/src/client/mac/crash_generation/client_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/crash_generation_client.cc b/src/client/mac/crash_generation/crash_generation_client.cc index ceeb3b32a..32f1c827d 100644 --- a/src/client/mac/crash_generation/crash_generation_client.cc +++ b/src/client/mac/crash_generation/crash_generation_client.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/crash_generation_client.h b/src/client/mac/crash_generation/crash_generation_client.h index 527f577a5..06cc0a313 100644 --- a/src/client/mac/crash_generation/crash_generation_client.h +++ b/src/client/mac/crash_generation/crash_generation_client.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/crash_generation_server.cc b/src/client/mac/crash_generation/crash_generation_server.cc index ae44e8bf8..6bbd4bb50 100644 --- a/src/client/mac/crash_generation/crash_generation_server.cc +++ b/src/client/mac/crash_generation/crash_generation_server.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/crash_generation/crash_generation_server.h b/src/client/mac/crash_generation/crash_generation_server.h index 82fef146e..2c4b56cf5 100644 --- a/src/client/mac/crash_generation/crash_generation_server.h +++ b/src/client/mac/crash_generation/crash_generation_server.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/breakpad_nlist_64.h b/src/client/mac/handler/breakpad_nlist_64.h index a1a3e83c9..7093d2849 100644 --- a/src/client/mac/handler/breakpad_nlist_64.h +++ b/src/client/mac/handler/breakpad_nlist_64.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/dynamic_images.cc b/src/client/mac/handler/dynamic_images.cc index b78c20877..b1d2c464e 100644 --- a/src/client/mac/handler/dynamic_images.cc +++ b/src/client/mac/handler/dynamic_images.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/dynamic_images.h b/src/client/mac/handler/dynamic_images.h index 01f3a0e91..b5af75848 100644 --- a/src/client/mac/handler/dynamic_images.h +++ b/src/client/mac/handler/dynamic_images.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc index 287fe1bec..c091209fb 100644 --- a/src/client/mac/handler/exception_handler.cc +++ b/src/client/mac/handler/exception_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/exception_handler.h b/src/client/mac/handler/exception_handler.h index fe7491fd4..ec7ffe7e0 100644 --- a/src/client/mac/handler/exception_handler.h +++ b/src/client/mac/handler/exception_handler.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/mach_vm_compat.h b/src/client/mac/handler/mach_vm_compat.h index 9e9028b92..b7dc159b5 100644 --- a/src/client/mac/handler/mach_vm_compat.h +++ b/src/client/mac/handler/mach_vm_compat.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index 05d91b08e..3738416e5 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h index e3a271b0b..efddfa9af 100644 --- a/src/client/mac/handler/minidump_generator.h +++ b/src/client/mac/handler/minidump_generator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/protected_memory_allocator.cc b/src/client/mac/handler/protected_memory_allocator.cc index 6142ad124..833832636 100644 --- a/src/client/mac/handler/protected_memory_allocator.cc +++ b/src/client/mac/handler/protected_memory_allocator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/protected_memory_allocator.h b/src/client/mac/handler/protected_memory_allocator.h index 7e188db26..86413c879 100644 --- a/src/client/mac/handler/protected_memory_allocator.h +++ b/src/client/mac/handler/protected_memory_allocator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/handler/testcases/DynamicImagesTests.cc b/src/client/mac/handler/testcases/DynamicImagesTests.cc index 0a80e434c..14ea88d23 100644 --- a/src/client/mac/handler/testcases/DynamicImagesTests.cc +++ b/src/client/mac/handler/testcases/DynamicImagesTests.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 4/17/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // #include "client/mac/handler/testcases/DynamicImagesTests.h" diff --git a/src/client/mac/handler/testcases/DynamicImagesTests.h b/src/client/mac/handler/testcases/DynamicImagesTests.h index e1e79993b..f60ee69c6 100644 --- a/src/client/mac/handler/testcases/DynamicImagesTests.h +++ b/src/client/mac/handler/testcases/DynamicImagesTests.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 4/17/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // // diff --git a/src/client/mac/handler/testcases/breakpad_nlist_test.cc b/src/client/mac/handler/testcases/breakpad_nlist_test.cc index 2014b9078..a89d8c440 100644 --- a/src/client/mac/handler/testcases/breakpad_nlist_test.cc +++ b/src/client/mac/handler/testcases/breakpad_nlist_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 4/13/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // #include "client/mac/handler/testcases/breakpad_nlist_test.h" diff --git a/src/client/mac/handler/testcases/breakpad_nlist_test.h b/src/client/mac/handler/testcases/breakpad_nlist_test.h index ee8010c75..ca407ea8f 100644 --- a/src/client/mac/handler/testcases/breakpad_nlist_test.h +++ b/src/client/mac/handler/testcases/breakpad_nlist_test.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 4/13/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // // diff --git a/src/client/mac/handler/testcases/dwarftests.h b/src/client/mac/handler/testcases/dwarftests.h index 21ff7a44f..0c35374a3 100644 --- a/src/client/mac/handler/testcases/dwarftests.h +++ b/src/client/mac/handler/testcases/dwarftests.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 9/24/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // #import diff --git a/src/client/mac/handler/testcases/dwarftests.mm b/src/client/mac/handler/testcases/dwarftests.mm index 40c69aff2..c02a2d23e 100644 --- a/src/client/mac/handler/testcases/dwarftests.mm +++ b/src/client/mac/handler/testcases/dwarftests.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved +// Copyright 2008 Google LLC // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -10,7 +9,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -31,7 +30,7 @@ // minidump_test // // Created by Neal Sidhwaney on 9/24/08. -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2008 Google LLC // #import "dwarftests.h" diff --git a/src/client/mac/handler/ucontext_compat.h b/src/client/mac/handler/ucontext_compat.h index 1e4b752e5..853b1caa7 100644 --- a/src/client/mac/handler/ucontext_compat.h +++ b/src/client/mac/handler/ucontext_compat.h @@ -1,5 +1,4 @@ -// Copyright 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/sender/crash_report_sender.h b/src/client/mac/sender/crash_report_sender.h index 6a29d48a1..13379ceaa 100644 --- a/src/client/mac/sender/crash_report_sender.h +++ b/src/client/mac/sender/crash_report_sender.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/sender/crash_report_sender.m b/src/client/mac/sender/crash_report_sender.m index 88d26fb03..170fa07f6 100644 --- a/src/client/mac/sender/crash_report_sender.m +++ b/src/client/mac/sender/crash_report_sender.m @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/sender/uploader.h b/src/client/mac/sender/uploader.h index 0897dade0..4eba71633 100644 --- a/src/client/mac/sender/uploader.h +++ b/src/client/mac/sender/uploader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/sender/uploader.mm b/src/client/mac/sender/uploader.mm index 13b6130ad..f2bcd0b17 100644 --- a/src/client/mac/sender/uploader.mm +++ b/src/client/mac/sender/uploader.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/testapp/Controller.h b/src/client/mac/testapp/Controller.h index 7b3be2d69..36f9572aa 100644 --- a/src/client/mac/testapp/Controller.h +++ b/src/client/mac/testapp/Controller.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/testapp/Controller.m b/src/client/mac/testapp/Controller.m index 87c43024b..2de84f3f1 100644 --- a/src/client/mac/testapp/Controller.m +++ b/src/client/mac/testapp/Controller.m @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/testapp/TestClass.h b/src/client/mac/testapp/TestClass.h index 0a6d736d1..e20b0e877 100644 --- a/src/client/mac/testapp/TestClass.h +++ b/src/client/mac/testapp/TestClass.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/testapp/TestClass.mm b/src/client/mac/testapp/TestClass.mm index 6e6a8833d..ed0a7eca3 100644 --- a/src/client/mac/testapp/TestClass.mm +++ b/src/client/mac/testapp/TestClass.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/testapp/main.m b/src/client/mac/testapp/main.m index de6733269..af2cc1411 100644 --- a/src/client/mac/testapp/main.m +++ b/src/client/mac/testapp/main.m @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/BreakpadFramework_Test.mm b/src/client/mac/tests/BreakpadFramework_Test.mm index 2ea103c69..7a7013306 100644 --- a/src/client/mac/tests/BreakpadFramework_Test.mm +++ b/src/client/mac/tests/BreakpadFramework_Test.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/crash_generation_server_test.cc b/src/client/mac/tests/crash_generation_server_test.cc index 128f25c10..50825a938 100644 --- a/src/client/mac/tests/crash_generation_server_test.cc +++ b/src/client/mac/tests/crash_generation_server_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc index 50f03f81b..eb9aa1bcd 100644 --- a/src/client/mac/tests/exception_handler_test.cc +++ b/src/client/mac/tests/exception_handler_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/minidump_generator_test.cc b/src/client/mac/tests/minidump_generator_test.cc index 1f374657a..1a889dfec 100644 --- a/src/client/mac/tests/minidump_generator_test.cc +++ b/src/client/mac/tests/minidump_generator_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/minidump_generator_test_helper.cc b/src/client/mac/tests/minidump_generator_test_helper.cc index 4e8ce3cf0..93cbe1bba 100644 --- a/src/client/mac/tests/minidump_generator_test_helper.cc +++ b/src/client/mac/tests/minidump_generator_test_helper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/mac/tests/spawn_child_process.h b/src/client/mac/tests/spawn_child_process.h index e52ff6b65..cc8045116 100644 --- a/src/client/mac/tests/spawn_child_process.h +++ b/src/client/mac/tests/spawn_child_process.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/minidump_file_writer-inl.h b/src/client/minidump_file_writer-inl.h index bdac2dae8..d95f3554d 100644 --- a/src/client/minidump_file_writer-inl.h +++ b/src/client/minidump_file_writer-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc index 5c3c5cbb0..d5193e2c0 100644 --- a/src/client/minidump_file_writer.cc +++ b/src/client/minidump_file_writer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/minidump_file_writer.h b/src/client/minidump_file_writer.h index c66dc5912..253a93a97 100644 --- a/src/client/minidump_file_writer.h +++ b/src/client/minidump_file_writer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/minidump_file_writer_unittest.cc b/src/client/minidump_file_writer_unittest.cc index 16c407d2e..bb3a02693 100644 --- a/src/client/minidump_file_writer_unittest.cc +++ b/src/client/minidump_file_writer_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/Makefile b/src/client/solaris/handler/Makefile index 6da9464e6..b22fe5614 100644 --- a/src/client/solaris/handler/Makefile +++ b/src/client/solaris/handler/Makefile @@ -1,5 +1,4 @@ -# Copyright (c) 2007, Google Inc. -# All rights reserved. +# Copyright 2007 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/solaris/handler/exception_handler.cc b/src/client/solaris/handler/exception_handler.cc index c96683f6f..b7b702acf 100644 --- a/src/client/solaris/handler/exception_handler.cc +++ b/src/client/solaris/handler/exception_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/exception_handler.h b/src/client/solaris/handler/exception_handler.h index cd6c85ea1..04d140f02 100644 --- a/src/client/solaris/handler/exception_handler.h +++ b/src/client/solaris/handler/exception_handler.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/exception_handler_test.cc b/src/client/solaris/handler/exception_handler_test.cc index 4d2b33faf..a84f2df13 100644 --- a/src/client/solaris/handler/exception_handler_test.cc +++ b/src/client/solaris/handler/exception_handler_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/minidump_generator.cc b/src/client/solaris/handler/minidump_generator.cc index 81a535870..8f2f6ee25 100644 --- a/src/client/solaris/handler/minidump_generator.cc +++ b/src/client/solaris/handler/minidump_generator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/minidump_generator.h b/src/client/solaris/handler/minidump_generator.h index daa6fe015..7d2adbce5 100644 --- a/src/client/solaris/handler/minidump_generator.h +++ b/src/client/solaris/handler/minidump_generator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/minidump_test.cc b/src/client/solaris/handler/minidump_test.cc index 5f685ef24..00f8d9a5b 100644 --- a/src/client/solaris/handler/minidump_test.cc +++ b/src/client/solaris/handler/minidump_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/solaris_lwp.cc b/src/client/solaris/handler/solaris_lwp.cc index cb6cc8ab9..d707a5b31 100644 --- a/src/client/solaris/handler/solaris_lwp.cc +++ b/src/client/solaris/handler/solaris_lwp.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/solaris/handler/solaris_lwp.h b/src/client/solaris/handler/solaris_lwp.h index afe352ce6..f27d6b747 100644 --- a/src/client/solaris/handler/solaris_lwp.h +++ b/src/client/solaris/handler/solaris_lwp.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/breakpad_client.gyp b/src/client/windows/breakpad_client.gyp index 647975342..05e2da3a0 100644 --- a/src/client/windows/breakpad_client.gyp +++ b/src/client/windows/breakpad_client.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/common/auto_critical_section.h b/src/client/windows/common/auto_critical_section.h index 3fd4b9b7e..75ed4b9b0 100644 --- a/src/client/windows/common/auto_critical_section.h +++ b/src/client/windows/common/auto_critical_section.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/common/ipc_protocol.h b/src/client/windows/common/ipc_protocol.h index c74868198..7e0c24e3c 100644 --- a/src/client/windows/common/ipc_protocol.h +++ b/src/client/windows/common/ipc_protocol.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc index ed3126381..f0a4b9119 100644 --- a/src/client/windows/crash_generation/client_info.cc +++ b/src/client/windows/crash_generation/client_info.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/client_info.h b/src/client/windows/crash_generation/client_info.h index 6a8fba31f..1c9cd3c3e 100644 --- a/src/client/windows/crash_generation/client_info.h +++ b/src/client/windows/crash_generation/client_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/crash_generation.gyp b/src/client/windows/crash_generation/crash_generation.gyp index ba343768a..9b4c6eaaf 100644 --- a/src/client/windows/crash_generation/crash_generation.gyp +++ b/src/client/windows/crash_generation/crash_generation.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/crash_generation/crash_generation_client.cc b/src/client/windows/crash_generation/crash_generation_client.cc index 3ba5d4e4f..d6da09eb9 100644 --- a/src/client/windows/crash_generation/crash_generation_client.cc +++ b/src/client/windows/crash_generation/crash_generation_client.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/crash_generation_client.h b/src/client/windows/crash_generation/crash_generation_client.h index 457f73195..f912bf5f9 100644 --- a/src/client/windows/crash_generation/crash_generation_client.h +++ b/src/client/windows/crash_generation/crash_generation_client.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc index 0af213ba2..bf80ee9cf 100644 --- a/src/client/windows/crash_generation/crash_generation_server.cc +++ b/src/client/windows/crash_generation/crash_generation_server.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/crash_generation_server.h b/src/client/windows/crash_generation/crash_generation_server.h index 0ea90e510..74275a748 100644 --- a/src/client/windows/crash_generation/crash_generation_server.h +++ b/src/client/windows/crash_generation/crash_generation_server.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/minidump_generator.cc b/src/client/windows/crash_generation/minidump_generator.cc index b6e293700..523db27ae 100644 --- a/src/client/windows/crash_generation/minidump_generator.cc +++ b/src/client/windows/crash_generation/minidump_generator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/crash_generation/minidump_generator.h b/src/client/windows/crash_generation/minidump_generator.h index a707c0bb1..f960c5dc2 100644 --- a/src/client/windows/crash_generation/minidump_generator.h +++ b/src/client/windows/crash_generation/minidump_generator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc index 20d63a841..3b3938aa5 100644 --- a/src/client/windows/handler/exception_handler.cc +++ b/src/client/windows/handler/exception_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/handler/exception_handler.gyp b/src/client/windows/handler/exception_handler.gyp index c5733277d..b53a6cd45 100644 --- a/src/client/windows/handler/exception_handler.gyp +++ b/src/client/windows/handler/exception_handler.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h index eb5adaac5..963572bf3 100644 --- a/src/client/windows/handler/exception_handler.h +++ b/src/client/windows/handler/exception_handler.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/sender/crash_report_sender.cc b/src/client/windows/sender/crash_report_sender.cc index 7fc644839..27a7ec393 100644 --- a/src/client/windows/sender/crash_report_sender.cc +++ b/src/client/windows/sender/crash_report_sender.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/sender/crash_report_sender.gyp b/src/client/windows/sender/crash_report_sender.gyp index dc8583a0a..82f81a4cc 100644 --- a/src/client/windows/sender/crash_report_sender.gyp +++ b/src/client/windows/sender/crash_report_sender.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/sender/crash_report_sender.h b/src/client/windows/sender/crash_report_sender.h index e6055857c..758adbb4d 100644 --- a/src/client/windows/sender/crash_report_sender.h +++ b/src/client/windows/sender/crash_report_sender.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/tests/crash_generation_app/abstract_class.cc b/src/client/windows/tests/crash_generation_app/abstract_class.cc index 32f78f2b9..28b8ee14d 100644 --- a/src/client/windows/tests/crash_generation_app/abstract_class.cc +++ b/src/client/windows/tests/crash_generation_app/abstract_class.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/tests/crash_generation_app/abstract_class.h b/src/client/windows/tests/crash_generation_app/abstract_class.h index e3f2a4f37..c996a216c 100644 --- a/src/client/windows/tests/crash_generation_app/abstract_class.h +++ b/src/client/windows/tests/crash_generation_app/abstract_class.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc index 0d837e521..883afcc69 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp b/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp index 3ce307da0..3c27273f1 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.h b/src/client/windows/tests/crash_generation_app/crash_generation_app.h index 4d3bb6eb2..1d1deea4b 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.h +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/tests/crash_generation_app/resource.h b/src/client/windows/tests/crash_generation_app/resource.h index 8c7f6570a..e91208267 100644 --- a/src/client/windows/tests/crash_generation_app/resource.h +++ b/src/client/windows/tests/crash_generation_app/resource.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/client_tests.gyp b/src/client/windows/unittests/client_tests.gyp index 768f8fd8c..1e594515a 100644 --- a/src/client/windows/unittests/client_tests.gyp +++ b/src/client/windows/unittests/client_tests.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/client/windows/unittests/crash_generation_server_test.cc b/src/client/windows/unittests/crash_generation_server_test.cc index 09f2dd200..cd624f072 100644 --- a/src/client/windows/unittests/crash_generation_server_test.cc +++ b/src/client/windows/unittests/crash_generation_server_test.cc @@ -1,5 +1,4 @@ -// Copyright 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/dump_analysis.cc b/src/client/windows/unittests/dump_analysis.cc index 0bb8f6c46..24a33769c 100644 --- a/src/client/windows/unittests/dump_analysis.cc +++ b/src/client/windows/unittests/dump_analysis.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/dump_analysis.h b/src/client/windows/unittests/dump_analysis.h index 6cef48d81..f8acc268d 100644 --- a/src/client/windows/unittests/dump_analysis.h +++ b/src/client/windows/unittests/dump_analysis.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/exception_handler_death_test.cc b/src/client/windows/unittests/exception_handler_death_test.cc index 04034e8d4..a7679dd66 100644 --- a/src/client/windows/unittests/exception_handler_death_test.cc +++ b/src/client/windows/unittests/exception_handler_death_test.cc @@ -1,5 +1,4 @@ -// Copyright 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/exception_handler_nesting_test.cc b/src/client/windows/unittests/exception_handler_nesting_test.cc index e24bd18b6..81ae7dc7d 100644 --- a/src/client/windows/unittests/exception_handler_nesting_test.cc +++ b/src/client/windows/unittests/exception_handler_nesting_test.cc @@ -1,5 +1,4 @@ -// Copyright 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/exception_handler_test.cc b/src/client/windows/unittests/exception_handler_test.cc index 51196ca06..237af29dd 100644 --- a/src/client/windows/unittests/exception_handler_test.cc +++ b/src/client/windows/unittests/exception_handler_test.cc @@ -1,5 +1,4 @@ -// Copyright 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/exception_handler_test.h b/src/client/windows/unittests/exception_handler_test.h index ef973e539..9d4e44e41 100644 --- a/src/client/windows/unittests/exception_handler_test.h +++ b/src/client/windows/unittests/exception_handler_test.h @@ -1,5 +1,4 @@ -// Copyright 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/minidump_test.cc b/src/client/windows/unittests/minidump_test.cc index 82641125c..7bfc8d772 100644 --- a/src/client/windows/unittests/minidump_test.cc +++ b/src/client/windows/unittests/minidump_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/client/windows/unittests/testing.gyp b/src/client/windows/unittests/testing.gyp index 0f9f944c2..2d8d31a97 100644 --- a/src/client/windows/unittests/testing.gyp +++ b/src/client/windows/unittests/testing.gyp @@ -1,4 +1,4 @@ -# Copyright 2010 Google Inc. All rights reserved. +# Copyright 2010 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/common/android/include/elf.h b/src/common/android/include/elf.h index e6f0c672f..80e4c8355 100644 --- a/src/common/android/include/elf.h +++ b/src/common/android/include/elf.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/include/link.h b/src/common/android/include/link.h index 4324629df..02d2db26c 100644 --- a/src/common/android/include/link.h +++ b/src/common/android/include/link.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/include/stab.h b/src/common/android/include/stab.h index cd9290215..28882445a 100644 --- a/src/common/android/include/stab.h +++ b/src/common/android/include/stab.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/include/sys/procfs.h b/src/common/android/include/sys/procfs.h index 185124364..f7ff97743 100644 --- a/src/common/android/include/sys/procfs.h +++ b/src/common/android/include/sys/procfs.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/include/sys/user.h b/src/common/android/include/sys/user.h index 9c27ef022..021ec90d0 100644 --- a/src/common/android/include/sys/user.h +++ b/src/common/android/include/sys/user.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/testing/include/wchar.h b/src/common/android/testing/include/wchar.h index 85373fd2a..aa17c731f 100644 --- a/src/common/android/testing/include/wchar.h +++ b/src/common/android/testing/include/wchar.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/testing/mkdtemp.h b/src/common/android/testing/mkdtemp.h index b86e2cd78..f05cf653d 100644 --- a/src/common/android/testing/mkdtemp.h +++ b/src/common/android/testing/mkdtemp.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/android/testing/pthread_fixes.h b/src/common/android/testing/pthread_fixes.h index b0a3d82e4..04bf63691 100644 --- a/src/common/android/testing/pthread_fixes.h +++ b/src/common/android/testing/pthread_fixes.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/basictypes.h b/src/common/basictypes.h index 9426c1f6c..6458a8932 100644 --- a/src/common/basictypes.h +++ b/src/common/basictypes.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/byte_cursor.h b/src/common/byte_cursor.h index 28bb8e767..fd0e45ffd 100644 --- a/src/common/byte_cursor.h +++ b/src/common/byte_cursor.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/byte_cursor_unittest.cc b/src/common/byte_cursor_unittest.cc index 45e6f2b4b..00648f764 100644 --- a/src/common/byte_cursor_unittest.cc +++ b/src/common/byte_cursor_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/common.gyp b/src/common/common.gyp index 6fd769520..f5833b03f 100644 --- a/src/common/common.gyp +++ b/src/common/common.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/common/dwarf/bytereader-inl.h b/src/common/dwarf/bytereader-inl.h index dec20e6ff..210264840 100644 --- a/src/common/dwarf/bytereader-inl.h +++ b/src/common/dwarf/bytereader-inl.h @@ -1,4 +1,4 @@ -// Copyright 2006 Google Inc. All Rights Reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/bytereader.cc b/src/common/dwarf/bytereader.cc index ea3e4f6bc..46bed6d03 100644 --- a/src/common/dwarf/bytereader.cc +++ b/src/common/dwarf/bytereader.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/bytereader.h b/src/common/dwarf/bytereader.h index b0cac4331..761eaf688 100644 --- a/src/common/dwarf/bytereader.h +++ b/src/common/dwarf/bytereader.h @@ -1,6 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/bytereader_unittest.cc b/src/common/dwarf/bytereader_unittest.cc index 9a9464d89..c23c737be 100644 --- a/src/common/dwarf/bytereader_unittest.cc +++ b/src/common/dwarf/bytereader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/cfi_assembler.cc b/src/common/dwarf/cfi_assembler.cc index b8dc920fa..9ed979b41 100644 --- a/src/common/dwarf/cfi_assembler.cc +++ b/src/common/dwarf/cfi_assembler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/cfi_assembler.h b/src/common/dwarf/cfi_assembler.h index 6ee2557a7..a33d5d847 100644 --- a/src/common/dwarf/cfi_assembler.h +++ b/src/common/dwarf/cfi_assembler.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2diehandler.cc b/src/common/dwarf/dwarf2diehandler.cc index 1393c3d7d..ea3ac71c8 100644 --- a/src/common/dwarf/dwarf2diehandler.cc +++ b/src/common/dwarf/dwarf2diehandler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2diehandler.h b/src/common/dwarf/dwarf2diehandler.h index 5e568eb85..02c22853e 100644 --- a/src/common/dwarf/dwarf2diehandler.h +++ b/src/common/dwarf/dwarf2diehandler.h @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2diehandler_unittest.cc b/src/common/dwarf/dwarf2diehandler_unittest.cc index 164b34627..67c9489dc 100644 --- a/src/common/dwarf/dwarf2diehandler_unittest.cc +++ b/src/common/dwarf/dwarf2diehandler_unittest.cc @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2enums.h b/src/common/dwarf/dwarf2enums.h index 7d84f35e2..777d9bfca 100644 --- a/src/common/dwarf/dwarf2enums.h +++ b/src/common/dwarf/dwarf2enums.h @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index e3d360a3a..b191d78c5 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader.h b/src/common/dwarf/dwarf2reader.h index 0526ee721..ddcdd8011 100644 --- a/src/common/dwarf/dwarf2reader.h +++ b/src/common/dwarf/dwarf2reader.h @@ -1,6 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/src/common/dwarf/dwarf2reader_cfi_unittest.cc index 686ecb14c..dc4418c72 100644 --- a/src/common/dwarf/dwarf2reader_cfi_unittest.cc +++ b/src/common/dwarf/dwarf2reader_cfi_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader_die_unittest.cc b/src/common/dwarf/dwarf2reader_die_unittest.cc index 85eedeee5..fc639a64b 100644 --- a/src/common/dwarf/dwarf2reader_die_unittest.cc +++ b/src/common/dwarf/dwarf2reader_die_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc b/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc index 8c0a1f07f..033c63336 100644 --- a/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc +++ b/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc b/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc index a13faa140..9ceea1097 100644 --- a/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc +++ b/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/dwarf2reader_test_common.h b/src/common/dwarf/dwarf2reader_test_common.h index b84cff010..1c45d527a 100644 --- a/src/common/dwarf/dwarf2reader_test_common.h +++ b/src/common/dwarf/dwarf2reader_test_common.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 97572a39e..4f8b6030c 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -1,4 +1,4 @@ -// Copyright 2005 Google Inc. All Rights Reserved. +// Copyright 2005 Google LLC // Author: chatham@google.com (Andrew Chatham) // Author: satorux@google.com (Satoru Takabayashi) // diff --git a/src/common/dwarf/elf_reader.h b/src/common/dwarf/elf_reader.h index 13ac39beb..672969d81 100644 --- a/src/common/dwarf/elf_reader.h +++ b/src/common/dwarf/elf_reader.h @@ -1,4 +1,4 @@ -// Copyright 2005 Google Inc. All Rights Reserved. +// Copyright 2005 Google LLC // Author: chatham@google.com (Andrew Chatham) // Author: satorux@google.com (Satoru Takabayashi) // diff --git a/src/common/dwarf/functioninfo.cc b/src/common/dwarf/functioninfo.cc index 57f843bb0..d8fdb842d 100644 --- a/src/common/dwarf/functioninfo.cc +++ b/src/common/dwarf/functioninfo.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/functioninfo.h b/src/common/dwarf/functioninfo.h index a6f05af6e..1387c5ba4 100644 --- a/src/common/dwarf/functioninfo.h +++ b/src/common/dwarf/functioninfo.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/line_state_machine.h b/src/common/dwarf/line_state_machine.h index b0f3f4907..1797e3bc5 100644 --- a/src/common/dwarf/line_state_machine.h +++ b/src/common/dwarf/line_state_machine.h @@ -1,4 +1,4 @@ -// Copyright 2008 Google Inc. All Rights Reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf/types.h b/src/common/dwarf/types.h index 23412d0ea..b14d7a3ee 100644 --- a/src/common/dwarf/types.h +++ b/src/common/dwarf/types.h @@ -1,4 +1,4 @@ -// Copyright 2008 Google, Inc. All Rights reserved +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index 794bab530..e7e595e76 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index b6d5fceba..3b092654d 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cfi_to_module_unittest.cc b/src/common/dwarf_cfi_to_module_unittest.cc index 58c3cca3a..0b677b211 100644 --- a/src/common/dwarf_cfi_to_module_unittest.cc +++ b/src/common/dwarf_cfi_to_module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index bf78fda15..f5293de49 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index 2873101a9..f44be8ced 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index 2ec4cc975..f3fa49032 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc index 83bb8f155..e716d483c 100644 --- a/src/common/dwarf_line_to_module.cc +++ b/src/common/dwarf_line_to_module.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_line_to_module.h b/src/common/dwarf_line_to_module.h index da2c5f0ec..c93a9bf50 100644 --- a/src/common/dwarf_line_to_module.h +++ b/src/common/dwarf_line_to_module.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_line_to_module_unittest.cc b/src/common/dwarf_line_to_module_unittest.cc index 34cb02ed4..c4a02dfa2 100644 --- a/src/common/dwarf_line_to_module_unittest.cc +++ b/src/common/dwarf_line_to_module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_range_list_handler.cc b/src/common/dwarf_range_list_handler.cc index 3fecb5645..4d3dbd2eb 100644 --- a/src/common/dwarf_range_list_handler.cc +++ b/src/common/dwarf_range_list_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2018 Google Inc. -// All rights reserved. +// Copyright 2018 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/dwarf_range_list_handler.h b/src/common/dwarf_range_list_handler.h index 7344e6047..cb1b8b1e3 100644 --- a/src/common/dwarf_range_list_handler.h +++ b/src/common/dwarf_range_list_handler.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2018 Google Inc. -// All rights reserved. +// Copyright 2018 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/language.cc b/src/common/language.cc index 63b72a79c..0096a8d1e 100644 --- a/src/common/language.cc +++ b/src/common/language.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/language.h b/src/common/language.h index 892ea862e..9ce8f1a68 100644 --- a/src/common/language.h +++ b/src/common/language.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/breakpad_getcontext.S b/src/common/linux/breakpad_getcontext.S index 2ebcf3191..e261b302c 100644 --- a/src/common/linux/breakpad_getcontext.S +++ b/src/common/linux/breakpad_getcontext.S @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/breakpad_getcontext.h b/src/common/linux/breakpad_getcontext.h index 1418cde62..c553219f8 100644 --- a/src/common/linux/breakpad_getcontext.h +++ b/src/common/linux/breakpad_getcontext.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/breakpad_getcontext_unittest.cc b/src/common/linux/breakpad_getcontext_unittest.cc index a57bfedf9..9d869f7e5 100644 --- a/src/common/linux/breakpad_getcontext_unittest.cc +++ b/src/common/linux/breakpad_getcontext_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/crc32.cc b/src/common/linux/crc32.cc index 8df636ce4..c02f06c4f 100644 --- a/src/common/linux/crc32.cc +++ b/src/common/linux/crc32.cc @@ -1,5 +1,4 @@ -// Copyright 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/crc32.h b/src/common/linux/crc32.h index e3d9db92b..7df469992 100644 --- a/src/common/linux/crc32.h +++ b/src/common/linux/crc32.h @@ -1,5 +1,4 @@ -// Copyright 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 75a4ceed2..8ccbbbd10 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/dump_symbols.h b/src/common/linux/dump_symbols.h index b033ce00e..8ac169c9f 100644 --- a/src/common/linux/dump_symbols.h +++ b/src/common/linux/dump_symbols.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/dump_symbols_unittest.cc b/src/common/linux/dump_symbols_unittest.cc index 54c210962..4167ccc59 100644 --- a/src/common/linux/dump_symbols_unittest.cc +++ b/src/common/linux/dump_symbols_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/eintr_wrapper.h b/src/common/linux/eintr_wrapper.h index 3f1d18481..a8428a9d3 100644 --- a/src/common/linux/eintr_wrapper.h +++ b/src/common/linux/eintr_wrapper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_core_dump.cc b/src/common/linux/elf_core_dump.cc index f3206092b..f5ee30337 100644 --- a/src/common/linux/elf_core_dump.cc +++ b/src/common/linux/elf_core_dump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h index c8117a0e2..4f27179f4 100644 --- a/src/common/linux/elf_core_dump.h +++ b/src/common/linux/elf_core_dump.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc index 7854f31cc..6789dd84c 100644 --- a/src/common/linux/elf_core_dump_unittest.cc +++ b/src/common/linux/elf_core_dump_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_gnu_compat.h b/src/common/linux/elf_gnu_compat.h index 0a3dfedb5..5d56c1e99 100644 --- a/src/common/linux/elf_gnu_compat.h +++ b/src/common/linux/elf_gnu_compat.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc index 81e985a72..4aee38d6a 100644 --- a/src/common/linux/elf_symbols_to_module.cc +++ b/src/common/linux/elf_symbols_to_module.cc @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011 Google Inc. All Rights Reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_symbols_to_module.h b/src/common/linux/elf_symbols_to_module.h index 861f72529..ab27ef6b8 100644 --- a/src/common/linux/elf_symbols_to_module.h +++ b/src/common/linux/elf_symbols_to_module.h @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011 Google Inc. All Rights Reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elf_symbols_to_module_unittest.cc b/src/common/linux/elf_symbols_to_module_unittest.cc index 6a860701b..17eb670ff 100644 --- a/src/common/linux/elf_symbols_to_module_unittest.cc +++ b/src/common/linux/elf_symbols_to_module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elfutils-inl.h b/src/common/linux/elfutils-inl.h index e56b37a9f..5fcc9c445 100644 --- a/src/common/linux/elfutils-inl.h +++ b/src/common/linux/elfutils-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elfutils.cc b/src/common/linux/elfutils.cc index aa95357a3..a68cc0af3 100644 --- a/src/common/linux/elfutils.cc +++ b/src/common/linux/elfutils.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/elfutils.h b/src/common/linux/elfutils.h index ec5872a4f..d44d4762c 100644 --- a/src/common/linux/elfutils.h +++ b/src/common/linux/elfutils.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc index b483eb5c0..0bd2a759e 100644 --- a/src/common/linux/file_id.cc +++ b/src/common/linux/file_id.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/file_id.h b/src/common/linux/file_id.h index 8556a2e5a..8e58d56e2 100644 --- a/src/common/linux/file_id.h +++ b/src/common/linux/file_id.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index 43c9af7b5..74bf9e1b5 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/google_crashdump_uploader.cc b/src/common/linux/google_crashdump_uploader.cc index 814c4cae5..6242e6d23 100644 --- a/src/common/linux/google_crashdump_uploader.cc +++ b/src/common/linux/google_crashdump_uploader.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/google_crashdump_uploader.h b/src/common/linux/google_crashdump_uploader.h index 9358afd88..74b5e1be9 100644 --- a/src/common/linux/google_crashdump_uploader.h +++ b/src/common/linux/google_crashdump_uploader.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/google_crashdump_uploader_test.cc b/src/common/linux/google_crashdump_uploader_test.cc index e463f2c86..39aab65d0 100644 --- a/src/common/linux/google_crashdump_uploader_test.cc +++ b/src/common/linux/google_crashdump_uploader_test.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/guid_creator.cc b/src/common/linux/guid_creator.cc index 637406382..31a326c71 100644 --- a/src/common/linux/guid_creator.cc +++ b/src/common/linux/guid_creator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/guid_creator.h b/src/common/linux/guid_creator.h index c86d856c4..c02f55520 100644 --- a/src/common/linux/guid_creator.h +++ b/src/common/linux/guid_creator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc index ace12b84e..1b576ea60 100644 --- a/src/common/linux/http_upload.cc +++ b/src/common/linux/http_upload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/http_upload.h b/src/common/linux/http_upload.h index 13f3d56cc..b7e557a00 100644 --- a/src/common/linux/http_upload.h +++ b/src/common/linux/http_upload.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/ignore_ret.h b/src/common/linux/ignore_ret.h index efd274c20..1f879e8f4 100644 --- a/src/common/linux/ignore_ret.h +++ b/src/common/linux/ignore_ret.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc index fdb200f8e..096681614 100644 --- a/src/common/linux/libcurl_wrapper.cc +++ b/src/common/linux/libcurl_wrapper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h index 823f83c7e..f4a4dca40 100644 --- a/src/common/linux/libcurl_wrapper.h +++ b/src/common/linux/libcurl_wrapper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/linux_libc_support.cc b/src/common/linux/linux_libc_support.cc index dd2929626..10cbeaef1 100644 --- a/src/common/linux/linux_libc_support.cc +++ b/src/common/linux/linux_libc_support.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/linux_libc_support.h b/src/common/linux/linux_libc_support.h index ec5a8d6b6..05e2aa245 100644 --- a/src/common/linux/linux_libc_support.h +++ b/src/common/linux/linux_libc_support.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/linux_libc_support_unittest.cc b/src/common/linux/linux_libc_support_unittest.cc index adadfed44..449f995fc 100644 --- a/src/common/linux/linux_libc_support_unittest.cc +++ b/src/common/linux/linux_libc_support_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc index 99362945c..9c2c0ad2a 100644 --- a/src/common/linux/memory_mapped_file.cc +++ b/src/common/linux/memory_mapped_file.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/memory_mapped_file.h b/src/common/linux/memory_mapped_file.h index fa660cc91..d4a85051e 100644 --- a/src/common/linux/memory_mapped_file.h +++ b/src/common/linux/memory_mapped_file.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/memory_mapped_file_unittest.cc b/src/common/linux/memory_mapped_file_unittest.cc index fad59f40c..5ed677df8 100644 --- a/src/common/linux/memory_mapped_file_unittest.cc +++ b/src/common/linux/memory_mapped_file_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/safe_readlink.cc b/src/common/linux/safe_readlink.cc index 870c28af3..97ea62c03 100644 --- a/src/common/linux/safe_readlink.cc +++ b/src/common/linux/safe_readlink.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/safe_readlink.h b/src/common/linux/safe_readlink.h index 4ae131b58..f3aa9332b 100644 --- a/src/common/linux/safe_readlink.h +++ b/src/common/linux/safe_readlink.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/safe_readlink_unittest.cc b/src/common/linux/safe_readlink_unittest.cc index d346b2a80..6f5f9d753 100644 --- a/src/common/linux/safe_readlink_unittest.cc +++ b/src/common/linux/safe_readlink_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/symbol_collector_client.cc b/src/common/linux/symbol_collector_client.cc index 92b25ddba..1c1dc97a5 100644 --- a/src/common/linux/symbol_collector_client.cc +++ b/src/common/linux/symbol_collector_client.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2019 Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/symbol_collector_client.h b/src/common/linux/symbol_collector_client.h index 0e23242a2..6190376fc 100644 --- a/src/common/linux/symbol_collector_client.h +++ b/src/common/linux/symbol_collector_client.h @@ -1,5 +1,4 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/symbol_upload.cc b/src/common/linux/symbol_upload.cc index 1d5ff7196..c080533af 100644 --- a/src/common/linux/symbol_upload.cc +++ b/src/common/linux/symbol_upload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/symbol_upload.h b/src/common/linux/symbol_upload.h index 9033152bf..a9d30e7b7 100644 --- a/src/common/linux/symbol_upload.h +++ b/src/common/linux/symbol_upload.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/synth_elf.h b/src/common/linux/synth_elf.h index 90fa28c0d..bf22081b6 100644 --- a/src/common/linux/synth_elf.h +++ b/src/common/linux/synth_elf.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/synth_elf_unittest.cc b/src/common/linux/synth_elf_unittest.cc index fb3601e65..44ef6ef3b 100644 --- a/src/common/linux/synth_elf_unittest.cc +++ b/src/common/linux/synth_elf_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/tests/auto_testfile.h b/src/common/linux/tests/auto_testfile.h index 92fe017b9..e2d2ff23b 100644 --- a/src/common/linux/tests/auto_testfile.h +++ b/src/common/linux/tests/auto_testfile.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc index 976f5e456..0db0c4a24 100644 --- a/src/common/linux/tests/crash_generator.cc +++ b/src/common/linux/tests/crash_generator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/tests/crash_generator.h b/src/common/linux/tests/crash_generator.h index 6d1c2eae4..71c05d273 100644 --- a/src/common/linux/tests/crash_generator.h +++ b/src/common/linux/tests/crash_generator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/linux/ucontext_constants.h b/src/common/linux/ucontext_constants.h index c390508a1..4218bb232 100644 --- a/src/common/linux/ucontext_constants.h +++ b/src/common/linux/ucontext_constants.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/long_string_dictionary.cc b/src/common/long_string_dictionary.cc index 46bbf6137..f504aa429 100644 --- a/src/common/long_string_dictionary.cc +++ b/src/common/long_string_dictionary.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2017, Google Inc. -// All rights reserved. +// Copyright 2017 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/long_string_dictionary.h b/src/common/long_string_dictionary.h index 68bf03de2..9319b27f7 100644 --- a/src/common/long_string_dictionary.h +++ b/src/common/long_string_dictionary.h @@ -1,5 +1,4 @@ -// Copyright (c) 2017, Google Inc. -// All rights reserved. +// Copyright 2017 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/long_string_dictionary_unittest.cc b/src/common/long_string_dictionary_unittest.cc index f9b645ba7..be34efdfc 100644 --- a/src/common/long_string_dictionary_unittest.cc +++ b/src/common/long_string_dictionary_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2017, Google Inc. -// All rights reserved. +// Copyright 2017 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/Breakpad.xcconfig b/src/common/mac/Breakpad.xcconfig index f09136908..fd28d3cec 100644 --- a/src/common/mac/Breakpad.xcconfig +++ b/src/common/mac/Breakpad.xcconfig @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/BreakpadDebug.xcconfig b/src/common/mac/BreakpadDebug.xcconfig index 94cdd8cfc..6ec7c00eb 100644 --- a/src/common/mac/BreakpadDebug.xcconfig +++ b/src/common/mac/BreakpadDebug.xcconfig @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/BreakpadRelease.xcconfig b/src/common/mac/BreakpadRelease.xcconfig index 920f277db..9121b0d08 100644 --- a/src/common/mac/BreakpadRelease.xcconfig +++ b/src/common/mac/BreakpadRelease.xcconfig @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/GTMDefines.h b/src/common/mac/GTMDefines.h index 04fcf6d0c..ae5368cdf 100644 --- a/src/common/mac/GTMDefines.h +++ b/src/common/mac/GTMDefines.h @@ -1,7 +1,7 @@ // // GTMDefines.h // -// Copyright 2008 Google Inc. +// Copyright 2008 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy diff --git a/src/common/mac/GTMLogger.h b/src/common/mac/GTMLogger.h index c4fd14029..dcc7da441 100644 --- a/src/common/mac/GTMLogger.h +++ b/src/common/mac/GTMLogger.h @@ -1,7 +1,7 @@ // // GTMLogger.h // -// Copyright 2007-2008 Google Inc. +// Copyright 2007-2008 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy diff --git a/src/common/mac/GTMLogger.m b/src/common/mac/GTMLogger.m index ebc5836a2..17db83d6e 100644 --- a/src/common/mac/GTMLogger.m +++ b/src/common/mac/GTMLogger.m @@ -1,7 +1,7 @@ // // GTMLogger.m // -// Copyright 2007-2008 Google Inc. +// Copyright 2007-2008 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy diff --git a/src/common/mac/HTTPGetRequest.h b/src/common/mac/HTTPGetRequest.h index 3aa316b54..9c3cb3f92 100644 --- a/src/common/mac/HTTPGetRequest.h +++ b/src/common/mac/HTTPGetRequest.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPGetRequest.m b/src/common/mac/HTTPGetRequest.m index f9b7bf0ec..e151cfd8a 100644 --- a/src/common/mac/HTTPGetRequest.m +++ b/src/common/mac/HTTPGetRequest.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPMultipartUpload.h b/src/common/mac/HTTPMultipartUpload.h index 56d5394db..27b9cf861 100644 --- a/src/common/mac/HTTPMultipartUpload.h +++ b/src/common/mac/HTTPMultipartUpload.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m index 2aa64f791..b3a084a91 100644 --- a/src/common/mac/HTTPMultipartUpload.m +++ b/src/common/mac/HTTPMultipartUpload.m @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPPutRequest.h b/src/common/mac/HTTPPutRequest.h index 431ea6104..36d38c016 100644 --- a/src/common/mac/HTTPPutRequest.h +++ b/src/common/mac/HTTPPutRequest.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPPutRequest.m b/src/common/mac/HTTPPutRequest.m index f6f1400a7..b7c7e091d 100644 --- a/src/common/mac/HTTPPutRequest.m +++ b/src/common/mac/HTTPPutRequest.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPRequest.h b/src/common/mac/HTTPRequest.h index b78fad6ba..493741473 100644 --- a/src/common/mac/HTTPRequest.h +++ b/src/common/mac/HTTPRequest.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPRequest.m b/src/common/mac/HTTPRequest.m index 925ab582b..af21874d1 100644 --- a/src/common/mac/HTTPRequest.m +++ b/src/common/mac/HTTPRequest.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPSimplePostRequest.h b/src/common/mac/HTTPSimplePostRequest.h index bfabfead6..01a1e8688 100644 --- a/src/common/mac/HTTPSimplePostRequest.h +++ b/src/common/mac/HTTPSimplePostRequest.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/HTTPSimplePostRequest.m b/src/common/mac/HTTPSimplePostRequest.m index 4cb3ef159..7aba94fdd 100644 --- a/src/common/mac/HTTPSimplePostRequest.m +++ b/src/common/mac/HTTPSimplePostRequest.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/MachIPC.h b/src/common/mac/MachIPC.h index a3fae5a14..78b97ad96 100644 --- a/src/common/mac/MachIPC.h +++ b/src/common/mac/MachIPC.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/MachIPC.mm b/src/common/mac/MachIPC.mm index b41a825d4..62e0f6b59 100644 --- a/src/common/mac/MachIPC.mm +++ b/src/common/mac/MachIPC.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/SymbolCollectorClient.h b/src/common/mac/SymbolCollectorClient.h index 8848cca6a..367753a4a 100644 --- a/src/common/mac/SymbolCollectorClient.h +++ b/src/common/mac/SymbolCollectorClient.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/SymbolCollectorClient.m b/src/common/mac/SymbolCollectorClient.m index 5465056dd..fd33432b7 100644 --- a/src/common/mac/SymbolCollectorClient.m +++ b/src/common/mac/SymbolCollectorClient.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index 6d06e6bd0..392efe786 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/arch_utilities.h b/src/common/mac/arch_utilities.h index 397c1f587..d267c43b8 100644 --- a/src/common/mac/arch_utilities.h +++ b/src/common/mac/arch_utilities.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/bootstrap_compat.cc b/src/common/mac/bootstrap_compat.cc index d875d95b5..6647bae36 100644 --- a/src/common/mac/bootstrap_compat.cc +++ b/src/common/mac/bootstrap_compat.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/bootstrap_compat.h b/src/common/mac/bootstrap_compat.h index 8ca7357c3..b57d90700 100644 --- a/src/common/mac/bootstrap_compat.h +++ b/src/common/mac/bootstrap_compat.h @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/byteswap.h b/src/common/mac/byteswap.h index b7bbc0b95..c4c7e6178 100644 --- a/src/common/mac/byteswap.h +++ b/src/common/mac/byteswap.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index ed5e65f9b..c7afb2152 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index 34ba14bc0..d097cfa55 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/encoding_util.h b/src/common/mac/encoding_util.h index 6495a7427..3028f2e9d 100644 --- a/src/common/mac/encoding_util.h +++ b/src/common/mac/encoding_util.h @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/encoding_util.m b/src/common/mac/encoding_util.m index 86d70fb6e..5cf84fc5d 100644 --- a/src/common/mac/encoding_util.m +++ b/src/common/mac/encoding_util.m @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc index 9ed65e5c8..a6c1d26f6 100644 --- a/src/common/mac/file_id.cc +++ b/src/common/mac/file_id.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/file_id.h b/src/common/mac/file_id.h index fc1821e7f..a14cd1377 100644 --- a/src/common/mac/file_id.h +++ b/src/common/mac/file_id.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/launch_reporter.cc b/src/common/mac/launch_reporter.cc index 245be8265..de554ee3a 100644 --- a/src/common/mac/launch_reporter.cc +++ b/src/common/mac/launch_reporter.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/launch_reporter.h b/src/common/mac/launch_reporter.h index 4531123c2..0cf73547c 100644 --- a/src/common/mac/launch_reporter.h +++ b/src/common/mac/launch_reporter.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc index 9b7ca24f3..e67ccddb7 100644 --- a/src/common/mac/macho_id.cc +++ b/src/common/mac/macho_id.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_id.h b/src/common/mac/macho_id.h index 0262697d4..b9cbdb00b 100644 --- a/src/common/mac/macho_id.h +++ b/src/common/mac/macho_id.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_reader.cc b/src/common/mac/macho_reader.cc index e89e0906f..23c809c48 100644 --- a/src/common/mac/macho_reader.cc +++ b/src/common/mac/macho_reader.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_reader.h b/src/common/mac/macho_reader.h index 02762c55c..d3c61a06a 100644 --- a/src/common/mac/macho_reader.h +++ b/src/common/mac/macho_reader.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_reader_unittest.cc b/src/common/mac/macho_reader_unittest.cc index fb2c479cc..3beec341f 100644 --- a/src/common/mac/macho_reader_unittest.cc +++ b/src/common/mac/macho_reader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_utilities.cc b/src/common/mac/macho_utilities.cc index f56fe768c..16e430df9 100644 --- a/src/common/mac/macho_utilities.cc +++ b/src/common/mac/macho_utilities.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_utilities.h b/src/common/mac/macho_utilities.h index 00563a77c..470cb5d22 100644 --- a/src/common/mac/macho_utilities.h +++ b/src/common/mac/macho_utilities.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc index a42128b80..505a4df1d 100644 --- a/src/common/mac/macho_walker.cc +++ b/src/common/mac/macho_walker.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/macho_walker.h b/src/common/mac/macho_walker.h index 168f30e64..13e8232e9 100644 --- a/src/common/mac/macho_walker.h +++ b/src/common/mac/macho_walker.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/minidump_upload.m b/src/common/mac/minidump_upload.m index 1fe4f213f..d8e2b24a6 100644 --- a/src/common/mac/minidump_upload.m +++ b/src/common/mac/minidump_upload.m @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/scoped_task_suspend-inl.h b/src/common/mac/scoped_task_suspend-inl.h index d6d1bef97..a4957d7a7 100644 --- a/src/common/mac/scoped_task_suspend-inl.h +++ b/src/common/mac/scoped_task_suspend-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/string_utilities.cc b/src/common/mac/string_utilities.cc index cb1554037..861029d4e 100644 --- a/src/common/mac/string_utilities.cc +++ b/src/common/mac/string_utilities.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/string_utilities.h b/src/common/mac/string_utilities.h index e87304c18..de282a941 100644 --- a/src/common/mac/string_utilities.h +++ b/src/common/mac/string_utilities.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/super_fat_arch.h b/src/common/mac/super_fat_arch.h index d7fa018ae..046fe166a 100644 --- a/src/common/mac/super_fat_arch.h +++ b/src/common/mac/super_fat_arch.h @@ -1,5 +1,4 @@ -// Copyright (c) 2015, Google Inc. -// All rights reserved. +// Copyright 2015 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/mac/testing/GTMSenTestCase.h b/src/common/mac/testing/GTMSenTestCase.h index ce3d9022c..cfef3ef14 100644 --- a/src/common/mac/testing/GTMSenTestCase.h +++ b/src/common/mac/testing/GTMSenTestCase.h @@ -1,7 +1,7 @@ // // GTMSenTestCase.h // -// Copyright 2007-2008 Google Inc. +// Copyright 2007-2008 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy diff --git a/src/common/mac/testing/GTMSenTestCase.m b/src/common/mac/testing/GTMSenTestCase.m index 162f01e97..eb9351bf3 100644 --- a/src/common/mac/testing/GTMSenTestCase.m +++ b/src/common/mac/testing/GTMSenTestCase.m @@ -1,7 +1,7 @@ // // GTMSenTestCase.m // -// Copyright 2007-2008 Google Inc. +// Copyright 2007-2008 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy diff --git a/src/common/macros.h b/src/common/macros.h index 14bb3f7bd..828d49d1a 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -1,5 +1,4 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/md5.h b/src/common/md5.h index 1b478feaf..9d1f59b52 100644 --- a/src/common/md5.h +++ b/src/common/md5.h @@ -1,4 +1,4 @@ -// Copyright 2007 Google Inc. All Rights Reserved. +// Copyright 2007 Google LLC // Author: liuli@google.com (Liu Li) #ifndef COMMON_MD5_H__ #define COMMON_MD5_H__ diff --git a/src/common/memory_allocator.h b/src/common/memory_allocator.h index d28fbfc36..1c99913ad 100644 --- a/src/common/memory_allocator.h +++ b/src/common/memory_allocator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/memory_allocator_unittest.cc b/src/common/memory_allocator_unittest.cc index 5803b90d5..6ca625bb5 100644 --- a/src/common/memory_allocator_unittest.cc +++ b/src/common/memory_allocator_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/memory_range.h b/src/common/memory_range.h index 41dd2da62..e2ab61d5a 100644 --- a/src/common/memory_range.h +++ b/src/common/memory_range.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/memory_range_unittest.cc b/src/common/memory_range_unittest.cc index f6cf8c8b2..f112e7616 100644 --- a/src/common/memory_range_unittest.cc +++ b/src/common/memory_range_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/minidump_type_helper.h b/src/common/minidump_type_helper.h index 5a7d5a6a8..04bafe7e0 100644 --- a/src/common/minidump_type_helper.h +++ b/src/common/minidump_type_helper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/module.cc b/src/common/module.cc index 13c229eb4..73c5f723e 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011 Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/module.h b/src/common/module.h index 01ecfa8aa..05bdbfb72 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index eba24e667..de52ceffa 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/path_helper.cc b/src/common/path_helper.cc index 61a6e3184..e51a1b681 100644 --- a/src/common/path_helper.cc +++ b/src/common/path_helper.cc @@ -1,5 +1,4 @@ -// Copyright 2017, Google Inc. -// All rights reserved. +// Copyright 2017 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/path_helper.h b/src/common/path_helper.h index 2166ba018..0c026c250 100644 --- a/src/common/path_helper.h +++ b/src/common/path_helper.h @@ -1,5 +1,4 @@ -// Copyright 2017, Google Inc. -// All rights reserved. +// Copyright 2017 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/safe_math.h b/src/common/safe_math.h index 879e2878b..3eab0d21f 100644 --- a/src/common/safe_math.h +++ b/src/common/safe_math.h @@ -1,5 +1,4 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. +// Copyright 2022 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/safe_math_unittest.cc b/src/common/safe_math_unittest.cc index 417d96d4c..1908155d4 100644 --- a/src/common/safe_math_unittest.cc +++ b/src/common/safe_math_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2022 Google Inc. -// All rights reserved. +// Copyright 2022 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/scoped_ptr.h b/src/common/scoped_ptr.h index d137c1868..d11101782 100644 --- a/src/common/scoped_ptr.h +++ b/src/common/scoped_ptr.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/simple_string_dictionary.cc b/src/common/simple_string_dictionary.cc index e0a74ceeb..682888978 100644 --- a/src/common/simple_string_dictionary.cc +++ b/src/common/simple_string_dictionary.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/simple_string_dictionary.h b/src/common/simple_string_dictionary.h index 948492053..f7253a34e 100644 --- a/src/common/simple_string_dictionary.h +++ b/src/common/simple_string_dictionary.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/simple_string_dictionary_unittest.cc b/src/common/simple_string_dictionary_unittest.cc index e7b8fd763..4f3f1f5c3 100644 --- a/src/common/simple_string_dictionary_unittest.cc +++ b/src/common/simple_string_dictionary_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/dump_symbols.cc b/src/common/solaris/dump_symbols.cc index 93aeed243..8277fd661 100644 --- a/src/common/solaris/dump_symbols.cc +++ b/src/common/solaris/dump_symbols.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/dump_symbols.h b/src/common/solaris/dump_symbols.h index 3bca8a235..9c986e4cc 100644 --- a/src/common/solaris/dump_symbols.h +++ b/src/common/solaris/dump_symbols.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/file_id.cc b/src/common/solaris/file_id.cc index 837793c86..53d205b67 100644 --- a/src/common/solaris/file_id.cc +++ b/src/common/solaris/file_id.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/file_id.h b/src/common/solaris/file_id.h index cacf17a96..2e41f0ae6 100644 --- a/src/common/solaris/file_id.h +++ b/src/common/solaris/file_id.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/guid_creator.cc b/src/common/solaris/guid_creator.cc index 17d773e72..4802f5a74 100644 --- a/src/common/solaris/guid_creator.cc +++ b/src/common/solaris/guid_creator.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/guid_creator.h b/src/common/solaris/guid_creator.h index 4aee3a1c2..91ed00419 100644 --- a/src/common/solaris/guid_creator.h +++ b/src/common/solaris/guid_creator.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/solaris/message_output.h b/src/common/solaris/message_output.h index 3e3b1d465..9810dc571 100644 --- a/src/common/solaris/message_output.h +++ b/src/common/solaris/message_output.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_reader.cc b/src/common/stabs_reader.cc index 43c404029..30118830a 100644 --- a/src/common/stabs_reader.cc +++ b/src/common/stabs_reader.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_reader.h b/src/common/stabs_reader.h index 1e773f45d..3f5f0a8f2 100644 --- a/src/common/stabs_reader.h +++ b/src/common/stabs_reader.h @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_reader_unittest.cc b/src/common/stabs_reader_unittest.cc index 24f3e1a57..79888815e 100644 --- a/src/common/stabs_reader_unittest.cc +++ b/src/common/stabs_reader_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index d8209eb5f..6cdb96a27 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_to_module.h b/src/common/stabs_to_module.h index 6f6e0ed7f..99c61b0c9 100644 --- a/src/common/stabs_to_module.h +++ b/src/common/stabs_to_module.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc index d265f4dc4..252724825 100644 --- a/src/common/stabs_to_module_unittest.cc +++ b/src/common/stabs_to_module_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/stdio_wrapper.h b/src/common/stdio_wrapper.h index a3dd50aab..32093bd4b 100644 --- a/src/common/stdio_wrapper.h +++ b/src/common/stdio_wrapper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2016, Google Inc. -// All rights reserved. +// Copyright 2016 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc index 6a78ed7e4..213d6ed7c 100644 --- a/src/common/string_conversion.cc +++ b/src/common/string_conversion.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/string_conversion.h b/src/common/string_conversion.h index 02d1486aa..c5f5a3576 100644 --- a/src/common/string_conversion.h +++ b/src/common/string_conversion.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/string_conversion_unittest.cc b/src/common/string_conversion_unittest.cc index e9f9b55d9..2e64a9576 100644 --- a/src/common/string_conversion_unittest.cc +++ b/src/common/string_conversion_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/string_view.h b/src/common/string_view.h index aa01db8bc..a8e15922d 100644 --- a/src/common/string_view.h +++ b/src/common/string_view.h @@ -1,5 +1,4 @@ -// Copyright (c) 2021 Google Inc. -// All rights reserved. +// Copyright 2021 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/symbol_data.h b/src/common/symbol_data.h index a790974bc..19d6f3dd2 100644 --- a/src/common/symbol_data.h +++ b/src/common/symbol_data.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/test_assembler.cc b/src/common/test_assembler.cc index 8a48bfb0b..918996638 100644 --- a/src/common/test_assembler.cc +++ b/src/common/test_assembler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/test_assembler.h b/src/common/test_assembler.h index 125ef4503..809c7b21d 100644 --- a/src/common/test_assembler.h +++ b/src/common/test_assembler.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/test_assembler_unittest.cc b/src/common/test_assembler_unittest.cc index bda25ebfc..f16594f1d 100644 --- a/src/common/test_assembler_unittest.cc +++ b/src/common/test_assembler_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/tests/auto_tempdir.h b/src/common/tests/auto_tempdir.h index 1df88db8b..963c2dcf4 100644 --- a/src/common/tests/auto_tempdir.h +++ b/src/common/tests/auto_tempdir.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/tests/file_utils.cc b/src/common/tests/file_utils.cc index c1cbb39cc..814b2094f 100644 --- a/src/common/tests/file_utils.cc +++ b/src/common/tests/file_utils.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/tests/file_utils.h b/src/common/tests/file_utils.h index 3d1a9c6fa..b96029d0e 100644 --- a/src/common/tests/file_utils.h +++ b/src/common/tests/file_utils.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/unordered.h b/src/common/unordered.h index 0be7f48f6..7606f1701 100644 --- a/src/common/unordered.h +++ b/src/common/unordered.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/using_std_string.h b/src/common/using_std_string.h index f0e1aed90..0f11db7bd 100644 --- a/src/common/using_std_string.h +++ b/src/common/using_std_string.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/common_windows.gyp b/src/common/windows/common_windows.gyp index 5f7594b16..e2f07a5f7 100644 --- a/src/common/windows/common_windows.gyp +++ b/src/common/windows/common_windows.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 Google Inc. All rights reserved. +# Copyright 2013 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/common/windows/dia_util.cc b/src/common/windows/dia_util.cc index ed8cb5b65..dcfe0ef97 100644 --- a/src/common/windows/dia_util.cc +++ b/src/common/windows/dia_util.cc @@ -1,92 +1,92 @@ -// Copyright 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "common/windows/dia_util.h" - -#include - -namespace google_breakpad { - -bool FindDebugStream(const wchar_t* name, - IDiaSession* session, - IDiaEnumDebugStreamData** debug_stream) { - CComPtr enum_debug_streams; - if (FAILED(session->getEnumDebugStreams(&enum_debug_streams))) { - fprintf(stderr, "IDiaSession::getEnumDebugStreams failed\n"); - return false; - } - - CComPtr temp_debug_stream; - ULONG fetched = 0; - while (SUCCEEDED(enum_debug_streams->Next(1, &temp_debug_stream, &fetched)) && - fetched == 1) { - CComBSTR stream_name; - if (FAILED(temp_debug_stream->get_name(&stream_name))) { - fprintf(stderr, "IDiaEnumDebugStreamData::get_name failed\n"); - return false; - } - - // Found the stream? - if (wcsncmp((LPWSTR)stream_name, name, stream_name.Length()) == 0) { - *debug_stream = temp_debug_stream.Detach(); - return true; - } - - temp_debug_stream.Release(); - } - - // No table was found. - return false; -} - -bool FindTable(REFIID iid, IDiaSession* session, void** table) { - // Get the table enumerator. - CComPtr enum_tables; - if (FAILED(session->getEnumTables(&enum_tables))) { - fprintf(stderr, "IDiaSession::getEnumTables failed\n"); - return false; - } - - // Iterate through the tables. - CComPtr temp_table; - ULONG fetched = 0; - while (SUCCEEDED(enum_tables->Next(1, &temp_table, &fetched)) && - fetched == 1) { - void* temp = NULL; - if (SUCCEEDED(temp_table->QueryInterface(iid, &temp))) { - *table = temp; - return true; - } - temp_table.Release(); - } - - // The table was not found. - return false; -} - +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/windows/dia_util.h" + +#include + +namespace google_breakpad { + +bool FindDebugStream(const wchar_t* name, + IDiaSession* session, + IDiaEnumDebugStreamData** debug_stream) { + CComPtr enum_debug_streams; + if (FAILED(session->getEnumDebugStreams(&enum_debug_streams))) { + fprintf(stderr, "IDiaSession::getEnumDebugStreams failed\n"); + return false; + } + + CComPtr temp_debug_stream; + ULONG fetched = 0; + while (SUCCEEDED(enum_debug_streams->Next(1, &temp_debug_stream, &fetched)) && + fetched == 1) { + CComBSTR stream_name; + if (FAILED(temp_debug_stream->get_name(&stream_name))) { + fprintf(stderr, "IDiaEnumDebugStreamData::get_name failed\n"); + return false; + } + + // Found the stream? + if (wcsncmp((LPWSTR)stream_name, name, stream_name.Length()) == 0) { + *debug_stream = temp_debug_stream.Detach(); + return true; + } + + temp_debug_stream.Release(); + } + + // No table was found. + return false; +} + +bool FindTable(REFIID iid, IDiaSession* session, void** table) { + // Get the table enumerator. + CComPtr enum_tables; + if (FAILED(session->getEnumTables(&enum_tables))) { + fprintf(stderr, "IDiaSession::getEnumTables failed\n"); + return false; + } + + // Iterate through the tables. + CComPtr temp_table; + ULONG fetched = 0; + while (SUCCEEDED(enum_tables->Next(1, &temp_table, &fetched)) && + fetched == 1) { + void* temp = NULL; + if (SUCCEEDED(temp_table->QueryInterface(iid, &temp))) { + *table = temp; + return true; + } + temp_table.Release(); + } + + // The table was not found. + return false; +} + } // namespace google_breakpad \ No newline at end of file diff --git a/src/common/windows/dia_util.h b/src/common/windows/dia_util.h index b9e0df2d5..16ed8380a 100644 --- a/src/common/windows/dia_util.h +++ b/src/common/windows/dia_util.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/guid_string.cc b/src/common/windows/guid_string.cc index b7f877e66..be9eb8a39 100644 --- a/src/common/windows/guid_string.cc +++ b/src/common/windows/guid_string.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/guid_string.h b/src/common/windows/guid_string.h index 48a5c1d37..ee3d10066 100644 --- a/src/common/windows/guid_string.h +++ b/src/common/windows/guid_string.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index 2d92fba96..093cd71d6 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/http_upload.h b/src/common/windows/http_upload.h index c7d8c6fec..e117840e9 100644 --- a/src/common/windows/http_upload.h +++ b/src/common/windows/http_upload.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/module_info.h b/src/common/windows/module_info.h index 3dccc8088..ade32c11c 100644 --- a/src/common/windows/module_info.h +++ b/src/common/windows/module_info.h @@ -1,75 +1,74 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef COMMON_WINDOWS_MODULE_INFO_H_ -#define COMMON_WINDOWS_MODULE_INFO_H_ - -#include - -namespace google_breakpad { - -using std::wstring; -// A structure that carries information that identifies a module. -struct PDBModuleInfo { -public: - // The basename of the pe/pdb file from which information was loaded. - wstring debug_file; - - // The module's identifier. For recent pe/pdb files, the identifier consists - // of the pe/pdb's guid, in uppercase hexadecimal form without any dashes - // or separators, followed immediately by the pe/pdb's age, also in - // uppercase hexadecimal form. For older pe/pdb files which have no guid, - // the identifier is the pe/pdb's 32-bit signature value, in zero-padded - // hexadecimal form, followed immediately by the pe/pdb's age, in lowercase - // hexadecimal form. - wstring debug_identifier; - - // A string identifying the cpu that the pe/pdb is associated with. - // Currently, this may be "x86" or "unknown". - wstring cpu; -}; - -// A structure that carries information that identifies a PE file, -// either an EXE or a DLL. -struct PEModuleInfo { - // The basename of the PE file. - wstring code_file; - - // The PE file's code identifier, which consists of its timestamp - // and file size concatenated together into a single hex string. - // (The fields IMAGE_OPTIONAL_HEADER::SizeOfImage and - // IMAGE_FILE_HEADER::TimeDateStamp, as defined in the ImageHlp - // documentation.) This is not well documented, if it's documented - // at all, but it's what symstore does and what DbgHelp supports. - wstring code_identifier; -}; - -} // namespace google_breakpad - -#endif // COMMON_WINDOWS_MODULE_INFO_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_WINDOWS_MODULE_INFO_H_ +#define COMMON_WINDOWS_MODULE_INFO_H_ + +#include + +namespace google_breakpad { + +using std::wstring; +// A structure that carries information that identifies a module. +struct PDBModuleInfo { +public: + // The basename of the pe/pdb file from which information was loaded. + wstring debug_file; + + // The module's identifier. For recent pe/pdb files, the identifier consists + // of the pe/pdb's guid, in uppercase hexadecimal form without any dashes + // or separators, followed immediately by the pe/pdb's age, also in + // uppercase hexadecimal form. For older pe/pdb files which have no guid, + // the identifier is the pe/pdb's 32-bit signature value, in zero-padded + // hexadecimal form, followed immediately by the pe/pdb's age, in lowercase + // hexadecimal form. + wstring debug_identifier; + + // A string identifying the cpu that the pe/pdb is associated with. + // Currently, this may be "x86" or "unknown". + wstring cpu; +}; + +// A structure that carries information that identifies a PE file, +// either an EXE or a DLL. +struct PEModuleInfo { + // The basename of the PE file. + wstring code_file; + + // The PE file's code identifier, which consists of its timestamp + // and file size concatenated together into a single hex string. + // (The fields IMAGE_OPTIONAL_HEADER::SizeOfImage and + // IMAGE_FILE_HEADER::TimeDateStamp, as defined in the ImageHlp + // documentation.) This is not well documented, if it's documented + // at all, but it's what symstore does and what DbgHelp supports. + wstring code_identifier; +}; + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_MODULE_INFO_H_ diff --git a/src/common/windows/omap.cc b/src/common/windows/omap.cc index 5a821b64f..ad9169974 100644 --- a/src/common/windows/omap.cc +++ b/src/common/windows/omap.cc @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/omap.h b/src/common/windows/omap.h index bc293afb5..51601fa91 100644 --- a/src/common/windows/omap.h +++ b/src/common/windows/omap.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/omap_internal.h b/src/common/windows/omap_internal.h index 2a4713d93..cd20d9fb8 100644 --- a/src/common/windows/omap_internal.h +++ b/src/common/windows/omap_internal.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/omap_unittest.cc b/src/common/windows/omap_unittest.cc index 7fe66bd40..841e53910 100644 --- a/src/common/windows/omap_unittest.cc +++ b/src/common/windows/omap_unittest.cc @@ -1,329 +1,329 @@ -// Copyright 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Unittests for OMAP related functions. - -#include "common/windows/omap.h" - -#include "breakpad_googletest_includes.h" - -namespace google_breakpad { - -// Equality operators for ContainerEq. These must be outside of the anonymous -// namespace in order for them to be found. -bool operator==(const MappedRange& mr1, const MappedRange& mr2) { - return mr1.rva_original == mr2.rva_original && - mr1.rva_transformed == mr2.rva_transformed && - mr1.length == mr2.length && - mr1.injected == mr2.injected && - mr1.removed == mr2.removed; -} -bool operator==(const EndpointIndex& ei1, const EndpointIndex& ei2) { - return ei1.endpoint == ei2.endpoint && ei1.index == ei2.index; -} - -// Pretty printers for more meaningful error messages. Also need to be outside -// the anonymous namespace. -std::ostream& operator<<(std::ostream& os, const MappedRange& mr) { - os << "MappedRange(rva_original=" << mr.rva_original - << ", rva_transformed=" << mr.rva_transformed - << ", length=" << mr.length - << ", injected=" << mr.injected - << ", removed=" << mr.removed << ")"; - return os; -} -std::ostream& operator<<(std::ostream& os, const EndpointIndex& ei) { - os << "EndpointIndex(endpoint=" << ei.endpoint - << ", index=" << ei.index << ")"; - return os; -} -std::ostream& operator<<(std::ostream& os, const AddressRange& ar) { - os << "AddressRange(rva=" << ar.rva << ", length=" << ar.length << ")"; - return os; -} - -namespace { - -OMAP CreateOmap(DWORD rva, DWORD rvaTo) { - OMAP o = { rva, rvaTo }; - return o; -} - -MappedRange CreateMappedRange(DWORD rva_original, - DWORD rva_transformed, - DWORD length, - DWORD injected, - DWORD removed) { - MappedRange mr = { rva_original, rva_transformed, length, injected, removed }; - return mr; -} - -EndpointIndex CreateEndpointIndex(DWORD endpoint, size_t index) { - EndpointIndex ei = { endpoint, index }; - return ei; -} - -// (C is removed) -// Original : A B C D E F G H -// Transformed: A B D F E * H1 G1 G2 H2 -// (* is injected, G is copied, H is split) -// A is implied. - -// Layout of the original image. -const AddressRange B(100, 15); -const AddressRange C(B.end(), 10); -const AddressRange D(C.end(), 25); -const AddressRange E(D.end(), 10); -const AddressRange F(E.end(), 40); -const AddressRange G(F.end(), 3); -const AddressRange H(G.end(), 7); - -// Layout of the transformed image. -const AddressRange Bt(100, 15); -const AddressRange Dt(Bt.end(), 20); // D is shortened. -const AddressRange Ft(Dt.end(), F.length); -const AddressRange Et(Ft.end(), E.length); -const AddressRange injected(Et.end(), 5); -const AddressRange H1t(injected.end(), 4); // H is split. -const AddressRange G1t(H1t.end(), G.length); // G is copied. -const AddressRange G2t(G1t.end(), G.length); // G is copied. -const AddressRange H2t(G2t.end(), 3); // H is split. - -class BuildImageMapTest : public testing::Test { - public: - static const DWORD kInvalidAddress = 0xFFFFFFFF; - - void InitOmapData() { - omap_data.length_original = H.end(); - - // Build the OMAPTO vector (from transformed to original). - omap_data.omap_to.push_back(CreateOmap(Bt.rva, B.rva)); - omap_data.omap_to.push_back(CreateOmap(Dt.rva, D.rva)); - omap_data.omap_to.push_back(CreateOmap(Ft.rva, F.rva)); - omap_data.omap_to.push_back(CreateOmap(Et.rva, E.rva)); - omap_data.omap_to.push_back(CreateOmap(injected.rva, kInvalidAddress)); - omap_data.omap_to.push_back(CreateOmap(H1t.rva, H.rva)); - omap_data.omap_to.push_back(CreateOmap(G1t.rva, G.rva)); - omap_data.omap_to.push_back(CreateOmap(G2t.rva, G.rva)); - omap_data.omap_to.push_back(CreateOmap(H2t.rva, H.rva + H1t.length)); - omap_data.omap_to.push_back(CreateOmap(H2t.end(), kInvalidAddress)); - - // Build the OMAPFROM vector (from original to transformed). - omap_data.omap_from.push_back(CreateOmap(B.rva, Bt.rva)); - omap_data.omap_from.push_back(CreateOmap(C.rva, kInvalidAddress)); - omap_data.omap_from.push_back(CreateOmap(D.rva, Dt.rva)); - omap_data.omap_from.push_back(CreateOmap(E.rva, Et.rva)); - omap_data.omap_from.push_back(CreateOmap(F.rva, Ft.rva)); - omap_data.omap_from.push_back(CreateOmap(G.rva, G1t.rva)); - omap_data.omap_from.push_back(CreateOmap(H.rva, H1t.rva)); - omap_data.omap_from.push_back(CreateOmap(H.rva + H1t.length, H2t.rva)); - omap_data.omap_from.push_back(CreateOmap(H.end(), kInvalidAddress)); - } - - OmapData omap_data; -}; - -} // namespace - -TEST_F(BuildImageMapTest, EmptyImageMapOnEmptyOmapData) { - ASSERT_EQ(0u, omap_data.omap_from.size()); - ASSERT_EQ(0u, omap_data.omap_to.size()); - ASSERT_EQ(0u, omap_data.length_original); - - ImageMap image_map; - BuildImageMap(omap_data, &image_map); - EXPECT_EQ(0u, image_map.mapping.size()); - EXPECT_EQ(0u, image_map.endpoint_index_map.size()); -} - -TEST_F(BuildImageMapTest, ImageMapIsCorrect) { - InitOmapData(); - ASSERT_LE(0u, omap_data.omap_from.size()); - ASSERT_LE(0u, omap_data.omap_to.size()); - ASSERT_LE(0u, omap_data.length_original); - - ImageMap image_map; - BuildImageMap(omap_data, &image_map); - EXPECT_LE(9u, image_map.mapping.size()); - EXPECT_LE(9u, image_map.endpoint_index_map.size()); - - Mapping mapping; - mapping.push_back(CreateMappedRange(0, 0, B.rva, 0, 0)); - // C is removed, and it originally comes immediately after B. - mapping.push_back(CreateMappedRange(B.rva, Bt.rva, B.length, 0, C.length)); - // D is shortened by a length of 5. - mapping.push_back(CreateMappedRange(D.rva, Dt.rva, Dt.length, 0, 5)); - // The injected content comes immediately after E in the transformed image. - mapping.push_back(CreateMappedRange(E.rva, Et.rva, E.length, injected.length, - 0)); - mapping.push_back(CreateMappedRange(F.rva, Ft.rva, F.length, 0, 0)); - // G is copied so creates two entries. - mapping.push_back(CreateMappedRange(G.rva, G1t.rva, G.length, 0, 0)); - mapping.push_back(CreateMappedRange(G.rva, G2t.rva, G.length, 0, 0)); - // H is split, so create two entries. - mapping.push_back(CreateMappedRange(H.rva, H1t.rva, H1t.length, 0, 0)); - mapping.push_back(CreateMappedRange(H.rva + H1t.length, H2t.rva, H2t.length, - 0, 0)); - EXPECT_THAT(mapping, - testing::ContainerEq(image_map.mapping)); - - EndpointIndexMap endpoint_index_map; - endpoint_index_map.push_back(CreateEndpointIndex(0, 0)); - endpoint_index_map.push_back(CreateEndpointIndex(B.rva, 1)); - endpoint_index_map.push_back(CreateEndpointIndex(D.rva, 2)); - endpoint_index_map.push_back(CreateEndpointIndex(E.rva, 3)); - endpoint_index_map.push_back(CreateEndpointIndex(F.rva, 4)); - // G is duplicated so 2 ranges map back to it, hence the skip from 5 to 7. - endpoint_index_map.push_back(CreateEndpointIndex(G.rva, 5)); - // H is split so we expect 2 endpoints to show up attributed to it. - endpoint_index_map.push_back(CreateEndpointIndex(H.rva, 7)); - endpoint_index_map.push_back(CreateEndpointIndex(H.rva + H1t.length, 8)); - endpoint_index_map.push_back(CreateEndpointIndex(H.end(), 9)); - EXPECT_THAT(endpoint_index_map, - testing::ContainerEq(image_map.endpoint_index_map)); -} - -namespace { - -class MapAddressRangeTest : public BuildImageMapTest { - public: - typedef BuildImageMapTest Super; - virtual void SetUp() { - Super::SetUp(); - InitOmapData(); - BuildImageMap(omap_data, &image_map); - } - - ImageMap image_map; - - private: - using BuildImageMapTest::InitOmapData; - using BuildImageMapTest::omap_data; -}; - -} // namespace - -TEST_F(MapAddressRangeTest, EmptyImageMapReturnsIdentity) { - ImageMap im; - AddressRangeVector mapped_ranges; - AddressRange ar(0, 1024); - MapAddressRange(im, ar, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - EXPECT_EQ(ar, mapped_ranges[0]); -} - -TEST_F(MapAddressRangeTest, MapOutOfImage) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, AddressRange(H.end() + 10, 10), &mapped_ranges); - EXPECT_EQ(0u, mapped_ranges.size()); -} - -TEST_F(MapAddressRangeTest, MapIdentity) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, B, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(B)); -} - -TEST_F(MapAddressRangeTest, MapReorderedContiguous) { - AddressRangeVector mapped_ranges; - - AddressRange DEF(D.rva, F.end() - D.rva); - MapAddressRange(image_map, DEF, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - - AddressRange DFEt(Dt.rva, Et.end() - Dt.rva); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(DFEt)); -} - -TEST_F(MapAddressRangeTest, MapEmptySingle) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, AddressRange(D.rva, 0), &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(Dt.rva, 0))); -} - -TEST_F(MapAddressRangeTest, MapEmptyCopied) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, AddressRange(G.rva, 0), &mapped_ranges); - EXPECT_EQ(2u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(G1t.rva, 0), - AddressRange(G2t.rva, 0))); -} - -TEST_F(MapAddressRangeTest, MapCopiedContiguous) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, G, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre( - AddressRange(G1t.rva, G2t.end() - G1t.rva))); -} - -TEST_F(MapAddressRangeTest, MapSplitDiscontiguous) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, H, &mapped_ranges); - EXPECT_EQ(2u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(H1t, H2t)); -} - -TEST_F(MapAddressRangeTest, MapInjected) { - AddressRangeVector mapped_ranges; - - AddressRange EFGH(E.rva, H.end() - E.rva); - MapAddressRange(image_map, EFGH, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - - AddressRange FEHGGHt(Ft.rva, H2t.end() - Ft.rva); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(FEHGGHt)); -} - -TEST_F(MapAddressRangeTest, MapRemovedEntirely) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, C, &mapped_ranges); - EXPECT_EQ(0u, mapped_ranges.size()); -} - -TEST_F(MapAddressRangeTest, MapRemovedPartly) { - AddressRangeVector mapped_ranges; - MapAddressRange(image_map, D, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(Dt)); -} - -TEST_F(MapAddressRangeTest, MapFull) { - AddressRangeVector mapped_ranges; - - AddressRange AH(0, H.end()); - MapAddressRange(image_map, AH, &mapped_ranges); - EXPECT_EQ(1u, mapped_ranges.size()); - - AddressRange AHt(0, H2t.end()); - EXPECT_THAT(mapped_ranges, testing::ElementsAre(AHt)); -} - -} // namespace google_breakpad +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Unittests for OMAP related functions. + +#include "common/windows/omap.h" + +#include "breakpad_googletest_includes.h" + +namespace google_breakpad { + +// Equality operators for ContainerEq. These must be outside of the anonymous +// namespace in order for them to be found. +bool operator==(const MappedRange& mr1, const MappedRange& mr2) { + return mr1.rva_original == mr2.rva_original && + mr1.rva_transformed == mr2.rva_transformed && + mr1.length == mr2.length && + mr1.injected == mr2.injected && + mr1.removed == mr2.removed; +} +bool operator==(const EndpointIndex& ei1, const EndpointIndex& ei2) { + return ei1.endpoint == ei2.endpoint && ei1.index == ei2.index; +} + +// Pretty printers for more meaningful error messages. Also need to be outside +// the anonymous namespace. +std::ostream& operator<<(std::ostream& os, const MappedRange& mr) { + os << "MappedRange(rva_original=" << mr.rva_original + << ", rva_transformed=" << mr.rva_transformed + << ", length=" << mr.length + << ", injected=" << mr.injected + << ", removed=" << mr.removed << ")"; + return os; +} +std::ostream& operator<<(std::ostream& os, const EndpointIndex& ei) { + os << "EndpointIndex(endpoint=" << ei.endpoint + << ", index=" << ei.index << ")"; + return os; +} +std::ostream& operator<<(std::ostream& os, const AddressRange& ar) { + os << "AddressRange(rva=" << ar.rva << ", length=" << ar.length << ")"; + return os; +} + +namespace { + +OMAP CreateOmap(DWORD rva, DWORD rvaTo) { + OMAP o = { rva, rvaTo }; + return o; +} + +MappedRange CreateMappedRange(DWORD rva_original, + DWORD rva_transformed, + DWORD length, + DWORD injected, + DWORD removed) { + MappedRange mr = { rva_original, rva_transformed, length, injected, removed }; + return mr; +} + +EndpointIndex CreateEndpointIndex(DWORD endpoint, size_t index) { + EndpointIndex ei = { endpoint, index }; + return ei; +} + +// (C is removed) +// Original : A B C D E F G H +// Transformed: A B D F E * H1 G1 G2 H2 +// (* is injected, G is copied, H is split) +// A is implied. + +// Layout of the original image. +const AddressRange B(100, 15); +const AddressRange C(B.end(), 10); +const AddressRange D(C.end(), 25); +const AddressRange E(D.end(), 10); +const AddressRange F(E.end(), 40); +const AddressRange G(F.end(), 3); +const AddressRange H(G.end(), 7); + +// Layout of the transformed image. +const AddressRange Bt(100, 15); +const AddressRange Dt(Bt.end(), 20); // D is shortened. +const AddressRange Ft(Dt.end(), F.length); +const AddressRange Et(Ft.end(), E.length); +const AddressRange injected(Et.end(), 5); +const AddressRange H1t(injected.end(), 4); // H is split. +const AddressRange G1t(H1t.end(), G.length); // G is copied. +const AddressRange G2t(G1t.end(), G.length); // G is copied. +const AddressRange H2t(G2t.end(), 3); // H is split. + +class BuildImageMapTest : public testing::Test { + public: + static const DWORD kInvalidAddress = 0xFFFFFFFF; + + void InitOmapData() { + omap_data.length_original = H.end(); + + // Build the OMAPTO vector (from transformed to original). + omap_data.omap_to.push_back(CreateOmap(Bt.rva, B.rva)); + omap_data.omap_to.push_back(CreateOmap(Dt.rva, D.rva)); + omap_data.omap_to.push_back(CreateOmap(Ft.rva, F.rva)); + omap_data.omap_to.push_back(CreateOmap(Et.rva, E.rva)); + omap_data.omap_to.push_back(CreateOmap(injected.rva, kInvalidAddress)); + omap_data.omap_to.push_back(CreateOmap(H1t.rva, H.rva)); + omap_data.omap_to.push_back(CreateOmap(G1t.rva, G.rva)); + omap_data.omap_to.push_back(CreateOmap(G2t.rva, G.rva)); + omap_data.omap_to.push_back(CreateOmap(H2t.rva, H.rva + H1t.length)); + omap_data.omap_to.push_back(CreateOmap(H2t.end(), kInvalidAddress)); + + // Build the OMAPFROM vector (from original to transformed). + omap_data.omap_from.push_back(CreateOmap(B.rva, Bt.rva)); + omap_data.omap_from.push_back(CreateOmap(C.rva, kInvalidAddress)); + omap_data.omap_from.push_back(CreateOmap(D.rva, Dt.rva)); + omap_data.omap_from.push_back(CreateOmap(E.rva, Et.rva)); + omap_data.omap_from.push_back(CreateOmap(F.rva, Ft.rva)); + omap_data.omap_from.push_back(CreateOmap(G.rva, G1t.rva)); + omap_data.omap_from.push_back(CreateOmap(H.rva, H1t.rva)); + omap_data.omap_from.push_back(CreateOmap(H.rva + H1t.length, H2t.rva)); + omap_data.omap_from.push_back(CreateOmap(H.end(), kInvalidAddress)); + } + + OmapData omap_data; +}; + +} // namespace + +TEST_F(BuildImageMapTest, EmptyImageMapOnEmptyOmapData) { + ASSERT_EQ(0u, omap_data.omap_from.size()); + ASSERT_EQ(0u, omap_data.omap_to.size()); + ASSERT_EQ(0u, omap_data.length_original); + + ImageMap image_map; + BuildImageMap(omap_data, &image_map); + EXPECT_EQ(0u, image_map.mapping.size()); + EXPECT_EQ(0u, image_map.endpoint_index_map.size()); +} + +TEST_F(BuildImageMapTest, ImageMapIsCorrect) { + InitOmapData(); + ASSERT_LE(0u, omap_data.omap_from.size()); + ASSERT_LE(0u, omap_data.omap_to.size()); + ASSERT_LE(0u, omap_data.length_original); + + ImageMap image_map; + BuildImageMap(omap_data, &image_map); + EXPECT_LE(9u, image_map.mapping.size()); + EXPECT_LE(9u, image_map.endpoint_index_map.size()); + + Mapping mapping; + mapping.push_back(CreateMappedRange(0, 0, B.rva, 0, 0)); + // C is removed, and it originally comes immediately after B. + mapping.push_back(CreateMappedRange(B.rva, Bt.rva, B.length, 0, C.length)); + // D is shortened by a length of 5. + mapping.push_back(CreateMappedRange(D.rva, Dt.rva, Dt.length, 0, 5)); + // The injected content comes immediately after E in the transformed image. + mapping.push_back(CreateMappedRange(E.rva, Et.rva, E.length, injected.length, + 0)); + mapping.push_back(CreateMappedRange(F.rva, Ft.rva, F.length, 0, 0)); + // G is copied so creates two entries. + mapping.push_back(CreateMappedRange(G.rva, G1t.rva, G.length, 0, 0)); + mapping.push_back(CreateMappedRange(G.rva, G2t.rva, G.length, 0, 0)); + // H is split, so create two entries. + mapping.push_back(CreateMappedRange(H.rva, H1t.rva, H1t.length, 0, 0)); + mapping.push_back(CreateMappedRange(H.rva + H1t.length, H2t.rva, H2t.length, + 0, 0)); + EXPECT_THAT(mapping, + testing::ContainerEq(image_map.mapping)); + + EndpointIndexMap endpoint_index_map; + endpoint_index_map.push_back(CreateEndpointIndex(0, 0)); + endpoint_index_map.push_back(CreateEndpointIndex(B.rva, 1)); + endpoint_index_map.push_back(CreateEndpointIndex(D.rva, 2)); + endpoint_index_map.push_back(CreateEndpointIndex(E.rva, 3)); + endpoint_index_map.push_back(CreateEndpointIndex(F.rva, 4)); + // G is duplicated so 2 ranges map back to it, hence the skip from 5 to 7. + endpoint_index_map.push_back(CreateEndpointIndex(G.rva, 5)); + // H is split so we expect 2 endpoints to show up attributed to it. + endpoint_index_map.push_back(CreateEndpointIndex(H.rva, 7)); + endpoint_index_map.push_back(CreateEndpointIndex(H.rva + H1t.length, 8)); + endpoint_index_map.push_back(CreateEndpointIndex(H.end(), 9)); + EXPECT_THAT(endpoint_index_map, + testing::ContainerEq(image_map.endpoint_index_map)); +} + +namespace { + +class MapAddressRangeTest : public BuildImageMapTest { + public: + typedef BuildImageMapTest Super; + virtual void SetUp() { + Super::SetUp(); + InitOmapData(); + BuildImageMap(omap_data, &image_map); + } + + ImageMap image_map; + + private: + using BuildImageMapTest::InitOmapData; + using BuildImageMapTest::omap_data; +}; + +} // namespace + +TEST_F(MapAddressRangeTest, EmptyImageMapReturnsIdentity) { + ImageMap im; + AddressRangeVector mapped_ranges; + AddressRange ar(0, 1024); + MapAddressRange(im, ar, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + EXPECT_EQ(ar, mapped_ranges[0]); +} + +TEST_F(MapAddressRangeTest, MapOutOfImage) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, AddressRange(H.end() + 10, 10), &mapped_ranges); + EXPECT_EQ(0u, mapped_ranges.size()); +} + +TEST_F(MapAddressRangeTest, MapIdentity) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, B, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(B)); +} + +TEST_F(MapAddressRangeTest, MapReorderedContiguous) { + AddressRangeVector mapped_ranges; + + AddressRange DEF(D.rva, F.end() - D.rva); + MapAddressRange(image_map, DEF, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + + AddressRange DFEt(Dt.rva, Et.end() - Dt.rva); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(DFEt)); +} + +TEST_F(MapAddressRangeTest, MapEmptySingle) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, AddressRange(D.rva, 0), &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(Dt.rva, 0))); +} + +TEST_F(MapAddressRangeTest, MapEmptyCopied) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, AddressRange(G.rva, 0), &mapped_ranges); + EXPECT_EQ(2u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(G1t.rva, 0), + AddressRange(G2t.rva, 0))); +} + +TEST_F(MapAddressRangeTest, MapCopiedContiguous) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, G, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre( + AddressRange(G1t.rva, G2t.end() - G1t.rva))); +} + +TEST_F(MapAddressRangeTest, MapSplitDiscontiguous) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, H, &mapped_ranges); + EXPECT_EQ(2u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(H1t, H2t)); +} + +TEST_F(MapAddressRangeTest, MapInjected) { + AddressRangeVector mapped_ranges; + + AddressRange EFGH(E.rva, H.end() - E.rva); + MapAddressRange(image_map, EFGH, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + + AddressRange FEHGGHt(Ft.rva, H2t.end() - Ft.rva); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(FEHGGHt)); +} + +TEST_F(MapAddressRangeTest, MapRemovedEntirely) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, C, &mapped_ranges); + EXPECT_EQ(0u, mapped_ranges.size()); +} + +TEST_F(MapAddressRangeTest, MapRemovedPartly) { + AddressRangeVector mapped_ranges; + MapAddressRange(image_map, D, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(Dt)); +} + +TEST_F(MapAddressRangeTest, MapFull) { + AddressRangeVector mapped_ranges; + + AddressRange AH(0, H.end()); + MapAddressRange(image_map, AH, &mapped_ranges); + EXPECT_EQ(1u, mapped_ranges.size()); + + AddressRange AHt(0, H2t.end()); + EXPECT_THAT(mapped_ranges, testing::ElementsAre(AHt)); +} + +} // namespace google_breakpad diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index ac3deda77..800c316fb 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h index 42bd94d95..8c74e2ca3 100644 --- a/src/common/windows/pdb_source_line_writer.h +++ b/src/common/windows/pdb_source_line_writer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/pe_source_line_writer.cc b/src/common/windows/pe_source_line_writer.cc index cb6cc7139..a568e0c75 100644 --- a/src/common/windows/pe_source_line_writer.cc +++ b/src/common/windows/pe_source_line_writer.cc @@ -1,77 +1,76 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "common/windows/pe_source_line_writer.h" - -#include "common/windows/pe_util.h" - -namespace google_breakpad { -PESourceLineWriter::PESourceLineWriter(const wstring& pe_file) : - pe_file_(pe_file) { -} - -PESourceLineWriter::~PESourceLineWriter() { -} - -bool PESourceLineWriter::WriteSymbols(FILE* symbol_file) { - PDBModuleInfo module_info; - if (!GetModuleInfo(&module_info)) { - return false; - } - // Hard-code "windows" for the OS because that's the only thing that makes - // sense for PDB files. (This might not be strictly correct for Windows CE - // support, but we don't care about that at the moment.) - fprintf(symbol_file, "MODULE windows %ws %ws %ws\n", - module_info.cpu.c_str(), module_info.debug_identifier.c_str(), - module_info.debug_file.c_str()); - - PEModuleInfo pe_info; - if (!GetPEInfo(&pe_info)) { - return false; - } - fprintf(symbol_file, "INFO CODE_ID %ws %ws\n", - pe_info.code_identifier.c_str(), - pe_info.code_file.c_str()); - - if (!PrintPEFrameData(pe_file_, symbol_file)) { - return false; - } - - return true; -} - -bool PESourceLineWriter::GetModuleInfo(PDBModuleInfo* info) { - return ReadModuleInfo(pe_file_, info); -} - -bool PESourceLineWriter::GetPEInfo(PEModuleInfo* info) { - return ReadPEInfo(pe_file_, info); -} - -} // namespace google_breakpad +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/windows/pe_source_line_writer.h" + +#include "common/windows/pe_util.h" + +namespace google_breakpad { +PESourceLineWriter::PESourceLineWriter(const wstring& pe_file) : + pe_file_(pe_file) { +} + +PESourceLineWriter::~PESourceLineWriter() { +} + +bool PESourceLineWriter::WriteSymbols(FILE* symbol_file) { + PDBModuleInfo module_info; + if (!GetModuleInfo(&module_info)) { + return false; + } + // Hard-code "windows" for the OS because that's the only thing that makes + // sense for PDB files. (This might not be strictly correct for Windows CE + // support, but we don't care about that at the moment.) + fprintf(symbol_file, "MODULE windows %ws %ws %ws\n", + module_info.cpu.c_str(), module_info.debug_identifier.c_str(), + module_info.debug_file.c_str()); + + PEModuleInfo pe_info; + if (!GetPEInfo(&pe_info)) { + return false; + } + fprintf(symbol_file, "INFO CODE_ID %ws %ws\n", + pe_info.code_identifier.c_str(), + pe_info.code_file.c_str()); + + if (!PrintPEFrameData(pe_file_, symbol_file)) { + return false; + } + + return true; +} + +bool PESourceLineWriter::GetModuleInfo(PDBModuleInfo* info) { + return ReadModuleInfo(pe_file_, info); +} + +bool PESourceLineWriter::GetPEInfo(PEModuleInfo* info) { + return ReadPEInfo(pe_file_, info); +} + +} // namespace google_breakpad diff --git a/src/common/windows/pe_source_line_writer.h b/src/common/windows/pe_source_line_writer.h index 2bf1d4fd2..a37481459 100644 --- a/src/common/windows/pe_source_line_writer.h +++ b/src/common/windows/pe_source_line_writer.h @@ -1,69 +1,68 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ -#define COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ - -#include - -#include "common/basictypes.h" -#include "common/windows/module_info.h" - -namespace google_breakpad { - -using std::wstring; - -// PESourceLineWriter uses a pe file produced by Visual C++ to output -// a line/address map for use with BasicSourceLineResolver. -// NOTE: Only supports PE32+ format, ie. a 64bit PE file. -class PESourceLineWriter { -public: - explicit PESourceLineWriter(const wstring& pe_file); - ~PESourceLineWriter(); - - // Writes Breakpad symbols from the pe file to |symbol_file|. - // Returns true on success. - bool WriteSymbols(FILE* symbol_file); - - // Retrieves information about the module. Returns true on success. - bool GetModuleInfo(PDBModuleInfo* info); - +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ +#define COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ + +#include + +#include "common/basictypes.h" +#include "common/windows/module_info.h" + +namespace google_breakpad { + +using std::wstring; + +// PESourceLineWriter uses a pe file produced by Visual C++ to output +// a line/address map for use with BasicSourceLineResolver. +// NOTE: Only supports PE32+ format, ie. a 64bit PE file. +class PESourceLineWriter { +public: + explicit PESourceLineWriter(const wstring& pe_file); + ~PESourceLineWriter(); + + // Writes Breakpad symbols from the pe file to |symbol_file|. + // Returns true on success. + bool WriteSymbols(FILE* symbol_file); + + // Retrieves information about the module. Returns true on success. + bool GetModuleInfo(PDBModuleInfo* info); + // Retrieves information about the module's PE file. Returns - // true on success. - bool GetPEInfo(PEModuleInfo* info); - -private: - const wstring pe_file_; - - DISALLOW_COPY_AND_ASSIGN(PESourceLineWriter); -}; - -} // namespace google_breakpad - -#endif // COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ + // true on success. + bool GetPEInfo(PEModuleInfo* info); + +private: + const wstring pe_file_; + + DISALLOW_COPY_AND_ASSIGN(PESourceLineWriter); +}; + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_ diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc index f8934d27e..1df931051 100644 --- a/src/common/windows/pe_util.cc +++ b/src/common/windows/pe_util.cc @@ -1,412 +1,411 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "pe_util.h" - -#include -#include -#include -#include - -#include -#include - -#include "common/windows/string_utils-inl.h" -#include "common/windows/guid_string.h" - -namespace { - -/* - * Not defined in WinNT.h prior to SDK 10.0.20348.0 for some reason. - * Definitions taken from: http://uninformed.org/index.cgi?v=4&a=1&p=13 - * - */ -typedef unsigned char UBYTE; - -#if !defined(UNW_FLAG_EHANDLER) -#define UNW_FLAG_EHANDLER 0x01 -#endif -#if !defined(UNW_FLAG_UHANDLER) -#define UNW_FLAG_UHANDLER 0x02 -#endif -#if !defined(UNW_FLAG_CHAININFO) -#define UNW_FLAG_CHAININFO 0x04 -#endif - -union UnwindCode { - struct { - UBYTE offset_in_prolog; - UBYTE unwind_operation_code : 4; - UBYTE operation_info : 4; - }; - USHORT frame_offset; -}; - -enum UnwindOperationCodes { - UWOP_PUSH_NONVOL = 0, /* info == register number */ - UWOP_ALLOC_LARGE, /* no info, alloc size in next 2 slots */ - UWOP_ALLOC_SMALL, /* info == size of allocation / 8 - 1 */ - UWOP_SET_FPREG, /* no info, FP = RSP + UNWIND_INFO.FPRegOffset*16 */ - UWOP_SAVE_NONVOL, /* info == register number, offset in next slot */ - UWOP_SAVE_NONVOL_FAR, /* info == register number, offset in next 2 slots */ - // XXX: these are missing from MSDN! - // See: http://www.osronline.com/ddkx/kmarch/64bitamd_4rs7.htm - UWOP_SAVE_XMM, - UWOP_SAVE_XMM_FAR, - UWOP_SAVE_XMM128, /* info == XMM reg number, offset in next slot */ - UWOP_SAVE_XMM128_FAR, /* info == XMM reg number, offset in next 2 slots */ - UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */ -}; - -// See: http://msdn.microsoft.com/en-us/library/ddssxxy8.aspx -// Note: some fields removed as we don't use them. -struct UnwindInfo { - UBYTE version : 3; - UBYTE flags : 5; - UBYTE size_of_prolog; - UBYTE count_of_codes; - UBYTE frame_register : 4; - UBYTE frame_offset : 4; - UnwindCode unwind_code[1]; -}; - -struct CV_INFO_PDB70 { - ULONG cv_signature; - GUID signature; - ULONG age; - CHAR pdb_filename[ANYSIZE_ARRAY]; -}; - -#define CV_SIGNATURE_RSDS 'SDSR' - -// A helper class to scope a PLOADED_IMAGE. -class AutoImage { -public: - explicit AutoImage(PLOADED_IMAGE img) : img_(img) {} - ~AutoImage() { - if (img_) - ImageUnload(img_); - } - - operator PLOADED_IMAGE() { return img_; } - PLOADED_IMAGE operator->() { return img_; } - -private: - PLOADED_IMAGE img_; -}; -} // namespace - -namespace google_breakpad { - -using std::unique_ptr; -using google_breakpad::GUIDString; - -bool ReadModuleInfo(const wstring & pe_file, PDBModuleInfo * info) { - // Convert wchar to native charset because ImageLoad only takes - // a PSTR as input. - string img_file; - if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { - fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", - pe_file.c_str()); - return false; - } - - AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); - if (!img) { - fprintf(stderr, "Failed to load %s\n", img_file.c_str()); - return false; - } - - info->cpu = FileHeaderMachineToCpuString( - img->FileHeader->FileHeader.Machine); - - PIMAGE_OPTIONAL_HEADER64 optional_header = - &(reinterpret_cast(img->FileHeader))->OptionalHeader; - - // Search debug directories for a guid signature & age - DWORD debug_rva = optional_header-> - DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress; - DWORD debug_size = optional_header-> - DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].Size; - PIMAGE_DEBUG_DIRECTORY debug_directories = - static_cast( - ImageRvaToVa(img->FileHeader, - img->MappedAddress, - debug_rva, - &img->LastRvaSection)); - - for (DWORD i = 0; i < debug_size / sizeof(*debug_directories); i++) { - if (debug_directories[i].Type != IMAGE_DEBUG_TYPE_CODEVIEW || - debug_directories[i].SizeOfData < sizeof(CV_INFO_PDB70)) { - continue; - } - - struct CV_INFO_PDB70* cv_info = static_cast(ImageRvaToVa( - img->FileHeader, - img->MappedAddress, - debug_directories[i].AddressOfRawData, - &img->LastRvaSection)); - if (cv_info->cv_signature != CV_SIGNATURE_RSDS) { - continue; - } - - info->debug_identifier = GenerateDebugIdentifier(cv_info->age, - cv_info->signature); - - // This code assumes that the pdb_filename is stored as ASCII without - // multibyte characters, but it's not clear if that's true. - size_t debug_file_length = strnlen_s(cv_info->pdb_filename, MAX_PATH); - if (debug_file_length < 0 || debug_file_length >= MAX_PATH) { - fprintf(stderr, "PE debug directory is corrupt.\n"); - return false; - } - std::string debug_file(cv_info->pdb_filename, debug_file_length); - if (!WindowsStringUtils::safe_mbstowcs(debug_file, &info->debug_file)) { - fprintf(stderr, "PDB filename '%s' contains unrecognized characters.\n", - debug_file.c_str()); - return false; - } - info->debug_file = WindowsStringUtils::GetBaseName(info->debug_file); - - return true; - } - - fprintf(stderr, "Image is missing debug information.\n"); - return false; -} - -bool ReadPEInfo(const wstring & pe_file, PEModuleInfo * info) { - // Convert wchar to native charset because ImageLoad only takes - // a PSTR as input. - string img_file; - if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { - fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", - pe_file.c_str()); - return false; - } - - AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); - if (!img) { - fprintf(stderr, "Failed to open PE file: %S\n", pe_file.c_str()); - return false; - } - - info->code_file = WindowsStringUtils::GetBaseName(pe_file); - - // The date and time that the file was created by the linker. - DWORD TimeDateStamp = img->FileHeader->FileHeader.TimeDateStamp; - // The size of the file in bytes, including all headers. - DWORD SizeOfImage = 0; - PIMAGE_OPTIONAL_HEADER64 opt = - &((PIMAGE_NT_HEADERS64)img->FileHeader)->OptionalHeader; - if (opt->Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { - // 64-bit PE file. - SizeOfImage = opt->SizeOfImage; - } - else { - // 32-bit PE file. - SizeOfImage = img->FileHeader->OptionalHeader.SizeOfImage; - } - wchar_t code_identifier[32]; - swprintf(code_identifier, - sizeof(code_identifier) / sizeof(code_identifier[0]), - L"%08X%X", TimeDateStamp, SizeOfImage); - info->code_identifier = code_identifier; - - return true; -} - -bool PrintPEFrameData(const wstring & pe_file, FILE * out_file) -{ - // Convert wchar to native charset because ImageLoad only takes - // a PSTR as input. - string img_file; - if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { - fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", - pe_file.c_str()); - return false; - } - - AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); - if (!img) { - fprintf(stderr, "Failed to load %s\n", img_file.c_str()); - return false; - } - PIMAGE_OPTIONAL_HEADER64 optional_header = - &(reinterpret_cast(img->FileHeader))->OptionalHeader; - if (optional_header->Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) { - fprintf(stderr, "Not a PE32+ image\n"); - return false; - } - - // Read Exception Directory - DWORD exception_rva = optional_header-> - DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress; - DWORD exception_size = optional_header-> - DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size; - PIMAGE_RUNTIME_FUNCTION_ENTRY funcs = - static_cast( - ImageRvaToVa(img->FileHeader, - img->MappedAddress, - exception_rva, - &img->LastRvaSection)); - for (DWORD i = 0; i < exception_size / sizeof(*funcs); i++) { - DWORD unwind_rva = funcs[i].UnwindInfoAddress; - // handle chaining - while (unwind_rva & 0x1) { - unwind_rva ^= 0x1; - PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func = - static_cast( - ImageRvaToVa(img->FileHeader, - img->MappedAddress, - unwind_rva, - &img->LastRvaSection)); - unwind_rva = chained_func->UnwindInfoAddress; - } - - UnwindInfo *unwind_info = static_cast( - ImageRvaToVa(img->FileHeader, - img->MappedAddress, - unwind_rva, - &img->LastRvaSection)); - - DWORD stack_size = 8; // minimal stack size is 8 for RIP - DWORD rip_offset = 8; - do { - for (UBYTE c = 0; c < unwind_info->count_of_codes; c++) { - UnwindCode *unwind_code = &unwind_info->unwind_code[c]; - switch (unwind_code->unwind_operation_code) { - case UWOP_PUSH_NONVOL: { - stack_size += 8; - break; - } - case UWOP_ALLOC_LARGE: { - if (unwind_code->operation_info == 0) { - c++; - if (c < unwind_info->count_of_codes) - stack_size += (unwind_code + 1)->frame_offset * 8; - } - else { - c += 2; - if (c < unwind_info->count_of_codes) - stack_size += (unwind_code + 1)->frame_offset | - ((unwind_code + 2)->frame_offset << 16); - } - break; - } - case UWOP_ALLOC_SMALL: { - stack_size += unwind_code->operation_info * 8 + 8; - break; - } - case UWOP_SET_FPREG: - case UWOP_SAVE_XMM: - case UWOP_SAVE_XMM_FAR: - break; - case UWOP_SAVE_NONVOL: - case UWOP_SAVE_XMM128: { - c++; // skip slot with offset - break; - } - case UWOP_SAVE_NONVOL_FAR: - case UWOP_SAVE_XMM128_FAR: { - c += 2; // skip 2 slots with offset - break; - } - case UWOP_PUSH_MACHFRAME: { - if (unwind_code->operation_info) { - stack_size += 88; - } - else { - stack_size += 80; - } - rip_offset += 80; - break; - } - } - } - if (unwind_info->flags & UNW_FLAG_CHAININFO) { - PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func = - reinterpret_cast( - (unwind_info->unwind_code + - ((unwind_info->count_of_codes + 1) & ~1))); - - unwind_info = static_cast( - ImageRvaToVa(img->FileHeader, - img->MappedAddress, - chained_func->UnwindInfoAddress, - &img->LastRvaSection)); - } - else { - unwind_info = NULL; - } - } while (unwind_info); - fprintf(out_file, "STACK CFI INIT %lx %lx .cfa: $rsp .ra: .cfa %lu - ^\n", - funcs[i].BeginAddress, - funcs[i].EndAddress - funcs[i].BeginAddress, rip_offset); - fprintf(out_file, "STACK CFI %lx .cfa: $rsp %lu +\n", - funcs[i].BeginAddress, stack_size); - } - - return true; -} - -wstring GenerateDebugIdentifier(DWORD age, GUID signature) -{ - // Use the same format that the MS symbol server uses in filesystem - // hierarchies. - wchar_t age_string[9]; - swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]), - L"%x", age); - - // remove when VC++7.1 is no longer supported - age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0'; - - wstring debug_identifier = GUIDString::GUIDToSymbolServerWString(&signature); - debug_identifier.append(age_string); - - return debug_identifier; -} - -wstring GenerateDebugIdentifier(DWORD age, DWORD signature) -{ - // Use the same format that the MS symbol server uses in filesystem - // hierarchies. - wchar_t identifier_string[17]; - swprintf(identifier_string, - sizeof(identifier_string) / sizeof(identifier_string[0]), - L"%08X%x", signature, age); - - // remove when VC++7.1 is no longer supported - identifier_string[sizeof(identifier_string) / - sizeof(identifier_string[0]) - 1] = L'\0'; - - return wstring(identifier_string); -} - -} // namespace google_breakpad +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "pe_util.h" + +#include +#include +#include +#include + +#include +#include + +#include "common/windows/string_utils-inl.h" +#include "common/windows/guid_string.h" + +namespace { + +/* + * Not defined in WinNT.h prior to SDK 10.0.20348.0 for some reason. + * Definitions taken from: http://uninformed.org/index.cgi?v=4&a=1&p=13 + * + */ +typedef unsigned char UBYTE; + +#if !defined(UNW_FLAG_EHANDLER) +#define UNW_FLAG_EHANDLER 0x01 +#endif +#if !defined(UNW_FLAG_UHANDLER) +#define UNW_FLAG_UHANDLER 0x02 +#endif +#if !defined(UNW_FLAG_CHAININFO) +#define UNW_FLAG_CHAININFO 0x04 +#endif + +union UnwindCode { + struct { + UBYTE offset_in_prolog; + UBYTE unwind_operation_code : 4; + UBYTE operation_info : 4; + }; + USHORT frame_offset; +}; + +enum UnwindOperationCodes { + UWOP_PUSH_NONVOL = 0, /* info == register number */ + UWOP_ALLOC_LARGE, /* no info, alloc size in next 2 slots */ + UWOP_ALLOC_SMALL, /* info == size of allocation / 8 - 1 */ + UWOP_SET_FPREG, /* no info, FP = RSP + UNWIND_INFO.FPRegOffset*16 */ + UWOP_SAVE_NONVOL, /* info == register number, offset in next slot */ + UWOP_SAVE_NONVOL_FAR, /* info == register number, offset in next 2 slots */ + // XXX: these are missing from MSDN! + // See: http://www.osronline.com/ddkx/kmarch/64bitamd_4rs7.htm + UWOP_SAVE_XMM, + UWOP_SAVE_XMM_FAR, + UWOP_SAVE_XMM128, /* info == XMM reg number, offset in next slot */ + UWOP_SAVE_XMM128_FAR, /* info == XMM reg number, offset in next 2 slots */ + UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */ +}; + +// See: http://msdn.microsoft.com/en-us/library/ddssxxy8.aspx +// Note: some fields removed as we don't use them. +struct UnwindInfo { + UBYTE version : 3; + UBYTE flags : 5; + UBYTE size_of_prolog; + UBYTE count_of_codes; + UBYTE frame_register : 4; + UBYTE frame_offset : 4; + UnwindCode unwind_code[1]; +}; + +struct CV_INFO_PDB70 { + ULONG cv_signature; + GUID signature; + ULONG age; + CHAR pdb_filename[ANYSIZE_ARRAY]; +}; + +#define CV_SIGNATURE_RSDS 'SDSR' + +// A helper class to scope a PLOADED_IMAGE. +class AutoImage { +public: + explicit AutoImage(PLOADED_IMAGE img) : img_(img) {} + ~AutoImage() { + if (img_) + ImageUnload(img_); + } + + operator PLOADED_IMAGE() { return img_; } + PLOADED_IMAGE operator->() { return img_; } + +private: + PLOADED_IMAGE img_; +}; +} // namespace + +namespace google_breakpad { + +using std::unique_ptr; +using google_breakpad::GUIDString; + +bool ReadModuleInfo(const wstring & pe_file, PDBModuleInfo * info) { + // Convert wchar to native charset because ImageLoad only takes + // a PSTR as input. + string img_file; + if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { + fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", + pe_file.c_str()); + return false; + } + + AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); + if (!img) { + fprintf(stderr, "Failed to load %s\n", img_file.c_str()); + return false; + } + + info->cpu = FileHeaderMachineToCpuString( + img->FileHeader->FileHeader.Machine); + + PIMAGE_OPTIONAL_HEADER64 optional_header = + &(reinterpret_cast(img->FileHeader))->OptionalHeader; + + // Search debug directories for a guid signature & age + DWORD debug_rva = optional_header-> + DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress; + DWORD debug_size = optional_header-> + DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].Size; + PIMAGE_DEBUG_DIRECTORY debug_directories = + static_cast( + ImageRvaToVa(img->FileHeader, + img->MappedAddress, + debug_rva, + &img->LastRvaSection)); + + for (DWORD i = 0; i < debug_size / sizeof(*debug_directories); i++) { + if (debug_directories[i].Type != IMAGE_DEBUG_TYPE_CODEVIEW || + debug_directories[i].SizeOfData < sizeof(CV_INFO_PDB70)) { + continue; + } + + struct CV_INFO_PDB70* cv_info = static_cast(ImageRvaToVa( + img->FileHeader, + img->MappedAddress, + debug_directories[i].AddressOfRawData, + &img->LastRvaSection)); + if (cv_info->cv_signature != CV_SIGNATURE_RSDS) { + continue; + } + + info->debug_identifier = GenerateDebugIdentifier(cv_info->age, + cv_info->signature); + + // This code assumes that the pdb_filename is stored as ASCII without + // multibyte characters, but it's not clear if that's true. + size_t debug_file_length = strnlen_s(cv_info->pdb_filename, MAX_PATH); + if (debug_file_length < 0 || debug_file_length >= MAX_PATH) { + fprintf(stderr, "PE debug directory is corrupt.\n"); + return false; + } + std::string debug_file(cv_info->pdb_filename, debug_file_length); + if (!WindowsStringUtils::safe_mbstowcs(debug_file, &info->debug_file)) { + fprintf(stderr, "PDB filename '%s' contains unrecognized characters.\n", + debug_file.c_str()); + return false; + } + info->debug_file = WindowsStringUtils::GetBaseName(info->debug_file); + + return true; + } + + fprintf(stderr, "Image is missing debug information.\n"); + return false; +} + +bool ReadPEInfo(const wstring & pe_file, PEModuleInfo * info) { + // Convert wchar to native charset because ImageLoad only takes + // a PSTR as input. + string img_file; + if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { + fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", + pe_file.c_str()); + return false; + } + + AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); + if (!img) { + fprintf(stderr, "Failed to open PE file: %S\n", pe_file.c_str()); + return false; + } + + info->code_file = WindowsStringUtils::GetBaseName(pe_file); + + // The date and time that the file was created by the linker. + DWORD TimeDateStamp = img->FileHeader->FileHeader.TimeDateStamp; + // The size of the file in bytes, including all headers. + DWORD SizeOfImage = 0; + PIMAGE_OPTIONAL_HEADER64 opt = + &((PIMAGE_NT_HEADERS64)img->FileHeader)->OptionalHeader; + if (opt->Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { + // 64-bit PE file. + SizeOfImage = opt->SizeOfImage; + } + else { + // 32-bit PE file. + SizeOfImage = img->FileHeader->OptionalHeader.SizeOfImage; + } + wchar_t code_identifier[32]; + swprintf(code_identifier, + sizeof(code_identifier) / sizeof(code_identifier[0]), + L"%08X%X", TimeDateStamp, SizeOfImage); + info->code_identifier = code_identifier; + + return true; +} + +bool PrintPEFrameData(const wstring & pe_file, FILE * out_file) +{ + // Convert wchar to native charset because ImageLoad only takes + // a PSTR as input. + string img_file; + if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) { + fprintf(stderr, "Image path '%S' contains unrecognized characters.\n", + pe_file.c_str()); + return false; + } + + AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL)); + if (!img) { + fprintf(stderr, "Failed to load %s\n", img_file.c_str()); + return false; + } + PIMAGE_OPTIONAL_HEADER64 optional_header = + &(reinterpret_cast(img->FileHeader))->OptionalHeader; + if (optional_header->Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) { + fprintf(stderr, "Not a PE32+ image\n"); + return false; + } + + // Read Exception Directory + DWORD exception_rva = optional_header-> + DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress; + DWORD exception_size = optional_header-> + DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size; + PIMAGE_RUNTIME_FUNCTION_ENTRY funcs = + static_cast( + ImageRvaToVa(img->FileHeader, + img->MappedAddress, + exception_rva, + &img->LastRvaSection)); + for (DWORD i = 0; i < exception_size / sizeof(*funcs); i++) { + DWORD unwind_rva = funcs[i].UnwindInfoAddress; + // handle chaining + while (unwind_rva & 0x1) { + unwind_rva ^= 0x1; + PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func = + static_cast( + ImageRvaToVa(img->FileHeader, + img->MappedAddress, + unwind_rva, + &img->LastRvaSection)); + unwind_rva = chained_func->UnwindInfoAddress; + } + + UnwindInfo *unwind_info = static_cast( + ImageRvaToVa(img->FileHeader, + img->MappedAddress, + unwind_rva, + &img->LastRvaSection)); + + DWORD stack_size = 8; // minimal stack size is 8 for RIP + DWORD rip_offset = 8; + do { + for (UBYTE c = 0; c < unwind_info->count_of_codes; c++) { + UnwindCode *unwind_code = &unwind_info->unwind_code[c]; + switch (unwind_code->unwind_operation_code) { + case UWOP_PUSH_NONVOL: { + stack_size += 8; + break; + } + case UWOP_ALLOC_LARGE: { + if (unwind_code->operation_info == 0) { + c++; + if (c < unwind_info->count_of_codes) + stack_size += (unwind_code + 1)->frame_offset * 8; + } + else { + c += 2; + if (c < unwind_info->count_of_codes) + stack_size += (unwind_code + 1)->frame_offset | + ((unwind_code + 2)->frame_offset << 16); + } + break; + } + case UWOP_ALLOC_SMALL: { + stack_size += unwind_code->operation_info * 8 + 8; + break; + } + case UWOP_SET_FPREG: + case UWOP_SAVE_XMM: + case UWOP_SAVE_XMM_FAR: + break; + case UWOP_SAVE_NONVOL: + case UWOP_SAVE_XMM128: { + c++; // skip slot with offset + break; + } + case UWOP_SAVE_NONVOL_FAR: + case UWOP_SAVE_XMM128_FAR: { + c += 2; // skip 2 slots with offset + break; + } + case UWOP_PUSH_MACHFRAME: { + if (unwind_code->operation_info) { + stack_size += 88; + } + else { + stack_size += 80; + } + rip_offset += 80; + break; + } + } + } + if (unwind_info->flags & UNW_FLAG_CHAININFO) { + PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func = + reinterpret_cast( + (unwind_info->unwind_code + + ((unwind_info->count_of_codes + 1) & ~1))); + + unwind_info = static_cast( + ImageRvaToVa(img->FileHeader, + img->MappedAddress, + chained_func->UnwindInfoAddress, + &img->LastRvaSection)); + } + else { + unwind_info = NULL; + } + } while (unwind_info); + fprintf(out_file, "STACK CFI INIT %lx %lx .cfa: $rsp .ra: .cfa %lu - ^\n", + funcs[i].BeginAddress, + funcs[i].EndAddress - funcs[i].BeginAddress, rip_offset); + fprintf(out_file, "STACK CFI %lx .cfa: $rsp %lu +\n", + funcs[i].BeginAddress, stack_size); + } + + return true; +} + +wstring GenerateDebugIdentifier(DWORD age, GUID signature) +{ + // Use the same format that the MS symbol server uses in filesystem + // hierarchies. + wchar_t age_string[9]; + swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]), + L"%x", age); + + // remove when VC++7.1 is no longer supported + age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0'; + + wstring debug_identifier = GUIDString::GUIDToSymbolServerWString(&signature); + debug_identifier.append(age_string); + + return debug_identifier; +} + +wstring GenerateDebugIdentifier(DWORD age, DWORD signature) +{ + // Use the same format that the MS symbol server uses in filesystem + // hierarchies. + wchar_t identifier_string[17]; + swprintf(identifier_string, + sizeof(identifier_string) / sizeof(identifier_string[0]), + L"%08X%x", signature, age); + + // remove when VC++7.1 is no longer supported + identifier_string[sizeof(identifier_string) / + sizeof(identifier_string[0]) - 1] = L'\0'; + + return wstring(identifier_string); +} + +} // namespace google_breakpad diff --git a/src/common/windows/pe_util.h b/src/common/windows/pe_util.h index 634ba2934..6c6b364f9 100644 --- a/src/common/windows/pe_util.h +++ b/src/common/windows/pe_util.h @@ -1,78 +1,77 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef COMMON_WINDOWS_PE_UTIL_H_ -#define COMMON_WINDOWS_PE_UTIL_H_ - -#include - -#include "common/windows/module_info.h" - -namespace google_breakpad { - -using std::wstring; - -// Reads |pe_file| and populates |info|. Returns true on success. -// Only supports PE32+ format, ie. a 64bit PE file. -// Will fail if |pe_file| does not contain a valid CodeView record. -bool ReadModuleInfo(const wstring& pe_file, PDBModuleInfo* info); - -// Reads |pe_file| and populates |info|. Returns true on success. -bool ReadPEInfo(const wstring& pe_file, PEModuleInfo* info); - -// Reads |pe_file| and prints frame data (aka. unwind info) to |out_file|. -// Only supports PE32+ format, ie. a 64bit PE file. -bool PrintPEFrameData(const wstring& pe_file, FILE* out_file); - -// Combines a GUID |signature| and DWORD |age| to create a Breakpad debug -// identifier. -wstring GenerateDebugIdentifier(DWORD age, GUID signature); - -// Combines a DWORD |signature| and DWORD |age| to create a Breakpad debug -// identifier. -wstring GenerateDebugIdentifier(DWORD age, DWORD signature); - -// Converts |machine| enum value to the corresponding string used by Breakpad. -// The enum is IMAGE_FILE_MACHINE_*, contained in winnt.h. -constexpr const wchar_t* FileHeaderMachineToCpuString(WORD machine) { - switch (machine) { - case IMAGE_FILE_MACHINE_I386: { - return L"x86"; - } - case IMAGE_FILE_MACHINE_IA64: - case IMAGE_FILE_MACHINE_AMD64: { - return L"x86_64"; - } - default: { return L"unknown"; } - } -} - -} // namespace google_breakpad - -#endif // COMMON_WINDOWS_PE_UTIL_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_WINDOWS_PE_UTIL_H_ +#define COMMON_WINDOWS_PE_UTIL_H_ + +#include + +#include "common/windows/module_info.h" + +namespace google_breakpad { + +using std::wstring; + +// Reads |pe_file| and populates |info|. Returns true on success. +// Only supports PE32+ format, ie. a 64bit PE file. +// Will fail if |pe_file| does not contain a valid CodeView record. +bool ReadModuleInfo(const wstring& pe_file, PDBModuleInfo* info); + +// Reads |pe_file| and populates |info|. Returns true on success. +bool ReadPEInfo(const wstring& pe_file, PEModuleInfo* info); + +// Reads |pe_file| and prints frame data (aka. unwind info) to |out_file|. +// Only supports PE32+ format, ie. a 64bit PE file. +bool PrintPEFrameData(const wstring& pe_file, FILE* out_file); + +// Combines a GUID |signature| and DWORD |age| to create a Breakpad debug +// identifier. +wstring GenerateDebugIdentifier(DWORD age, GUID signature); + +// Combines a DWORD |signature| and DWORD |age| to create a Breakpad debug +// identifier. +wstring GenerateDebugIdentifier(DWORD age, DWORD signature); + +// Converts |machine| enum value to the corresponding string used by Breakpad. +// The enum is IMAGE_FILE_MACHINE_*, contained in winnt.h. +constexpr const wchar_t* FileHeaderMachineToCpuString(WORD machine) { + switch (machine) { + case IMAGE_FILE_MACHINE_I386: { + return L"x86"; + } + case IMAGE_FILE_MACHINE_IA64: + case IMAGE_FILE_MACHINE_AMD64: { + return L"x86_64"; + } + default: { return L"unknown"; } + } +} + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_PE_UTIL_H_ diff --git a/src/common/windows/string_utils-inl.h b/src/common/windows/string_utils-inl.h index 935e19f52..c6f5e0ac1 100644 --- a/src/common/windows/string_utils-inl.h +++ b/src/common/windows/string_utils-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/string_utils.cc b/src/common/windows/string_utils.cc index 90aab0386..01dca1937 100644 --- a/src/common/windows/string_utils.cc +++ b/src/common/windows/string_utils.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc index ad2b83a3f..f2dc660cf 100644 --- a/src/common/windows/sym_upload_v2_protocol.cc +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -1,90 +1,118 @@ -#include "common/windows/sym_upload_v2_protocol.h" - -#include - -#include "common/windows/http_upload.h" -#include "common/windows/symbol_collector_client.h" - -using google_breakpad::CompleteUploadResult; -using google_breakpad::HTTPUpload; -using google_breakpad::SymbolCollectorClient; -using google_breakpad::SymbolStatus; -using google_breakpad::UploadUrlResponse; -using std::wstring; - -namespace google_breakpad { - -static bool SymUploadV2ProtocolSend(const wchar_t* api_url, - const wchar_t* api_key, - int* timeout_ms, - const wstring& debug_file, - const wstring& debug_id, - const wstring& symbol_filename, - const wstring& symbol_type, - const wstring& product_name, - bool force) { - wstring url(api_url); - wstring key(api_key); - - if (!force) { - SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus( - url, key, timeout_ms, debug_file, debug_id); - if (symbolStatus == SymbolStatus::Found) { - wprintf( - L"Symbol file already exists, upload aborted." - L" Use \"-f\" to overwrite.\n"); - return true; - } else if (symbolStatus == SymbolStatus::Unknown) { - wprintf(L"Failed to get check for existing symbol.\n"); - return false; - } - } - - UploadUrlResponse uploadUrlResponse; - if (!SymbolCollectorClient::CreateUploadUrl(url, key, timeout_ms, - &uploadUrlResponse)) { - wprintf(L"Failed to create upload URL.\n"); - return false; - } - - wstring signed_url = uploadUrlResponse.upload_url; - wstring upload_key = uploadUrlResponse.upload_key; - wstring response; - int response_code; - bool success = HTTPUpload::SendPutRequest( - signed_url, symbol_filename, timeout_ms, &response, &response_code); - if (!success) { - wprintf(L"Failed to send symbol file.\n"); - wprintf(L"Response code: %ld\n", response_code); - wprintf(L"Response:\n"); - wprintf(L"%s\n", response.c_str()); - return false; - } else if (response_code == 0) { - wprintf(L"Failed to send symbol file: No response code\n"); - return false; - } else if (response_code != 200) { - wprintf(L"Failed to send symbol file: Response code %ld\n", response_code); - wprintf(L"Response:\n"); - wprintf(L"%s\n", response.c_str()); - return false; - } - - CompleteUploadResult completeUploadResult = - SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, - debug_file, debug_id, symbol_type, - product_name); - if (completeUploadResult == CompleteUploadResult::Error) { - wprintf(L"Failed to complete upload.\n"); - return false; - } else if (completeUploadResult == CompleteUploadResult::DuplicateData) { - wprintf( - L"Uploaded file checksum matched existing file checksum," - L" no change necessary.\n"); - } else { - wprintf(L"Successfully sent the symbol file.\n"); - } - - return true; -} - -} // namespace google_breakpad \ No newline at end of file +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/windows/sym_upload_v2_protocol.h" + +#include + +#include "common/windows/http_upload.h" +#include "common/windows/symbol_collector_client.h" + +using google_breakpad::CompleteUploadResult; +using google_breakpad::HTTPUpload; +using google_breakpad::SymbolCollectorClient; +using google_breakpad::SymbolStatus; +using google_breakpad::UploadUrlResponse; +using std::wstring; + +namespace google_breakpad { + +static bool SymUploadV2ProtocolSend(const wchar_t* api_url, + const wchar_t* api_key, + int* timeout_ms, + const wstring& debug_file, + const wstring& debug_id, + const wstring& symbol_filename, + const wstring& symbol_type, + const wstring& product_name, + bool force) { + wstring url(api_url); + wstring key(api_key); + + if (!force) { + SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus( + url, key, timeout_ms, debug_file, debug_id); + if (symbolStatus == SymbolStatus::Found) { + wprintf( + L"Symbol file already exists, upload aborted." + L" Use \"-f\" to overwrite.\n"); + return true; + } else if (symbolStatus == SymbolStatus::Unknown) { + wprintf(L"Failed to get check for existing symbol.\n"); + return false; + } + } + + UploadUrlResponse uploadUrlResponse; + if (!SymbolCollectorClient::CreateUploadUrl(url, key, timeout_ms, + &uploadUrlResponse)) { + wprintf(L"Failed to create upload URL.\n"); + return false; + } + + wstring signed_url = uploadUrlResponse.upload_url; + wstring upload_key = uploadUrlResponse.upload_key; + wstring response; + int response_code; + bool success = HTTPUpload::SendPutRequest( + signed_url, symbol_filename, timeout_ms, &response, &response_code); + if (!success) { + wprintf(L"Failed to send symbol file.\n"); + wprintf(L"Response code: %ld\n", response_code); + wprintf(L"Response:\n"); + wprintf(L"%s\n", response.c_str()); + return false; + } else if (response_code == 0) { + wprintf(L"Failed to send symbol file: No response code\n"); + return false; + } else if (response_code != 200) { + wprintf(L"Failed to send symbol file: Response code %ld\n", response_code); + wprintf(L"Response:\n"); + wprintf(L"%s\n", response.c_str()); + return false; + } + + CompleteUploadResult completeUploadResult = + SymbolCollectorClient::CompleteUpload(url, key, timeout_ms, upload_key, + debug_file, debug_id, symbol_type, + product_name); + if (completeUploadResult == CompleteUploadResult::Error) { + wprintf(L"Failed to complete upload.\n"); + return false; + } else if (completeUploadResult == CompleteUploadResult::DuplicateData) { + wprintf( + L"Uploaded file checksum matched existing file checksum," + L" no change necessary.\n"); + } else { + wprintf(L"Successfully sent the symbol file.\n"); + } + + return true; +} + +} // namespace google_breakpad diff --git a/src/common/windows/sym_upload_v2_protocol.h b/src/common/windows/sym_upload_v2_protocol.h index 3c345a4d2..19e6f87a8 100644 --- a/src/common/windows/sym_upload_v2_protocol.h +++ b/src/common/windows/sym_upload_v2_protocol.h @@ -1,67 +1,66 @@ -// Copyright (c) 2022, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ -#define COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ - -#include - -namespace google_breakpad { - -// Sends file at |symbol_filename| using the sym-upload-v2 protocol to -// |api_url| using key |api_key|, and using identifiers |debug_file| and -// |debug_id|. |timeout_ms| is the number of milliseconds to wait before -// terminating the upload attempt. |symbol_type| is the type of the symbol -// file, which is one of: -// "BREAKPAD" -// "ELF" -// "PE" -// "MACHO" -// "DEBUG_ONLY" -// "DWP" -// "DSYM" -// "PDB" -// "SOURCE_MAP" -// If |product_name| is non-empty then it will be sent as part of the symbol -// metadata. -// If |force| is set then it will overwrite an existing file with the -// same |debug_file| and |debug_id| in the store. -bool SymUploadV2ProtocolSend(const wchar_t* api_url, - const wchar_t* api_key, - int* timeout_ms, - const std::wstring& debug_file, - const std::wstring& debug_id, - const std::wstring& symbol_filename, - const std::wstring& symbol_type, - const std::wstring& product_name, - bool force); - -} // namespace google_breakpad - +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ +#define COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ + +#include + +namespace google_breakpad { + +// Sends file at |symbol_filename| using the sym-upload-v2 protocol to +// |api_url| using key |api_key|, and using identifiers |debug_file| and +// |debug_id|. |timeout_ms| is the number of milliseconds to wait before +// terminating the upload attempt. |symbol_type| is the type of the symbol +// file, which is one of: +// "BREAKPAD" +// "ELF" +// "PE" +// "MACHO" +// "DEBUG_ONLY" +// "DWP" +// "DSYM" +// "PDB" +// "SOURCE_MAP" +// If |product_name| is non-empty then it will be sent as part of the symbol +// metadata. +// If |force| is set then it will overwrite an existing file with the +// same |debug_file| and |debug_id| in the store. +bool SymUploadV2ProtocolSend(const wchar_t* api_url, + const wchar_t* api_key, + int* timeout_ms, + const std::wstring& debug_file, + const std::wstring& debug_id, + const std::wstring& symbol_filename, + const std::wstring& symbol_type, + const std::wstring& product_name, + bool force); + +} // namespace google_breakpad + #endif // COMMON_WINDOWS_SYM_UPLOAD_V2_PROTOCOL_H_ \ No newline at end of file diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h index 61ee997dc..4e9bf3b6f 100644 --- a/src/common/windows/symbol_collector_client.h +++ b/src/common/windows/symbol_collector_client.h @@ -1,5 +1,4 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/common/breakpad_types.h b/src/google_breakpad/common/breakpad_types.h index d8828043f..efd94e9d7 100644 --- a/src/google_breakpad/common/breakpad_types.h +++ b/src/google_breakpad/common/breakpad_types.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_amd64.h b/src/google_breakpad/common/minidump_cpu_amd64.h index 4256706d7..308f21ecb 100644 --- a/src/google_breakpad/common/minidump_cpu_amd64.h +++ b/src/google_breakpad/common/minidump_cpu_amd64.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_arm.h b/src/google_breakpad/common/minidump_cpu_arm.h index 6a7113833..2ac0623ec 100644 --- a/src/google_breakpad/common/minidump_cpu_arm.h +++ b/src/google_breakpad/common/minidump_cpu_arm.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2009, Google Inc. - * All rights reserved. +/* Copyright 2009 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_arm64.h b/src/google_breakpad/common/minidump_cpu_arm64.h index 0411bebb4..96f263320 100644 --- a/src/google_breakpad/common/minidump_cpu_arm64.h +++ b/src/google_breakpad/common/minidump_cpu_arm64.h @@ -1,5 +1,4 @@ -/* Copyright 2013 Google Inc. - * All rights reserved. +/* Copyright 2013 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_mips.h b/src/google_breakpad/common/minidump_cpu_mips.h index f4e2b5891..91b700af5 100644 --- a/src/google_breakpad/common/minidump_cpu_mips.h +++ b/src/google_breakpad/common/minidump_cpu_mips.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2013, Google Inc. - * All rights reserved. +/* Copyright 2013 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_ppc.h b/src/google_breakpad/common/minidump_cpu_ppc.h index b24cc4243..17a71af7c 100644 --- a/src/google_breakpad/common/minidump_cpu_ppc.h +++ b/src/google_breakpad/common/minidump_cpu_ppc.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_ppc64.h b/src/google_breakpad/common/minidump_cpu_ppc64.h index 61f419386..75638b5da 100644 --- a/src/google_breakpad/common/minidump_cpu_ppc64.h +++ b/src/google_breakpad/common/minidump_cpu_ppc64.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2008, Google Inc. - * All rights reserved. +/* Copyright 2008 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_sparc.h b/src/google_breakpad/common/minidump_cpu_sparc.h index 95c08b174..6452588a6 100644 --- a/src/google_breakpad/common/minidump_cpu_sparc.h +++ b/src/google_breakpad/common/minidump_cpu_sparc.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_cpu_x86.h b/src/google_breakpad/common/minidump_cpu_x86.h index e09cb7cb5..add1e225d 100644 --- a/src/google_breakpad/common/minidump_cpu_x86.h +++ b/src/google_breakpad/common/minidump_cpu_x86.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_fuchsia.h b/src/google_breakpad/common/minidump_exception_fuchsia.h index f26a8a2ae..169094b22 100644 --- a/src/google_breakpad/common/minidump_exception_fuchsia.h +++ b/src/google_breakpad/common/minidump_exception_fuchsia.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2019, Google Inc. - * All rights reserved. +/* Copyright 2019 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_linux.h b/src/google_breakpad/common/minidump_exception_linux.h index 6138d5d76..354cdd6b3 100644 --- a/src/google_breakpad/common/minidump_exception_linux.h +++ b/src/google_breakpad/common/minidump_exception_linux.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h index e53edc5d5..feb47079f 100644 --- a/src/google_breakpad/common/minidump_exception_mac.h +++ b/src/google_breakpad/common/minidump_exception_mac.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_ps3.h b/src/google_breakpad/common/minidump_exception_ps3.h index adff5a6bb..dd87d7a73 100644 --- a/src/google_breakpad/common/minidump_exception_ps3.h +++ b/src/google_breakpad/common/minidump_exception_ps3.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2013, Google Inc. - * All rights reserved. +/* Copyright 2013 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_solaris.h b/src/google_breakpad/common/minidump_exception_solaris.h index f18ddf424..16641919a 100644 --- a/src/google_breakpad/common/minidump_exception_solaris.h +++ b/src/google_breakpad/common/minidump_exception_solaris.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_exception_win32.h b/src/google_breakpad/common/minidump_exception_win32.h index 9f734d5b7..0431a3fa7 100644 --- a/src/google_breakpad/common/minidump_exception_win32.h +++ b/src/google_breakpad/common/minidump_exception_win32.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index e23666358..3e86f7c8a 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. +/* Copyright 2006 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/google_breakpad/common/minidump_size.h b/src/google_breakpad/common/minidump_size.h index fae57923c..f9abdc361 100644 --- a/src/google_breakpad/common/minidump_size.h +++ b/src/google_breakpad/common/minidump_size.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index d676ab70e..e86b28d2c 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/call_stack.h b/src/google_breakpad/processor/call_stack.h index c59142315..9bf062f83 100644 --- a/src/google_breakpad/processor/call_stack.h +++ b/src/google_breakpad/processor/call_stack.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/code_module.h b/src/google_breakpad/processor/code_module.h index 29b8d9c9a..76bbfab81 100644 --- a/src/google_breakpad/processor/code_module.h +++ b/src/google_breakpad/processor/code_module.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/code_modules.h b/src/google_breakpad/processor/code_modules.h index 74f113c19..7538328bd 100644 --- a/src/google_breakpad/processor/code_modules.h +++ b/src/google_breakpad/processor/code_modules.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/dump_context.h b/src/google_breakpad/processor/dump_context.h index df80bf7ef..90f066b89 100644 --- a/src/google_breakpad/processor/dump_context.h +++ b/src/google_breakpad/processor/dump_context.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/dump_object.h b/src/google_breakpad/processor/dump_object.h index 112f687f4..0b1f48844 100644 --- a/src/google_breakpad/processor/dump_object.h +++ b/src/google_breakpad/processor/dump_object.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/exception_record.h b/src/google_breakpad/processor/exception_record.h index eac6c90ae..aa2b0de30 100644 --- a/src/google_breakpad/processor/exception_record.h +++ b/src/google_breakpad/processor/exception_record.h @@ -1,5 +1,4 @@ -// Copyright (c) 2019 Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/exploitability.h b/src/google_breakpad/processor/exploitability.h index 014413c94..0b51ba135 100644 --- a/src/google_breakpad/processor/exploitability.h +++ b/src/google_breakpad/processor/exploitability.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/fast_source_line_resolver.h b/src/google_breakpad/processor/fast_source_line_resolver.h index 535fc1064..11cec75ed 100644 --- a/src/google_breakpad/processor/fast_source_line_resolver.h +++ b/src/google_breakpad/processor/fast_source_line_resolver.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/memory_region.h b/src/google_breakpad/processor/memory_region.h index 30f88df49..378fcc39b 100644 --- a/src/google_breakpad/processor/memory_region.h +++ b/src/google_breakpad/processor/memory_region.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/microdump.h b/src/google_breakpad/processor/microdump.h index 02ebdcd79..7c2f3e662 100644 --- a/src/google_breakpad/processor/microdump.h +++ b/src/google_breakpad/processor/microdump.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/microdump_processor.h b/src/google_breakpad/processor/microdump_processor.h index 60d14a541..abf468f48 100644 --- a/src/google_breakpad/processor/microdump_processor.h +++ b/src/google_breakpad/processor/microdump_processor.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 200a7e82d..54d288176 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h index 414050e97..aa44e86c1 100644 --- a/src/google_breakpad/processor/minidump_processor.h +++ b/src/google_breakpad/processor/minidump_processor.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/proc_maps_linux.h b/src/google_breakpad/processor/proc_maps_linux.h index 3045daa5f..b99414c34 100644 --- a/src/google_breakpad/processor/proc_maps_linux.h +++ b/src/google_breakpad/processor/proc_maps_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 Google LLC // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/src/google_breakpad/processor/process_result.h b/src/google_breakpad/processor/process_result.h index 9317e98e1..780060d9a 100644 --- a/src/google_breakpad/processor/process_result.h +++ b/src/google_breakpad/processor/process_result.h @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/process_state.h b/src/google_breakpad/processor/process_state.h index c13246fda..3fe6a5c27 100644 --- a/src/google_breakpad/processor/process_state.h +++ b/src/google_breakpad/processor/process_state.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/source_line_resolver_base.h b/src/google_breakpad/processor/source_line_resolver_base.h index ba68798ab..4c64bfc91 100644 --- a/src/google_breakpad/processor/source_line_resolver_base.h +++ b/src/google_breakpad/processor/source_line_resolver_base.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index 2614f65e0..9f1f50c91 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/stack_frame.h b/src/google_breakpad/processor/stack_frame.h index 7d5682a7d..eebe06e6a 100644 --- a/src/google_breakpad/processor/stack_frame.h +++ b/src/google_breakpad/processor/stack_frame.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h index 24e28ca12..363913bf6 100644 --- a/src/google_breakpad/processor/stack_frame_cpu.h +++ b/src/google_breakpad/processor/stack_frame_cpu.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h index 91ef64b54..ed342ce65 100644 --- a/src/google_breakpad/processor/stack_frame_symbolizer.h +++ b/src/google_breakpad/processor/stack_frame_symbolizer.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h index daa5039ae..e5d88c806 100644 --- a/src/google_breakpad/processor/stackwalker.h +++ b/src/google_breakpad/processor/stackwalker.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/symbol_supplier.h b/src/google_breakpad/processor/symbol_supplier.h index 6ec017665..b1c235351 100644 --- a/src/google_breakpad/processor/symbol_supplier.h +++ b/src/google_breakpad/processor/symbol_supplier.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/google_breakpad/processor/system_info.h b/src/google_breakpad/processor/system_info.h index 8d2f60be4..01c48182b 100644 --- a/src/google_breakpad/processor/system_info.h +++ b/src/google_breakpad/processor/system_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/address_map-inl.h b/src/processor/address_map-inl.h index 96d955ad7..e1b944d1e 100644 --- a/src/processor/address_map-inl.h +++ b/src/processor/address_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/address_map.h b/src/processor/address_map.h index 87321a7f6..8a4f7ba85 100644 --- a/src/processor/address_map.h +++ b/src/processor/address_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/address_map_unittest.cc b/src/processor/address_map_unittest.cc index 7c85f5ebd..1bf0d7180 100644 --- a/src/processor/address_map_unittest.cc +++ b/src/processor/address_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_code_module.h b/src/processor/basic_code_module.h index 75272897d..9da62d928 100644 --- a/src/processor/basic_code_module.h +++ b/src/processor/basic_code_module.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_code_modules.cc b/src/processor/basic_code_modules.cc index f71aeb747..57021d479 100644 --- a/src/processor/basic_code_modules.cc +++ b/src/processor/basic_code_modules.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_code_modules.h b/src/processor/basic_code_modules.h index 8c26abb1e..e9d58f6b0 100644 --- a/src/processor/basic_code_modules.h +++ b/src/processor/basic_code_modules.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index e525d4f9e..07aba6bc2 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h index 6bd6968ce..3c8b01c70 100644 --- a/src/processor/basic_source_line_resolver_types.h +++ b/src/processor/basic_source_line_resolver_types.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index a9f1a886a..fba4e9a6b 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/call_stack.cc b/src/processor/call_stack.cc index f219e8431..87ffd1ae3 100644 --- a/src/processor/call_stack.cc +++ b/src/processor/call_stack.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/cfi_frame_info-inl.h b/src/processor/cfi_frame_info-inl.h index 52d2f5fc7..acfc4f795 100644 --- a/src/processor/cfi_frame_info-inl.h +++ b/src/processor/cfi_frame_info-inl.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc index 258a1194a..5216a44ea 100644 --- a/src/processor/cfi_frame_info.cc +++ b/src/processor/cfi_frame_info.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/cfi_frame_info.h b/src/processor/cfi_frame_info.h index 2bc933360..08f1eb72b 100644 --- a/src/processor/cfi_frame_info.h +++ b/src/processor/cfi_frame_info.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/cfi_frame_info_unittest.cc b/src/processor/cfi_frame_info_unittest.cc index 919aafac1..85f970a5e 100644 --- a/src/processor/cfi_frame_info_unittest.cc +++ b/src/processor/cfi_frame_info_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/contained_range_map-inl.h b/src/processor/contained_range_map-inl.h index 605f60f2b..e085dcb45 100644 --- a/src/processor/contained_range_map-inl.h +++ b/src/processor/contained_range_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/contained_range_map.h b/src/processor/contained_range_map.h index 963548f47..24a3bb41e 100644 --- a/src/processor/contained_range_map.h +++ b/src/processor/contained_range_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/contained_range_map_unittest.cc b/src/processor/contained_range_map_unittest.cc index 6597cac81..670bb1898 100644 --- a/src/processor/contained_range_map_unittest.cc +++ b/src/processor/contained_range_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/convert_old_arm64_context.cc b/src/processor/convert_old_arm64_context.cc index d4b749e7f..8347064a2 100644 --- a/src/processor/convert_old_arm64_context.cc +++ b/src/processor/convert_old_arm64_context.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2018, Google Inc. -// All rights reserved. +// Copyright 2018 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/convert_old_arm64_context.h b/src/processor/convert_old_arm64_context.h index 8c0dfe900..241b9259b 100644 --- a/src/processor/convert_old_arm64_context.h +++ b/src/processor/convert_old_arm64_context.h @@ -1,5 +1,4 @@ -// Copyright (c) 2018, Google Inc. -// All rights reserved. +// Copyright 2018 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/disassembler_x86.cc b/src/processor/disassembler_x86.cc index 012676785..dffb996de 100644 --- a/src/processor/disassembler_x86.cc +++ b/src/processor/disassembler_x86.cc @@ -1,7 +1,16 @@ +// Copyright 2010 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/disassembler_x86.h b/src/processor/disassembler_x86.h index ca65b6e89..493f7f2e7 100644 --- a/src/processor/disassembler_x86.h +++ b/src/processor/disassembler_x86.h @@ -1,4 +1,4 @@ -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/disassembler_x86_unittest.cc b/src/processor/disassembler_x86_unittest.cc index 352905f20..117b3bf8e 100644 --- a/src/processor/disassembler_x86_unittest.cc +++ b/src/processor/disassembler_x86_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -25,7 +24,7 @@ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include diff --git a/src/processor/dump_context.cc b/src/processor/dump_context.cc index da531b74d..70798d1e8 100644 --- a/src/processor/dump_context.cc +++ b/src/processor/dump_context.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/dump_object.cc b/src/processor/dump_object.cc index 2c82b200b..6186c8faf 100644 --- a/src/processor/dump_object.cc +++ b/src/processor/dump_object.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/exploitability.cc b/src/processor/exploitability.cc index 5f05b5105..7a4107bf9 100644 --- a/src/processor/exploitability.cc +++ b/src/processor/exploitability.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index bc1b0b08c..30e799fc6 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/exploitability_linux.h b/src/processor/exploitability_linux.h index 84197bb6b..c5ed25724 100644 --- a/src/processor/exploitability_linux.h +++ b/src/processor/exploitability_linux.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index 2baff327b..db3dc687a 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -25,7 +24,7 @@ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include diff --git a/src/processor/exploitability_win.cc b/src/processor/exploitability_win.cc index 3c1f48953..accaadd3e 100644 --- a/src/processor/exploitability_win.cc +++ b/src/processor/exploitability_win.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/exploitability_win.h b/src/processor/exploitability_win.h index 4e08aef03..52cff8b75 100644 --- a/src/processor/exploitability_win.h +++ b/src/processor/exploitability_win.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 1fbe06fac..0d1ebc6b4 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/fast_source_line_resolver_types.h b/src/processor/fast_source_line_resolver_types.h index 718905dfe..75b9004f6 100644 --- a/src/processor/fast_source_line_resolver_types.h +++ b/src/processor/fast_source_line_resolver_types.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc index 6ef443caa..1bb350193 100644 --- a/src/processor/fast_source_line_resolver_unittest.cc +++ b/src/processor/fast_source_line_resolver_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/linked_ptr.h b/src/processor/linked_ptr.h index 72fbba84a..5de49ee90 100644 --- a/src/processor/linked_ptr.h +++ b/src/processor/linked_ptr.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/logging.cc b/src/processor/logging.cc index 3c5b16165..136f4f8f4 100644 --- a/src/processor/logging.cc +++ b/src/processor/logging.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/logging.h b/src/processor/logging.h index e6c6eee2a..8c040837f 100644 --- a/src/processor/logging.h +++ b/src/processor/logging.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/map_serializers-inl.h b/src/processor/map_serializers-inl.h index 4933f907b..577b95f7b 100644 --- a/src/processor/map_serializers-inl.h +++ b/src/processor/map_serializers-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/map_serializers.h b/src/processor/map_serializers.h index 3d504158e..54153f8a2 100644 --- a/src/processor/map_serializers.h +++ b/src/processor/map_serializers.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/map_serializers_unittest.cc b/src/processor/map_serializers_unittest.cc index 48b9c4b24..74ebd5e5a 100644 --- a/src/processor/map_serializers_unittest.cc +++ b/src/processor/map_serializers_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc index d8141a2a8..83fb098cc 100644 --- a/src/processor/microdump.cc +++ b/src/processor/microdump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/microdump_processor.cc b/src/processor/microdump_processor.cc index 2d3a9558a..be6150cdd 100644 --- a/src/processor/microdump_processor.cc +++ b/src/processor/microdump_processor.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc index 83bdef952..3362431b0 100644 --- a/src/processor/microdump_processor_unittest.cc +++ b/src/processor/microdump_processor_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014, Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/microdump_stackwalk.cc b/src/processor/microdump_stackwalk.cc index 34b6fb942..593b07d68 100644 --- a/src/processor/microdump_stackwalk.cc +++ b/src/processor/microdump_stackwalk.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2014 Google Inc. -// All rights reserved. +// Copyright 2014 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/microdump_stackwalk_machine_readable_test b/src/processor/microdump_stackwalk_machine_readable_test index f5614e20f..a08984663 100755 --- a/src/processor/microdump_stackwalk_machine_readable_test +++ b/src/processor/microdump_stackwalk_machine_readable_test @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2014, Google Inc. -# All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/microdump_stackwalk_test b/src/processor/microdump_stackwalk_test index e18976566..cb8950820 100755 --- a/src/processor/microdump_stackwalk_test +++ b/src/processor/microdump_stackwalk_test @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2014, Google Inc. -# All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index db7a4a16a..d9e3e3232 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/minidump_dump.cc b/src/processor/minidump_dump.cc index ce7432e56..83afd1da5 100644 --- a/src/processor/minidump_dump.cc +++ b/src/processor/minidump_dump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/minidump_dump_test b/src/processor/minidump_dump_test index fb62ace73..32ae38c5c 100755 --- a/src/processor/minidump_dump_test +++ b/src/processor/minidump_dump_test @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2006, Google Inc. -# All rights reserved. +# Copyright 2006 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index e6875c9ea..a80baf457 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 3af000d0a..6dfa54a64 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc index 270a2b859..cee9a734d 100644 --- a/src/processor/minidump_stackwalk.cc +++ b/src/processor/minidump_stackwalk.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/minidump_stackwalk_machine_readable_test b/src/processor/minidump_stackwalk_machine_readable_test index 2aadb2412..84672183b 100755 --- a/src/processor/minidump_stackwalk_machine_readable_test +++ b/src/processor/minidump_stackwalk_machine_readable_test @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2007, Google Inc. -# All rights reserved. +# Copyright 2007 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/minidump_stackwalk_test b/src/processor/minidump_stackwalk_test index f97902791..c7da9c4af 100755 --- a/src/processor/minidump_stackwalk_test +++ b/src/processor/minidump_stackwalk_test @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2006, Google Inc. -# All rights reserved. +# Copyright 2006 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc index 49b007fed..9936a7e4a 100644 --- a/src/processor/minidump_unittest.cc +++ b/src/processor/minidump_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/module_comparer.cc b/src/processor/module_comparer.cc index 669f11335..389712c50 100644 --- a/src/processor/module_comparer.cc +++ b/src/processor/module_comparer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/module_comparer.h b/src/processor/module_comparer.h index 3691081d0..6bd3e7b8a 100644 --- a/src/processor/module_comparer.h +++ b/src/processor/module_comparer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/module_factory.h b/src/processor/module_factory.h index c6465f42d..3df85a60c 100644 --- a/src/processor/module_factory.h +++ b/src/processor/module_factory.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/module_serializer.cc b/src/processor/module_serializer.cc index 8ad0d589b..d04450946 100644 --- a/src/processor/module_serializer.cc +++ b/src/processor/module_serializer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/module_serializer.h b/src/processor/module_serializer.h index 94e25c010..4e365a417 100644 --- a/src/processor/module_serializer.h +++ b/src/processor/module_serializer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/pathname_stripper.cc b/src/processor/pathname_stripper.cc index c425b46a1..f34b53f7f 100644 --- a/src/processor/pathname_stripper.cc +++ b/src/processor/pathname_stripper.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/pathname_stripper.h b/src/processor/pathname_stripper.h index fdf15e03b..62c9bdddc 100644 --- a/src/processor/pathname_stripper.h +++ b/src/processor/pathname_stripper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/pathname_stripper_unittest.cc b/src/processor/pathname_stripper_unittest.cc index 61f74fa5e..ff474a7b7 100644 --- a/src/processor/pathname_stripper_unittest.cc +++ b/src/processor/pathname_stripper_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/postfix_evaluator-inl.h b/src/processor/postfix_evaluator-inl.h index f567b1c8d..abdf259ef 100644 --- a/src/processor/postfix_evaluator-inl.h +++ b/src/processor/postfix_evaluator-inl.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/postfix_evaluator.h b/src/processor/postfix_evaluator.h index d847a9b16..b6f718ab0 100644 --- a/src/processor/postfix_evaluator.h +++ b/src/processor/postfix_evaluator.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/postfix_evaluator_unittest.cc b/src/processor/postfix_evaluator_unittest.cc index 5a01584a0..76d857511 100644 --- a/src/processor/postfix_evaluator_unittest.cc +++ b/src/processor/postfix_evaluator_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/proc_maps_linux.cc b/src/processor/proc_maps_linux.cc index 3c0dea25d..05c1145a9 100644 --- a/src/processor/proc_maps_linux.cc +++ b/src/processor/proc_maps_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 Google LLC // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/src/processor/proc_maps_linux_unittest.cc b/src/processor/proc_maps_linux_unittest.cc index 466f23455..dc51babb9 100644 --- a/src/processor/proc_maps_linux_unittest.cc +++ b/src/processor/proc_maps_linux_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 Google LLC // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/src/processor/process_state.cc b/src/processor/process_state.cc index 52e484d9a..95bbd48dc 100644 --- a/src/processor/process_state.cc +++ b/src/processor/process_state.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/processor.gyp b/src/processor/processor.gyp index 93896c0e9..f812b1ec9 100644 --- a/src/processor/processor.gyp +++ b/src/processor/processor.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/processor_tools.gypi b/src/processor/processor_tools.gypi index ecb450d60..e64645db7 100644 --- a/src/processor/processor_tools.gypi +++ b/src/processor/processor_tools.gypi @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/processor/proto/process_state.proto b/src/processor/proto/process_state.proto index d3e02dc3f..f6b5fb4fe 100644 --- a/src/processor/proto/process_state.proto +++ b/src/processor/proto/process_state.proto @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/range_map-inl.h b/src/processor/range_map-inl.h index ba47893c5..860314f52 100644 --- a/src/processor/range_map-inl.h +++ b/src/processor/range_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/range_map.h b/src/processor/range_map.h index baea91cf4..578bd1442 100644 --- a/src/processor/range_map.h +++ b/src/processor/range_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/range_map_truncate_lower_unittest.cc b/src/processor/range_map_truncate_lower_unittest.cc index a933c956f..12dad8733 100644 --- a/src/processor/range_map_truncate_lower_unittest.cc +++ b/src/processor/range_map_truncate_lower_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2019, Google Inc. -// All rights reserved. +// Copyright 2019 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -25,7 +24,7 @@ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include diff --git a/src/processor/range_map_truncate_upper_unittest.cc b/src/processor/range_map_truncate_upper_unittest.cc index 7e3034f2f..57046e196 100644 --- a/src/processor/range_map_truncate_upper_unittest.cc +++ b/src/processor/range_map_truncate_upper_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2016, Google Inc. -// All rights reserved. +// Copyright 2016 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -25,7 +24,7 @@ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // range_map_shrink_down_unittest.cc: Unit tests for RangeMap that specifically // test shrink down when ranges overlap. diff --git a/src/processor/range_map_unittest.cc b/src/processor/range_map_unittest.cc index 38369bfbf..2745e8097 100644 --- a/src/processor/range_map_unittest.cc +++ b/src/processor/range_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/simple_serializer-inl.h b/src/processor/simple_serializer-inl.h index c8d3e3c29..bc2c8def2 100644 --- a/src/processor/simple_serializer-inl.h +++ b/src/processor/simple_serializer-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/simple_serializer.h b/src/processor/simple_serializer.h index e1b1efd14..bd6cc84ce 100644 --- a/src/processor/simple_serializer.h +++ b/src/processor/simple_serializer.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/simple_symbol_supplier.cc b/src/processor/simple_symbol_supplier.cc index cdc3efbf9..5b3f6819e 100644 --- a/src/processor/simple_symbol_supplier.cc +++ b/src/processor/simple_symbol_supplier.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/simple_symbol_supplier.h b/src/processor/simple_symbol_supplier.h index 3a65c7e60..3302bab63 100644 --- a/src/processor/simple_symbol_supplier.h +++ b/src/processor/simple_symbol_supplier.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index 463033482..5c0b6cd7a 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h index 828895503..4b3b366cb 100644 --- a/src/processor/source_line_resolver_base_types.h +++ b/src/processor/source_line_resolver_base_types.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stack_frame_cpu.cc b/src/processor/stack_frame_cpu.cc index 6175dc7f2..e31a31988 100644 --- a/src/processor/stack_frame_cpu.cc +++ b/src/processor/stack_frame_cpu.cc @@ -1,5 +1,4 @@ -// Copyright 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc index a460bc9ed..0d124a021 100644 --- a/src/processor/stack_frame_symbolizer.cc +++ b/src/processor/stack_frame_symbolizer.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012 Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index c1e17084d..cf1114d96 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalk_common.h b/src/processor/stackwalk_common.h index 998f89b0f..bb12b98f4 100644 --- a/src/processor/stackwalk_common.h +++ b/src/processor/stackwalk_common.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index e123b0277..13f89b171 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_address_list.cc b/src/processor/stackwalker_address_list.cc index e81fec282..b393d4757 100644 --- a/src/processor/stackwalker_address_list.cc +++ b/src/processor/stackwalker_address_list.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_address_list.h b/src/processor/stackwalker_address_list.h index 0f8c989ef..28d377c3e 100644 --- a/src/processor/stackwalker_address_list.h +++ b/src/processor/stackwalker_address_list.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_address_list_unittest.cc b/src/processor/stackwalker_address_list_unittest.cc index 2828dff21..feda62681 100644 --- a/src/processor/stackwalker_address_list_unittest.cc +++ b/src/processor/stackwalker_address_list_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index b7628ac38..6a539709f 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_amd64.h b/src/processor/stackwalker_amd64.h index 784010388..307f2444a 100644 --- a/src/processor/stackwalker_amd64.h +++ b/src/processor/stackwalker_amd64.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_amd64_unittest.cc b/src/processor/stackwalker_amd64_unittest.cc index a77015a6c..a7e513e93 100644 --- a/src/processor/stackwalker_amd64_unittest.cc +++ b/src/processor/stackwalker_amd64_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm.cc b/src/processor/stackwalker_arm.cc index 7890cbe3e..7df2eb6d3 100644 --- a/src/processor/stackwalker_arm.cc +++ b/src/processor/stackwalker_arm.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm.h b/src/processor/stackwalker_arm.h index 72ddddcc4..d95b4e32d 100644 --- a/src/processor/stackwalker_arm.h +++ b/src/processor/stackwalker_arm.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm64.cc b/src/processor/stackwalker_arm64.cc index 71814c2da..ae3a05958 100644 --- a/src/processor/stackwalker_arm64.cc +++ b/src/processor/stackwalker_arm64.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm64.h b/src/processor/stackwalker_arm64.h index 4c7da3fbd..193ab302a 100644 --- a/src/processor/stackwalker_arm64.h +++ b/src/processor/stackwalker_arm64.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm64_unittest.cc b/src/processor/stackwalker_arm64_unittest.cc index 6553e0cd9..37475058f 100644 --- a/src/processor/stackwalker_arm64_unittest.cc +++ b/src/processor/stackwalker_arm64_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_arm_unittest.cc b/src/processor/stackwalker_arm_unittest.cc index 046081fa2..20c810a71 100644 --- a/src/processor/stackwalker_arm_unittest.cc +++ b/src/processor/stackwalker_arm_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_mips.cc b/src/processor/stackwalker_mips.cc index c4ee21f35..11b08fae7 100644 --- a/src/processor/stackwalker_mips.cc +++ b/src/processor/stackwalker_mips.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_mips.h b/src/processor/stackwalker_mips.h index 5f97791fb..e9776074e 100644 --- a/src/processor/stackwalker_mips.h +++ b/src/processor/stackwalker_mips.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_mips64_unittest.cc b/src/processor/stackwalker_mips64_unittest.cc index e1bf5086c..aefcf8eec 100644 --- a/src/processor/stackwalker_mips64_unittest.cc +++ b/src/processor/stackwalker_mips64_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_mips_unittest.cc b/src/processor/stackwalker_mips_unittest.cc index 21267aebc..ac7324c46 100644 --- a/src/processor/stackwalker_mips_unittest.cc +++ b/src/processor/stackwalker_mips_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013, Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_ppc.cc b/src/processor/stackwalker_ppc.cc index b5dab8990..e71d91380 100644 --- a/src/processor/stackwalker_ppc.cc +++ b/src/processor/stackwalker_ppc.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_ppc.h b/src/processor/stackwalker_ppc.h index 012e5c32f..182e46d45 100644 --- a/src/processor/stackwalker_ppc.h +++ b/src/processor/stackwalker_ppc.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_ppc64.cc b/src/processor/stackwalker_ppc64.cc index f7b24a2b5..9ac8e45bd 100644 --- a/src/processor/stackwalker_ppc64.cc +++ b/src/processor/stackwalker_ppc64.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_ppc64.h b/src/processor/stackwalker_ppc64.h index a406343af..ede0b51c6 100644 --- a/src/processor/stackwalker_ppc64.h +++ b/src/processor/stackwalker_ppc64.h @@ -1,5 +1,4 @@ -// Copyright (c) 2013 Google Inc. -// All rights reserved. +// Copyright 2013 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_selftest.cc b/src/processor/stackwalker_selftest.cc index dcb2df007..2737f64dc 100644 --- a/src/processor/stackwalker_selftest.cc +++ b/src/processor/stackwalker_selftest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_selftest_sol.s b/src/processor/stackwalker_selftest_sol.s index 648b0499a..11d1698fb 100644 --- a/src/processor/stackwalker_selftest_sol.s +++ b/src/processor/stackwalker_selftest_sol.s @@ -1,5 +1,4 @@ -/* Copyright (c) 2007, Google Inc. - * All rights reserved. +/* Copyright 2007 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * diff --git a/src/processor/stackwalker_sparc.cc b/src/processor/stackwalker_sparc.cc index df58570d2..fb76744cb 100644 --- a/src/processor/stackwalker_sparc.cc +++ b/src/processor/stackwalker_sparc.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_sparc.h b/src/processor/stackwalker_sparc.h index e8f2a3888..b7ba507e5 100644 --- a/src/processor/stackwalker_sparc.h +++ b/src/processor/stackwalker_sparc.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_unittest_utils.h b/src/processor/stackwalker_unittest_utils.h index 2905ea06e..3d651b2cb 100644 --- a/src/processor/stackwalker_unittest_utils.h +++ b/src/processor/stackwalker_unittest_utils.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc index 41acaae43..b598c5bd6 100644 --- a/src/processor/stackwalker_x86.cc +++ b/src/processor/stackwalker_x86.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_x86.h b/src/processor/stackwalker_x86.h index 1783fda32..1867a689b 100644 --- a/src/processor/stackwalker_x86.h +++ b/src/processor/stackwalker_x86.h @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/stackwalker_x86_unittest.cc b/src/processor/stackwalker_x86_unittest.cc index b6f14a145..3d786b8e3 100644 --- a/src/processor/stackwalker_x86_unittest.cc +++ b/src/processor/stackwalker_x86_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_address_map-inl.h b/src/processor/static_address_map-inl.h index 9d2c1defb..0dd13f840 100644 --- a/src/processor/static_address_map-inl.h +++ b/src/processor/static_address_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_address_map.h b/src/processor/static_address_map.h index 9d1a467b0..156ecd635 100644 --- a/src/processor/static_address_map.h +++ b/src/processor/static_address_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_address_map_unittest.cc b/src/processor/static_address_map_unittest.cc index 9f1215d6a..2e206a099 100644 --- a/src/processor/static_address_map_unittest.cc +++ b/src/processor/static_address_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_contained_range_map-inl.h b/src/processor/static_contained_range_map-inl.h index 58c833717..60606ddc6 100644 --- a/src/processor/static_contained_range_map-inl.h +++ b/src/processor/static_contained_range_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_contained_range_map.h b/src/processor/static_contained_range_map.h index efdfbeabb..86e54666d 100644 --- a/src/processor/static_contained_range_map.h +++ b/src/processor/static_contained_range_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_contained_range_map_unittest.cc b/src/processor/static_contained_range_map_unittest.cc index e2b25a2a1..cdc11c1db 100644 --- a/src/processor/static_contained_range_map_unittest.cc +++ b/src/processor/static_contained_range_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_map-inl.h b/src/processor/static_map-inl.h index 75a8a335a..f9929efe9 100644 --- a/src/processor/static_map-inl.h +++ b/src/processor/static_map-inl.h @@ -1,4 +1,4 @@ -// Copyright 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_map.h b/src/processor/static_map.h index e7d8c9600..a8f495820 100644 --- a/src/processor/static_map.h +++ b/src/processor/static_map.h @@ -1,4 +1,4 @@ -// Copyright 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_map_iterator-inl.h b/src/processor/static_map_iterator-inl.h index 84745842c..01a1b7f7b 100644 --- a/src/processor/static_map_iterator-inl.h +++ b/src/processor/static_map_iterator-inl.h @@ -1,4 +1,4 @@ -// Copyright 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_map_iterator.h b/src/processor/static_map_iterator.h index c49a8b71b..6c190e975 100644 --- a/src/processor/static_map_iterator.h +++ b/src/processor/static_map_iterator.h @@ -1,4 +1,4 @@ -// Copyright 2010 Google Inc. All Rights Reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_map_unittest.cc b/src/processor/static_map_unittest.cc index d17153d96..4360e8c61 100644 --- a/src/processor/static_map_unittest.cc +++ b/src/processor/static_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_range_map-inl.h b/src/processor/static_range_map-inl.h index 37fb6fae4..b0a327479 100644 --- a/src/processor/static_range_map-inl.h +++ b/src/processor/static_range_map-inl.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_range_map.h b/src/processor/static_range_map.h index ea89fae4a..319085db2 100644 --- a/src/processor/static_range_map.h +++ b/src/processor/static_range_map.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/static_range_map_unittest.cc b/src/processor/static_range_map_unittest.cc index 22384253d..3903e9486 100644 --- a/src/processor/static_range_map_unittest.cc +++ b/src/processor/static_range_map_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/symbolic_constants_win.cc b/src/processor/symbolic_constants_win.cc index 8cf283f6a..0c57b6868 100644 --- a/src/processor/symbolic_constants_win.cc +++ b/src/processor/symbolic_constants_win.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2015 Google Inc. -// All rights reserved. +// Copyright 2015 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/symbolic_constants_win.h b/src/processor/symbolic_constants_win.h index 3f4d38eb2..bc9ff3500 100644 --- a/src/processor/symbolic_constants_win.h +++ b/src/processor/symbolic_constants_win.h @@ -1,5 +1,4 @@ -// Copyright (c) 2015 Google Inc. -// All rights reserved. +// Copyright 2015 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/synth_minidump.cc b/src/processor/synth_minidump.cc index da61afc4b..9dacb395a 100644 --- a/src/processor/synth_minidump.cc +++ b/src/processor/synth_minidump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/synth_minidump.h b/src/processor/synth_minidump.h index 2da4d5fe9..a52be03bf 100644 --- a/src/processor/synth_minidump.h +++ b/src/processor/synth_minidump.h @@ -1,7 +1,6 @@ // -*- mode: C++ -*- -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/synth_minidump_unittest.cc b/src/processor/synth_minidump_unittest.cc index 8835b4493..4bc46747b 100644 --- a/src/processor/synth_minidump_unittest.cc +++ b/src/processor/synth_minidump_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/testdata/linux_test_app.cc b/src/processor/testdata/linux_test_app.cc index 9df6dccca..4ff4f7076 100644 --- a/src/processor/testdata/linux_test_app.cc +++ b/src/processor/testdata/linux_test_app.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/testdata/test_app.cc b/src/processor/testdata/test_app.cc index c744a37a9..79cabef09 100644 --- a/src/processor/testdata/test_app.cc +++ b/src/processor/testdata/test_app.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/tokenize.cc b/src/processor/tokenize.cc index 29e8125ab..4e62f2ea8 100644 --- a/src/processor/tokenize.cc +++ b/src/processor/tokenize.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/tokenize.h b/src/processor/tokenize.h index c4480aa80..b30c74155 100644 --- a/src/processor/tokenize.h +++ b/src/processor/tokenize.h @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/processor/windows_frame_info.h b/src/processor/windows_frame_info.h index 993832ad7..4014a1a99 100644 --- a/src/processor/windows_frame_info.h +++ b/src/processor/windows_frame_info.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/third_party/libdisasm/libdisasm.gyp b/src/third_party/libdisasm/libdisasm.gyp index 5c8dc4586..4847dd428 100644 --- a/src/third_party/libdisasm/libdisasm.gyp +++ b/src/third_party/libdisasm/libdisasm.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/third_party/linux/include/gflags/gflags_completions.h b/src/third_party/linux/include/gflags/gflags_completions.h index 9d9ce7a5f..fe06b47a3 100644 --- a/src/third_party/linux/include/gflags/gflags_completions.h +++ b/src/third_party/linux/include/gflags/gflags_completions.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. +// Copyright 2008 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/core2md/core2md.cc b/src/tools/linux/core2md/core2md.cc index 723796c72..3f34294f5 100644 --- a/src/tools/linux/core2md/core2md.cc +++ b/src/tools/linux/core2md/core2md.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. +// Copyright 2012 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/core_handler/core_handler.cc b/src/tools/linux/core_handler/core_handler.cc index 975311d6c..224073d34 100644 --- a/src/tools/linux/core_handler/core_handler.cc +++ b/src/tools/linux/core_handler/core_handler.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index b0f56e958..6e6a64249 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 7e351d16f..522b9d1c0 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/md2core/minidump_memory_range.h b/src/tools/linux/md2core/minidump_memory_range.h index a793e2cfb..6cf074703 100644 --- a/src/tools/linux/md2core/minidump_memory_range.h +++ b/src/tools/linux/md2core/minidump_memory_range.h @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/md2core/minidump_memory_range_unittest.cc b/src/tools/linux/md2core/minidump_memory_range_unittest.cc index fe4ded83d..9012101d6 100644 --- a/src/tools/linux/md2core/minidump_memory_range_unittest.cc +++ b/src/tools/linux/md2core/minidump_memory_range_unittest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/pid2md/pid2md.cc b/src/tools/linux/pid2md/pid2md.cc index f9cc291e0..ca1cb6377 100644 --- a/src/tools/linux/pid2md/pid2md.cc +++ b/src/tools/linux/pid2md/pid2md.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2020, Google Inc. -// All rights reserved. +// Copyright 2020 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/symupload/minidump_upload.cc b/src/tools/linux/symupload/minidump_upload.cc index 44c3ef63f..6adead034 100644 --- a/src/tools/linux/symupload/minidump_upload.cc +++ b/src/tools/linux/symupload/minidump_upload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/symupload/sym_upload.cc b/src/tools/linux/symupload/sym_upload.cc index 13e5b06fe..8f5e8a507 100644 --- a/src/tools/linux/symupload/sym_upload.cc +++ b/src/tools/linux/symupload/sym_upload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/linux/tools_linux.gypi b/src/tools/linux/tools_linux.gypi index 020e4c1c7..48a43a8ce 100644 --- a/src/tools/linux/tools_linux.gypi +++ b/src/tools/linux/tools_linux.gypi @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/mac/crash_report/crash_report.mm b/src/tools/mac/crash_report/crash_report.mm index 40b36252b..36322ec8f 100644 --- a/src/tools/mac/crash_report/crash_report.mm +++ b/src/tools/mac/crash_report/crash_report.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/src/tools/mac/crash_report/on_demand_symbol_supplier.h index 69b41405c..e265a78a9 100644 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.h +++ b/src/tools/mac/crash_report/on_demand_symbol_supplier.h @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm index cfcecee8c..d4c4b1ab2 100644 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm +++ b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 0f43d1633..2ac9e2ccd 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -1,7 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2011, Google Inc. -// All rights reserved. +// Copyright 2011 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/dump_syms/macho_dump.cc b/src/tools/mac/dump_syms/macho_dump.cc index 34f82ab1f..b724cc740 100644 --- a/src/tools/mac/dump_syms/macho_dump.cc +++ b/src/tools/mac/dump_syms/macho_dump.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2010, Google Inc. -// All rights reserved. +// Copyright 2010 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/symupload/symupload.mm b/src/tools/mac/symupload/symupload.mm index 727834ce5..521b811f0 100644 --- a/src/tools/mac/symupload/symupload.mm +++ b/src/tools/mac/symupload/symupload.mm @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/mac/tools_mac.gypi b/src/tools/mac/tools_mac.gypi index 7457573b4..6ee9c6fdd 100644 --- a/src/tools/mac/tools_mac.gypi +++ b/src/tools/mac/tools_mac.gypi @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/mac/upload_system_symbols/arch_constants.h b/src/tools/mac/upload_system_symbols/arch_constants.h index e12e53e22..b6dbc89a0 100644 --- a/src/tools/mac/upload_system_symbols/arch_constants.h +++ b/src/tools/mac/upload_system_symbols/arch_constants.h @@ -1,5 +1,4 @@ -/* Copyright 2014, Google Inc. -All rights reserved. +/* Copyright 2014 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/src/tools/mac/upload_system_symbols/arch_reader.go b/src/tools/mac/upload_system_symbols/arch_reader.go index ed98fa60f..03a764215 100644 --- a/src/tools/mac/upload_system_symbols/arch_reader.go +++ b/src/tools/mac/upload_system_symbols/arch_reader.go @@ -1,5 +1,4 @@ -/* Copyright 2014, Google Inc. -All rights reserved. +/* Copyright 2014 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index 05a7764ab..d38f439ab 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -1,5 +1,4 @@ -/* Copyright 2014, Google Inc. -All rights reserved. +/* Copyright 2014 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/src/tools/python/deps-to-manifest.py b/src/tools/python/deps-to-manifest.py index 2a9e1bdab..2fcaf7717 100755 --- a/src/tools/python/deps-to-manifest.py +++ b/src/tools/python/deps-to-manifest.py @@ -1,6 +1,5 @@ #!/usr/bin/python -# Copyright 2016 Google Inc. -# All rights reserved. +# Copyright 2016 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/python/filter_syms.py b/src/tools/python/filter_syms.py index abddf7893..caf3693a5 100644 --- a/src/tools/python/filter_syms.py +++ b/src/tools/python/filter_syms.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2012 Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/python/tests/filter_syms_unittest.py b/src/tools/python/tests/filter_syms_unittest.py index b111f3498..1081fc731 100644 --- a/src/tools/python/tests/filter_syms_unittest.py +++ b/src/tools/python/tests/filter_syms_unittest.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2012 Google Inc. -# All rights reserved. +# Copyright 2012 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/solaris/dump_syms/Makefile b/src/tools/solaris/dump_syms/Makefile index ff77105c6..c5f48240e 100644 --- a/src/tools/solaris/dump_syms/Makefile +++ b/src/tools/solaris/dump_syms/Makefile @@ -1,5 +1,4 @@ -# Copyright (c) 2007, Google Inc. -# All rights reserved. +# Copyright 2007 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/solaris/dump_syms/dump_syms.cc b/src/tools/solaris/dump_syms/dump_syms.cc index ba396e10a..fc331c21b 100644 --- a/src/tools/solaris/dump_syms/dump_syms.cc +++ b/src/tools/solaris/dump_syms/dump_syms.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/solaris/dump_syms/run_regtest.sh b/src/tools/solaris/dump_syms/run_regtest.sh index ffb343306..27710d9ac 100644 --- a/src/tools/solaris/dump_syms/run_regtest.sh +++ b/src/tools/solaris/dump_syms/run_regtest.sh @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2007, Google Inc. -# All rights reserved. +# Copyright 2007 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc b/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc index 6824ed98b..b4d191bde 100644 --- a/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc +++ b/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/tools.gyp b/src/tools/tools.gyp index e6a4210fe..66b749136 100644 --- a/src/tools/tools.gyp +++ b/src/tools/tools.gyp @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# Copyright 2014 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/converter/ms_symbol_server_converter.cc b/src/tools/windows/converter/ms_symbol_server_converter.cc index 4645644a1..bfe46925c 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.cc +++ b/src/tools/windows/converter/ms_symbol_server_converter.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/windows/converter/ms_symbol_server_converter.gyp b/src/tools/windows/converter/ms_symbol_server_converter.gyp index 57ec79068..a6e500d6a 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.gyp +++ b/src/tools/windows/converter/ms_symbol_server_converter.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 Google Inc. All rights reserved. +# Copyright 2013 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/converter/ms_symbol_server_converter.h b/src/tools/windows/converter/ms_symbol_server_converter.h index a41cad165..ffdea7c0a 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.h +++ b/src/tools/windows/converter/ms_symbol_server_converter.h @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index b433dff04..75bfdd552 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -1,891 +1,891 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#pragma comment(lib, "winhttp.lib") -#pragma comment(lib, "wininet.lib") -#pragma comment(lib, "diaguids.lib") -#pragma comment(lib, "imagehlp.lib") - -#include -#include -#include -#include -#include -#include -#include - -#include "common/windows/http_upload.h" -#include "common/windows/string_utils-inl.h" -#include "common/windows/sym_upload_v2_protocol.h" -#include "tools/windows/converter/ms_symbol_server_converter.h" -#include "tools/windows/converter_exe/escaping.h" -#include "tools/windows/converter_exe/http_download.h" -#include "tools/windows/converter_exe/tokenizer.h" - -using strings::WebSafeBase64Unescape; -using strings::WebSafeBase64Escape; - -namespace { - -using std::map; -using std::string; -using std::vector; -using std::wstring; -using crash::HTTPDownload; -using crash::Tokenizer; -using google_breakpad::HTTPUpload; -using google_breakpad::MissingSymbolInfo; -using google_breakpad::MSSymbolServerConverter; -using google_breakpad::WindowsStringUtils; - -const char* kMissingStringDelimiters = "|"; -const char* kLocalCachePath = "c:\\symbols"; -const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; -const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; -const wchar_t* kSymbolUploadTypePE = L"PE"; -const wchar_t* kSymbolUploadTypePDB = L"PDB"; -const wchar_t* kConverterProductName = L"WinSymConv"; - -// Windows stdio doesn't do line buffering. Use this function to flush after -// writing to stdout and stderr so that a log will be available if the -// converter crashes. -static int FprintfFlush(FILE* file, const char* format, ...) { - va_list arguments; - va_start(arguments, format); - int retval = vfprintf(file, format, arguments); - va_end(arguments); - fflush(file); - return retval; -} - -static string CurrentDateAndTime() { - const string kUnknownDateAndTime = R"(????-??-?? ??:??:??)"; - - time_t current_time; - time(¤t_time); - - // localtime_s is safer but is only available in MSVC8. Use localtime - // in earlier environments. - struct tm* time_pointer; -#if _MSC_VER >= 1400 // MSVC 2005/8 - struct tm time_struct; - time_pointer =& time_struct; - if (localtime_s(time_pointer,& current_time) != 0) { - return kUnknownDateAndTime; - } -#else // _MSC_VER >= 1400 - time_pointer = localtime(¤t_time); - if (!time_pointer) { - return kUnknownDateAndTime; - } -#endif // _MSC_VER >= 1400 - - char buffer[256]; - if (!strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", time_pointer)) { - return kUnknownDateAndTime; - } - - return string(buffer); -} - -// ParseMissingString turns |missing_string| into a MissingSymbolInfo -// structure. It returns true on success, and false if no such conversion -// is possible. -static bool ParseMissingString(const string& missing_string, - MissingSymbolInfo* missing_info) { - assert(missing_info); - - vector tokens; - Tokenizer::Tokenize(kMissingStringDelimiters, missing_string,& tokens); - if (tokens.size() != 5) { - return false; - } - - missing_info->debug_file = tokens[0]; - missing_info->debug_identifier = tokens[1]; - missing_info->version = tokens[2]; - missing_info->code_file = tokens[3]; - missing_info->code_identifier = tokens[4]; - - return true; -} - -// StringMapToWStringMap takes each element in a map that associates -// (narrow) strings to strings and converts the keys and values to wstrings. -// Returns true on success and false on failure, printing an error message. -static bool StringMapToWStringMap(const map& smap, - map* wsmap) { - assert(wsmap); - wsmap->clear(); - - for (map::const_iterator iterator = smap.begin(); - iterator != smap.end(); - ++iterator) { - wstring key; - if (!WindowsStringUtils::safe_mbstowcs(iterator->first,& key)) { - FprintfFlush(stderr, - "StringMapToWStringMap: safe_mbstowcs failed for key %s\n", - iterator->first.c_str()); - return false; - } - - wstring value; - if (!WindowsStringUtils::safe_mbstowcs(iterator->second,& value)) { - FprintfFlush(stderr, "StringMapToWStringMap: safe_mbstowcs failed " - "for value %s\n", - iterator->second.c_str()); - return false; - } - - wsmap->insert(make_pair(key, value)); - } - - return true; -} - -// MissingSymbolInfoToParameters turns a MissingSymbolInfo structure into a -// map of parameters suitable for passing to HTTPDownload or HTTPUpload. -// Returns true on success and false on failure, printing an error message. -static bool MissingSymbolInfoToParameters(const MissingSymbolInfo& missing_info, - map* wparameters) { - assert(wparameters); - - map parameters; - string encoded_param; - // Indicate the params are encoded. - parameters["encoded"] = "true"; // The string value here does not matter. - - WebSafeBase64Escape(missing_info.code_file,& encoded_param); - parameters["code_file"] = encoded_param; - - WebSafeBase64Escape(missing_info.code_identifier,& encoded_param); - parameters["code_identifier"] = encoded_param; - - WebSafeBase64Escape(missing_info.debug_file,& encoded_param); - parameters["debug_file"] = encoded_param; - - WebSafeBase64Escape(missing_info.debug_identifier,& encoded_param); - parameters["debug_identifier"] = encoded_param; - - if (!missing_info.version.empty()) { - // The version is optional. - WebSafeBase64Escape(missing_info.version,& encoded_param); - parameters["version"] = encoded_param; - } - - WebSafeBase64Escape("WinSymConv",& encoded_param); - parameters["product"] = encoded_param; - - if (!StringMapToWStringMap(parameters, wparameters)) { - // StringMapToWStringMap will have printed an error. - return false; - } - - return true; -} - -// UploadSymbolFile sends |converted_file| as identified by |debug_file| and -// |debug_identifier|, to the symbol server rooted at |upload_symbol_url|. -// Returns true on success and false on failure, printing an error message. -static bool UploadSymbolFile(const wstring& upload_symbol_url, - const wstring& api_key, - const string& debug_file, - const string& debug_identifier, - const string& symbol_file, - const wstring& symbol_type) { - wstring debug_file_w; - if (!WindowsStringUtils::safe_mbstowcs(debug_file, &debug_file_w)) { - FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - symbol_file.c_str()); - return false; - } - - wstring debug_id_w; - if (!WindowsStringUtils::safe_mbstowcs(debug_identifier, &debug_id_w)) { - FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - symbol_file.c_str()); - return false; - } - - wstring symbol_file_w; - if (!WindowsStringUtils::safe_mbstowcs(symbol_file, &symbol_file_w)) { - FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", - symbol_file.c_str()); - return false; - } - - int timeout_ms = 60 * 1000; - FprintfFlush(stderr, "Uploading %s\n", symbol_file.c_str()); - if (!google_breakpad::SymUploadV2ProtocolSend( - upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, - debug_id_w, symbol_file_w, symbol_type, kConverterProductName, - /*force=*/true)) { - FprintfFlush(stderr, - "UploadSymbolFile: HTTPUpload::SendRequest failed " - "for %s %s\n", - debug_file.c_str(), debug_identifier.c_str()); - return false; - } - - return true; -} - -// SendFetchFailedPing informs the symbol server based at -// |fetch_symbol_failure_url| that the symbol file identified by -// |missing_info| could authoritatively not be located. Returns -// true on success and false on failure. -static bool SendFetchFailedPing(const wstring& fetch_symbol_failure_url, - const MissingSymbolInfo& missing_info) { - map parameters; - if (!MissingSymbolInfoToParameters(missing_info,& parameters)) { - // MissingSymbolInfoToParameters or a callee will have printed an error. - return false; - } - - string content; - if (!HTTPDownload::Download(fetch_symbol_failure_url, - & parameters, - & content, - NULL)) { - FprintfFlush(stderr, "SendFetchFailedPing: HTTPDownload::Download failed " - "for %s %s %s\n", - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str(), - missing_info.version.c_str()); - return false; - } - - return true; -} - -// Returns true if it's safe to make an external request for the symbol -// file described in missing_info. It's considered safe to make an -// external request unless the symbol file's debug_file string matches -// the given blacklist regular expression. -// The debug_file name is used from the MissingSymbolInfo struct, -// matched against the blacklist_regex. -static bool SafeToMakeExternalRequest(const MissingSymbolInfo& missing_info, - std::regex blacklist_regex) { - string file_name = missing_info.debug_file; - // Use regex_search because we want to match substrings. - if (std::regex_search(file_name, blacklist_regex)) { - FprintfFlush(stderr, "Not safe to make external request for file %s\n", - file_name.c_str()); - return false; - } - - return true; -} - -// Converter options derived from command line parameters. -struct ConverterOptions { - ConverterOptions() : report_fetch_failures(true), trace_symsrv(false) {} - - ~ConverterOptions() { - } - - // Names of MS Symbol Supplier Servers that are internal to Google, and may - // have symbols for any request. - vector full_internal_msss_servers; - - // Names of MS Symbol Supplier Servers that are internal to Google, and - // shouldn't be checked for symbols for any .exe files. - vector full_external_msss_servers; - - // Names of MS Symbol Supplier Servers that are external to Google, and may - // have symbols for any request. - vector no_exe_internal_msss_servers; - - // Names of MS Symbol Supplier Servers that are external to Google, and - // shouldn't be checked for symbols for any .exe files. - vector no_exe_external_msss_servers; - - // Temporary local storage for symbols. - string local_cache_path; - - // URL for uploading symbols. - wstring upload_symbols_url; - - // API key to use when uploading symbols. - wstring api_key; - - // URL to fetch list of missing symbols. - wstring missing_symbols_url; - - // URL to report symbol fetch failure. - wstring fetch_symbol_failure_url; - - // Are symbol fetch failures reported. - bool report_fetch_failures; - - // File containing the list of missing symbols. Fetch failures are not - // reported if such file is provided. - string missing_symbols_file; - - // Regex used to blacklist files to prevent external symbol requests. - // Owned and cleaned up by this struct. - std::regex blacklist_regex; - - // If set then SymSrv callbacks are logged to stderr. - bool trace_symsrv; - - private: - // DISABLE_COPY_AND_ASSIGN - ConverterOptions(const ConverterOptions&); - ConverterOptions& operator=(const ConverterOptions&); -}; - -// ConverMissingSymbolFile takes a single MissingSymbolInfo structure and -// attempts to locate it from the symbol servers provided in the -// |options.*_msss_servers| arguments. "Full" servers are those that will be -// queried for all symbol files; "No-EXE" servers will only be queried for -// modules whose missing symbol data indicates are not main program executables. -// Results will be sent to the |options.upload_symbols_url| on success or -// |options.fetch_symbol_failure_url| on failure, and the local cache will be -// stored at |options.local_cache_path|. Because nothing can be done even in -// the event of a failure, this function returns no value, although it -// may result in error messages being printed. -static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, - const ConverterOptions& options) { - string time_string = CurrentDateAndTime(); - FprintfFlush(stdout, "converter: %s: attempting %s %s %s\n", - time_string.c_str(), - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str(), - missing_info.version.c_str()); - - // The first lookup is always to internal symbol servers. - // Always ask the symbol servers identified as "full." - vector msss_servers = options.full_internal_msss_servers; - - // If the file is not an .exe file, also ask an additional set of symbol - // servers, such as Microsoft's public symbol server. - bool is_exe = false; - - if (missing_info.code_file.length() >= 4) { - string code_extension = - missing_info.code_file.substr(missing_info.code_file.size() - 4); - - // Firefox is a special case: .dll-only servers should be consulted for - // its symbols. This enables us to get its symbols from Mozilla's - // symbol server when crashes occur in Google extension code hosted by a - // Firefox process. - if (_stricmp(code_extension.c_str(), ".exe") == 0 && - _stricmp(missing_info.code_file.c_str(), "firefox.exe") != 0) { - is_exe = true; - } - } - - if (!is_exe) { - msss_servers.insert(msss_servers.end(), - options.no_exe_internal_msss_servers.begin(), - options.no_exe_internal_msss_servers.end()); - } - - // If there are any suitable internal symbol servers, make a request. - MSSymbolServerConverter::LocateResult located = - MSSymbolServerConverter::LOCATE_FAILURE; - string converted_file; - string symbol_file; - string pe_file; - if (msss_servers.size() > 0) { - // Attempt to fetch the symbol file and convert it. - FprintfFlush(stderr, "Making internal request for %s (%s)\n", - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str()); - MSSymbolServerConverter converter(options.local_cache_path, msss_servers, - options.trace_symsrv); - located = converter.LocateAndConvertSymbolFile( - missing_info, - /*keep_symbol_file=*/true, - /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); - switch (located) { - case MSSymbolServerConverter::LOCATE_SUCCESS: - FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); - // Upload it. Don't bother checking the return value. If this - // succeeds, it should disappear from the missing symbol list. - // If it fails, something will print an error message indicating - // the cause of the failure, and the item will remain on the - // missing symbol list. - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.debug_file, missing_info.debug_identifier, - converted_file, kSymbolUploadTypeBreakpad); - remove(converted_file.c_str()); - - // Upload PDB/PE if we have them - if (!symbol_file.empty()) { - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.debug_file, - missing_info.debug_identifier, symbol_file, - kSymbolUploadTypePDB); - remove(symbol_file.c_str()); - } - if (!pe_file.empty()) { - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.code_file, - missing_info.debug_identifier, pe_file, - kSymbolUploadTypePE); - remove(pe_file.c_str()); - } - - // Note: this does leave some directories behind that could be - // cleaned up. The directories inside options.local_cache_path for - // debug_file/debug_identifier can be removed at this point. - break; - - case MSSymbolServerConverter::LOCATE_NOT_FOUND: - FprintfFlush(stderr, "LocateResult = LOCATE_NOT_FOUND\n"); - // The symbol file definitively did not exist. Fall through, - // so we can attempt an external query if it's safe to do so. - break; - - case MSSymbolServerConverter::LOCATE_RETRY: - FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n"); - // Fall through in case we should make an external request. - // If not, or if an external request fails in the same way, - // we'll leave the entry in the symbol file list and - // try again on a future pass. Print a message so that there's - // a record. - break; - - case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: - FprintfFlush( - stderr, - "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" - "One of the specified URLs is using HTTP, which causes a redirect " - "from the server to HTTPS, which causes the SymSrv lookup to " - "fail.\n" - "This URL must be replaced with the correct HTTPS URL.\n"); - break; - - case MSSymbolServerConverter::LOCATE_FAILURE: - FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); - // LocateAndConvertSymbolFile printed an error message. - break; - - default: - FprintfFlush( - stderr, - "FATAL: Unexpected return value '%d' from " - "LocateAndConvertSymbolFile()\n", - located); - assert(0); - break; - } - } else { - // No suitable internal symbol servers. This is fine because the converter - // is mainly used for downloading and converting of external symbols. - } - - // Make a request to an external server if the internal request didn't - // succeed, and it's safe to do so. - if (located != MSSymbolServerConverter::LOCATE_SUCCESS && - SafeToMakeExternalRequest(missing_info, options.blacklist_regex)) { - msss_servers = options.full_external_msss_servers; - if (!is_exe) { - msss_servers.insert(msss_servers.end(), - options.no_exe_external_msss_servers.begin(), - options.no_exe_external_msss_servers.end()); - } - if (msss_servers.size() > 0) { - FprintfFlush(stderr, "Making external request for %s (%s)\n", - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str()); - MSSymbolServerConverter external_converter( - options.local_cache_path, msss_servers, options.trace_symsrv); - located = external_converter.LocateAndConvertSymbolFile( - missing_info, - /*keep_symbol_file=*/true, - /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); - } else { - FprintfFlush(stderr, "ERROR: No suitable external symbol servers.\n"); - } - } - - // Final handling for this symbol file is based on the result from the - // external request (if performed above), or on the result from the - // previous internal lookup. - switch (located) { - case MSSymbolServerConverter::LOCATE_SUCCESS: - FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); - // Upload it. Don't bother checking the return value. If this - // succeeds, it should disappear from the missing symbol list. - // If it fails, something will print an error message indicating - // the cause of the failure, and the item will remain on the - // missing symbol list. - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.debug_file, missing_info.debug_identifier, - converted_file, kSymbolUploadTypeBreakpad); - remove(converted_file.c_str()); - - // Upload PDB/PE if we have them - if (!symbol_file.empty()) { - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.debug_file, missing_info.debug_identifier, - symbol_file, kSymbolUploadTypePDB); - remove(symbol_file.c_str()); - } - if (!pe_file.empty()) { - UploadSymbolFile(options.upload_symbols_url, options.api_key, - missing_info.code_file, missing_info.debug_identifier, - pe_file, kSymbolUploadTypePE); - remove(pe_file.c_str()); - } - - // Note: this does leave some directories behind that could be - // cleaned up. The directories inside options.local_cache_path for - // debug_file/debug_identifier can be removed at this point. - break; - - case MSSymbolServerConverter::LOCATE_NOT_FOUND: - // The symbol file definitively didn't exist. Inform the server. - // If this fails, something will print an error message indicating - // the cause of the failure, but there's really nothing more to - // do. If this succeeds, the entry should be removed from the - // missing symbols list. - if (!options.report_fetch_failures) { - FprintfFlush(stderr, "SendFetchFailedPing skipped\n"); - } else if (SendFetchFailedPing(options.fetch_symbol_failure_url, - missing_info)) { - FprintfFlush(stderr, "SendFetchFailedPing succeeded\n"); - } else { - FprintfFlush(stderr, "SendFetchFailedPing failed\n"); - } - break; - - case MSSymbolServerConverter::LOCATE_RETRY: - FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n"); - // Nothing to do but leave the entry in the symbol file list and - // try again on a future pass. Print a message so that there's - // a record. - FprintfFlush(stderr, "ConvertMissingSymbolFile: deferring retry " - "for %s %s %s\n", - missing_info.debug_file.c_str(), - missing_info.debug_identifier.c_str(), - missing_info.version.c_str()); - break; - - case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: - FprintfFlush( - stderr, - "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" - "One of the specified URLs is using HTTP, which causes a redirect " - "from the server to HTTPS, which causes the SymSrv lookup to fail.\n" - "This URL must be replaced with the correct HTTPS URL.\n"); - break; - - case MSSymbolServerConverter::LOCATE_FAILURE: - FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); - // LocateAndConvertSymbolFile printed an error message. - - // This is due to a bad debug file name, so fetch failed. - if (!options.report_fetch_failures) { - FprintfFlush(stderr, "SendFetchFailedPing skipped\n"); - } else if (SendFetchFailedPing(options.fetch_symbol_failure_url, - missing_info)) { - FprintfFlush(stderr, "SendFetchFailedPing succeeded\n"); - } else { - FprintfFlush(stderr, "SendFetchFailedPing failed\n"); - } - break; - - default: - FprintfFlush( - stderr, - "FATAL: Unexpected return value '%d' from " - "LocateAndConvertSymbolFile()\n", - located); - assert(0); - break; - } -} - - -// Reads the contents of file |file_name| and populates |contents|. -// Returns true on success. -static bool ReadFile(string file_name, string* contents) { - char buffer[1024 * 8]; - FILE* fp = fopen(file_name.c_str(), "rt"); - if (!fp) { - return false; - } - contents->clear(); - while (fgets(buffer, sizeof(buffer), fp) != NULL) { - contents->append(buffer); - } - fclose(fp); - return true; -} - -// ConvertMissingSymbolsList obtains a missing symbol list from -// |options.missing_symbols_url| or |options.missing_symbols_file| and calls -// ConvertMissingSymbolFile for each missing symbol file in the list. -static bool ConvertMissingSymbolsList(const ConverterOptions& options) { - // Set param to indicate requesting for encoded response. - map parameters; - parameters[L"product"] = kConverterProductName; - parameters[L"encoded"] = L"true"; - // Get the missing symbol list. - string missing_symbol_list; - if (!options.missing_symbols_file.empty()) { - if (!ReadFile(options.missing_symbols_file,& missing_symbol_list)) { - return false; - } - } else if (!HTTPDownload::Download(options.missing_symbols_url,& parameters, - & missing_symbol_list, NULL)) { - return false; - } - - // Tokenize the content into a vector. - vector missing_symbol_lines; - Tokenizer::Tokenize("\n", missing_symbol_list,& missing_symbol_lines); - - FprintfFlush(stderr, "Found %d missing symbol files in list.\n", - missing_symbol_lines.size() - 1); // last line is empty. - int convert_attempts = 0; - for (vector::const_iterator iterator = missing_symbol_lines.begin(); - iterator != missing_symbol_lines.end(); - ++iterator) { - // Decode symbol line. - const string& encoded_line = *iterator; - // Skip lines that are blank. - if (encoded_line.empty()) { - continue; - } - - string line; - if (!WebSafeBase64Unescape(encoded_line,& line)) { - // If decoding fails, assume the line is not encoded. - // This is helpful when the program connects to a debug server without - // encoding. - line = encoded_line; - } - - FprintfFlush(stderr, "\nLine: %s\n", line.c_str()); - - // Turn each element into a MissingSymbolInfo structure. - MissingSymbolInfo missing_info; - if (!ParseMissingString(line,& missing_info)) { - FprintfFlush(stderr, "ConvertMissingSymbols: ParseMissingString failed " - "for %s from %ws\n", - line.c_str(), options.missing_symbols_url.c_str()); - continue; - } - - ++convert_attempts; - ConvertMissingSymbolFile(missing_info, options); - } - - // Say something reassuring, since ConvertMissingSymbolFile was never called - // and therefore never reported any progress. - if (convert_attempts == 0) { - string current_time = CurrentDateAndTime(); - FprintfFlush(stdout, "converter: %s: nothing to convert\n", - current_time.c_str()); - } - - return true; -} - -// usage prints the usage message. It returns 1 as a convenience, to be used -// as a return value from main. -static int usage(const char* program_name) { - FprintfFlush( - stderr, - "usage: %s [options]\n" - " -f MS servers to ask for all symbols\n" - " -n same, but prevent asking for EXEs\n" - " -l Temporary local storage for symbols\n" - " -s URL for uploading symbols\n" - " -k API key to use when uploading symbols\n" - " -m URL to fetch list of missing symbols\n" - " -mf File containing the list of missing\n" - " symbols. Fetch failures are not\n" - " reported if such file is provided.\n" - " -t URL to report symbol fetch failure\n" - " -b Regex used to blacklist files to\n" - " prevent external symbol requests\n" - " -tss If set then SymSrv callbacks will be\n" - " traced to stderr.\n" - " Note that any server specified by -f or -n that starts with \\filer\n" - " will be treated as internal, and all others as external.\n", - program_name); - - return 1; -} - -// "Internal" servers consist only of those whose names start with -// the literal string "\\filer\". -static bool IsInternalServer(const string& server_name) { - if (server_name.find("\\\\filer\\") == 0) { - return true; - } - return false; -} - -// Adds a server with the given name to the list of internal or external -// servers, as appropriate. -static void AddServer(const string& server_name, - vector* internal_servers, - vector* external_servers) { - if (IsInternalServer(server_name)) { - internal_servers->push_back(server_name); - } else { - external_servers->push_back(server_name); - } -} - -} // namespace - -int main(int argc, char** argv) { - string time_string = CurrentDateAndTime(); - FprintfFlush(stdout, "converter: %s: starting\n", time_string.c_str()); - - ConverterOptions options; - options.report_fetch_failures = true; - - // All arguments are paired. - if (argc % 2 != 1) { - return usage(argv[0]); - } - - string blacklist_regex_str; - bool have_any_msss_servers = false; - for (int argi = 1; argi < argc; argi += 2) { - string option = argv[argi]; - string value = argv[argi + 1]; - - if (option == "-f") { - AddServer(value,& options.full_internal_msss_servers, - & options.full_external_msss_servers); - have_any_msss_servers = true; - } else if (option == "-n") { - AddServer(value,& options.no_exe_internal_msss_servers, - & options.no_exe_external_msss_servers); - have_any_msss_servers = true; - } else if (option == "-l") { - if (!options.local_cache_path.empty()) { - return usage(argv[0]); - } - options.local_cache_path = value; - } else if (option == "-s") { - if (!WindowsStringUtils::safe_mbstowcs(value, - & options.upload_symbols_url)) { - FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", - value.c_str()); - return 1; - } - } else if (option == "-k") { - if (!WindowsStringUtils::safe_mbstowcs(value, &options.api_key)) { - FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", - value.c_str()); - return 1; - } - } else if (option == "-m") { - if (!WindowsStringUtils::safe_mbstowcs(value, - & options.missing_symbols_url)) { - FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", - value.c_str()); - return 1; - } - } else if (option == "-mf") { - options.missing_symbols_file = value; - printf("Getting the list of missing symbols from a file. Fetch failures" - " will not be reported.\n"); - options.report_fetch_failures = false; - } else if (option == "-tss") { - printf("Tracing SymSrv callbacks to stderr.\n"); - options.trace_symsrv = true; - } else if (option == "-t") { - if (!WindowsStringUtils::safe_mbstowcs( - value, - & options.fetch_symbol_failure_url)) { - FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", - value.c_str()); - return 1; - } - } else if (option == "-b") { - blacklist_regex_str = value; - } else { - return usage(argv[0]); - } - } - - if (blacklist_regex_str.empty()) { - FprintfFlush(stderr, "No blacklist specified.\n"); - return usage(argv[0]); - } - - // Compile the blacklist regular expression for later use. - options.blacklist_regex = std::regex(blacklist_regex_str.c_str(), - std::regex_constants::icase); - - // Set the defaults. If the user specified any MSSS servers, don't use - // any default. - if (!have_any_msss_servers) { - AddServer(kNoExeMSSSServer,& options.no_exe_internal_msss_servers, - & options.no_exe_external_msss_servers); - } - - if (options.local_cache_path.empty()) { - options.local_cache_path = kLocalCachePath; - } - - if (options.upload_symbols_url.empty()) { - FprintfFlush(stderr, "No upload symbols URL specified.\n"); - return usage(argv[0]); - } - if (options.api_key.empty()) { - FprintfFlush(stderr, "No API key specified.\n"); - return usage(argv[0]); - } - if (options.missing_symbols_url.empty() && - options.missing_symbols_file.empty()) { - FprintfFlush(stderr, "No missing symbols URL or file specified.\n"); - return usage(argv[0]); - } - if (options.fetch_symbol_failure_url.empty()) { - FprintfFlush(stderr, "No fetch symbol failure URL specified.\n"); - return usage(argv[0]); - } - - FprintfFlush(stdout, - "# of Symbol Servers (int/ext): %d/%d full, %d/%d no_exe\n", - options.full_internal_msss_servers.size(), - options.full_external_msss_servers.size(), - options.no_exe_internal_msss_servers.size(), - options.no_exe_external_msss_servers.size()); - - if (!ConvertMissingSymbolsList(options)) { - return 1; - } - - time_string = CurrentDateAndTime(); - FprintfFlush(stdout, "converter: %s: finished\n", time_string.c_str()); - return 0; -} +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#pragma comment(lib, "winhttp.lib") +#pragma comment(lib, "wininet.lib") +#pragma comment(lib, "diaguids.lib") +#pragma comment(lib, "imagehlp.lib") + +#include +#include +#include +#include +#include +#include +#include + +#include "common/windows/http_upload.h" +#include "common/windows/string_utils-inl.h" +#include "common/windows/sym_upload_v2_protocol.h" +#include "tools/windows/converter/ms_symbol_server_converter.h" +#include "tools/windows/converter_exe/escaping.h" +#include "tools/windows/converter_exe/http_download.h" +#include "tools/windows/converter_exe/tokenizer.h" + +using strings::WebSafeBase64Unescape; +using strings::WebSafeBase64Escape; + +namespace { + +using std::map; +using std::string; +using std::vector; +using std::wstring; +using crash::HTTPDownload; +using crash::Tokenizer; +using google_breakpad::HTTPUpload; +using google_breakpad::MissingSymbolInfo; +using google_breakpad::MSSymbolServerConverter; +using google_breakpad::WindowsStringUtils; + +const char* kMissingStringDelimiters = "|"; +const char* kLocalCachePath = "c:\\symbols"; +const char* kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/"; +const wchar_t* kSymbolUploadTypeBreakpad = L"BREAKPAD"; +const wchar_t* kSymbolUploadTypePE = L"PE"; +const wchar_t* kSymbolUploadTypePDB = L"PDB"; +const wchar_t* kConverterProductName = L"WinSymConv"; + +// Windows stdio doesn't do line buffering. Use this function to flush after +// writing to stdout and stderr so that a log will be available if the +// converter crashes. +static int FprintfFlush(FILE* file, const char* format, ...) { + va_list arguments; + va_start(arguments, format); + int retval = vfprintf(file, format, arguments); + va_end(arguments); + fflush(file); + return retval; +} + +static string CurrentDateAndTime() { + const string kUnknownDateAndTime = R"(????-??-?? ??:??:??)"; + + time_t current_time; + time(¤t_time); + + // localtime_s is safer but is only available in MSVC8. Use localtime + // in earlier environments. + struct tm* time_pointer; +#if _MSC_VER >= 1400 // MSVC 2005/8 + struct tm time_struct; + time_pointer =& time_struct; + if (localtime_s(time_pointer,& current_time) != 0) { + return kUnknownDateAndTime; + } +#else // _MSC_VER >= 1400 + time_pointer = localtime(¤t_time); + if (!time_pointer) { + return kUnknownDateAndTime; + } +#endif // _MSC_VER >= 1400 + + char buffer[256]; + if (!strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", time_pointer)) { + return kUnknownDateAndTime; + } + + return string(buffer); +} + +// ParseMissingString turns |missing_string| into a MissingSymbolInfo +// structure. It returns true on success, and false if no such conversion +// is possible. +static bool ParseMissingString(const string& missing_string, + MissingSymbolInfo* missing_info) { + assert(missing_info); + + vector tokens; + Tokenizer::Tokenize(kMissingStringDelimiters, missing_string,& tokens); + if (tokens.size() != 5) { + return false; + } + + missing_info->debug_file = tokens[0]; + missing_info->debug_identifier = tokens[1]; + missing_info->version = tokens[2]; + missing_info->code_file = tokens[3]; + missing_info->code_identifier = tokens[4]; + + return true; +} + +// StringMapToWStringMap takes each element in a map that associates +// (narrow) strings to strings and converts the keys and values to wstrings. +// Returns true on success and false on failure, printing an error message. +static bool StringMapToWStringMap(const map& smap, + map* wsmap) { + assert(wsmap); + wsmap->clear(); + + for (map::const_iterator iterator = smap.begin(); + iterator != smap.end(); + ++iterator) { + wstring key; + if (!WindowsStringUtils::safe_mbstowcs(iterator->first,& key)) { + FprintfFlush(stderr, + "StringMapToWStringMap: safe_mbstowcs failed for key %s\n", + iterator->first.c_str()); + return false; + } + + wstring value; + if (!WindowsStringUtils::safe_mbstowcs(iterator->second,& value)) { + FprintfFlush(stderr, "StringMapToWStringMap: safe_mbstowcs failed " + "for value %s\n", + iterator->second.c_str()); + return false; + } + + wsmap->insert(make_pair(key, value)); + } + + return true; +} + +// MissingSymbolInfoToParameters turns a MissingSymbolInfo structure into a +// map of parameters suitable for passing to HTTPDownload or HTTPUpload. +// Returns true on success and false on failure, printing an error message. +static bool MissingSymbolInfoToParameters(const MissingSymbolInfo& missing_info, + map* wparameters) { + assert(wparameters); + + map parameters; + string encoded_param; + // Indicate the params are encoded. + parameters["encoded"] = "true"; // The string value here does not matter. + + WebSafeBase64Escape(missing_info.code_file,& encoded_param); + parameters["code_file"] = encoded_param; + + WebSafeBase64Escape(missing_info.code_identifier,& encoded_param); + parameters["code_identifier"] = encoded_param; + + WebSafeBase64Escape(missing_info.debug_file,& encoded_param); + parameters["debug_file"] = encoded_param; + + WebSafeBase64Escape(missing_info.debug_identifier,& encoded_param); + parameters["debug_identifier"] = encoded_param; + + if (!missing_info.version.empty()) { + // The version is optional. + WebSafeBase64Escape(missing_info.version,& encoded_param); + parameters["version"] = encoded_param; + } + + WebSafeBase64Escape("WinSymConv",& encoded_param); + parameters["product"] = encoded_param; + + if (!StringMapToWStringMap(parameters, wparameters)) { + // StringMapToWStringMap will have printed an error. + return false; + } + + return true; +} + +// UploadSymbolFile sends |converted_file| as identified by |debug_file| and +// |debug_identifier|, to the symbol server rooted at |upload_symbol_url|. +// Returns true on success and false on failure, printing an error message. +static bool UploadSymbolFile(const wstring& upload_symbol_url, + const wstring& api_key, + const string& debug_file, + const string& debug_identifier, + const string& symbol_file, + const wstring& symbol_type) { + wstring debug_file_w; + if (!WindowsStringUtils::safe_mbstowcs(debug_file, &debug_file_w)) { + FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", + symbol_file.c_str()); + return false; + } + + wstring debug_id_w; + if (!WindowsStringUtils::safe_mbstowcs(debug_identifier, &debug_id_w)) { + FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", + symbol_file.c_str()); + return false; + } + + wstring symbol_file_w; + if (!WindowsStringUtils::safe_mbstowcs(symbol_file, &symbol_file_w)) { + FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n", + symbol_file.c_str()); + return false; + } + + int timeout_ms = 60 * 1000; + FprintfFlush(stderr, "Uploading %s\n", symbol_file.c_str()); + if (!google_breakpad::SymUploadV2ProtocolSend( + upload_symbol_url.c_str(), api_key.c_str(), &timeout_ms, debug_file_w, + debug_id_w, symbol_file_w, symbol_type, kConverterProductName, + /*force=*/true)) { + FprintfFlush(stderr, + "UploadSymbolFile: HTTPUpload::SendRequest failed " + "for %s %s\n", + debug_file.c_str(), debug_identifier.c_str()); + return false; + } + + return true; +} + +// SendFetchFailedPing informs the symbol server based at +// |fetch_symbol_failure_url| that the symbol file identified by +// |missing_info| could authoritatively not be located. Returns +// true on success and false on failure. +static bool SendFetchFailedPing(const wstring& fetch_symbol_failure_url, + const MissingSymbolInfo& missing_info) { + map parameters; + if (!MissingSymbolInfoToParameters(missing_info,& parameters)) { + // MissingSymbolInfoToParameters or a callee will have printed an error. + return false; + } + + string content; + if (!HTTPDownload::Download(fetch_symbol_failure_url, + & parameters, + & content, + NULL)) { + FprintfFlush(stderr, "SendFetchFailedPing: HTTPDownload::Download failed " + "for %s %s %s\n", + missing_info.debug_file.c_str(), + missing_info.debug_identifier.c_str(), + missing_info.version.c_str()); + return false; + } + + return true; +} + +// Returns true if it's safe to make an external request for the symbol +// file described in missing_info. It's considered safe to make an +// external request unless the symbol file's debug_file string matches +// the given blacklist regular expression. +// The debug_file name is used from the MissingSymbolInfo struct, +// matched against the blacklist_regex. +static bool SafeToMakeExternalRequest(const MissingSymbolInfo& missing_info, + std::regex blacklist_regex) { + string file_name = missing_info.debug_file; + // Use regex_search because we want to match substrings. + if (std::regex_search(file_name, blacklist_regex)) { + FprintfFlush(stderr, "Not safe to make external request for file %s\n", + file_name.c_str()); + return false; + } + + return true; +} + +// Converter options derived from command line parameters. +struct ConverterOptions { + ConverterOptions() : report_fetch_failures(true), trace_symsrv(false) {} + + ~ConverterOptions() { + } + + // Names of MS Symbol Supplier Servers that are internal to Google, and may + // have symbols for any request. + vector full_internal_msss_servers; + + // Names of MS Symbol Supplier Servers that are internal to Google, and + // shouldn't be checked for symbols for any .exe files. + vector full_external_msss_servers; + + // Names of MS Symbol Supplier Servers that are external to Google, and may + // have symbols for any request. + vector no_exe_internal_msss_servers; + + // Names of MS Symbol Supplier Servers that are external to Google, and + // shouldn't be checked for symbols for any .exe files. + vector no_exe_external_msss_servers; + + // Temporary local storage for symbols. + string local_cache_path; + + // URL for uploading symbols. + wstring upload_symbols_url; + + // API key to use when uploading symbols. + wstring api_key; + + // URL to fetch list of missing symbols. + wstring missing_symbols_url; + + // URL to report symbol fetch failure. + wstring fetch_symbol_failure_url; + + // Are symbol fetch failures reported. + bool report_fetch_failures; + + // File containing the list of missing symbols. Fetch failures are not + // reported if such file is provided. + string missing_symbols_file; + + // Regex used to blacklist files to prevent external symbol requests. + // Owned and cleaned up by this struct. + std::regex blacklist_regex; + + // If set then SymSrv callbacks are logged to stderr. + bool trace_symsrv; + + private: + // DISABLE_COPY_AND_ASSIGN + ConverterOptions(const ConverterOptions&); + ConverterOptions& operator=(const ConverterOptions&); +}; + +// ConverMissingSymbolFile takes a single MissingSymbolInfo structure and +// attempts to locate it from the symbol servers provided in the +// |options.*_msss_servers| arguments. "Full" servers are those that will be +// queried for all symbol files; "No-EXE" servers will only be queried for +// modules whose missing symbol data indicates are not main program executables. +// Results will be sent to the |options.upload_symbols_url| on success or +// |options.fetch_symbol_failure_url| on failure, and the local cache will be +// stored at |options.local_cache_path|. Because nothing can be done even in +// the event of a failure, this function returns no value, although it +// may result in error messages being printed. +static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, + const ConverterOptions& options) { + string time_string = CurrentDateAndTime(); + FprintfFlush(stdout, "converter: %s: attempting %s %s %s\n", + time_string.c_str(), + missing_info.debug_file.c_str(), + missing_info.debug_identifier.c_str(), + missing_info.version.c_str()); + + // The first lookup is always to internal symbol servers. + // Always ask the symbol servers identified as "full." + vector msss_servers = options.full_internal_msss_servers; + + // If the file is not an .exe file, also ask an additional set of symbol + // servers, such as Microsoft's public symbol server. + bool is_exe = false; + + if (missing_info.code_file.length() >= 4) { + string code_extension = + missing_info.code_file.substr(missing_info.code_file.size() - 4); + + // Firefox is a special case: .dll-only servers should be consulted for + // its symbols. This enables us to get its symbols from Mozilla's + // symbol server when crashes occur in Google extension code hosted by a + // Firefox process. + if (_stricmp(code_extension.c_str(), ".exe") == 0 && + _stricmp(missing_info.code_file.c_str(), "firefox.exe") != 0) { + is_exe = true; + } + } + + if (!is_exe) { + msss_servers.insert(msss_servers.end(), + options.no_exe_internal_msss_servers.begin(), + options.no_exe_internal_msss_servers.end()); + } + + // If there are any suitable internal symbol servers, make a request. + MSSymbolServerConverter::LocateResult located = + MSSymbolServerConverter::LOCATE_FAILURE; + string converted_file; + string symbol_file; + string pe_file; + if (msss_servers.size() > 0) { + // Attempt to fetch the symbol file and convert it. + FprintfFlush(stderr, "Making internal request for %s (%s)\n", + missing_info.debug_file.c_str(), + missing_info.debug_identifier.c_str()); + MSSymbolServerConverter converter(options.local_cache_path, msss_servers, + options.trace_symsrv); + located = converter.LocateAndConvertSymbolFile( + missing_info, + /*keep_symbol_file=*/true, + /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); + switch (located) { + case MSSymbolServerConverter::LOCATE_SUCCESS: + FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); + // Upload it. Don't bother checking the return value. If this + // succeeds, it should disappear from the missing symbol list. + // If it fails, something will print an error message indicating + // the cause of the failure, and the item will remain on the + // missing symbol list. + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, missing_info.debug_identifier, + converted_file, kSymbolUploadTypeBreakpad); + remove(converted_file.c_str()); + + // Upload PDB/PE if we have them + if (!symbol_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, + missing_info.debug_identifier, symbol_file, + kSymbolUploadTypePDB); + remove(symbol_file.c_str()); + } + if (!pe_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.code_file, + missing_info.debug_identifier, pe_file, + kSymbolUploadTypePE); + remove(pe_file.c_str()); + } + + // Note: this does leave some directories behind that could be + // cleaned up. The directories inside options.local_cache_path for + // debug_file/debug_identifier can be removed at this point. + break; + + case MSSymbolServerConverter::LOCATE_NOT_FOUND: + FprintfFlush(stderr, "LocateResult = LOCATE_NOT_FOUND\n"); + // The symbol file definitively did not exist. Fall through, + // so we can attempt an external query if it's safe to do so. + break; + + case MSSymbolServerConverter::LOCATE_RETRY: + FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n"); + // Fall through in case we should make an external request. + // If not, or if an external request fails in the same way, + // we'll leave the entry in the symbol file list and + // try again on a future pass. Print a message so that there's + // a record. + break; + + case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: + FprintfFlush( + stderr, + "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" + "One of the specified URLs is using HTTP, which causes a redirect " + "from the server to HTTPS, which causes the SymSrv lookup to " + "fail.\n" + "This URL must be replaced with the correct HTTPS URL.\n"); + break; + + case MSSymbolServerConverter::LOCATE_FAILURE: + FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); + // LocateAndConvertSymbolFile printed an error message. + break; + + default: + FprintfFlush( + stderr, + "FATAL: Unexpected return value '%d' from " + "LocateAndConvertSymbolFile()\n", + located); + assert(0); + break; + } + } else { + // No suitable internal symbol servers. This is fine because the converter + // is mainly used for downloading and converting of external symbols. + } + + // Make a request to an external server if the internal request didn't + // succeed, and it's safe to do so. + if (located != MSSymbolServerConverter::LOCATE_SUCCESS && + SafeToMakeExternalRequest(missing_info, options.blacklist_regex)) { + msss_servers = options.full_external_msss_servers; + if (!is_exe) { + msss_servers.insert(msss_servers.end(), + options.no_exe_external_msss_servers.begin(), + options.no_exe_external_msss_servers.end()); + } + if (msss_servers.size() > 0) { + FprintfFlush(stderr, "Making external request for %s (%s)\n", + missing_info.debug_file.c_str(), + missing_info.debug_identifier.c_str()); + MSSymbolServerConverter external_converter( + options.local_cache_path, msss_servers, options.trace_symsrv); + located = external_converter.LocateAndConvertSymbolFile( + missing_info, + /*keep_symbol_file=*/true, + /*keep_pe_file=*/true, &converted_file, &symbol_file, &pe_file); + } else { + FprintfFlush(stderr, "ERROR: No suitable external symbol servers.\n"); + } + } + + // Final handling for this symbol file is based on the result from the + // external request (if performed above), or on the result from the + // previous internal lookup. + switch (located) { + case MSSymbolServerConverter::LOCATE_SUCCESS: + FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n"); + // Upload it. Don't bother checking the return value. If this + // succeeds, it should disappear from the missing symbol list. + // If it fails, something will print an error message indicating + // the cause of the failure, and the item will remain on the + // missing symbol list. + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, missing_info.debug_identifier, + converted_file, kSymbolUploadTypeBreakpad); + remove(converted_file.c_str()); + + // Upload PDB/PE if we have them + if (!symbol_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.debug_file, missing_info.debug_identifier, + symbol_file, kSymbolUploadTypePDB); + remove(symbol_file.c_str()); + } + if (!pe_file.empty()) { + UploadSymbolFile(options.upload_symbols_url, options.api_key, + missing_info.code_file, missing_info.debug_identifier, + pe_file, kSymbolUploadTypePE); + remove(pe_file.c_str()); + } + + // Note: this does leave some directories behind that could be + // cleaned up. The directories inside options.local_cache_path for + // debug_file/debug_identifier can be removed at this point. + break; + + case MSSymbolServerConverter::LOCATE_NOT_FOUND: + // The symbol file definitively didn't exist. Inform the server. + // If this fails, something will print an error message indicating + // the cause of the failure, but there's really nothing more to + // do. If this succeeds, the entry should be removed from the + // missing symbols list. + if (!options.report_fetch_failures) { + FprintfFlush(stderr, "SendFetchFailedPing skipped\n"); + } else if (SendFetchFailedPing(options.fetch_symbol_failure_url, + missing_info)) { + FprintfFlush(stderr, "SendFetchFailedPing succeeded\n"); + } else { + FprintfFlush(stderr, "SendFetchFailedPing failed\n"); + } + break; + + case MSSymbolServerConverter::LOCATE_RETRY: + FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n"); + // Nothing to do but leave the entry in the symbol file list and + // try again on a future pass. Print a message so that there's + // a record. + FprintfFlush(stderr, "ConvertMissingSymbolFile: deferring retry " + "for %s %s %s\n", + missing_info.debug_file.c_str(), + missing_info.debug_identifier.c_str(), + missing_info.version.c_str()); + break; + + case MSSymbolServerConverter::LOCATE_HTTP_HTTPS_REDIR: + FprintfFlush( + stderr, + "LocateResult = LOCATE_HTTP_HTTPS_REDIR\n" + "One of the specified URLs is using HTTP, which causes a redirect " + "from the server to HTTPS, which causes the SymSrv lookup to fail.\n" + "This URL must be replaced with the correct HTTPS URL.\n"); + break; + + case MSSymbolServerConverter::LOCATE_FAILURE: + FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n"); + // LocateAndConvertSymbolFile printed an error message. + + // This is due to a bad debug file name, so fetch failed. + if (!options.report_fetch_failures) { + FprintfFlush(stderr, "SendFetchFailedPing skipped\n"); + } else if (SendFetchFailedPing(options.fetch_symbol_failure_url, + missing_info)) { + FprintfFlush(stderr, "SendFetchFailedPing succeeded\n"); + } else { + FprintfFlush(stderr, "SendFetchFailedPing failed\n"); + } + break; + + default: + FprintfFlush( + stderr, + "FATAL: Unexpected return value '%d' from " + "LocateAndConvertSymbolFile()\n", + located); + assert(0); + break; + } +} + + +// Reads the contents of file |file_name| and populates |contents|. +// Returns true on success. +static bool ReadFile(string file_name, string* contents) { + char buffer[1024 * 8]; + FILE* fp = fopen(file_name.c_str(), "rt"); + if (!fp) { + return false; + } + contents->clear(); + while (fgets(buffer, sizeof(buffer), fp) != NULL) { + contents->append(buffer); + } + fclose(fp); + return true; +} + +// ConvertMissingSymbolsList obtains a missing symbol list from +// |options.missing_symbols_url| or |options.missing_symbols_file| and calls +// ConvertMissingSymbolFile for each missing symbol file in the list. +static bool ConvertMissingSymbolsList(const ConverterOptions& options) { + // Set param to indicate requesting for encoded response. + map parameters; + parameters[L"product"] = kConverterProductName; + parameters[L"encoded"] = L"true"; + // Get the missing symbol list. + string missing_symbol_list; + if (!options.missing_symbols_file.empty()) { + if (!ReadFile(options.missing_symbols_file,& missing_symbol_list)) { + return false; + } + } else if (!HTTPDownload::Download(options.missing_symbols_url,& parameters, + & missing_symbol_list, NULL)) { + return false; + } + + // Tokenize the content into a vector. + vector missing_symbol_lines; + Tokenizer::Tokenize("\n", missing_symbol_list,& missing_symbol_lines); + + FprintfFlush(stderr, "Found %d missing symbol files in list.\n", + missing_symbol_lines.size() - 1); // last line is empty. + int convert_attempts = 0; + for (vector::const_iterator iterator = missing_symbol_lines.begin(); + iterator != missing_symbol_lines.end(); + ++iterator) { + // Decode symbol line. + const string& encoded_line = *iterator; + // Skip lines that are blank. + if (encoded_line.empty()) { + continue; + } + + string line; + if (!WebSafeBase64Unescape(encoded_line,& line)) { + // If decoding fails, assume the line is not encoded. + // This is helpful when the program connects to a debug server without + // encoding. + line = encoded_line; + } + + FprintfFlush(stderr, "\nLine: %s\n", line.c_str()); + + // Turn each element into a MissingSymbolInfo structure. + MissingSymbolInfo missing_info; + if (!ParseMissingString(line,& missing_info)) { + FprintfFlush(stderr, "ConvertMissingSymbols: ParseMissingString failed " + "for %s from %ws\n", + line.c_str(), options.missing_symbols_url.c_str()); + continue; + } + + ++convert_attempts; + ConvertMissingSymbolFile(missing_info, options); + } + + // Say something reassuring, since ConvertMissingSymbolFile was never called + // and therefore never reported any progress. + if (convert_attempts == 0) { + string current_time = CurrentDateAndTime(); + FprintfFlush(stdout, "converter: %s: nothing to convert\n", + current_time.c_str()); + } + + return true; +} + +// usage prints the usage message. It returns 1 as a convenience, to be used +// as a return value from main. +static int usage(const char* program_name) { + FprintfFlush( + stderr, + "usage: %s [options]\n" + " -f MS servers to ask for all symbols\n" + " -n same, but prevent asking for EXEs\n" + " -l Temporary local storage for symbols\n" + " -s URL for uploading symbols\n" + " -k API key to use when uploading symbols\n" + " -m URL to fetch list of missing symbols\n" + " -mf File containing the list of missing\n" + " symbols. Fetch failures are not\n" + " reported if such file is provided.\n" + " -t URL to report symbol fetch failure\n" + " -b Regex used to blacklist files to\n" + " prevent external symbol requests\n" + " -tss If set then SymSrv callbacks will be\n" + " traced to stderr.\n" + " Note that any server specified by -f or -n that starts with \\filer\n" + " will be treated as internal, and all others as external.\n", + program_name); + + return 1; +} + +// "Internal" servers consist only of those whose names start with +// the literal string "\\filer\". +static bool IsInternalServer(const string& server_name) { + if (server_name.find("\\\\filer\\") == 0) { + return true; + } + return false; +} + +// Adds a server with the given name to the list of internal or external +// servers, as appropriate. +static void AddServer(const string& server_name, + vector* internal_servers, + vector* external_servers) { + if (IsInternalServer(server_name)) { + internal_servers->push_back(server_name); + } else { + external_servers->push_back(server_name); + } +} + +} // namespace + +int main(int argc, char** argv) { + string time_string = CurrentDateAndTime(); + FprintfFlush(stdout, "converter: %s: starting\n", time_string.c_str()); + + ConverterOptions options; + options.report_fetch_failures = true; + + // All arguments are paired. + if (argc % 2 != 1) { + return usage(argv[0]); + } + + string blacklist_regex_str; + bool have_any_msss_servers = false; + for (int argi = 1; argi < argc; argi += 2) { + string option = argv[argi]; + string value = argv[argi + 1]; + + if (option == "-f") { + AddServer(value,& options.full_internal_msss_servers, + & options.full_external_msss_servers); + have_any_msss_servers = true; + } else if (option == "-n") { + AddServer(value,& options.no_exe_internal_msss_servers, + & options.no_exe_external_msss_servers); + have_any_msss_servers = true; + } else if (option == "-l") { + if (!options.local_cache_path.empty()) { + return usage(argv[0]); + } + options.local_cache_path = value; + } else if (option == "-s") { + if (!WindowsStringUtils::safe_mbstowcs(value, + & options.upload_symbols_url)) { + FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", + value.c_str()); + return 1; + } + } else if (option == "-k") { + if (!WindowsStringUtils::safe_mbstowcs(value, &options.api_key)) { + FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", + value.c_str()); + return 1; + } + } else if (option == "-m") { + if (!WindowsStringUtils::safe_mbstowcs(value, + & options.missing_symbols_url)) { + FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", + value.c_str()); + return 1; + } + } else if (option == "-mf") { + options.missing_symbols_file = value; + printf("Getting the list of missing symbols from a file. Fetch failures" + " will not be reported.\n"); + options.report_fetch_failures = false; + } else if (option == "-tss") { + printf("Tracing SymSrv callbacks to stderr.\n"); + options.trace_symsrv = true; + } else if (option == "-t") { + if (!WindowsStringUtils::safe_mbstowcs( + value, + & options.fetch_symbol_failure_url)) { + FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n", + value.c_str()); + return 1; + } + } else if (option == "-b") { + blacklist_regex_str = value; + } else { + return usage(argv[0]); + } + } + + if (blacklist_regex_str.empty()) { + FprintfFlush(stderr, "No blacklist specified.\n"); + return usage(argv[0]); + } + + // Compile the blacklist regular expression for later use. + options.blacklist_regex = std::regex(blacklist_regex_str.c_str(), + std::regex_constants::icase); + + // Set the defaults. If the user specified any MSSS servers, don't use + // any default. + if (!have_any_msss_servers) { + AddServer(kNoExeMSSSServer,& options.no_exe_internal_msss_servers, + & options.no_exe_external_msss_servers); + } + + if (options.local_cache_path.empty()) { + options.local_cache_path = kLocalCachePath; + } + + if (options.upload_symbols_url.empty()) { + FprintfFlush(stderr, "No upload symbols URL specified.\n"); + return usage(argv[0]); + } + if (options.api_key.empty()) { + FprintfFlush(stderr, "No API key specified.\n"); + return usage(argv[0]); + } + if (options.missing_symbols_url.empty() && + options.missing_symbols_file.empty()) { + FprintfFlush(stderr, "No missing symbols URL or file specified.\n"); + return usage(argv[0]); + } + if (options.fetch_symbol_failure_url.empty()) { + FprintfFlush(stderr, "No fetch symbol failure URL specified.\n"); + return usage(argv[0]); + } + + FprintfFlush(stdout, + "# of Symbol Servers (int/ext): %d/%d full, %d/%d no_exe\n", + options.full_internal_msss_servers.size(), + options.full_external_msss_servers.size(), + options.no_exe_internal_msss_servers.size(), + options.no_exe_external_msss_servers.size()); + + if (!ConvertMissingSymbolsList(options)) { + return 1; + } + + time_string = CurrentDateAndTime(); + FprintfFlush(stdout, "converter: %s: finished\n", time_string.c_str()); + return 0; +} diff --git a/src/tools/windows/converter_exe/converter.gyp b/src/tools/windows/converter_exe/converter.gyp index fe443d1b4..b930e8812 100644 --- a/src/tools/windows/converter_exe/converter.gyp +++ b/src/tools/windows/converter_exe/converter.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 Google Inc. All rights reserved. +# Copyright 2013 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/converter_exe/escaping.cc b/src/tools/windows/converter_exe/escaping.cc index 74a7203ab..de0742984 100644 --- a/src/tools/windows/converter_exe/escaping.cc +++ b/src/tools/windows/converter_exe/escaping.cc @@ -1,757 +1,757 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "tools/windows/converter_exe/escaping.h" - -#include - -#define kApb kAsciiPropertyBits - -const unsigned char kAsciiPropertyBits[256] = { - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x00 - 0x40, 0x68, 0x48, 0x48, 0x48, 0x48, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x10 - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 0x20 - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x40 - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x50 - 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x60 - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x70 - 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x40, -}; - -// Use !! to suppress the warning C4800 of forcing 'int' to 'bool'. -static inline bool ascii_isspace(unsigned char c) { return !!(kApb[c] & 0x08); } - -/////////////////////////////////// -// scoped_array -/////////////////////////////////// -// scoped_array is like scoped_ptr, except that the caller must allocate -// with new [] and the destructor deletes objects with delete []. -// -// As with scoped_ptr, a scoped_array either points to an object -// or is NULL. A scoped_array owns the object that it points to. -// scoped_array is thread-compatible, and once you index into it, -// the returned objects have only the threadsafety guarantees of T. -// -// Size: sizeof(scoped_array) == sizeof(C*) -template -class scoped_array { - public: - - // The element type - typedef C element_type; - - // Constructor. Defaults to intializing with NULL. - // There is no way to create an uninitialized scoped_array. - // The input parameter must be allocated with new []. - explicit scoped_array(C* p = NULL) : array_(p) { } - - // Destructor. If there is a C object, delete it. - // We don't need to test ptr_ == NULL because C++ does that for us. - ~scoped_array() { - enum { type_must_be_complete = sizeof(C) }; - delete[] array_; - } - - // Reset. Deletes the current owned object, if any. - // Then takes ownership of a new object, if given. - // this->reset(this->get()) works. - void reset(C* p = NULL) { - if (p != array_) { - enum { type_must_be_complete = sizeof(C) }; - delete[] array_; - array_ = p; - } - } - - // Get one element of the current object. - // Will assert() if there is no current object, or index i is negative. - C& operator[](std::ptrdiff_t i) const { - assert(i >= 0); - assert(array_ != NULL); - return array_[i]; - } - - // Get a pointer to the zeroth element of the current object. - // If there is no current object, return NULL. - C* get() const { - return array_; - } - - // Comparison operators. - // These return whether a scoped_array and a raw pointer refer to - // the same array, not just to two different but equal arrays. - bool operator==(const C* p) const { return array_ == p; } - bool operator!=(const C* p) const { return array_ != p; } - - // Swap two scoped arrays. - void swap(scoped_array& p2) { - C* tmp = array_; - array_ = p2.array_; - p2.array_ = tmp; - } - - // Release an array. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - C* release() { - C* retVal = array_; - array_ = NULL; - return retVal; - } - - private: - C* array_; - - // Forbid comparison of different scoped_array types. - template bool operator==(scoped_array const& p2) const; - template bool operator!=(scoped_array const& p2) const; - - // Disallow evil constructors - scoped_array(const scoped_array&); - void operator=(const scoped_array&); -}; - - -/////////////////////////////////// -// Escape methods -/////////////////////////////////// - -namespace strings { - -// Return a mutable char* pointing to a string's internal buffer, -// which may not be null-terminated. Writing through this pointer will -// modify the string. -// -// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the -// next call to a string method that invalidates iterators. -// -// As of 2006-04, there is no standard-blessed way of getting a -// mutable reference to a string's internal buffer. However, issue 530 -// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530) -// proposes this as the method. According to Matt Austern, this should -// already work on all current implementations. -inline char* string_as_array(string* str) { - // DO NOT USE const_cast(str->data())! See the unittest for why. - return str->empty() ? NULL : &*str->begin(); -} - -int CalculateBase64EscapedLen(int input_len, bool do_padding) { - // these formulae were copied from comments that used to go with the base64 - // encoding functions - int intermediate_result = 8 * input_len + 5; - assert(intermediate_result > 0); // make sure we didn't overflow - int len = intermediate_result / 6; - if (do_padding) len = ((len + 3) / 4) * 4; - return len; -} - -// Base64Escape does padding, so this calculation includes padding. -int CalculateBase64EscapedLen(int input_len) { - return CalculateBase64EscapedLen(input_len, true); -} - -// ---------------------------------------------------------------------- -// int Base64Unescape() - base64 decoder -// int Base64Escape() - base64 encoder -// int WebSafeBase64Unescape() - Google's variation of base64 decoder -// int WebSafeBase64Escape() - Google's variation of base64 encoder -// -// Check out -// http://www.cis.ohio-state.edu/htbin/rfc/rfc2045.html for formal -// description, but what we care about is that... -// Take the encoded stuff in groups of 4 characters and turn each -// character into a code 0 to 63 thus: -// A-Z map to 0 to 25 -// a-z map to 26 to 51 -// 0-9 map to 52 to 61 -// +(- for WebSafe) maps to 62 -// /(_ for WebSafe) maps to 63 -// There will be four numbers, all less than 64 which can be represented -// by a 6 digit binary number (aaaaaa, bbbbbb, cccccc, dddddd respectively). -// Arrange the 6 digit binary numbers into three bytes as such: -// aaaaaabb bbbbcccc ccdddddd -// Equals signs (one or two) are used at the end of the encoded block to -// indicate that the text was not an integer multiple of three bytes long. -// ---------------------------------------------------------------------- - -int Base64UnescapeInternal(const char *src, int szsrc, - char *dest, int szdest, - const signed char* unbase64) { - static const char kPad64 = '='; - - int decode = 0; - int destidx = 0; - int state = 0; - unsigned int ch = 0; - unsigned int temp = 0; - - // The GET_INPUT macro gets the next input character, skipping - // over any whitespace, and stopping when we reach the end of the - // string or when we read any non-data character. The arguments are - // an arbitrary identifier (used as a label for goto) and the number - // of data bytes that must remain in the input to avoid aborting the - // loop. -#define GET_INPUT(label, remain) \ - label: \ - --szsrc; \ - ch = *src++; \ - decode = unbase64[ch]; \ - if (decode < 0) { \ - if (ascii_isspace((char)ch) && szsrc >= remain) \ - goto label; \ - state = 4 - remain; \ - break; \ - } - - // if dest is null, we're just checking to see if it's legal input - // rather than producing output. (I suspect this could just be done - // with a regexp...). We duplicate the loop so this test can be - // outside it instead of in every iteration. - - if (dest) { - // This loop consumes 4 input bytes and produces 3 output bytes - // per iteration. We can't know at the start that there is enough - // data left in the string for a full iteration, so the loop may - // break out in the middle; if so 'state' will be set to the - // number of input bytes read. - - while (szsrc >= 4) { - // We'll start by optimistically assuming that the next four - // bytes of the string (src[0..3]) are four good data bytes - // (that is, no nulls, whitespace, padding chars, or illegal - // chars). We need to test src[0..2] for nulls individually - // before constructing temp to preserve the property that we - // never read past a null in the string (no matter how long - // szsrc claims the string is). - - if (!src[0] || !src[1] || !src[2] || - (temp = ((unbase64[static_cast(src[0])] << 18) | - (unbase64[static_cast(src[1])] << 12) | - (unbase64[static_cast(src[2])] << 6) | - (unbase64[static_cast(src[3])]))) & 0x80000000) { - // Iff any of those four characters was bad (null, illegal, - // whitespace, padding), then temp's high bit will be set - // (because unbase64[] is -1 for all bad characters). - // - // We'll back up and resort to the slower decoder, which knows - // how to handle those cases. - - GET_INPUT(first, 4); - temp = decode; - GET_INPUT(second, 3); - temp = (temp << 6) | decode; - GET_INPUT(third, 2); - temp = (temp << 6) | decode; - GET_INPUT(fourth, 1); - temp = (temp << 6) | decode; - } else { - // We really did have four good data bytes, so advance four - // characters in the string. - - szsrc -= 4; - src += 4; - decode = -1; - ch = '\0'; - } - - // temp has 24 bits of input, so write that out as three bytes. - - if (destidx+3 > szdest) return -1; - dest[destidx+2] = (char)temp; - temp >>= 8; - dest[destidx+1] = (char)temp; - temp >>= 8; - dest[destidx] = (char)temp; - destidx += 3; - } - } else { - while (szsrc >= 4) { - if (!src[0] || !src[1] || !src[2] || - (temp = ((unbase64[static_cast(src[0])] << 18) | - (unbase64[static_cast(src[1])] << 12) | - (unbase64[static_cast(src[2])] << 6) | - (unbase64[static_cast(src[3])]))) & 0x80000000) { - GET_INPUT(first_no_dest, 4); - GET_INPUT(second_no_dest, 3); - GET_INPUT(third_no_dest, 2); - GET_INPUT(fourth_no_dest, 1); - } else { - szsrc -= 4; - src += 4; - decode = -1; - ch = '\0'; - } - destidx += 3; - } - } - -#undef GET_INPUT - - // if the loop terminated because we read a bad character, return - // now. - if (decode < 0 && ch != '\0' && ch != kPad64 && !ascii_isspace((char)ch)) - return -1; - - if (ch == kPad64) { - // if we stopped by hitting an '=', un-read that character -- we'll - // look at it again when we count to check for the proper number of - // equals signs at the end. - ++szsrc; - --src; - } else { - // This loop consumes 1 input byte per iteration. It's used to - // clean up the 0-3 input bytes remaining when the first, faster - // loop finishes. 'temp' contains the data from 'state' input - // characters read by the first loop. - while (szsrc > 0) { - --szsrc; - ch = *src++; - decode = unbase64[ch]; - if (decode < 0) { - if (ascii_isspace((char)ch)) { - continue; - } else if (ch == '\0') { - break; - } else if (ch == kPad64) { - // back up one character; we'll read it again when we check - // for the correct number of equals signs at the end. - ++szsrc; - --src; - break; - } else { - return -1; - } - } - - // Each input character gives us six bits of output. - temp = (temp << 6) | decode; - ++state; - if (state == 4) { - // If we've accumulated 24 bits of output, write that out as - // three bytes. - if (dest) { - if (destidx+3 > szdest) return -1; - dest[destidx+2] = (char)temp; - temp >>= 8; - dest[destidx+1] = (char)temp; - temp >>= 8; - dest[destidx] = (char)temp; - } - destidx += 3; - state = 0; - temp = 0; - } - } - } - - // Process the leftover data contained in 'temp' at the end of the input. - int expected_equals = 0; - switch (state) { - case 0: - // Nothing left over; output is a multiple of 3 bytes. - break; - - case 1: - // Bad input; we have 6 bits left over. - return -1; - - case 2: - // Produce one more output byte from the 12 input bits we have left. - if (dest) { - if (destidx+1 > szdest) return -1; - temp >>= 4; - dest[destidx] = (char)temp; - } - ++destidx; - expected_equals = 2; - break; - - case 3: - // Produce two more output bytes from the 18 input bits we have left. - if (dest) { - if (destidx+2 > szdest) return -1; - temp >>= 2; - dest[destidx+1] = (char)temp; - temp >>= 8; - dest[destidx] = (char)temp; - } - destidx += 2; - expected_equals = 1; - break; - - default: - // state should have no other values at this point. - fprintf(stdout, "This can't happen; base64 decoder state = %d", state); - } - - // The remainder of the string should be all whitespace, mixed with - // exactly 0 equals signs, or exactly 'expected_equals' equals - // signs. (Always accepting 0 equals signs is a google extension - // not covered in the RFC.) - - int equals = 0; - while (szsrc > 0 && *src) { - if (*src == kPad64) - ++equals; - else if (!ascii_isspace(*src)) - return -1; - --szsrc; - ++src; - } - - return (equals == 0 || equals == expected_equals) ? destidx : -1; -} - -int Base64Unescape(const char *src, int szsrc, char *dest, int szdest) { - static const signed char UnBase64[] = { - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 62/*+*/, -1, -1, -1, 63/*/ */, - 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/, - 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1, - -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/, - 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/, - 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/, - 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, -1, - -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/, - 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/, - 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/, - 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1 - }; - // The above array was generated by the following code - // #include - // #include - // #include - // main() - // { - // static const char Base64[] = - // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - // char *pos; - // int idx, i, j; - // printf(" "); - // for (i = 0; i < 255; i += 8) { - // for (j = i; j < i + 8; j++) { - // pos = strchr(Base64, j); - // if ((pos == NULL) || (j == 0)) - // idx = -1; - // else - // idx = pos - Base64; - // if (idx == -1) - // printf(" %2d, ", idx); - // else - // printf(" %2d/*%c*/,", idx, j); - // } - // printf("\n "); - // } - // } - - return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64); -} - -bool Base64Unescape(const char *src, int slen, string* dest) { - // Determine the size of the output string. Base64 encodes every 3 bytes into - // 4 characters. any leftover chars are added directly for good measure. - // This is documented in the base64 RFC: http://www.ietf.org/rfc/rfc3548.txt - const int dest_len = 3 * (slen / 4) + (slen % 4); - - dest->resize(dest_len); - - // We are getting the destination buffer by getting the beginning of the - // string and converting it into a char *. - const int len = Base64Unescape(src, slen, - string_as_array(dest), dest->size()); - if (len < 0) { - return false; - } - - // could be shorter if there was padding - assert(len <= dest_len); - dest->resize(len); - - return true; -} - -// Base64Escape -// -// NOTE: We have to use an unsigned type for src because code built -// in the the /google tree treats characters as signed unless -// otherwised specified. -// -// TODO(who?): Move this function to use the char* type for "src" -int Base64EscapeInternal(const unsigned char *src, int szsrc, - char *dest, int szdest, const char *base64, - bool do_padding) { - static const char kPad64 = '='; - - if (szsrc <= 0) return 0; - - char *cur_dest = dest; - const unsigned char *cur_src = src; - - // Three bytes of data encodes to four characters of cyphertext. - // So we can pump through three-byte chunks atomically. - while (szsrc > 2) { /* keep going until we have less than 24 bits */ - if ((szdest -= 4) < 0) return 0; - cur_dest[0] = base64[cur_src[0] >> 2]; - cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)]; - cur_dest[2] = base64[((cur_src[1] & 0x0f) << 2) + (cur_src[2] >> 6)]; - cur_dest[3] = base64[cur_src[2] & 0x3f]; - - cur_dest += 4; - cur_src += 3; - szsrc -= 3; - } - - /* now deal with the tail (<=2 bytes) */ - switch (szsrc) { - case 0: - // Nothing left; nothing more to do. - break; - case 1: - // One byte left: this encodes to two characters, and (optionally) - // two pad characters to round out the four-character cypherblock. - if ((szdest -= 2) < 0) return 0; - cur_dest[0] = base64[cur_src[0] >> 2]; - cur_dest[1] = base64[(cur_src[0] & 0x03) << 4]; - cur_dest += 2; - if (do_padding) { - if ((szdest -= 2) < 0) return 0; - cur_dest[0] = kPad64; - cur_dest[1] = kPad64; - cur_dest += 2; - } - break; - case 2: - // Two bytes left: this encodes to three characters, and (optionally) - // one pad character to round out the four-character cypherblock. - if ((szdest -= 3) < 0) return 0; - cur_dest[0] = base64[cur_src[0] >> 2]; - cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)]; - cur_dest[2] = base64[(cur_src[1] & 0x0f) << 2]; - cur_dest += 3; - if (do_padding) { - if ((szdest -= 1) < 0) return 0; - cur_dest[0] = kPad64; - cur_dest += 1; - } - break; - default: - // Should not be reached: blocks of 3 bytes are handled - // in the while loop before this switch statement. - fprintf(stderr, "Logic problem? szsrc = %d", szsrc); - assert(false); - break; - } - return (cur_dest - dest); -} - -static const char kBase64Chars[] = -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -static const char kWebSafeBase64Chars[] = -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - -int Base64Escape(const unsigned char *src, int szsrc, char *dest, int szdest) { - return Base64EscapeInternal(src, szsrc, dest, szdest, kBase64Chars, true); -} - -void Base64Escape(const unsigned char *src, int szsrc, - string* dest, bool do_padding) { - const int max_escaped_size = - CalculateBase64EscapedLen(szsrc, do_padding); - dest->clear(); - dest->resize(max_escaped_size + 1, '\0'); - const int escaped_len = Base64EscapeInternal(src, szsrc, - &*dest->begin(), dest->size(), - kBase64Chars, - do_padding); - assert(max_escaped_size <= escaped_len); - dest->resize(escaped_len); -} - -void Base64Escape(const string& src, string* dest) { - Base64Escape(reinterpret_cast(src.c_str()), - src.size(), dest, true); -} - -//////////////////////////////////////////////////// -// WebSafe methods -//////////////////////////////////////////////////// - -int WebSafeBase64Unescape(const char *src, int szsrc, char *dest, int szdest) { - static const signed char UnBase64[] = { - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 62/*-*/, -1, -1, - 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/, - 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1, - -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/, - 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/, - 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/, - 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, 63/*_*/, - -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/, - 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/, - 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/, - 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1 - }; - // The above array was generated by the following code - // #include - // #include - // #include - // main() - // { - // static const char Base64[] = - // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - // char *pos; - // int idx, i, j; - // printf(" "); - // for (i = 0; i < 255; i += 8) { - // for (j = i; j < i + 8; j++) { - // pos = strchr(Base64, j); - // if ((pos == NULL) || (j == 0)) - // idx = -1; - // else - // idx = pos - Base64; - // if (idx == -1) - // printf(" %2d, ", idx); - // else - // printf(" %2d/*%c*/,", idx, j); - // } - // printf("\n "); - // } - // } - - return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64); -} - -bool WebSafeBase64Unescape(const char *src, int slen, string* dest) { - int dest_len = 3 * (slen / 4) + (slen % 4); - dest->clear(); - dest->resize(dest_len); - int len = WebSafeBase64Unescape(src, slen, &*dest->begin(), dest->size()); - if (len < 0) { - dest->clear(); - return false; - } - // could be shorter if there was padding - assert(len <= dest_len); - dest->resize(len); - return true; -} - -bool WebSafeBase64Unescape(const string& src, string* dest) { - return WebSafeBase64Unescape(src.data(), src.size(), dest); -} - -int WebSafeBase64Escape(const unsigned char *src, int szsrc, char *dest, - int szdest, bool do_padding) { - return Base64EscapeInternal(src, szsrc, dest, szdest, - kWebSafeBase64Chars, do_padding); -} - -void WebSafeBase64Escape(const unsigned char *src, int szsrc, - string *dest, bool do_padding) { - const int max_escaped_size = - CalculateBase64EscapedLen(szsrc, do_padding); - dest->clear(); - dest->resize(max_escaped_size + 1, '\0'); - const int escaped_len = Base64EscapeInternal(src, szsrc, - &*dest->begin(), dest->size(), - kWebSafeBase64Chars, - do_padding); - assert(max_escaped_size <= escaped_len); - dest->resize(escaped_len); -} - -void WebSafeBase64EscapeInternal(const string& src, - string* dest, - bool do_padding) { - int encoded_len = CalculateBase64EscapedLen(src.size()); - scoped_array buf(new char[encoded_len]); - int len = WebSafeBase64Escape(reinterpret_cast(src.c_str()), - src.size(), buf.get(), - encoded_len, do_padding); - dest->assign(buf.get(), len); -} - -void WebSafeBase64Escape(const string& src, string* dest) { - WebSafeBase64EscapeInternal(src, dest, false); -} - -void WebSafeBase64EscapeWithPadding(const string& src, string* dest) { - WebSafeBase64EscapeInternal(src, dest, true); -} - -} // namespace strings +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "tools/windows/converter_exe/escaping.h" + +#include + +#define kApb kAsciiPropertyBits + +const unsigned char kAsciiPropertyBits[256] = { + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x00 + 0x40, 0x68, 0x48, 0x48, 0x48, 0x48, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x10 + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 0x20 + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x40 + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x50 + 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x60 + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x70 + 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x40, +}; + +// Use !! to suppress the warning C4800 of forcing 'int' to 'bool'. +static inline bool ascii_isspace(unsigned char c) { return !!(kApb[c] & 0x08); } + +/////////////////////////////////// +// scoped_array +/////////////////////////////////// +// scoped_array is like scoped_ptr, except that the caller must allocate +// with new [] and the destructor deletes objects with delete []. +// +// As with scoped_ptr, a scoped_array either points to an object +// or is NULL. A scoped_array owns the object that it points to. +// scoped_array is thread-compatible, and once you index into it, +// the returned objects have only the threadsafety guarantees of T. +// +// Size: sizeof(scoped_array) == sizeof(C*) +template +class scoped_array { + public: + + // The element type + typedef C element_type; + + // Constructor. Defaults to intializing with NULL. + // There is no way to create an uninitialized scoped_array. + // The input parameter must be allocated with new []. + explicit scoped_array(C* p = NULL) : array_(p) { } + + // Destructor. If there is a C object, delete it. + // We don't need to test ptr_ == NULL because C++ does that for us. + ~scoped_array() { + enum { type_must_be_complete = sizeof(C) }; + delete[] array_; + } + + // Reset. Deletes the current owned object, if any. + // Then takes ownership of a new object, if given. + // this->reset(this->get()) works. + void reset(C* p = NULL) { + if (p != array_) { + enum { type_must_be_complete = sizeof(C) }; + delete[] array_; + array_ = p; + } + } + + // Get one element of the current object. + // Will assert() if there is no current object, or index i is negative. + C& operator[](std::ptrdiff_t i) const { + assert(i >= 0); + assert(array_ != NULL); + return array_[i]; + } + + // Get a pointer to the zeroth element of the current object. + // If there is no current object, return NULL. + C* get() const { + return array_; + } + + // Comparison operators. + // These return whether a scoped_array and a raw pointer refer to + // the same array, not just to two different but equal arrays. + bool operator==(const C* p) const { return array_ == p; } + bool operator!=(const C* p) const { return array_ != p; } + + // Swap two scoped arrays. + void swap(scoped_array& p2) { + C* tmp = array_; + array_ = p2.array_; + p2.array_ = tmp; + } + + // Release an array. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + C* release() { + C* retVal = array_; + array_ = NULL; + return retVal; + } + + private: + C* array_; + + // Forbid comparison of different scoped_array types. + template bool operator==(scoped_array const& p2) const; + template bool operator!=(scoped_array const& p2) const; + + // Disallow evil constructors + scoped_array(const scoped_array&); + void operator=(const scoped_array&); +}; + + +/////////////////////////////////// +// Escape methods +/////////////////////////////////// + +namespace strings { + +// Return a mutable char* pointing to a string's internal buffer, +// which may not be null-terminated. Writing through this pointer will +// modify the string. +// +// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the +// next call to a string method that invalidates iterators. +// +// As of 2006-04, there is no standard-blessed way of getting a +// mutable reference to a string's internal buffer. However, issue 530 +// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530) +// proposes this as the method. According to Matt Austern, this should +// already work on all current implementations. +inline char* string_as_array(string* str) { + // DO NOT USE const_cast(str->data())! See the unittest for why. + return str->empty() ? NULL : &*str->begin(); +} + +int CalculateBase64EscapedLen(int input_len, bool do_padding) { + // these formulae were copied from comments that used to go with the base64 + // encoding functions + int intermediate_result = 8 * input_len + 5; + assert(intermediate_result > 0); // make sure we didn't overflow + int len = intermediate_result / 6; + if (do_padding) len = ((len + 3) / 4) * 4; + return len; +} + +// Base64Escape does padding, so this calculation includes padding. +int CalculateBase64EscapedLen(int input_len) { + return CalculateBase64EscapedLen(input_len, true); +} + +// ---------------------------------------------------------------------- +// int Base64Unescape() - base64 decoder +// int Base64Escape() - base64 encoder +// int WebSafeBase64Unescape() - Google's variation of base64 decoder +// int WebSafeBase64Escape() - Google's variation of base64 encoder +// +// Check out +// http://www.cis.ohio-state.edu/htbin/rfc/rfc2045.html for formal +// description, but what we care about is that... +// Take the encoded stuff in groups of 4 characters and turn each +// character into a code 0 to 63 thus: +// A-Z map to 0 to 25 +// a-z map to 26 to 51 +// 0-9 map to 52 to 61 +// +(- for WebSafe) maps to 62 +// /(_ for WebSafe) maps to 63 +// There will be four numbers, all less than 64 which can be represented +// by a 6 digit binary number (aaaaaa, bbbbbb, cccccc, dddddd respectively). +// Arrange the 6 digit binary numbers into three bytes as such: +// aaaaaabb bbbbcccc ccdddddd +// Equals signs (one or two) are used at the end of the encoded block to +// indicate that the text was not an integer multiple of three bytes long. +// ---------------------------------------------------------------------- + +int Base64UnescapeInternal(const char *src, int szsrc, + char *dest, int szdest, + const signed char* unbase64) { + static const char kPad64 = '='; + + int decode = 0; + int destidx = 0; + int state = 0; + unsigned int ch = 0; + unsigned int temp = 0; + + // The GET_INPUT macro gets the next input character, skipping + // over any whitespace, and stopping when we reach the end of the + // string or when we read any non-data character. The arguments are + // an arbitrary identifier (used as a label for goto) and the number + // of data bytes that must remain in the input to avoid aborting the + // loop. +#define GET_INPUT(label, remain) \ + label: \ + --szsrc; \ + ch = *src++; \ + decode = unbase64[ch]; \ + if (decode < 0) { \ + if (ascii_isspace((char)ch) && szsrc >= remain) \ + goto label; \ + state = 4 - remain; \ + break; \ + } + + // if dest is null, we're just checking to see if it's legal input + // rather than producing output. (I suspect this could just be done + // with a regexp...). We duplicate the loop so this test can be + // outside it instead of in every iteration. + + if (dest) { + // This loop consumes 4 input bytes and produces 3 output bytes + // per iteration. We can't know at the start that there is enough + // data left in the string for a full iteration, so the loop may + // break out in the middle; if so 'state' will be set to the + // number of input bytes read. + + while (szsrc >= 4) { + // We'll start by optimistically assuming that the next four + // bytes of the string (src[0..3]) are four good data bytes + // (that is, no nulls, whitespace, padding chars, or illegal + // chars). We need to test src[0..2] for nulls individually + // before constructing temp to preserve the property that we + // never read past a null in the string (no matter how long + // szsrc claims the string is). + + if (!src[0] || !src[1] || !src[2] || + (temp = ((unbase64[static_cast(src[0])] << 18) | + (unbase64[static_cast(src[1])] << 12) | + (unbase64[static_cast(src[2])] << 6) | + (unbase64[static_cast(src[3])]))) & 0x80000000) { + // Iff any of those four characters was bad (null, illegal, + // whitespace, padding), then temp's high bit will be set + // (because unbase64[] is -1 for all bad characters). + // + // We'll back up and resort to the slower decoder, which knows + // how to handle those cases. + + GET_INPUT(first, 4); + temp = decode; + GET_INPUT(second, 3); + temp = (temp << 6) | decode; + GET_INPUT(third, 2); + temp = (temp << 6) | decode; + GET_INPUT(fourth, 1); + temp = (temp << 6) | decode; + } else { + // We really did have four good data bytes, so advance four + // characters in the string. + + szsrc -= 4; + src += 4; + decode = -1; + ch = '\0'; + } + + // temp has 24 bits of input, so write that out as three bytes. + + if (destidx+3 > szdest) return -1; + dest[destidx+2] = (char)temp; + temp >>= 8; + dest[destidx+1] = (char)temp; + temp >>= 8; + dest[destidx] = (char)temp; + destidx += 3; + } + } else { + while (szsrc >= 4) { + if (!src[0] || !src[1] || !src[2] || + (temp = ((unbase64[static_cast(src[0])] << 18) | + (unbase64[static_cast(src[1])] << 12) | + (unbase64[static_cast(src[2])] << 6) | + (unbase64[static_cast(src[3])]))) & 0x80000000) { + GET_INPUT(first_no_dest, 4); + GET_INPUT(second_no_dest, 3); + GET_INPUT(third_no_dest, 2); + GET_INPUT(fourth_no_dest, 1); + } else { + szsrc -= 4; + src += 4; + decode = -1; + ch = '\0'; + } + destidx += 3; + } + } + +#undef GET_INPUT + + // if the loop terminated because we read a bad character, return + // now. + if (decode < 0 && ch != '\0' && ch != kPad64 && !ascii_isspace((char)ch)) + return -1; + + if (ch == kPad64) { + // if we stopped by hitting an '=', un-read that character -- we'll + // look at it again when we count to check for the proper number of + // equals signs at the end. + ++szsrc; + --src; + } else { + // This loop consumes 1 input byte per iteration. It's used to + // clean up the 0-3 input bytes remaining when the first, faster + // loop finishes. 'temp' contains the data from 'state' input + // characters read by the first loop. + while (szsrc > 0) { + --szsrc; + ch = *src++; + decode = unbase64[ch]; + if (decode < 0) { + if (ascii_isspace((char)ch)) { + continue; + } else if (ch == '\0') { + break; + } else if (ch == kPad64) { + // back up one character; we'll read it again when we check + // for the correct number of equals signs at the end. + ++szsrc; + --src; + break; + } else { + return -1; + } + } + + // Each input character gives us six bits of output. + temp = (temp << 6) | decode; + ++state; + if (state == 4) { + // If we've accumulated 24 bits of output, write that out as + // three bytes. + if (dest) { + if (destidx+3 > szdest) return -1; + dest[destidx+2] = (char)temp; + temp >>= 8; + dest[destidx+1] = (char)temp; + temp >>= 8; + dest[destidx] = (char)temp; + } + destidx += 3; + state = 0; + temp = 0; + } + } + } + + // Process the leftover data contained in 'temp' at the end of the input. + int expected_equals = 0; + switch (state) { + case 0: + // Nothing left over; output is a multiple of 3 bytes. + break; + + case 1: + // Bad input; we have 6 bits left over. + return -1; + + case 2: + // Produce one more output byte from the 12 input bits we have left. + if (dest) { + if (destidx+1 > szdest) return -1; + temp >>= 4; + dest[destidx] = (char)temp; + } + ++destidx; + expected_equals = 2; + break; + + case 3: + // Produce two more output bytes from the 18 input bits we have left. + if (dest) { + if (destidx+2 > szdest) return -1; + temp >>= 2; + dest[destidx+1] = (char)temp; + temp >>= 8; + dest[destidx] = (char)temp; + } + destidx += 2; + expected_equals = 1; + break; + + default: + // state should have no other values at this point. + fprintf(stdout, "This can't happen; base64 decoder state = %d", state); + } + + // The remainder of the string should be all whitespace, mixed with + // exactly 0 equals signs, or exactly 'expected_equals' equals + // signs. (Always accepting 0 equals signs is a google extension + // not covered in the RFC.) + + int equals = 0; + while (szsrc > 0 && *src) { + if (*src == kPad64) + ++equals; + else if (!ascii_isspace(*src)) + return -1; + --szsrc; + ++src; + } + + return (equals == 0 || equals == expected_equals) ? destidx : -1; +} + +int Base64Unescape(const char *src, int szsrc, char *dest, int szdest) { + static const signed char UnBase64[] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 62/*+*/, -1, -1, -1, 63/*/ */, + 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/, + 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1, + -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/, + 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/, + 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/, + 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, -1, + -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/, + 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/, + 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/, + 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1 + }; + // The above array was generated by the following code + // #include + // #include + // #include + // main() + // { + // static const char Base64[] = + // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + // char *pos; + // int idx, i, j; + // printf(" "); + // for (i = 0; i < 255; i += 8) { + // for (j = i; j < i + 8; j++) { + // pos = strchr(Base64, j); + // if ((pos == NULL) || (j == 0)) + // idx = -1; + // else + // idx = pos - Base64; + // if (idx == -1) + // printf(" %2d, ", idx); + // else + // printf(" %2d/*%c*/,", idx, j); + // } + // printf("\n "); + // } + // } + + return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64); +} + +bool Base64Unescape(const char *src, int slen, string* dest) { + // Determine the size of the output string. Base64 encodes every 3 bytes into + // 4 characters. any leftover chars are added directly for good measure. + // This is documented in the base64 RFC: http://www.ietf.org/rfc/rfc3548.txt + const int dest_len = 3 * (slen / 4) + (slen % 4); + + dest->resize(dest_len); + + // We are getting the destination buffer by getting the beginning of the + // string and converting it into a char *. + const int len = Base64Unescape(src, slen, + string_as_array(dest), dest->size()); + if (len < 0) { + return false; + } + + // could be shorter if there was padding + assert(len <= dest_len); + dest->resize(len); + + return true; +} + +// Base64Escape +// +// NOTE: We have to use an unsigned type for src because code built +// in the the /google tree treats characters as signed unless +// otherwised specified. +// +// TODO(who?): Move this function to use the char* type for "src" +int Base64EscapeInternal(const unsigned char *src, int szsrc, + char *dest, int szdest, const char *base64, + bool do_padding) { + static const char kPad64 = '='; + + if (szsrc <= 0) return 0; + + char *cur_dest = dest; + const unsigned char *cur_src = src; + + // Three bytes of data encodes to four characters of cyphertext. + // So we can pump through three-byte chunks atomically. + while (szsrc > 2) { /* keep going until we have less than 24 bits */ + if ((szdest -= 4) < 0) return 0; + cur_dest[0] = base64[cur_src[0] >> 2]; + cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)]; + cur_dest[2] = base64[((cur_src[1] & 0x0f) << 2) + (cur_src[2] >> 6)]; + cur_dest[3] = base64[cur_src[2] & 0x3f]; + + cur_dest += 4; + cur_src += 3; + szsrc -= 3; + } + + /* now deal with the tail (<=2 bytes) */ + switch (szsrc) { + case 0: + // Nothing left; nothing more to do. + break; + case 1: + // One byte left: this encodes to two characters, and (optionally) + // two pad characters to round out the four-character cypherblock. + if ((szdest -= 2) < 0) return 0; + cur_dest[0] = base64[cur_src[0] >> 2]; + cur_dest[1] = base64[(cur_src[0] & 0x03) << 4]; + cur_dest += 2; + if (do_padding) { + if ((szdest -= 2) < 0) return 0; + cur_dest[0] = kPad64; + cur_dest[1] = kPad64; + cur_dest += 2; + } + break; + case 2: + // Two bytes left: this encodes to three characters, and (optionally) + // one pad character to round out the four-character cypherblock. + if ((szdest -= 3) < 0) return 0; + cur_dest[0] = base64[cur_src[0] >> 2]; + cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)]; + cur_dest[2] = base64[(cur_src[1] & 0x0f) << 2]; + cur_dest += 3; + if (do_padding) { + if ((szdest -= 1) < 0) return 0; + cur_dest[0] = kPad64; + cur_dest += 1; + } + break; + default: + // Should not be reached: blocks of 3 bytes are handled + // in the while loop before this switch statement. + fprintf(stderr, "Logic problem? szsrc = %d", szsrc); + assert(false); + break; + } + return (cur_dest - dest); +} + +static const char kBase64Chars[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static const char kWebSafeBase64Chars[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + +int Base64Escape(const unsigned char *src, int szsrc, char *dest, int szdest) { + return Base64EscapeInternal(src, szsrc, dest, szdest, kBase64Chars, true); +} + +void Base64Escape(const unsigned char *src, int szsrc, + string* dest, bool do_padding) { + const int max_escaped_size = + CalculateBase64EscapedLen(szsrc, do_padding); + dest->clear(); + dest->resize(max_escaped_size + 1, '\0'); + const int escaped_len = Base64EscapeInternal(src, szsrc, + &*dest->begin(), dest->size(), + kBase64Chars, + do_padding); + assert(max_escaped_size <= escaped_len); + dest->resize(escaped_len); +} + +void Base64Escape(const string& src, string* dest) { + Base64Escape(reinterpret_cast(src.c_str()), + src.size(), dest, true); +} + +//////////////////////////////////////////////////// +// WebSafe methods +//////////////////////////////////////////////////// + +int WebSafeBase64Unescape(const char *src, int szsrc, char *dest, int szdest) { + static const signed char UnBase64[] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 62/*-*/, -1, -1, + 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/, + 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1, + -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/, + 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/, + 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/, + 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, 63/*_*/, + -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/, + 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/, + 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/, + 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1 + }; + // The above array was generated by the following code + // #include + // #include + // #include + // main() + // { + // static const char Base64[] = + // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + // char *pos; + // int idx, i, j; + // printf(" "); + // for (i = 0; i < 255; i += 8) { + // for (j = i; j < i + 8; j++) { + // pos = strchr(Base64, j); + // if ((pos == NULL) || (j == 0)) + // idx = -1; + // else + // idx = pos - Base64; + // if (idx == -1) + // printf(" %2d, ", idx); + // else + // printf(" %2d/*%c*/,", idx, j); + // } + // printf("\n "); + // } + // } + + return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64); +} + +bool WebSafeBase64Unescape(const char *src, int slen, string* dest) { + int dest_len = 3 * (slen / 4) + (slen % 4); + dest->clear(); + dest->resize(dest_len); + int len = WebSafeBase64Unescape(src, slen, &*dest->begin(), dest->size()); + if (len < 0) { + dest->clear(); + return false; + } + // could be shorter if there was padding + assert(len <= dest_len); + dest->resize(len); + return true; +} + +bool WebSafeBase64Unescape(const string& src, string* dest) { + return WebSafeBase64Unescape(src.data(), src.size(), dest); +} + +int WebSafeBase64Escape(const unsigned char *src, int szsrc, char *dest, + int szdest, bool do_padding) { + return Base64EscapeInternal(src, szsrc, dest, szdest, + kWebSafeBase64Chars, do_padding); +} + +void WebSafeBase64Escape(const unsigned char *src, int szsrc, + string *dest, bool do_padding) { + const int max_escaped_size = + CalculateBase64EscapedLen(szsrc, do_padding); + dest->clear(); + dest->resize(max_escaped_size + 1, '\0'); + const int escaped_len = Base64EscapeInternal(src, szsrc, + &*dest->begin(), dest->size(), + kWebSafeBase64Chars, + do_padding); + assert(max_escaped_size <= escaped_len); + dest->resize(escaped_len); +} + +void WebSafeBase64EscapeInternal(const string& src, + string* dest, + bool do_padding) { + int encoded_len = CalculateBase64EscapedLen(src.size()); + scoped_array buf(new char[encoded_len]); + int len = WebSafeBase64Escape(reinterpret_cast(src.c_str()), + src.size(), buf.get(), + encoded_len, do_padding); + dest->assign(buf.get(), len); +} + +void WebSafeBase64Escape(const string& src, string* dest) { + WebSafeBase64EscapeInternal(src, dest, false); +} + +void WebSafeBase64EscapeWithPadding(const string& src, string* dest) { + WebSafeBase64EscapeInternal(src, dest, true); +} + +} // namespace strings diff --git a/src/tools/windows/converter_exe/escaping.h b/src/tools/windows/converter_exe/escaping.h index c8aa90b7b..bc36bf57c 100644 --- a/src/tools/windows/converter_exe/escaping.h +++ b/src/tools/windows/converter_exe/escaping.h @@ -1,99 +1,99 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Base64 escaping methods to encode/decode strings. - -#ifndef TOOLS_WINDOWS_CONVERTER_EXE_ESCAPING_H_ -#define TOOLS_WINDOWS_CONVERTER_EXE_ESCAPING_H_ - -#include - -namespace strings { - -using std::string; - -// ---------------------------------------------------------------------- -// Base64Escape() -// WebSafeBase64Escape() -// Encode "src" to "dest" using base64 encoding. -// src is not null terminated, instead specify len. -// 'dest' should have at least CalculateBase64EscapedLen() length. -// RETURNS the length of dest. -// The WebSafe variation use '-' instead of '+' and '_' instead of '/' -// so that we can place the out in the URL or cookies without having -// to escape them. It also has an extra parameter "do_padding", -// which when set to false will prevent padding with "=". -// ---------------------------------------------------------------------- -void Base64Escape(const string& src, string* dest); -int Base64Escape(const unsigned char* src, int slen, char* dest, int szdest); -// Encode src into dest with padding. -void Base64Escape(const unsigned char* src, int szsrc, - string* dest, bool do_padding); - -int WebSafeBase64Escape(const unsigned char* src, int slen, char* dest, - int szdest, bool do_padding); -// Encode src into dest web-safely without padding. -void WebSafeBase64Escape(const string& src, string* dest); -// Encode src into dest web-safely with padding. -void WebSafeBase64EscapeWithPadding(const string& src, string* dest); -void WebSafeBase64Escape(const unsigned char* src, int szsrc, - string* dest, bool do_padding); - -// ---------------------------------------------------------------------- -// Base64Unescape() -// WebSafeBase64Unescape() -// Copies "src" to "dest", where src is in base64 and is written to its -// ASCII equivalents. src is not null terminated, instead specify len. -// I recommend that slen + +namespace strings { + +using std::string; + +// ---------------------------------------------------------------------- +// Base64Escape() +// WebSafeBase64Escape() +// Encode "src" to "dest" using base64 encoding. +// src is not null terminated, instead specify len. +// 'dest' should have at least CalculateBase64EscapedLen() length. +// RETURNS the length of dest. +// The WebSafe variation use '-' instead of '+' and '_' instead of '/' +// so that we can place the out in the URL or cookies without having +// to escape them. It also has an extra parameter "do_padding", +// which when set to false will prevent padding with "=". +// ---------------------------------------------------------------------- +void Base64Escape(const string& src, string* dest); +int Base64Escape(const unsigned char* src, int slen, char* dest, int szdest); +// Encode src into dest with padding. +void Base64Escape(const unsigned char* src, int szsrc, + string* dest, bool do_padding); + +int WebSafeBase64Escape(const unsigned char* src, int slen, char* dest, + int szdest, bool do_padding); +// Encode src into dest web-safely without padding. +void WebSafeBase64Escape(const string& src, string* dest); +// Encode src into dest web-safely with padding. +void WebSafeBase64EscapeWithPadding(const string& src, string* dest); +void WebSafeBase64Escape(const unsigned char* src, int szsrc, + string* dest, bool do_padding); + +// ---------------------------------------------------------------------- +// Base64Unescape() +// WebSafeBase64Unescape() +// Copies "src" to "dest", where src is in base64 and is written to its +// ASCII equivalents. src is not null terminated, instead specify len. +// I recommend that slen -#include -#include - -typedef void* HttpHandle; - -namespace crash { - -// HttpClient provides an abstract layer for HTTP APIs. The actual -// implementation can be based on either WinHttp or WinInet. -class HttpClient { - public: - enum AccessType { - ACCESS_TYPE_PRECONFIG, - ACCESS_TYPE_DIRECT, - ACCESS_TYPE_PROXY, - }; - - virtual ~HttpClient() {} - - virtual bool CrackUrl(const TCHAR* url, - DWORD flags, - TCHAR* scheme, - size_t scheme_buffer_length, - TCHAR* host, - size_t host_buffer_length, - TCHAR* uri, - size_t uri_buffer_length, - int* port) const = 0; - virtual bool Open(const TCHAR* user_agent, - DWORD access_type, - const TCHAR* proxy_name, - const TCHAR* proxy_bypass, - HttpHandle* session_handle) const = 0; - virtual bool Connect(HttpHandle session_handle, - const TCHAR* server, - int port, - HttpHandle* connection_handle) const = 0; - virtual bool OpenRequest(HttpHandle connection_handle, - const TCHAR* verb, - const TCHAR* uri, - const TCHAR* version, - const TCHAR* referrer, - bool is_secure, - HttpHandle* request_handle) const = 0; - virtual bool SendRequest(HttpHandle request_handle, - const TCHAR* headers, - DWORD headers_length) const = 0; - virtual bool ReceiveResponse(HttpHandle request_handle) const = 0; - virtual bool GetHttpStatusCode(HttpHandle request_handle, - int* status_code) const = 0; - virtual bool GetContentLength(HttpHandle request_handle, - DWORD* content_length) const = 0; - virtual bool ReadData(HttpHandle request_handle, - void* buffer, - DWORD buffer_length, - DWORD* bytes_read) const = 0; - virtual bool Close(HttpHandle handle) const = 0; - - static const DWORD kUnknownContentLength = (DWORD)-1; -}; - -} // namespace crash - -#endif // TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_ +#define TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_ + +#include +#include +#include + +typedef void* HttpHandle; + +namespace crash { + +// HttpClient provides an abstract layer for HTTP APIs. The actual +// implementation can be based on either WinHttp or WinInet. +class HttpClient { + public: + enum AccessType { + ACCESS_TYPE_PRECONFIG, + ACCESS_TYPE_DIRECT, + ACCESS_TYPE_PROXY, + }; + + virtual ~HttpClient() {} + + virtual bool CrackUrl(const TCHAR* url, + DWORD flags, + TCHAR* scheme, + size_t scheme_buffer_length, + TCHAR* host, + size_t host_buffer_length, + TCHAR* uri, + size_t uri_buffer_length, + int* port) const = 0; + virtual bool Open(const TCHAR* user_agent, + DWORD access_type, + const TCHAR* proxy_name, + const TCHAR* proxy_bypass, + HttpHandle* session_handle) const = 0; + virtual bool Connect(HttpHandle session_handle, + const TCHAR* server, + int port, + HttpHandle* connection_handle) const = 0; + virtual bool OpenRequest(HttpHandle connection_handle, + const TCHAR* verb, + const TCHAR* uri, + const TCHAR* version, + const TCHAR* referrer, + bool is_secure, + HttpHandle* request_handle) const = 0; + virtual bool SendRequest(HttpHandle request_handle, + const TCHAR* headers, + DWORD headers_length) const = 0; + virtual bool ReceiveResponse(HttpHandle request_handle) const = 0; + virtual bool GetHttpStatusCode(HttpHandle request_handle, + int* status_code) const = 0; + virtual bool GetContentLength(HttpHandle request_handle, + DWORD* content_length) const = 0; + virtual bool ReadData(HttpHandle request_handle, + void* buffer, + DWORD buffer_length, + DWORD* bytes_read) const = 0; + virtual bool Close(HttpHandle handle) const = 0; + + static const DWORD kUnknownContentLength = (DWORD)-1; +}; + +} // namespace crash + +#endif // TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_ diff --git a/src/tools/windows/converter_exe/http_download.cc b/src/tools/windows/converter_exe/http_download.cc index 58fcbb3bf..75f674e08 100644 --- a/src/tools/windows/converter_exe/http_download.cc +++ b/src/tools/windows/converter_exe/http_download.cc @@ -1,326 +1,326 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include - -#include - -#include "tools/windows/converter_exe/http_download.h" -#include "tools/windows/converter_exe/winhttp_client.h" -#include "tools/windows/converter_exe/wininet_client.h" - -namespace crash { -static const std::vector::size_type kVectorChunkSize = 4096; // 4 KB - -using std::vector; - -// Class that atuo closes the contained HttpHandle when the object -// goes out of scope. -class AutoHttpHandle { - public: - AutoHttpHandle() : handle_(NULL) {} - explicit AutoHttpHandle(HttpHandle handle) : handle_(handle) {} - ~AutoHttpHandle() { - if (handle_) { - InternetCloseHandle(handle_); - } - } - - HttpHandle get() { return handle_; } - HttpHandle* get_handle_addr () { return &handle_; } - - private: - HttpHandle handle_; -}; - -// Template class for auto releasing the contained pointer when -// the object goes out of scope. -template -class AutoPtr { - public: - explicit AutoPtr(T* ptr) : ptr_(ptr) {} - ~AutoPtr() { - if (ptr_) { - delete ptr_; - } - } - - T* get() { return ptr_; } - T* operator -> () { return ptr_; } - - private: - T* ptr_; -}; - -// CheckParameters ensures that the parameters in |parameters| are safe for -// use in an HTTP URL. Returns true if they are, false if unsafe characters -// are present. -static bool CheckParameters(const map* parameters) { - for (map::const_iterator iterator = parameters->begin(); - iterator != parameters->end(); - ++iterator) { - const wstring& key = iterator->first; - if (key.empty()) { - // Disallow empty parameter names. - return false; - } - for (unsigned int i = 0; i < key.size(); ++i) { - wchar_t c = key[i]; - if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) { - return false; - } - } - - const wstring& value = iterator->second; - for (unsigned int i = 0; i < value.size(); ++i) { - wchar_t c = value[i]; - if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) { - return false; - } - } - } - - return true; -} - -HttpClient* HTTPDownload::CreateHttpClient(const wchar_t* url) { - const TCHAR* kHttpApiPolicyEnvironmentVariable = TEXT("USE_WINHTTP"); - TCHAR buffer[2] = {0}; - HttpClient* http_client = NULL; - - if (::GetEnvironmentVariable(kHttpApiPolicyEnvironmentVariable, - buffer, - sizeof(buffer)/sizeof(buffer[0])) > 0) { - fprintf(stdout, - "Environment variable [%ws] is set, use WinHttp\n", - kHttpApiPolicyEnvironmentVariable); - http_client = CreateWinHttpClient(url); - if (http_client == NULL) { - fprintf(stderr, "WinHttpClient not created, Is the protocol HTTPS? " - "Fall back to WinInet API.\n"); - } - } else { - fprintf(stderr, - "Environment variable [%ws] is NOT set, use WinInet API\n", - kHttpApiPolicyEnvironmentVariable); - } - - if (http_client == NULL) { - return CreateWinInetClient(url); - } - - return http_client; -} - -// static -bool HTTPDownload::Download(const wstring& url, - const map* parameters, - string *content, int *status_code) { - assert(content); - AutoPtr http_client(CreateHttpClient(url.c_str())); - - if (!http_client.get()) { - fprintf(stderr, "Failed to create any http client.\n"); - return false; - } - - if (status_code) { - *status_code = 0; - } - - wchar_t scheme[16] = {0}; - wchar_t host[256] = {0}; - wchar_t path[256] = {0}; - int port = 0; - if (!http_client->CrackUrl(url.c_str(), - 0, - scheme, - sizeof(scheme)/sizeof(scheme[0]), - host, - sizeof(host)/sizeof(host[0]), - path, - sizeof(path)/sizeof(path[0]), - &port)) { - fprintf(stderr, - "HTTPDownload::Download: InternetCrackUrl: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - - bool secure = false; - if (_wcsicmp(scheme, L"https") == 0) { - secure = true; - } else if (wcscmp(scheme, L"http") != 0) { - fprintf(stderr, - "HTTPDownload::Download: scheme must be http or https for %ws\n", - url.c_str()); - return false; - } - - AutoHttpHandle internet; - if (!http_client->Open(NULL, // user agent - HttpClient::ACCESS_TYPE_PRECONFIG, - NULL, // proxy name - NULL, // proxy bypass - internet.get_handle_addr())) { - fprintf(stderr, - "HTTPDownload::Download: Open: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - - AutoHttpHandle connection; - if (!http_client->Connect(internet.get(), - host, - port, - connection.get_handle_addr())) { - fprintf(stderr, - "HTTPDownload::Download: InternetConnect: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - - wstring request_string = path; - if (parameters) { - // TODO(mmentovai): escape bad characters in parameters instead of - // forbidding them. - if (!CheckParameters(parameters)) { - fprintf(stderr, - "HTTPDownload::Download: invalid characters in parameters\n"); - return false; - } - - bool added_parameter = false; - for (map::const_iterator iterator = parameters->begin(); - iterator != parameters->end(); - ++iterator) { - request_string.append(added_parameter ? L"&" : L"?"); - request_string.append(iterator->first); - request_string.append(L"="); - request_string.append(iterator->second); - added_parameter = true; - } - } - - AutoHttpHandle request; - if (!http_client->OpenRequest(connection.get(), - L"GET", - request_string.c_str(), - NULL, // version - NULL, // referer - secure, - request.get_handle_addr())) { - fprintf(stderr, - "HttpClient::OpenRequest: error %lu for %ws, request: %ws\n", - GetLastError(), url.c_str(), request_string.c_str()); - return false; - } - - if (!http_client->SendRequest(request.get(), NULL, 0)) { - fprintf(stderr, - "HttpClient::SendRequest: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - - if (!http_client->ReceiveResponse(request.get())) { - fprintf(stderr, - "HttpClient::ReceiveResponse: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - - int http_status = 0; - if (!http_client->GetHttpStatusCode(request.get(), &http_status)) { - fprintf(stderr, - "HttpClient::GetHttpStatusCode: error %lu for %ws\n", - GetLastError(), url.c_str()); - return false; - } - if (http_status != 200) { - fprintf(stderr, - "HTTPDownload::Download: HTTP status code %d for %ws\n", - http_status, url.c_str()); - return false; - } - - DWORD content_length = 0; - vector::size_type buffer_size = 0; - http_client->GetContentLength(request.get(), &content_length); - if (content_length == HttpClient::kUnknownContentLength) { - buffer_size = kVectorChunkSize; - } else { - buffer_size = content_length; - } - - if (content_length != 0) { - vector response_buffer = vector(buffer_size+1); - DWORD size_read; - DWORD total_read = 0; - bool read_result; - do { - if (content_length == HttpClient::kUnknownContentLength - && buffer_size == total_read) { - // The content length wasn't specified in the response header, so we - // have to keep growing the buffer until we're done reading. - buffer_size += kVectorChunkSize; - response_buffer.resize(buffer_size); - } - read_result = !!http_client->ReadData( - request.get(), - &response_buffer[total_read], - static_cast(buffer_size) - total_read, - &size_read); - total_read += size_read; - } while (read_result && (size_read != 0)); - - if (!read_result) { - fprintf(stderr, - "HttpClient::ReadData: error %lu for %ws\n", - GetLastError(), - url.c_str()); - return false; - } else if (size_read != 0) { - fprintf(stderr, - "HttpClient::ReadData: error %lu/%lu for %ws\n", - total_read, - content_length, - url.c_str()); - return false; - } - content->assign(&response_buffer[0], total_read); - } else { - content->clear(); - } - return true; -} - -} // namespace crash +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include + +#include + +#include "tools/windows/converter_exe/http_download.h" +#include "tools/windows/converter_exe/winhttp_client.h" +#include "tools/windows/converter_exe/wininet_client.h" + +namespace crash { +static const std::vector::size_type kVectorChunkSize = 4096; // 4 KB + +using std::vector; + +// Class that atuo closes the contained HttpHandle when the object +// goes out of scope. +class AutoHttpHandle { + public: + AutoHttpHandle() : handle_(NULL) {} + explicit AutoHttpHandle(HttpHandle handle) : handle_(handle) {} + ~AutoHttpHandle() { + if (handle_) { + InternetCloseHandle(handle_); + } + } + + HttpHandle get() { return handle_; } + HttpHandle* get_handle_addr () { return &handle_; } + + private: + HttpHandle handle_; +}; + +// Template class for auto releasing the contained pointer when +// the object goes out of scope. +template +class AutoPtr { + public: + explicit AutoPtr(T* ptr) : ptr_(ptr) {} + ~AutoPtr() { + if (ptr_) { + delete ptr_; + } + } + + T* get() { return ptr_; } + T* operator -> () { return ptr_; } + + private: + T* ptr_; +}; + +// CheckParameters ensures that the parameters in |parameters| are safe for +// use in an HTTP URL. Returns true if they are, false if unsafe characters +// are present. +static bool CheckParameters(const map* parameters) { + for (map::const_iterator iterator = parameters->begin(); + iterator != parameters->end(); + ++iterator) { + const wstring& key = iterator->first; + if (key.empty()) { + // Disallow empty parameter names. + return false; + } + for (unsigned int i = 0; i < key.size(); ++i) { + wchar_t c = key[i]; + if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) { + return false; + } + } + + const wstring& value = iterator->second; + for (unsigned int i = 0; i < value.size(); ++i) { + wchar_t c = value[i]; + if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) { + return false; + } + } + } + + return true; +} + +HttpClient* HTTPDownload::CreateHttpClient(const wchar_t* url) { + const TCHAR* kHttpApiPolicyEnvironmentVariable = TEXT("USE_WINHTTP"); + TCHAR buffer[2] = {0}; + HttpClient* http_client = NULL; + + if (::GetEnvironmentVariable(kHttpApiPolicyEnvironmentVariable, + buffer, + sizeof(buffer)/sizeof(buffer[0])) > 0) { + fprintf(stdout, + "Environment variable [%ws] is set, use WinHttp\n", + kHttpApiPolicyEnvironmentVariable); + http_client = CreateWinHttpClient(url); + if (http_client == NULL) { + fprintf(stderr, "WinHttpClient not created, Is the protocol HTTPS? " + "Fall back to WinInet API.\n"); + } + } else { + fprintf(stderr, + "Environment variable [%ws] is NOT set, use WinInet API\n", + kHttpApiPolicyEnvironmentVariable); + } + + if (http_client == NULL) { + return CreateWinInetClient(url); + } + + return http_client; +} + +// static +bool HTTPDownload::Download(const wstring& url, + const map* parameters, + string *content, int *status_code) { + assert(content); + AutoPtr http_client(CreateHttpClient(url.c_str())); + + if (!http_client.get()) { + fprintf(stderr, "Failed to create any http client.\n"); + return false; + } + + if (status_code) { + *status_code = 0; + } + + wchar_t scheme[16] = {0}; + wchar_t host[256] = {0}; + wchar_t path[256] = {0}; + int port = 0; + if (!http_client->CrackUrl(url.c_str(), + 0, + scheme, + sizeof(scheme)/sizeof(scheme[0]), + host, + sizeof(host)/sizeof(host[0]), + path, + sizeof(path)/sizeof(path[0]), + &port)) { + fprintf(stderr, + "HTTPDownload::Download: InternetCrackUrl: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + + bool secure = false; + if (_wcsicmp(scheme, L"https") == 0) { + secure = true; + } else if (wcscmp(scheme, L"http") != 0) { + fprintf(stderr, + "HTTPDownload::Download: scheme must be http or https for %ws\n", + url.c_str()); + return false; + } + + AutoHttpHandle internet; + if (!http_client->Open(NULL, // user agent + HttpClient::ACCESS_TYPE_PRECONFIG, + NULL, // proxy name + NULL, // proxy bypass + internet.get_handle_addr())) { + fprintf(stderr, + "HTTPDownload::Download: Open: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + + AutoHttpHandle connection; + if (!http_client->Connect(internet.get(), + host, + port, + connection.get_handle_addr())) { + fprintf(stderr, + "HTTPDownload::Download: InternetConnect: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + + wstring request_string = path; + if (parameters) { + // TODO(mmentovai): escape bad characters in parameters instead of + // forbidding them. + if (!CheckParameters(parameters)) { + fprintf(stderr, + "HTTPDownload::Download: invalid characters in parameters\n"); + return false; + } + + bool added_parameter = false; + for (map::const_iterator iterator = parameters->begin(); + iterator != parameters->end(); + ++iterator) { + request_string.append(added_parameter ? L"&" : L"?"); + request_string.append(iterator->first); + request_string.append(L"="); + request_string.append(iterator->second); + added_parameter = true; + } + } + + AutoHttpHandle request; + if (!http_client->OpenRequest(connection.get(), + L"GET", + request_string.c_str(), + NULL, // version + NULL, // referer + secure, + request.get_handle_addr())) { + fprintf(stderr, + "HttpClient::OpenRequest: error %lu for %ws, request: %ws\n", + GetLastError(), url.c_str(), request_string.c_str()); + return false; + } + + if (!http_client->SendRequest(request.get(), NULL, 0)) { + fprintf(stderr, + "HttpClient::SendRequest: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + + if (!http_client->ReceiveResponse(request.get())) { + fprintf(stderr, + "HttpClient::ReceiveResponse: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + + int http_status = 0; + if (!http_client->GetHttpStatusCode(request.get(), &http_status)) { + fprintf(stderr, + "HttpClient::GetHttpStatusCode: error %lu for %ws\n", + GetLastError(), url.c_str()); + return false; + } + if (http_status != 200) { + fprintf(stderr, + "HTTPDownload::Download: HTTP status code %d for %ws\n", + http_status, url.c_str()); + return false; + } + + DWORD content_length = 0; + vector::size_type buffer_size = 0; + http_client->GetContentLength(request.get(), &content_length); + if (content_length == HttpClient::kUnknownContentLength) { + buffer_size = kVectorChunkSize; + } else { + buffer_size = content_length; + } + + if (content_length != 0) { + vector response_buffer = vector(buffer_size+1); + DWORD size_read; + DWORD total_read = 0; + bool read_result; + do { + if (content_length == HttpClient::kUnknownContentLength + && buffer_size == total_read) { + // The content length wasn't specified in the response header, so we + // have to keep growing the buffer until we're done reading. + buffer_size += kVectorChunkSize; + response_buffer.resize(buffer_size); + } + read_result = !!http_client->ReadData( + request.get(), + &response_buffer[total_read], + static_cast(buffer_size) - total_read, + &size_read); + total_read += size_read; + } while (read_result && (size_read != 0)); + + if (!read_result) { + fprintf(stderr, + "HttpClient::ReadData: error %lu for %ws\n", + GetLastError(), + url.c_str()); + return false; + } else if (size_read != 0) { + fprintf(stderr, + "HttpClient::ReadData: error %lu/%lu for %ws\n", + total_read, + content_length, + url.c_str()); + return false; + } + content->assign(&response_buffer[0], total_read); + } else { + content->clear(); + } + return true; +} + +} // namespace crash diff --git a/src/tools/windows/converter_exe/http_download.h b/src/tools/windows/converter_exe/http_download.h index cbae11b5a..f58a3d0f9 100644 --- a/src/tools/windows/converter_exe/http_download.h +++ b/src/tools/windows/converter_exe/http_download.h @@ -1,62 +1,62 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ -#define TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ - -#include -#include -#include "tools/windows/converter_exe/winhttp_client.h" - -namespace crash { - -using std::map; -using std::string; -using std::wstring; - -class HTTPDownload { - public: - // Retrieves the resource located at |url|, a http or https URL, via WinInet. - // The request is fetched with GET request; the optional |parameters| are - // appended to the URL. Returns true on success, placing the content of the - // retrieved resource in |content|. Returns false on failure. HTTP status - // codes other than 200 cause Download to return false. If |status_code| is - // supplied, it will be set to the value of the HTTP status code, if an HTTP - // transaction occurs. If Download fails before a transaction can occur, - // |status_code| will be set to 0. Any failures will result in messages - // being printed to stderr. - static bool Download(const wstring& url, - const map* parameters, - string *content, int *status_code); - private: - static HttpClient* CreateHttpClient(const wchar_t*); -}; - -} // namespace crash - -#endif // TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ +#define TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ + +#include +#include +#include "tools/windows/converter_exe/winhttp_client.h" + +namespace crash { + +using std::map; +using std::string; +using std::wstring; + +class HTTPDownload { + public: + // Retrieves the resource located at |url|, a http or https URL, via WinInet. + // The request is fetched with GET request; the optional |parameters| are + // appended to the URL. Returns true on success, placing the content of the + // retrieved resource in |content|. Returns false on failure. HTTP status + // codes other than 200 cause Download to return false. If |status_code| is + // supplied, it will be set to the value of the HTTP status code, if an HTTP + // transaction occurs. If Download fails before a transaction can occur, + // |status_code| will be set to 0. Any failures will result in messages + // being printed to stderr. + static bool Download(const wstring& url, + const map* parameters, + string *content, int *status_code); + private: + static HttpClient* CreateHttpClient(const wchar_t*); +}; + +} // namespace crash + +#endif // TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_ diff --git a/src/tools/windows/converter_exe/tokenizer.cc b/src/tools/windows/converter_exe/tokenizer.cc index aee398676..6d627536d 100644 --- a/src/tools/windows/converter_exe/tokenizer.cc +++ b/src/tools/windows/converter_exe/tokenizer.cc @@ -1,61 +1,61 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "tools/windows/converter_exe/tokenizer.h" - -namespace crash { - -// static -void Tokenizer::Tokenize(const string& delimiters, const string& input, - vector* output) { - assert(output); - output->clear(); - - string::size_type position = 0; // Where to begin looking for a delimiter - string::size_type new_position; // Position of found delimiter - string token; - - while ((new_position = input.find_first_of(delimiters, position)) != - string::npos) { - token = input.substr(position, new_position - position); - output->push_back(token); - - // Next time, begin looking right after this delimiter. - position = new_position + 1; - } - - // There are no more delimiters in the string. Take everything from the - // final delimiter up to the end of the string as a token. This may be - // an empty string. - token = input.substr(position); - output->push_back(token); -} - -} // namespace crash +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "tools/windows/converter_exe/tokenizer.h" + +namespace crash { + +// static +void Tokenizer::Tokenize(const string& delimiters, const string& input, + vector* output) { + assert(output); + output->clear(); + + string::size_type position = 0; // Where to begin looking for a delimiter + string::size_type new_position; // Position of found delimiter + string token; + + while ((new_position = input.find_first_of(delimiters, position)) != + string::npos) { + token = input.substr(position, new_position - position); + output->push_back(token); + + // Next time, begin looking right after this delimiter. + position = new_position + 1; + } + + // There are no more delimiters in the string. Take everything from the + // final delimiter up to the end of the string as a token. This may be + // an empty string. + token = input.substr(position); + output->push_back(token); +} + +} // namespace crash diff --git a/src/tools/windows/converter_exe/tokenizer.h b/src/tools/windows/converter_exe/tokenizer.h index bfdfa220a..d9829f605 100644 --- a/src/tools/windows/converter_exe/tokenizer.h +++ b/src/tools/windows/converter_exe/tokenizer.h @@ -1,51 +1,51 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ -#define TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ - -#include -#include - -namespace crash { - -using std::string; -using std::vector; - -class Tokenizer { - public: - // Splits |input| into a series of tokens delimited in the input string by - // any of the characters in |delimiters|. The tokens are passed back in the - // |output| vector. - static void Tokenize(const string& delimiters, const string& input, - vector* output); -}; - -} // namespace crash - -#endif // TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ +#define TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ + +#include +#include + +namespace crash { + +using std::string; +using std::vector; + +class Tokenizer { + public: + // Splits |input| into a series of tokens delimited in the input string by + // any of the characters in |delimiters|. The tokens are passed back in the + // |output| vector. + static void Tokenize(const string& delimiters, const string& input, + vector* output); +}; + +} // namespace crash + +#endif // TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_ diff --git a/src/tools/windows/converter_exe/winhttp_client.cc b/src/tools/windows/converter_exe/winhttp_client.cc index cc70e53f4..f8c1492d5 100644 --- a/src/tools/windows/converter_exe/winhttp_client.cc +++ b/src/tools/windows/converter_exe/winhttp_client.cc @@ -1,307 +1,307 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "tools/windows/converter_exe/winhttp_client.h" - -#include -#include -#include -#include -#include - -namespace crash { - -namespace internal { - -// This class implements HttpClient based on WinInet APIs. -class WinHttpClient : public HttpClient { - public: - virtual ~WinHttpClient() {} - virtual bool CrackUrl(const TCHAR* url, - DWORD flags, - TCHAR* scheme, - size_t scheme_buffer_length, - TCHAR* host, - size_t host_buffer_length, - TCHAR* uri, - size_t uri_buffer_length, - int* port) const; - virtual bool Open(const TCHAR* user_agent, - DWORD access_type, - const TCHAR* proxy_name, - const TCHAR* proxy_bypass, - HttpHandle* session_handle) const; - virtual bool Connect(HttpHandle session_handle, - const TCHAR* server, - int port, - HttpHandle* connection_handle) const; - virtual bool OpenRequest(HttpHandle connection_handle, - const TCHAR* verb, - const TCHAR* uri, - const TCHAR* version, - const TCHAR* referrer, - bool is_secure, - HttpHandle* request_handle) const; - virtual bool SendRequest(HttpHandle request_handle, - const TCHAR* headers, - DWORD headers_length) const; - virtual bool ReceiveResponse(HttpHandle request_handle) const; - virtual bool GetHttpStatusCode(HttpHandle request_handle, - int* status_code) const; - virtual bool GetContentLength(HttpHandle request_handle, - DWORD* content_length) const; - virtual bool ReadData(HttpHandle request_handle, - void* buffer, - DWORD buffer_length, - DWORD* bytes_read) const; - virtual bool Close(HttpHandle handle) const; - - private: - static DWORD MapAccessType(DWORD access_type); - static HINTERNET ToHINTERNET(HttpHandle handle); - static HttpHandle FromHINTERNET(HINTERNET handle); -}; - -bool WinHttpClient::CrackUrl(const TCHAR* url, - DWORD flags, - TCHAR* scheme, - size_t scheme_buffer_length, - TCHAR* host, - size_t host_buffer_length, - TCHAR* uri, - size_t uri_buffer_length, - int* port) const { - assert(url); - assert(scheme); - assert(host); - assert(uri); - assert(port); - - URL_COMPONENTS url_comp = {0}; - url_comp.dwStructSize = sizeof(url_comp); - url_comp.lpszScheme = scheme; - url_comp.dwSchemeLength = static_cast(scheme_buffer_length); - url_comp.lpszHostName = host; - url_comp.dwHostNameLength = static_cast(host_buffer_length); - url_comp.lpszUrlPath = uri; - url_comp.dwUrlPathLength = static_cast(uri_buffer_length); - - bool result = !!::WinHttpCrackUrl(url, 0, flags, &url_comp); - if (result) { - *port = static_cast(url_comp.nPort); - } - return result; -} - -bool WinHttpClient::Open(const TCHAR* user_agent, - DWORD access_type, - const TCHAR* proxy_name, - const TCHAR* proxy_bypass, - HttpHandle* session_handle) const { - *session_handle = FromHINTERNET(::WinHttpOpen(user_agent, - MapAccessType(access_type), - proxy_name, - proxy_bypass, - 0)); - - return !!(*session_handle); -} - -bool WinHttpClient::Connect(HttpHandle session_handle, - const TCHAR* server, - int port, - HttpHandle* connection_handle) const { - assert(server); - - // Uses NULL user name and password to connect. - *connection_handle = FromHINTERNET(::WinHttpConnect( - ToHINTERNET(session_handle), - server, - static_cast(port), - NULL)); - return !!(*connection_handle); -} - -bool WinHttpClient::OpenRequest(HttpHandle connection_handle, - const TCHAR* verb, - const TCHAR* uri, - const TCHAR* version, - const TCHAR* referrer, - bool is_secure, - HttpHandle* request_handle) const { - assert(connection_handle); - assert(verb); - assert(uri); - assert(request_handle); - - *request_handle = FromHINTERNET(::WinHttpOpenRequest( - ToHINTERNET(connection_handle), - verb, - uri, - version, - referrer, - WINHTTP_DEFAULT_ACCEPT_TYPES, - is_secure ? WINHTTP_FLAG_SECURE : 0)); - return !!(*request_handle); -} - -bool WinHttpClient::SendRequest(HttpHandle request_handle, - const TCHAR* headers, - DWORD headers_length) const { - assert(request_handle); - - return !!::WinHttpSendRequest(ToHINTERNET(request_handle), - headers, - headers_length, - NULL, - 0, - WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH, - NULL); -} - -bool WinHttpClient::ReceiveResponse(HttpHandle request_handle) const { - assert(request_handle); - - return !!::WinHttpReceiveResponse(ToHINTERNET(request_handle), NULL); -} - -bool WinHttpClient::GetHttpStatusCode(HttpHandle request_handle, - int* status_code) const { - TCHAR http_status_string[4] = {0}; - DWORD http_status_string_size = sizeof(http_status_string); - if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle), - WINHTTP_QUERY_STATUS_CODE, - WINHTTP_HEADER_NAME_BY_INDEX, - static_cast(&http_status_string), - &http_status_string_size, 0)) { - return false; - } - - *status_code = static_cast(_tcstol(http_status_string, NULL, 10)); - return true; -} - -bool WinHttpClient::GetContentLength(HttpHandle request_handle, - DWORD* content_length) const { - assert(request_handle); - assert(content_length); - - TCHAR content_length_string[11] = {0}; - DWORD content_length_string_size = sizeof(content_length_string); - if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle), - WINHTTP_QUERY_CONTENT_LENGTH, - WINHTTP_HEADER_NAME_BY_INDEX, - static_cast(&content_length_string), - &content_length_string_size, 0)) { - *content_length = kUnknownContentLength; - } else { - *content_length = - static_cast(wcstol(content_length_string, NULL, 10)); - } - return true; -} - -bool WinHttpClient::ReadData(HttpHandle request_handle, - void* buffer, - DWORD buffer_length, - DWORD* bytes_read) const { - assert(request_handle); - assert(buffer); - assert(bytes_read); - - DWORD bytes_read_local = 0; - if (!::WinHttpReadData(ToHINTERNET(request_handle), - buffer, - buffer_length, - &bytes_read_local)) { - return false; - } - *bytes_read = bytes_read_local; - return true; -} - -bool WinHttpClient::Close(HttpHandle handle) const { - assert(handle); - return !!::WinHttpCloseHandle(ToHINTERNET(handle)); -} - -DWORD WinHttpClient::MapAccessType(DWORD access_type) { - switch (static_cast(access_type)) { - case ACCESS_TYPE_PRECONFIG: - default: - return WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; - case ACCESS_TYPE_DIRECT: - return WINHTTP_ACCESS_TYPE_NO_PROXY; - case ACCESS_TYPE_PROXY: - return WINHTTP_ACCESS_TYPE_NAMED_PROXY; - } -} - - -HINTERNET WinHttpClient::ToHINTERNET(HttpHandle handle) { - return static_cast(handle); -} - -HttpHandle WinHttpClient::FromHINTERNET(HINTERNET handle) { - return static_cast(handle); -} - -} // namespace internal - -HttpClient* CreateWinHttpClient(const TCHAR* url) { - assert(url); - - internal::WinHttpClient winhttp; - wchar_t scheme[16] = {0}; - wchar_t host[256] = {0}; - wchar_t path[256] = {0}; - int port = 0; - - if (!winhttp.CrackUrl(url, - 0, - scheme, - sizeof(scheme)/sizeof(scheme[0]), - host, - sizeof(host)/sizeof(host[0]), - path, - sizeof(path)/sizeof(path[0]), - &port)) { - return NULL; - } - - if (_wcsicmp(scheme, L"https") == 0) { - // Winhttp under WINE doesn't support wildcard certificates, so avoid - // to use it if the scheme is https. The caller should fall back to - // use wininet if NULL is returned. - return NULL; - } - - return new internal::WinHttpClient(); -} - -} // namespace crash +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "tools/windows/converter_exe/winhttp_client.h" + +#include +#include +#include +#include +#include + +namespace crash { + +namespace internal { + +// This class implements HttpClient based on WinInet APIs. +class WinHttpClient : public HttpClient { + public: + virtual ~WinHttpClient() {} + virtual bool CrackUrl(const TCHAR* url, + DWORD flags, + TCHAR* scheme, + size_t scheme_buffer_length, + TCHAR* host, + size_t host_buffer_length, + TCHAR* uri, + size_t uri_buffer_length, + int* port) const; + virtual bool Open(const TCHAR* user_agent, + DWORD access_type, + const TCHAR* proxy_name, + const TCHAR* proxy_bypass, + HttpHandle* session_handle) const; + virtual bool Connect(HttpHandle session_handle, + const TCHAR* server, + int port, + HttpHandle* connection_handle) const; + virtual bool OpenRequest(HttpHandle connection_handle, + const TCHAR* verb, + const TCHAR* uri, + const TCHAR* version, + const TCHAR* referrer, + bool is_secure, + HttpHandle* request_handle) const; + virtual bool SendRequest(HttpHandle request_handle, + const TCHAR* headers, + DWORD headers_length) const; + virtual bool ReceiveResponse(HttpHandle request_handle) const; + virtual bool GetHttpStatusCode(HttpHandle request_handle, + int* status_code) const; + virtual bool GetContentLength(HttpHandle request_handle, + DWORD* content_length) const; + virtual bool ReadData(HttpHandle request_handle, + void* buffer, + DWORD buffer_length, + DWORD* bytes_read) const; + virtual bool Close(HttpHandle handle) const; + + private: + static DWORD MapAccessType(DWORD access_type); + static HINTERNET ToHINTERNET(HttpHandle handle); + static HttpHandle FromHINTERNET(HINTERNET handle); +}; + +bool WinHttpClient::CrackUrl(const TCHAR* url, + DWORD flags, + TCHAR* scheme, + size_t scheme_buffer_length, + TCHAR* host, + size_t host_buffer_length, + TCHAR* uri, + size_t uri_buffer_length, + int* port) const { + assert(url); + assert(scheme); + assert(host); + assert(uri); + assert(port); + + URL_COMPONENTS url_comp = {0}; + url_comp.dwStructSize = sizeof(url_comp); + url_comp.lpszScheme = scheme; + url_comp.dwSchemeLength = static_cast(scheme_buffer_length); + url_comp.lpszHostName = host; + url_comp.dwHostNameLength = static_cast(host_buffer_length); + url_comp.lpszUrlPath = uri; + url_comp.dwUrlPathLength = static_cast(uri_buffer_length); + + bool result = !!::WinHttpCrackUrl(url, 0, flags, &url_comp); + if (result) { + *port = static_cast(url_comp.nPort); + } + return result; +} + +bool WinHttpClient::Open(const TCHAR* user_agent, + DWORD access_type, + const TCHAR* proxy_name, + const TCHAR* proxy_bypass, + HttpHandle* session_handle) const { + *session_handle = FromHINTERNET(::WinHttpOpen(user_agent, + MapAccessType(access_type), + proxy_name, + proxy_bypass, + 0)); + + return !!(*session_handle); +} + +bool WinHttpClient::Connect(HttpHandle session_handle, + const TCHAR* server, + int port, + HttpHandle* connection_handle) const { + assert(server); + + // Uses NULL user name and password to connect. + *connection_handle = FromHINTERNET(::WinHttpConnect( + ToHINTERNET(session_handle), + server, + static_cast(port), + NULL)); + return !!(*connection_handle); +} + +bool WinHttpClient::OpenRequest(HttpHandle connection_handle, + const TCHAR* verb, + const TCHAR* uri, + const TCHAR* version, + const TCHAR* referrer, + bool is_secure, + HttpHandle* request_handle) const { + assert(connection_handle); + assert(verb); + assert(uri); + assert(request_handle); + + *request_handle = FromHINTERNET(::WinHttpOpenRequest( + ToHINTERNET(connection_handle), + verb, + uri, + version, + referrer, + WINHTTP_DEFAULT_ACCEPT_TYPES, + is_secure ? WINHTTP_FLAG_SECURE : 0)); + return !!(*request_handle); +} + +bool WinHttpClient::SendRequest(HttpHandle request_handle, + const TCHAR* headers, + DWORD headers_length) const { + assert(request_handle); + + return !!::WinHttpSendRequest(ToHINTERNET(request_handle), + headers, + headers_length, + NULL, + 0, + WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH, + NULL); +} + +bool WinHttpClient::ReceiveResponse(HttpHandle request_handle) const { + assert(request_handle); + + return !!::WinHttpReceiveResponse(ToHINTERNET(request_handle), NULL); +} + +bool WinHttpClient::GetHttpStatusCode(HttpHandle request_handle, + int* status_code) const { + TCHAR http_status_string[4] = {0}; + DWORD http_status_string_size = sizeof(http_status_string); + if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle), + WINHTTP_QUERY_STATUS_CODE, + WINHTTP_HEADER_NAME_BY_INDEX, + static_cast(&http_status_string), + &http_status_string_size, 0)) { + return false; + } + + *status_code = static_cast(_tcstol(http_status_string, NULL, 10)); + return true; +} + +bool WinHttpClient::GetContentLength(HttpHandle request_handle, + DWORD* content_length) const { + assert(request_handle); + assert(content_length); + + TCHAR content_length_string[11] = {0}; + DWORD content_length_string_size = sizeof(content_length_string); + if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle), + WINHTTP_QUERY_CONTENT_LENGTH, + WINHTTP_HEADER_NAME_BY_INDEX, + static_cast(&content_length_string), + &content_length_string_size, 0)) { + *content_length = kUnknownContentLength; + } else { + *content_length = + static_cast(wcstol(content_length_string, NULL, 10)); + } + return true; +} + +bool WinHttpClient::ReadData(HttpHandle request_handle, + void* buffer, + DWORD buffer_length, + DWORD* bytes_read) const { + assert(request_handle); + assert(buffer); + assert(bytes_read); + + DWORD bytes_read_local = 0; + if (!::WinHttpReadData(ToHINTERNET(request_handle), + buffer, + buffer_length, + &bytes_read_local)) { + return false; + } + *bytes_read = bytes_read_local; + return true; +} + +bool WinHttpClient::Close(HttpHandle handle) const { + assert(handle); + return !!::WinHttpCloseHandle(ToHINTERNET(handle)); +} + +DWORD WinHttpClient::MapAccessType(DWORD access_type) { + switch (static_cast(access_type)) { + case ACCESS_TYPE_PRECONFIG: + default: + return WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; + case ACCESS_TYPE_DIRECT: + return WINHTTP_ACCESS_TYPE_NO_PROXY; + case ACCESS_TYPE_PROXY: + return WINHTTP_ACCESS_TYPE_NAMED_PROXY; + } +} + + +HINTERNET WinHttpClient::ToHINTERNET(HttpHandle handle) { + return static_cast(handle); +} + +HttpHandle WinHttpClient::FromHINTERNET(HINTERNET handle) { + return static_cast(handle); +} + +} // namespace internal + +HttpClient* CreateWinHttpClient(const TCHAR* url) { + assert(url); + + internal::WinHttpClient winhttp; + wchar_t scheme[16] = {0}; + wchar_t host[256] = {0}; + wchar_t path[256] = {0}; + int port = 0; + + if (!winhttp.CrackUrl(url, + 0, + scheme, + sizeof(scheme)/sizeof(scheme[0]), + host, + sizeof(host)/sizeof(host[0]), + path, + sizeof(path)/sizeof(path[0]), + &port)) { + return NULL; + } + + if (_wcsicmp(scheme, L"https") == 0) { + // Winhttp under WINE doesn't support wildcard certificates, so avoid + // to use it if the scheme is https. The caller should fall back to + // use wininet if NULL is returned. + return NULL; + } + + return new internal::WinHttpClient(); +} + +} // namespace crash diff --git a/src/tools/windows/converter_exe/winhttp_client.h b/src/tools/windows/converter_exe/winhttp_client.h index 819d610f1..4ccac7e0b 100644 --- a/src/tools/windows/converter_exe/winhttp_client.h +++ b/src/tools/windows/converter_exe/winhttp_client.h @@ -1,40 +1,40 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ -#define TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ - -#include "tools/windows/converter_exe/http_client.h" - -namespace crash { - -HttpClient* CreateWinHttpClient(const TCHAR* url); - -} // namespace crash - -#endif // TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ +#define TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ + +#include "tools/windows/converter_exe/http_client.h" + +namespace crash { + +HttpClient* CreateWinHttpClient(const TCHAR* url); + +} // namespace crash + +#endif // TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_ diff --git a/src/tools/windows/converter_exe/wininet_client.cc b/src/tools/windows/converter_exe/wininet_client.cc index 986a66ff4..90cf114ca 100644 --- a/src/tools/windows/converter_exe/wininet_client.cc +++ b/src/tools/windows/converter_exe/wininet_client.cc @@ -1,278 +1,278 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "tools/windows/converter_exe/wininet_client.h" - -#include -#include -#include -#include - -namespace crash { - -namespace internal { - -// This class implements HttpClient based on WinInet APIs. -class WinInetClient : public HttpClient { - public: - virtual ~WinInetClient() {} - virtual bool CrackUrl(const TCHAR* url, - DWORD flags, - TCHAR* scheme, - size_t scheme_buffer_length, - TCHAR* host, - size_t host_buffer_length, - TCHAR* uri, - size_t uri_buffer_length, - int* port) const; - virtual bool Open(const TCHAR* user_agent, - DWORD access_type, - const TCHAR* proxy_name, - const TCHAR* proxy_bypass, - HttpHandle* session_handle) const; - virtual bool Connect(HttpHandle session_handle, - const TCHAR* server, - int port, - HttpHandle* connection_handle) const; - virtual bool OpenRequest(HttpHandle connection_handle, - const TCHAR* verb, - const TCHAR* uri, - const TCHAR* version, - const TCHAR* referrer, - bool is_secure, - HttpHandle* request_handle) const; - virtual bool SendRequest(HttpHandle request_handle, - const TCHAR* headers, - DWORD headers_length) const; - virtual bool ReceiveResponse(HttpHandle request_handle) const; - virtual bool GetHttpStatusCode(HttpHandle request_handle, - int* status_code) const; - virtual bool GetContentLength(HttpHandle request_handle, - DWORD* content_length) const; - virtual bool ReadData(HttpHandle request_handle, - void* buffer, - DWORD buffer_length, - DWORD* bytes_read) const; - virtual bool Close(HttpHandle handle) const; - - private: - static DWORD MapAccessType(DWORD access_type); - static HINTERNET ToHINTERNET(HttpHandle handle); - static HttpHandle FromHINTERNET(HINTERNET handle); -}; - -bool WinInetClient::CrackUrl(const TCHAR* url, - DWORD flags, - TCHAR* scheme, - size_t scheme_buffer_length, - TCHAR* host, - size_t host_buffer_length, - TCHAR* uri, - size_t uri_buffer_length, - int* port) const { - assert(url); - assert(scheme); - assert(host); - assert(uri); - assert(port); - - URL_COMPONENTS url_comp = {0}; - url_comp.dwStructSize = sizeof(url_comp); - url_comp.lpszScheme = scheme; - url_comp.dwSchemeLength = static_cast(scheme_buffer_length); - url_comp.lpszHostName = host; - url_comp.dwHostNameLength = static_cast(host_buffer_length); - url_comp.lpszUrlPath = uri; - url_comp.dwUrlPathLength = static_cast(uri_buffer_length); - - bool result = !!::InternetCrackUrl(url, 0, flags, &url_comp); - if (result) { - *port = static_cast(url_comp.nPort); - } - return result; -} - -bool WinInetClient::Open(const TCHAR* user_agent, - DWORD access_type, - const TCHAR* proxy_name, - const TCHAR* proxy_bypass, - HttpHandle* session_handle) const { - *session_handle = FromHINTERNET(::InternetOpen(user_agent, - MapAccessType(access_type), - proxy_name, - proxy_bypass, - 0)); - return !!(*session_handle); -} - -bool WinInetClient::Connect(HttpHandle session_handle, - const TCHAR* server, - int port, - HttpHandle* connection_handle) const { - assert(server); - - // Uses NULL user name and password to connect. Always uses http service. - *connection_handle = FromHINTERNET(::InternetConnect( - ToHINTERNET(session_handle), - server, - static_cast(port), - NULL, - NULL, - INTERNET_SERVICE_HTTP, - 0, - 0)); - return !!(*connection_handle); -} - -bool WinInetClient::OpenRequest(HttpHandle connection_handle, - const TCHAR* verb, - const TCHAR* uri, - const TCHAR* version, - const TCHAR* referrer, - bool is_secure, - HttpHandle* request_handle) const { - assert(connection_handle); - assert(verb); - assert(uri); - - *request_handle = FromHINTERNET(::HttpOpenRequest( - ToHINTERNET(connection_handle), - verb, - uri, - version, - referrer, - NULL, - is_secure ? INTERNET_FLAG_SECURE : 0, - NULL)); - return !!(*request_handle); -} - -bool WinInetClient::SendRequest(HttpHandle request_handle, - const TCHAR* headers, - DWORD headers_length) const { - assert(request_handle); - - return !!::HttpSendRequest(ToHINTERNET(request_handle), - headers, - headers_length, - NULL, - 0); -} - -bool WinInetClient::ReceiveResponse(HttpHandle) const { - return true; -} - -bool WinInetClient::GetHttpStatusCode(HttpHandle request_handle, - int* status_code) const { - assert(request_handle); - - TCHAR http_status_string[4] = {0}; - DWORD http_status_string_size = sizeof(http_status_string); - if (!::HttpQueryInfo(ToHINTERNET(request_handle), - HTTP_QUERY_STATUS_CODE, - static_cast(&http_status_string), - &http_status_string_size, - 0)) { - return false; - } - - *status_code = _tcstol(http_status_string, NULL, 10); - return true; -} - -bool WinInetClient::GetContentLength(HttpHandle request_handle, - DWORD* content_length) const { - assert(request_handle); - assert(content_length); - - TCHAR content_length_string[11]; - DWORD content_length_string_size = sizeof(content_length_string); - if (!::HttpQueryInfo(ToHINTERNET(request_handle), - HTTP_QUERY_CONTENT_LENGTH, - static_cast(&content_length_string), - &content_length_string_size, - 0)) { - *content_length = kUnknownContentLength; - } else { - *content_length = wcstol(content_length_string, NULL, 10); - } - return true; -} - -bool WinInetClient::ReadData(HttpHandle request_handle, - void* buffer, - DWORD buffer_length, - DWORD* bytes_read) const { - assert(request_handle); - assert(buffer); - assert(bytes_read); - - DWORD bytes_read_local = 0; - if (!::InternetReadFile(ToHINTERNET(request_handle), - buffer, - buffer_length, - &bytes_read_local)) { - return false; - } - *bytes_read = bytes_read_local; - return true; -} - -bool WinInetClient::Close(HttpHandle handle) const { - assert(handle); - return !!::InternetCloseHandle(ToHINTERNET(handle)); -} - -DWORD WinInetClient::MapAccessType(DWORD access_type) { - switch (static_cast(access_type)) { - case ACCESS_TYPE_PRECONFIG: - default: - return INTERNET_OPEN_TYPE_PRECONFIG; - case ACCESS_TYPE_DIRECT: - return INTERNET_OPEN_TYPE_DIRECT; - case ACCESS_TYPE_PROXY: - return INTERNET_OPEN_TYPE_PROXY; - } -} - -HINTERNET WinInetClient::ToHINTERNET(HttpHandle handle) { - return static_cast(handle); -} - -HttpHandle WinInetClient::FromHINTERNET(HINTERNET handle) { - return static_cast(handle); -} - -} // namespace internal - -HttpClient* CreateWinInetClient(const TCHAR*) { - return new internal::WinInetClient(); -} - -} // namespace crash +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "tools/windows/converter_exe/wininet_client.h" + +#include +#include +#include +#include + +namespace crash { + +namespace internal { + +// This class implements HttpClient based on WinInet APIs. +class WinInetClient : public HttpClient { + public: + virtual ~WinInetClient() {} + virtual bool CrackUrl(const TCHAR* url, + DWORD flags, + TCHAR* scheme, + size_t scheme_buffer_length, + TCHAR* host, + size_t host_buffer_length, + TCHAR* uri, + size_t uri_buffer_length, + int* port) const; + virtual bool Open(const TCHAR* user_agent, + DWORD access_type, + const TCHAR* proxy_name, + const TCHAR* proxy_bypass, + HttpHandle* session_handle) const; + virtual bool Connect(HttpHandle session_handle, + const TCHAR* server, + int port, + HttpHandle* connection_handle) const; + virtual bool OpenRequest(HttpHandle connection_handle, + const TCHAR* verb, + const TCHAR* uri, + const TCHAR* version, + const TCHAR* referrer, + bool is_secure, + HttpHandle* request_handle) const; + virtual bool SendRequest(HttpHandle request_handle, + const TCHAR* headers, + DWORD headers_length) const; + virtual bool ReceiveResponse(HttpHandle request_handle) const; + virtual bool GetHttpStatusCode(HttpHandle request_handle, + int* status_code) const; + virtual bool GetContentLength(HttpHandle request_handle, + DWORD* content_length) const; + virtual bool ReadData(HttpHandle request_handle, + void* buffer, + DWORD buffer_length, + DWORD* bytes_read) const; + virtual bool Close(HttpHandle handle) const; + + private: + static DWORD MapAccessType(DWORD access_type); + static HINTERNET ToHINTERNET(HttpHandle handle); + static HttpHandle FromHINTERNET(HINTERNET handle); +}; + +bool WinInetClient::CrackUrl(const TCHAR* url, + DWORD flags, + TCHAR* scheme, + size_t scheme_buffer_length, + TCHAR* host, + size_t host_buffer_length, + TCHAR* uri, + size_t uri_buffer_length, + int* port) const { + assert(url); + assert(scheme); + assert(host); + assert(uri); + assert(port); + + URL_COMPONENTS url_comp = {0}; + url_comp.dwStructSize = sizeof(url_comp); + url_comp.lpszScheme = scheme; + url_comp.dwSchemeLength = static_cast(scheme_buffer_length); + url_comp.lpszHostName = host; + url_comp.dwHostNameLength = static_cast(host_buffer_length); + url_comp.lpszUrlPath = uri; + url_comp.dwUrlPathLength = static_cast(uri_buffer_length); + + bool result = !!::InternetCrackUrl(url, 0, flags, &url_comp); + if (result) { + *port = static_cast(url_comp.nPort); + } + return result; +} + +bool WinInetClient::Open(const TCHAR* user_agent, + DWORD access_type, + const TCHAR* proxy_name, + const TCHAR* proxy_bypass, + HttpHandle* session_handle) const { + *session_handle = FromHINTERNET(::InternetOpen(user_agent, + MapAccessType(access_type), + proxy_name, + proxy_bypass, + 0)); + return !!(*session_handle); +} + +bool WinInetClient::Connect(HttpHandle session_handle, + const TCHAR* server, + int port, + HttpHandle* connection_handle) const { + assert(server); + + // Uses NULL user name and password to connect. Always uses http service. + *connection_handle = FromHINTERNET(::InternetConnect( + ToHINTERNET(session_handle), + server, + static_cast(port), + NULL, + NULL, + INTERNET_SERVICE_HTTP, + 0, + 0)); + return !!(*connection_handle); +} + +bool WinInetClient::OpenRequest(HttpHandle connection_handle, + const TCHAR* verb, + const TCHAR* uri, + const TCHAR* version, + const TCHAR* referrer, + bool is_secure, + HttpHandle* request_handle) const { + assert(connection_handle); + assert(verb); + assert(uri); + + *request_handle = FromHINTERNET(::HttpOpenRequest( + ToHINTERNET(connection_handle), + verb, + uri, + version, + referrer, + NULL, + is_secure ? INTERNET_FLAG_SECURE : 0, + NULL)); + return !!(*request_handle); +} + +bool WinInetClient::SendRequest(HttpHandle request_handle, + const TCHAR* headers, + DWORD headers_length) const { + assert(request_handle); + + return !!::HttpSendRequest(ToHINTERNET(request_handle), + headers, + headers_length, + NULL, + 0); +} + +bool WinInetClient::ReceiveResponse(HttpHandle) const { + return true; +} + +bool WinInetClient::GetHttpStatusCode(HttpHandle request_handle, + int* status_code) const { + assert(request_handle); + + TCHAR http_status_string[4] = {0}; + DWORD http_status_string_size = sizeof(http_status_string); + if (!::HttpQueryInfo(ToHINTERNET(request_handle), + HTTP_QUERY_STATUS_CODE, + static_cast(&http_status_string), + &http_status_string_size, + 0)) { + return false; + } + + *status_code = _tcstol(http_status_string, NULL, 10); + return true; +} + +bool WinInetClient::GetContentLength(HttpHandle request_handle, + DWORD* content_length) const { + assert(request_handle); + assert(content_length); + + TCHAR content_length_string[11]; + DWORD content_length_string_size = sizeof(content_length_string); + if (!::HttpQueryInfo(ToHINTERNET(request_handle), + HTTP_QUERY_CONTENT_LENGTH, + static_cast(&content_length_string), + &content_length_string_size, + 0)) { + *content_length = kUnknownContentLength; + } else { + *content_length = wcstol(content_length_string, NULL, 10); + } + return true; +} + +bool WinInetClient::ReadData(HttpHandle request_handle, + void* buffer, + DWORD buffer_length, + DWORD* bytes_read) const { + assert(request_handle); + assert(buffer); + assert(bytes_read); + + DWORD bytes_read_local = 0; + if (!::InternetReadFile(ToHINTERNET(request_handle), + buffer, + buffer_length, + &bytes_read_local)) { + return false; + } + *bytes_read = bytes_read_local; + return true; +} + +bool WinInetClient::Close(HttpHandle handle) const { + assert(handle); + return !!::InternetCloseHandle(ToHINTERNET(handle)); +} + +DWORD WinInetClient::MapAccessType(DWORD access_type) { + switch (static_cast(access_type)) { + case ACCESS_TYPE_PRECONFIG: + default: + return INTERNET_OPEN_TYPE_PRECONFIG; + case ACCESS_TYPE_DIRECT: + return INTERNET_OPEN_TYPE_DIRECT; + case ACCESS_TYPE_PROXY: + return INTERNET_OPEN_TYPE_PROXY; + } +} + +HINTERNET WinInetClient::ToHINTERNET(HttpHandle handle) { + return static_cast(handle); +} + +HttpHandle WinInetClient::FromHINTERNET(HINTERNET handle) { + return static_cast(handle); +} + +} // namespace internal + +HttpClient* CreateWinInetClient(const TCHAR*) { + return new internal::WinInetClient(); +} + +} // namespace crash diff --git a/src/tools/windows/converter_exe/wininet_client.h b/src/tools/windows/converter_exe/wininet_client.h index bd04b605d..8b4c61b57 100644 --- a/src/tools/windows/converter_exe/wininet_client.h +++ b/src/tools/windows/converter_exe/wininet_client.h @@ -1,40 +1,40 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ -#define TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ - -#include "tools/windows/converter_exe/http_client.h" - -namespace crash { - -HttpClient* CreateWinInetClient(const TCHAR* url); - -} // namespace crash - -#endif // TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ +// Copyright 2019 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ +#define TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ + +#include "tools/windows/converter_exe/http_client.h" + +namespace crash { + +HttpClient* CreateWinInetClient(const TCHAR* url); + +} // namespace crash + +#endif // TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_ diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc index 672e27d34..26c226a25 100644 --- a/src/tools/windows/dump_syms/dump_syms.cc +++ b/src/tools/windows/dump_syms/dump_syms.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/windows/dump_syms/dump_syms.gyp b/src/tools/windows/dump_syms/dump_syms.gyp index b815574b2..efb013e41 100644 --- a/src/tools/windows/dump_syms/dump_syms.gyp +++ b/src/tools/windows/dump_syms/dump_syms.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 Google Inc. All rights reserved. +# Copyright 2013 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/dump_syms/dump_syms_unittest.cc b/src/tools/windows/dump_syms/dump_syms_unittest.cc index accecda13..97dc5c9b9 100644 --- a/src/tools/windows/dump_syms/dump_syms_unittest.cc +++ b/src/tools/windows/dump_syms/dump_syms_unittest.cc @@ -1,244 +1,244 @@ -// Copyright 2003 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include - -#include "breakpad_googletest_includes.h" - -namespace tools { -namespace windows { -namespace dump_syms { - -namespace { - -// Root names of PDB and dumped symbol files to be regression tested. These are -// specified in complexity of the resulting dumped symbol files. -const wchar_t* kRootNames[] = { - // A PDB file with no OMAP data. - L"dump_syms_regtest", - // A PDB file with OMAP data for an image that has been function-level - // reordered. - L"omap_reorder_funcs", - // A PDB file with OMAP data for an image that had new content injected, all - // of it with source data. - L"omap_stretched_filled", - // A PDB file with OMAP data for an image that had new content injected, but - // without source data. - L"omap_stretched", - // A PDB file with OMAP data for an image that has been basic block reordered. - L"omap_reorder_bbs", - // A 64bit PDB file with no OMAP data. - L"dump_syms_regtest64", -}; - -const wchar_t* kPEOnlyRootNames[] = { - L"pe_only_symbol_test", -}; - -void TrimLastComponent(const std::wstring& path, - std::wstring* trimmed, - std::wstring* component) { - size_t len = path.size(); - while (len > 0 && path[len - 1] != '\\') - --len; - - if (component != NULL) - component->assign(path.c_str() + len, path.c_str() + path.size()); - - while (len > 0 && path[len - 1] == '\\') - --len; - - if (trimmed != NULL) - trimmed->assign(path.c_str(), len); -} - -// Get the directory of the current executable. -bool GetSelfDirectory(std::wstring* self_dir) { - std::wstring command_line = GetCommandLineW(); - - int num_args = 0; - wchar_t** args = NULL; - args = ::CommandLineToArgvW(command_line.c_str(), &num_args); - if (args == NULL) - return false; - - *self_dir = args[0]; - TrimLastComponent(*self_dir, self_dir, NULL); - - return true; -} - -void RunCommand(const std::wstring& command_line, - std::string* stdout_string) { - // Create a PIPE for the child process stdout. - HANDLE child_stdout_read = 0; - HANDLE child_stdout_write = 0; - SECURITY_ATTRIBUTES sec_attr_stdout = {}; - sec_attr_stdout.nLength = sizeof(sec_attr_stdout); - sec_attr_stdout.bInheritHandle = TRUE; - ASSERT_TRUE(::CreatePipe(&child_stdout_read, &child_stdout_write, - &sec_attr_stdout, 0)); - ASSERT_TRUE(::SetHandleInformation(child_stdout_read, HANDLE_FLAG_INHERIT, - 0)); - - // Create a PIPE for the child process stdin. - HANDLE child_stdin_read = 0; - HANDLE child_stdin_write = 0; - SECURITY_ATTRIBUTES sec_attr_stdin = {}; - sec_attr_stdin.nLength = sizeof(sec_attr_stdin); - sec_attr_stdin.bInheritHandle = TRUE; - ASSERT_TRUE(::CreatePipe(&child_stdin_read, &child_stdin_write, - &sec_attr_stdin, 0)); - ASSERT_TRUE(::SetHandleInformation(child_stdin_write, HANDLE_FLAG_INHERIT, - 0)); - - // Startup the child. - STARTUPINFO startup_info = {}; - PROCESS_INFORMATION process_info = {}; - startup_info.cb = sizeof(STARTUPINFO); - startup_info.hStdError = NULL; - startup_info.hStdInput = child_stdin_read; - startup_info.hStdOutput = child_stdout_write; - startup_info.dwFlags = STARTF_USESTDHANDLES; - ASSERT_TRUE(::CreateProcessW(NULL, (LPWSTR)command_line.c_str(), NULL, NULL, - TRUE, 0, NULL, NULL, - &startup_info, &process_info)); - - // Collect the output. - ASSERT_TRUE(::CloseHandle(child_stdout_write)); - char buffer[4096] = {}; - DWORD bytes_read = 0; - while (::ReadFile(child_stdout_read, buffer, sizeof(buffer), &bytes_read, - NULL) && bytes_read > 0) { - stdout_string->append(buffer, bytes_read); - } - - // Wait for the process to finish. - ::WaitForSingleObject(process_info.hProcess, INFINITE); - - // Shut down all of our handles. - ASSERT_TRUE(::CloseHandle(process_info.hThread)); - ASSERT_TRUE(::CloseHandle(process_info.hProcess)); - ASSERT_TRUE(::CloseHandle(child_stdin_write)); - ASSERT_TRUE(::CloseHandle(child_stdin_read)); - ASSERT_TRUE(::CloseHandle(child_stdout_read)); -} - -void GetFileContents(const std::wstring& path, std::string* content) { - FILE* f = ::_wfopen(path.c_str(), L"rb"); - ASSERT_TRUE(f != NULL); - - char buffer[4096] = {}; - while (true) { - size_t bytes_read = ::fread(buffer, 1, sizeof(buffer), f); - if (bytes_read == 0) - break; - content->append(buffer, bytes_read); - } -} - -class DumpSymsRegressionTest : public testing::TestWithParam { - public: - virtual void SetUp() { - std::wstring self_dir; - ASSERT_TRUE(GetSelfDirectory(&self_dir)); - dump_syms_exe = self_dir + L"\\dump_syms.exe"; - - TrimLastComponent(self_dir, &testdata_dir, NULL); - testdata_dir += L"\\testdata"; - } - - std::wstring dump_syms_exe; - std::wstring testdata_dir; -}; - -class DumpSymsPEOnlyRegressionTest : public testing::TestWithParam { -public: - virtual void SetUp() { - std::wstring self_dir; - ASSERT_TRUE(GetSelfDirectory(&self_dir)); - dump_syms_exe = self_dir + L"\\dump_syms.exe"; - - TrimLastComponent(self_dir, &testdata_dir, NULL); - testdata_dir += L"\\testdata"; - } - - std::wstring dump_syms_exe; - std::wstring testdata_dir; -}; - -} //namespace - -TEST_P(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) { - const wchar_t* root_name = GetParam(); - std::wstring root_path = testdata_dir + L"\\" + root_name; - - std::wstring sym_path = root_path + L".sym"; - std::string expected_symbols; - ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols)); - - std::wstring pdb_path = root_path + L".pdb"; - std::wstring command_line = L"\"" + dump_syms_exe + L"\" \"" + - pdb_path + L"\""; - std::string symbols; - ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols)); - - EXPECT_EQ(expected_symbols, symbols); -} - -INSTANTIATE_TEST_SUITE_P(DumpSyms, DumpSymsRegressionTest, - testing::ValuesIn(kRootNames)); - -TEST_P(DumpSymsPEOnlyRegressionTest, EnsurePEOnlyDumpedSymbolsMatch) { - const wchar_t* root_name = GetParam(); - std::wstring root_path = testdata_dir + L"\\" + root_name; - - std::wstring sym_path = root_path + L".sym"; - std::string expected_symbols; - ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols)); - - std::wstring dll_path = root_path + L".dll"; - std::wstring command_line = L"\"" + dump_syms_exe + L"\" --pe \"" + - dll_path + L"\""; - std::string symbols; - ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols)); - - EXPECT_EQ(expected_symbols, symbols); -} - -INSTANTIATE_TEST_SUITE_P(PEOnlyDumpSyms, DumpSymsPEOnlyRegressionTest, - testing::ValuesIn(kPEOnlyRootNames)); - - -} // namespace dump_syms -} // namespace windows -} // namespace tools +// Copyright 2003 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include +#include + +#include "breakpad_googletest_includes.h" + +namespace tools { +namespace windows { +namespace dump_syms { + +namespace { + +// Root names of PDB and dumped symbol files to be regression tested. These are +// specified in complexity of the resulting dumped symbol files. +const wchar_t* kRootNames[] = { + // A PDB file with no OMAP data. + L"dump_syms_regtest", + // A PDB file with OMAP data for an image that has been function-level + // reordered. + L"omap_reorder_funcs", + // A PDB file with OMAP data for an image that had new content injected, all + // of it with source data. + L"omap_stretched_filled", + // A PDB file with OMAP data for an image that had new content injected, but + // without source data. + L"omap_stretched", + // A PDB file with OMAP data for an image that has been basic block reordered. + L"omap_reorder_bbs", + // A 64bit PDB file with no OMAP data. + L"dump_syms_regtest64", +}; + +const wchar_t* kPEOnlyRootNames[] = { + L"pe_only_symbol_test", +}; + +void TrimLastComponent(const std::wstring& path, + std::wstring* trimmed, + std::wstring* component) { + size_t len = path.size(); + while (len > 0 && path[len - 1] != '\\') + --len; + + if (component != NULL) + component->assign(path.c_str() + len, path.c_str() + path.size()); + + while (len > 0 && path[len - 1] == '\\') + --len; + + if (trimmed != NULL) + trimmed->assign(path.c_str(), len); +} + +// Get the directory of the current executable. +bool GetSelfDirectory(std::wstring* self_dir) { + std::wstring command_line = GetCommandLineW(); + + int num_args = 0; + wchar_t** args = NULL; + args = ::CommandLineToArgvW(command_line.c_str(), &num_args); + if (args == NULL) + return false; + + *self_dir = args[0]; + TrimLastComponent(*self_dir, self_dir, NULL); + + return true; +} + +void RunCommand(const std::wstring& command_line, + std::string* stdout_string) { + // Create a PIPE for the child process stdout. + HANDLE child_stdout_read = 0; + HANDLE child_stdout_write = 0; + SECURITY_ATTRIBUTES sec_attr_stdout = {}; + sec_attr_stdout.nLength = sizeof(sec_attr_stdout); + sec_attr_stdout.bInheritHandle = TRUE; + ASSERT_TRUE(::CreatePipe(&child_stdout_read, &child_stdout_write, + &sec_attr_stdout, 0)); + ASSERT_TRUE(::SetHandleInformation(child_stdout_read, HANDLE_FLAG_INHERIT, + 0)); + + // Create a PIPE for the child process stdin. + HANDLE child_stdin_read = 0; + HANDLE child_stdin_write = 0; + SECURITY_ATTRIBUTES sec_attr_stdin = {}; + sec_attr_stdin.nLength = sizeof(sec_attr_stdin); + sec_attr_stdin.bInheritHandle = TRUE; + ASSERT_TRUE(::CreatePipe(&child_stdin_read, &child_stdin_write, + &sec_attr_stdin, 0)); + ASSERT_TRUE(::SetHandleInformation(child_stdin_write, HANDLE_FLAG_INHERIT, + 0)); + + // Startup the child. + STARTUPINFO startup_info = {}; + PROCESS_INFORMATION process_info = {}; + startup_info.cb = sizeof(STARTUPINFO); + startup_info.hStdError = NULL; + startup_info.hStdInput = child_stdin_read; + startup_info.hStdOutput = child_stdout_write; + startup_info.dwFlags = STARTF_USESTDHANDLES; + ASSERT_TRUE(::CreateProcessW(NULL, (LPWSTR)command_line.c_str(), NULL, NULL, + TRUE, 0, NULL, NULL, + &startup_info, &process_info)); + + // Collect the output. + ASSERT_TRUE(::CloseHandle(child_stdout_write)); + char buffer[4096] = {}; + DWORD bytes_read = 0; + while (::ReadFile(child_stdout_read, buffer, sizeof(buffer), &bytes_read, + NULL) && bytes_read > 0) { + stdout_string->append(buffer, bytes_read); + } + + // Wait for the process to finish. + ::WaitForSingleObject(process_info.hProcess, INFINITE); + + // Shut down all of our handles. + ASSERT_TRUE(::CloseHandle(process_info.hThread)); + ASSERT_TRUE(::CloseHandle(process_info.hProcess)); + ASSERT_TRUE(::CloseHandle(child_stdin_write)); + ASSERT_TRUE(::CloseHandle(child_stdin_read)); + ASSERT_TRUE(::CloseHandle(child_stdout_read)); +} + +void GetFileContents(const std::wstring& path, std::string* content) { + FILE* f = ::_wfopen(path.c_str(), L"rb"); + ASSERT_TRUE(f != NULL); + + char buffer[4096] = {}; + while (true) { + size_t bytes_read = ::fread(buffer, 1, sizeof(buffer), f); + if (bytes_read == 0) + break; + content->append(buffer, bytes_read); + } +} + +class DumpSymsRegressionTest : public testing::TestWithParam { + public: + virtual void SetUp() { + std::wstring self_dir; + ASSERT_TRUE(GetSelfDirectory(&self_dir)); + dump_syms_exe = self_dir + L"\\dump_syms.exe"; + + TrimLastComponent(self_dir, &testdata_dir, NULL); + testdata_dir += L"\\testdata"; + } + + std::wstring dump_syms_exe; + std::wstring testdata_dir; +}; + +class DumpSymsPEOnlyRegressionTest : public testing::TestWithParam { +public: + virtual void SetUp() { + std::wstring self_dir; + ASSERT_TRUE(GetSelfDirectory(&self_dir)); + dump_syms_exe = self_dir + L"\\dump_syms.exe"; + + TrimLastComponent(self_dir, &testdata_dir, NULL); + testdata_dir += L"\\testdata"; + } + + std::wstring dump_syms_exe; + std::wstring testdata_dir; +}; + +} //namespace + +TEST_P(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) { + const wchar_t* root_name = GetParam(); + std::wstring root_path = testdata_dir + L"\\" + root_name; + + std::wstring sym_path = root_path + L".sym"; + std::string expected_symbols; + ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols)); + + std::wstring pdb_path = root_path + L".pdb"; + std::wstring command_line = L"\"" + dump_syms_exe + L"\" \"" + + pdb_path + L"\""; + std::string symbols; + ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols)); + + EXPECT_EQ(expected_symbols, symbols); +} + +INSTANTIATE_TEST_SUITE_P(DumpSyms, DumpSymsRegressionTest, + testing::ValuesIn(kRootNames)); + +TEST_P(DumpSymsPEOnlyRegressionTest, EnsurePEOnlyDumpedSymbolsMatch) { + const wchar_t* root_name = GetParam(); + std::wstring root_path = testdata_dir + L"\\" + root_name; + + std::wstring sym_path = root_path + L".sym"; + std::string expected_symbols; + ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols)); + + std::wstring dll_path = root_path + L".dll"; + std::wstring command_line = L"\"" + dump_syms_exe + L"\" --pe \"" + + dll_path + L"\""; + std::string symbols; + ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols)); + + EXPECT_EQ(expected_symbols, symbols); +} + +INSTANTIATE_TEST_SUITE_P(PEOnlyDumpSyms, DumpSymsPEOnlyRegressionTest, + testing::ValuesIn(kPEOnlyRootNames)); + + +} // namespace dump_syms +} // namespace windows +} // namespace tools diff --git a/src/tools/windows/dump_syms/run_regtest.sh b/src/tools/windows/dump_syms/run_regtest.sh index 1f20f64fd..2401edd14 100755 --- a/src/tools/windows/dump_syms/run_regtest.sh +++ b/src/tools/windows/dump_syms/run_regtest.sh @@ -1,7 +1,6 @@ #!/bin/sh -# Copyright (c) 2006, Google Inc. -# All rights reserved. +# Copyright 2006 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -13,7 +12,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc index de6109fe2..442676bae 100644 --- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc +++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. +// Copyright 2007 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 11e38438e..65123a280 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. +// Copyright 2006 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // diff --git a/src/tools/windows/symupload/symupload.gyp b/src/tools/windows/symupload/symupload.gyp index 4567a4bdf..5e6295918 100644 --- a/src/tools/windows/symupload/symupload.gyp +++ b/src/tools/windows/symupload/symupload.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 Google Inc. All rights reserved. +# Copyright 2013 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # diff --git a/src/tools/windows/tools_windows.gyp b/src/tools/windows/tools_windows.gyp index 17b88b4a7..a616b2371 100644 --- a/src/tools/windows/tools_windows.gyp +++ b/src/tools/windows/tools_windows.gyp @@ -1,4 +1,4 @@ -# Copyright 2017 Google Inc. All rights reserved. +# Copyright 2017 Google LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. -# * Neither the name of Google Inc. nor the names of its +# * Neither the name of Google LLC nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # From e059dad5ea3e781786f155ff9806602a4374b5fa Mon Sep 17 00:00:00 2001 From: Iacopo Colonnelli Date: Thu, 8 Sep 2022 09:38:48 +0200 Subject: [PATCH 117/195] Polling in ParallelChildCrashesDontHang test Instead of (arbitrarily) wait 1s for the child process to terminate, the parent now polls the child process every 100ms to check if it's terminated, and it does so for a much longer total time of 10s. This implementation ensures correct check for slower architectures, and fast success for faster ones. Change-Id: I2ff38458bf747de5b74268a4e22fd6164450419b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3876346 Reviewed-by: Mike Frysinger --- .../handler/exception_handler_unittest.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 01ec2ef96..691ea1335 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -305,8 +305,22 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) { } } - // Wait a while until the child should have crashed. - usleep(1000000); + // Poll the child to see if it crashed. + int status, wp_pid; + for (int i = 0; i < 100; i++) { + wp_pid = HANDLE_EINTR(waitpid(child, &status, WNOHANG)); + ASSERT_NE(-1, wp_pid); + if (wp_pid > 0) { + ASSERT_TRUE(WIFSIGNALED(status)); + // If the child process terminated by itself, + // it will have returned SIGSEGV. + ASSERT_EQ(SIGSEGV, WTERMSIG(status)); + return; + } else { + usleep(100000); + } + } + // Kill the child if it is still running. kill(child, SIGKILL); From 28cf16bc342c0e39f867ccc1a30357a803b9a15a Mon Sep 17 00:00:00 2001 From: Iacopo Colonnelli Date: Fri, 9 Sep 2022 09:53:29 +0200 Subject: [PATCH 118/195] Added riscv and riscv64 support for Linux Change-Id: I62cd157d00a87720db001072662a81d8eb9112b0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3873291 Reviewed-by: Mike Frysinger --- Makefile.am | 38 + Makefile.in | 210 +++++ .../dump_writer_common/raw_context_cpu.h | 8 + .../linux/dump_writer_common/thread_info.cc | 93 +- .../linux/dump_writer_common/thread_info.h | 2 +- .../dump_writer_common/ucontext_reader.cc | 69 ++ src/client/linux/handler/exception_handler.cc | 9 +- src/client/linux/handler/exception_handler.h | 2 +- .../microdump_writer/microdump_writer.cc | 12 +- .../minidump_writer/linux_core_dumper.cc | 18 +- .../linux/minidump_writer/linux_dumper.h | 6 +- .../linux_dumper_unittest_helper.cc | 2 + .../minidump_writer/linux_ptrace_dumper.cc | 5 +- .../linux_ptrace_dumper_unittest.cc | 5 + .../linux/minidump_writer/minidump_writer.cc | 57 +- .../minidump_writer_unittest.cc | 3 + src/common/linux/breakpad_getcontext.S | 96 +- .../linux/breakpad_getcontext_unittest.cc | 19 + src/common/linux/memory_mapped_file.cc | 3 +- src/common/linux/ucontext_constants.h | 101 +- .../common/minidump_cpu_riscv.h | 168 ++++ src/google_breakpad/common/minidump_format.h | 3 + src/google_breakpad/processor/dump_context.h | 40 +- .../processor/stack_frame_cpu.h | 112 +++ src/processor/dump_context.cc | 235 +++++ src/processor/minidump.cc | 185 ++++ src/processor/processor.gyp | 2 + src/processor/stackwalk_common.cc | 296 +++++- src/processor/stackwalker.cc | 16 + src/processor/stackwalker_riscv.cc | 535 +++++++++++ src/processor/stackwalker_riscv.h | 100 ++ src/processor/stackwalker_riscv64.cc | 535 +++++++++++ src/processor/stackwalker_riscv64.h | 100 ++ src/processor/stackwalker_riscv64_unittest.cc | 883 ++++++++++++++++++ src/processor/stackwalker_riscv_unittest.cc | 883 ++++++++++++++++++ src/third_party/curl/curlbuild.h | 3 +- src/tools/linux/md2core/minidump-2-core.cc | 95 +- 37 files changed, 4901 insertions(+), 48 deletions(-) create mode 100644 src/google_breakpad/common/minidump_cpu_riscv.h create mode 100644 src/processor/stackwalker_riscv.cc create mode 100644 src/processor/stackwalker_riscv.h create mode 100644 src/processor/stackwalker_riscv64.cc create mode 100644 src/processor/stackwalker_riscv64.h create mode 100644 src/processor/stackwalker_riscv64_unittest.cc create mode 100644 src/processor/stackwalker_riscv_unittest.cc diff --git a/Makefile.am b/Makefile.am index fd89ea51f..281bc5222 100644 --- a/Makefile.am +++ b/Makefile.am @@ -296,6 +296,10 @@ src_libbreakpad_a_SOURCES = \ src/processor/stackwalker_ppc.h \ src/processor/stackwalker_ppc64.cc \ src/processor/stackwalker_ppc64.h \ + src/processor/stackwalker_riscv.cc \ + src/processor/stackwalker_riscv.h \ + src/processor/stackwalker_riscv64.cc \ + src/processor/stackwalker_riscv64.h \ src/processor/stackwalker_sparc.cc \ src/processor/stackwalker_sparc.h \ src/processor/stackwalker_x86.cc \ @@ -409,6 +413,8 @@ check_PROGRAMS += \ src/processor/stackwalker_address_list_unittest \ src/processor/stackwalker_mips_unittest \ src/processor/stackwalker_mips64_unittest \ + src/processor/stackwalker_riscv_unittest \ + src/processor/stackwalker_riscv64_unittest \ src/processor/stackwalker_x86_unittest \ src/processor/synth_minidump_unittest endif @@ -893,6 +899,8 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ @@ -966,6 +974,8 @@ src_processor_microdump_processor_unittest_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ @@ -1005,6 +1015,8 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ @@ -1148,6 +1160,8 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ @@ -1213,6 +1227,26 @@ src_processor_stackwalker_mips64_unittest_LDADD = \ src_processor_stackwalker_mips64_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_processor_stackwalker_riscv_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv_unittest.cc +src_processor_stackwalker_riscv_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +src_processor_stackwalker_riscv_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_riscv64_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv64_unittest.cc +src_processor_stackwalker_riscv64_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +src_processor_stackwalker_riscv64_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + src_processor_stackwalker_x86_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/stackwalker_x86_unittest.cc @@ -1316,6 +1350,8 @@ src_processor_microdump_stackwalk_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ @@ -1355,6 +1391,8 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/stackwalker_mips.o \ src/processor/stackwalker_ppc.o \ src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ diff --git a/Makefile.in b/Makefile.in index abe7daaee..729498824 100644 --- a/Makefile.in +++ b/Makefile.in @@ -199,6 +199,8 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest @@ -299,6 +301,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) @LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT) \ @@ -496,6 +500,10 @@ am__src_libbreakpad_a_SOURCES_DIST = \ src/processor/stackwalker_ppc.h \ src/processor/stackwalker_ppc64.cc \ src/processor/stackwalker_ppc64.h \ + src/processor/stackwalker_riscv.cc \ + src/processor/stackwalker_riscv.h \ + src/processor/stackwalker_riscv64.cc \ + src/processor/stackwalker_riscv64.h \ src/processor/stackwalker_sparc.cc \ src/processor/stackwalker_sparc.h \ src/processor/stackwalker_x86.cc \ @@ -547,6 +555,8 @@ am__src_libbreakpad_a_SOURCES_DIST = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.$(OBJEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.$(OBJEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.$(OBJEXT) \ @@ -994,6 +1004,8 @@ src_processor_exploitability_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -1058,6 +1070,8 @@ src_processor_microdump_processor_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -1097,6 +1111,8 @@ src_processor_microdump_stackwalk_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -1150,6 +1166,8 @@ src_processor_minidump_processor_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -1195,6 +1213,8 @@ src_processor_minidump_stackwalk_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -1358,6 +1378,30 @@ src_processor_stackwalker_mips_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ @DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ @DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) +am__src_processor_stackwalker_riscv64_unittest_SOURCES_DIST = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv64_unittest.cc +@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_riscv64_unittest_OBJECTS = src/common/processor_stackwalker_riscv64_unittest-test_assembler.$(OBJEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.$(OBJEXT) +src_processor_stackwalker_riscv64_unittest_OBJECTS = \ + $(am_src_processor_stackwalker_riscv64_unittest_OBJECTS) +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_DEPENDENCIES = \ +@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) +am__src_processor_stackwalker_riscv_unittest_SOURCES_DIST = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv_unittest.cc +@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_riscv_unittest_OBJECTS = src/common/processor_stackwalker_riscv_unittest-test_assembler.$(OBJEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.$(OBJEXT) +src_processor_stackwalker_riscv_unittest_OBJECTS = \ + $(am_src_processor_stackwalker_riscv_unittest_OBJECTS) +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_DEPENDENCIES = \ +@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) am__src_processor_stackwalker_selftest_SOURCES_DIST = \ src/processor/stackwalker_selftest.cc @DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_selftest_OBJECTS = src/processor/stackwalker_selftest.$(OBJEXT) @@ -1386,6 +1430,8 @@ src_processor_stackwalker_selftest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -1708,6 +1754,8 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/$(DEPDIR)/processor_stackwalker_arm_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_stackwalker_mips64_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po \ + src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po \ + src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po \ src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po \ src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po \ @@ -1891,6 +1939,10 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/processor/$(DEPDIR)/stackwalker_mips_unittest-stackwalker_mips_unittest.Po \ src/processor/$(DEPDIR)/stackwalker_ppc.Po \ src/processor/$(DEPDIR)/stackwalker_ppc64.Po \ + src/processor/$(DEPDIR)/stackwalker_riscv.Po \ + src/processor/$(DEPDIR)/stackwalker_riscv64.Po \ + src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po \ + src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po \ src/processor/$(DEPDIR)/stackwalker_selftest.Po \ src/processor/$(DEPDIR)/stackwalker_sparc.Po \ src/processor/$(DEPDIR)/stackwalker_x86.Po \ @@ -2008,6 +2060,8 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_processor_stackwalker_arm_unittest_SOURCES) \ $(src_processor_stackwalker_mips64_unittest_SOURCES) \ $(src_processor_stackwalker_mips_unittest_SOURCES) \ + $(src_processor_stackwalker_riscv64_unittest_SOURCES) \ + $(src_processor_stackwalker_riscv_unittest_SOURCES) \ $(src_processor_stackwalker_selftest_SOURCES) \ $(src_processor_stackwalker_x86_unittest_SOURCES) \ $(src_processor_static_address_map_unittest_SOURCES) \ @@ -2065,6 +2119,8 @@ DIST_SOURCES = \ $(am__src_processor_stackwalker_arm_unittest_SOURCES_DIST) \ $(am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST) \ $(am__src_processor_stackwalker_mips_unittest_SOURCES_DIST) \ + $(am__src_processor_stackwalker_riscv64_unittest_SOURCES_DIST) \ + $(am__src_processor_stackwalker_riscv_unittest_SOURCES_DIST) \ $(am__src_processor_stackwalker_selftest_SOURCES_DIST) \ $(am__src_processor_stackwalker_x86_unittest_SOURCES_DIST) \ $(am__src_processor_static_address_map_unittest_SOURCES_DIST) \ @@ -2652,6 +2708,10 @@ CLEANFILES = $(am__append_12) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.h \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.h \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.cc \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.h \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.cc \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.h \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.h \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.cc \ @@ -3138,6 +3198,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -3219,6 +3281,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -3260,6 +3324,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -3423,6 +3489,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -3500,6 +3568,30 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_CPPFLAGS = \ @DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_SOURCES = \ +@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest.cc + +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_LDADD = \ +@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ +@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ +@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_CPPFLAGS = \ +@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) + +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_SOURCES = \ +@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest.cc + +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_LDADD = \ +@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ +@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ +@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_CPPFLAGS = \ +@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) + @DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_SOURCES = \ @DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest.cc @@ -3612,6 +3704,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ @@ -3652,6 +3746,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ @@ -4342,6 +4438,12 @@ src/processor/stackwalker_ppc.$(OBJEXT): \ src/processor/stackwalker_ppc64.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) +src/processor/stackwalker_riscv.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) +src/processor/stackwalker_riscv64.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/stackwalker_sparc.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -5048,6 +5150,26 @@ src/processor/stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT): \ src/processor/stackwalker_mips_unittest$(EXEEXT): $(src_processor_stackwalker_mips_unittest_OBJECTS) $(src_processor_stackwalker_mips_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_mips_unittest_DEPENDENCIES) src/processor/$(am__dirstamp) @rm -f src/processor/stackwalker_mips_unittest$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_mips_unittest_OBJECTS) $(src_processor_stackwalker_mips_unittest_LDADD) $(LIBS) +src/common/processor_stackwalker_riscv64_unittest-test_assembler.$(OBJEXT): \ + src/common/$(am__dirstamp) \ + src/common/$(DEPDIR)/$(am__dirstamp) +src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) + +src/processor/stackwalker_riscv64_unittest$(EXEEXT): $(src_processor_stackwalker_riscv64_unittest_OBJECTS) $(src_processor_stackwalker_riscv64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_riscv64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp) + @rm -f src/processor/stackwalker_riscv64_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_riscv64_unittest_OBJECTS) $(src_processor_stackwalker_riscv64_unittest_LDADD) $(LIBS) +src/common/processor_stackwalker_riscv_unittest-test_assembler.$(OBJEXT): \ + src/common/$(am__dirstamp) \ + src/common/$(DEPDIR)/$(am__dirstamp) +src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) + +src/processor/stackwalker_riscv_unittest$(EXEEXT): $(src_processor_stackwalker_riscv_unittest_OBJECTS) $(src_processor_stackwalker_riscv_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_riscv_unittest_DEPENDENCIES) src/processor/$(am__dirstamp) + @rm -f src/processor/stackwalker_riscv_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_riscv_unittest_OBJECTS) $(src_processor_stackwalker_riscv_unittest_LDADD) $(LIBS) src/processor/stackwalker_selftest.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -5451,6 +5573,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_arm_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_mips64_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po@am__quote@ # am--include-marker @@ -5634,6 +5758,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_mips_unittest-stackwalker_mips_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_ppc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_ppc64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_riscv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_riscv64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_selftest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_sparc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_x86.Po@am__quote@ # am--include-marker @@ -7704,6 +7832,62 @@ src/processor/stackwalker_mips_unittest-stackwalker_mips_unittest.obj: src/proce @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/stackwalker_mips_unittest-stackwalker_mips_unittest.obj `if test -f 'src/processor/stackwalker_mips_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips_unittest.cc'; fi` +src/common/processor_stackwalker_riscv64_unittest-test_assembler.o: src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/processor_stackwalker_riscv64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Tpo -c -o src/common/processor_stackwalker_riscv64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/processor_stackwalker_riscv64_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/processor_stackwalker_riscv64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc + +src/common/processor_stackwalker_riscv64_unittest-test_assembler.obj: src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/processor_stackwalker_riscv64_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Tpo -c -o src/common/processor_stackwalker_riscv64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/processor_stackwalker_riscv64_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/processor_stackwalker_riscv64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi` + +src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.o: src/processor/stackwalker_riscv64_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Tpo -c -o src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.o `test -f 'src/processor/stackwalker_riscv64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_riscv64_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Tpo src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_riscv64_unittest.cc' object='src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.o `test -f 'src/processor/stackwalker_riscv64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_riscv64_unittest.cc + +src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.obj: src/processor/stackwalker_riscv64_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Tpo -c -o src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.obj `if test -f 'src/processor/stackwalker_riscv64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_riscv64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_riscv64_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Tpo src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_riscv64_unittest.cc' object='src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.obj `if test -f 'src/processor/stackwalker_riscv64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_riscv64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_riscv64_unittest.cc'; fi` + +src/common/processor_stackwalker_riscv_unittest-test_assembler.o: src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/processor_stackwalker_riscv_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Tpo -c -o src/common/processor_stackwalker_riscv_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Tpo src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/processor_stackwalker_riscv_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/processor_stackwalker_riscv_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc + +src/common/processor_stackwalker_riscv_unittest-test_assembler.obj: src/common/test_assembler.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/processor_stackwalker_riscv_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Tpo -c -o src/common/processor_stackwalker_riscv_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Tpo src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/processor_stackwalker_riscv_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/processor_stackwalker_riscv_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi` + +src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.o: src/processor/stackwalker_riscv_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Tpo -c -o src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.o `test -f 'src/processor/stackwalker_riscv_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_riscv_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Tpo src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_riscv_unittest.cc' object='src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.o `test -f 'src/processor/stackwalker_riscv_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_riscv_unittest.cc + +src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.obj: src/processor/stackwalker_riscv_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Tpo -c -o src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.obj `if test -f 'src/processor/stackwalker_riscv_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_riscv_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_riscv_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Tpo src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_riscv_unittest.cc' object='src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_riscv_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.obj `if test -f 'src/processor/stackwalker_riscv_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_riscv_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_riscv_unittest.cc'; fi` + src/common/processor_stackwalker_x86_unittest-test_assembler.o: src/common/test_assembler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/processor_stackwalker_x86_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Tpo -c -o src/common/processor_stackwalker_x86_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Tpo src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po @@ -9108,6 +9292,20 @@ src/processor/stackwalker_mips64_unittest.log: src/processor/stackwalker_mips64_ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/processor/stackwalker_riscv_unittest.log: src/processor/stackwalker_riscv_unittest$(EXEEXT) + @p='src/processor/stackwalker_riscv_unittest$(EXEEXT)'; \ + b='src/processor/stackwalker_riscv_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +src/processor/stackwalker_riscv64_unittest.log: src/processor/stackwalker_riscv64_unittest$(EXEEXT) + @p='src/processor/stackwalker_riscv64_unittest$(EXEEXT)'; \ + b='src/processor/stackwalker_riscv64_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/stackwalker_x86_unittest.log: src/processor/stackwalker_x86_unittest$(EXEEXT) @p='src/processor/stackwalker_x86_unittest$(EXEEXT)'; \ b='src/processor/stackwalker_x86_unittest'; \ @@ -9558,6 +9756,8 @@ distclean: distclean-am -rm -f src/common/$(DEPDIR)/processor_stackwalker_arm_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips64_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po @@ -9741,6 +9941,10 @@ distclean: distclean-am -rm -f src/processor/$(DEPDIR)/stackwalker_mips_unittest-stackwalker_mips_unittest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_ppc.Po -rm -f src/processor/$(DEPDIR)/stackwalker_ppc64.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv64.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_selftest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_sparc.Po -rm -f src/processor/$(DEPDIR)/stackwalker_x86.Po @@ -9904,6 +10108,8 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/$(DEPDIR)/processor_stackwalker_arm_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips64_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_mips_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/processor_stackwalker_riscv64_unittest-test_assembler.Po + -rm -f src/common/$(DEPDIR)/processor_stackwalker_riscv_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_stackwalker_x86_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/processor_synth_minidump_unittest-test_assembler.Po -rm -f src/common/$(DEPDIR)/safe_math_unittest-safe_math_unittest.Po @@ -10087,6 +10293,10 @@ maintainer-clean: maintainer-clean-am -rm -f src/processor/$(DEPDIR)/stackwalker_mips_unittest-stackwalker_mips_unittest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_ppc.Po -rm -f src/processor/$(DEPDIR)/stackwalker_ppc64.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv64.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.Po + -rm -f src/processor/$(DEPDIR)/stackwalker_riscv_unittest-stackwalker_riscv_unittest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_selftest.Po -rm -f src/processor/$(DEPDIR)/stackwalker_sparc.Po -rm -f src/processor/$(DEPDIR)/stackwalker_x86.Po diff --git a/src/client/linux/dump_writer_common/raw_context_cpu.h b/src/client/linux/dump_writer_common/raw_context_cpu.h index 58243dfee..ea4b6f6a2 100644 --- a/src/client/linux/dump_writer_common/raw_context_cpu.h +++ b/src/client/linux/dump_writer_common/raw_context_cpu.h @@ -43,6 +43,14 @@ typedef MDRawContextARM RawContextCPU; typedef MDRawContextARM64_Old RawContextCPU; #elif defined(__mips__) typedef MDRawContextMIPS RawContextCPU; +#elif defined(__riscv) +# if __riscv_xlen == 32 +typedef MDRawContextRISCV RawContextCPU; +# elif __riscv_xlen == 64 +typedef MDRawContextRISCV64 RawContextCPU; +# else +# error "Unexpected __riscv_xlen" +# endif #else #error "This code has not been ported to your platform yet." #endif diff --git a/src/client/linux/dump_writer_common/thread_info.cc b/src/client/linux/dump_writer_common/thread_info.cc index 5f32c031b..d8bf80b0c 100644 --- a/src/client/linux/dump_writer_common/thread_info.cc +++ b/src/client/linux/dump_writer_common/thread_info.cc @@ -269,7 +269,74 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const { out->float_save.fir = mcontext.fpc_eir; #endif } -#endif // __mips__ + +#elif defined(__riscv) + +uintptr_t ThreadInfo::GetInstructionPointer() const { + return mcontext.__gregs[0]; +} + +void ThreadInfo::FillCPUContext(RawContextCPU* out) const { +# if __riscv__xlen == 32 + out->context_flags = MD_CONTEXT_RISCV_FULL; +# elif __riscv_xlen == 64 + out->context_flags = MD_CONTEXT_RISCV64_FULL; +# else +# error "Unexpected __riscv_xlen" +# endif + + out->pc = mcontext.__gregs[0]; + out->ra = mcontext.__gregs[1]; + out->sp = mcontext.__gregs[2]; + out->gp = mcontext.__gregs[3]; + out->tp = mcontext.__gregs[4]; + out->t0 = mcontext.__gregs[5]; + out->t1 = mcontext.__gregs[6]; + out->t2 = mcontext.__gregs[7]; + out->s0 = mcontext.__gregs[8]; + out->s1 = mcontext.__gregs[9]; + out->a0 = mcontext.__gregs[10]; + out->a1 = mcontext.__gregs[11]; + out->a2 = mcontext.__gregs[12]; + out->a3 = mcontext.__gregs[13]; + out->a4 = mcontext.__gregs[14]; + out->a5 = mcontext.__gregs[15]; + out->a6 = mcontext.__gregs[16]; + out->a7 = mcontext.__gregs[17]; + out->s2 = mcontext.__gregs[18]; + out->s3 = mcontext.__gregs[19]; + out->s4 = mcontext.__gregs[20]; + out->s5 = mcontext.__gregs[21]; + out->s6 = mcontext.__gregs[22]; + out->s7 = mcontext.__gregs[23]; + out->s8 = mcontext.__gregs[24]; + out->s9 = mcontext.__gregs[25]; + out->s10 = mcontext.__gregs[26]; + out->s11 = mcontext.__gregs[27]; + out->t3 = mcontext.__gregs[28]; + out->t4 = mcontext.__gregs[29]; + out->t5 = mcontext.__gregs[30]; + out->t6 = mcontext.__gregs[31]; + +# if __riscv_flen == 32 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) + out->float_save.regs[i] = mcontext.__fpregs.__f.__f[i]; + out->float_save.fpcsr = mcontext.__fpregs.__f.__fcsr; +# elif __riscv_flen == 64 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) + out->float_save.regs[i] = mcontext.__fpregs.__d.__f[i]; + out->float_save.fpcsr = mcontext.__fpregs.__d.__fcsr; +# elif __riscv_flen == 128 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) { + out->float_save.regs[i].high = mcontext.__fpregs.__q.__f[2*i]; + out->float_save.regs[i].low = mcontext.__fpregs.__q.__f[2*i+1]; + } + out->float_save.fpcsr = mcontext.__fpregs.__q.__fcsr; +# else +# error "Unexpected __riscv_flen" +# endif +} +#endif // __riscv void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) { assert(gp_regs || size); @@ -278,6 +345,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) { *gp_regs = mcontext.gregs; if (size) *size = sizeof(mcontext.gregs); +#elif defined(__riscv) + if (gp_regs) + *gp_regs = mcontext.__gregs; + if (size) + *size = sizeof(mcontext.__gregs); #else if (gp_regs) *gp_regs = ®s; @@ -293,6 +365,25 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) { *fp_regs = &mcontext.fpregs; if (size) *size = sizeof(mcontext.fpregs); +#elif defined(__riscv) +# if __riscv_flen == 32 + if (fp_regs) + *fp_regs = &mcontext.__fpregs.__f.__f; + if (size) + *size = sizeof(mcontext.__fpregs.__f.__f); +# elif __riscv_flen == 64 + if (fp_regs) + *fp_regs = &mcontext.__fpregs.__d.__f; + if (size) + *size = sizeof(mcontext.__fpregs.__d.__f); +# elif __riscv_flen == 128 + if (fp_regs) + *fp_regs = &mcontext.__fpregs.__q.__f; + if (size) + *size = sizeof(mcontext.__fpregs.__q.__f); +# else +# error "Unexpected __riscv_flen" +# endif #else if (fp_regs) *fp_regs = &fpregs; diff --git a/src/client/linux/dump_writer_common/thread_info.h b/src/client/linux/dump_writer_common/thread_info.h index 9e1b454b4..af786bcc9 100644 --- a/src/client/linux/dump_writer_common/thread_info.h +++ b/src/client/linux/dump_writer_common/thread_info.h @@ -67,7 +67,7 @@ struct ThreadInfo { // Use the structures defined in struct user_regs_struct regs; struct user_fpsimd_struct fpregs; -#elif defined(__mips__) +#elif defined(__mips__) || defined(__riscv) // Use the structure defined in . mcontext_t mcontext; #endif diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc index 7de824579..97ed2a9f4 100644 --- a/src/client/linux/dump_writer_common/ucontext_reader.cc +++ b/src/client/linux/dump_writer_common/ucontext_reader.cc @@ -253,6 +253,75 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc) { out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. #endif } + +#elif defined(__riscv) + +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP]; +} + +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.__gregs[MD_CONTEXT_RISCV_REG_PC]; +} + +void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc) { +# if __riscv__xlen == 32 + out->context_flags = MD_CONTEXT_RISCV_FULL; +# elif __riscv_xlen == 64 + out->context_flags = MD_CONTEXT_RISCV64_FULL; +# else +# error "Unexpected __riscv_xlen" +# endif + + out->pc = uc->uc_mcontext.__gregs[0]; + out->ra = uc->uc_mcontext.__gregs[1]; + out->sp = uc->uc_mcontext.__gregs[2]; + out->gp = uc->uc_mcontext.__gregs[3]; + out->tp = uc->uc_mcontext.__gregs[4]; + out->t0 = uc->uc_mcontext.__gregs[5]; + out->t1 = uc->uc_mcontext.__gregs[6]; + out->t2 = uc->uc_mcontext.__gregs[7]; + out->s0 = uc->uc_mcontext.__gregs[8]; + out->s1 = uc->uc_mcontext.__gregs[9]; + out->a0 = uc->uc_mcontext.__gregs[10]; + out->a1 = uc->uc_mcontext.__gregs[11]; + out->a2 = uc->uc_mcontext.__gregs[12]; + out->a3 = uc->uc_mcontext.__gregs[13]; + out->a4 = uc->uc_mcontext.__gregs[14]; + out->a5 = uc->uc_mcontext.__gregs[15]; + out->a6 = uc->uc_mcontext.__gregs[16]; + out->a7 = uc->uc_mcontext.__gregs[17]; + out->s2 = uc->uc_mcontext.__gregs[18]; + out->s3 = uc->uc_mcontext.__gregs[19]; + out->s4 = uc->uc_mcontext.__gregs[20]; + out->s5 = uc->uc_mcontext.__gregs[21]; + out->s6 = uc->uc_mcontext.__gregs[22]; + out->s7 = uc->uc_mcontext.__gregs[23]; + out->s8 = uc->uc_mcontext.__gregs[24]; + out->s9 = uc->uc_mcontext.__gregs[25]; + out->s10 = uc->uc_mcontext.__gregs[26]; + out->s11 = uc->uc_mcontext.__gregs[27]; + out->t3 = uc->uc_mcontext.__gregs[28]; + out->t4 = uc->uc_mcontext.__gregs[29]; + out->t5 = uc->uc_mcontext.__gregs[30]; + out->t6 = uc->uc_mcontext.__gregs[31]; + +# if __riscv_flen == 32 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) + out->float_save.regs[i] = uc->uc_mcontext.__fpregs.__f.__f[i]; + out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__f.__fcsr; +# elif __riscv_flen == 64 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) + out->float_save.regs[i] = uc->uc_mcontext.__fpregs.__d.__f[i]; + out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__d.__fcsr; +# elif __riscv_flen == 128 + for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) { + out->float_save.regs[i].high = uc->uc_mcontext.__fpregs.__q.__f[2*i]; + out->float_save.regs[i].low = uc->uc_mcontext.__fpregs.__q.__f[2*i+1]; + } + out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__q.__fcsr; +# endif +} #endif } // namespace google_breakpad diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 36de9be32..bbdb798b5 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -461,9 +461,6 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { sizeof(g_crash_context_.float_state)); } #elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE - // FP state is not part of user ABI on ARM Linux. - // In case of MIPS Linux FP state is already part of ucontext_t - // and 'float_state' is not a member of CrashContext. ucontext_t* uc_ptr = (ucontext_t*)uc; if (uc_ptr->uc_mcontext.fpregs) { memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, @@ -701,7 +698,6 @@ bool ExceptionHandler::WriteMinidump() { #endif #if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__) - // FPU state is not part of ARM EABI ucontext_t. memcpy(&context.float_state, context.context.uc_mcontext.fpregs, sizeof(context.float_state)); #endif @@ -725,8 +721,11 @@ bool ExceptionHandler::WriteMinidump() { #elif defined(__mips__) context.siginfo.si_addr = reinterpret_cast(context.context.uc_mcontext.pc); +#elif defined(__riscv) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.__gregs[REG_PC]); #else -#error "This code has not been ported to your platform yet." +# error "This code has not been ported to your platform yet." #endif return GenerateDump(&context); diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index 670415482..f8bc1ead7 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -43,7 +43,7 @@ #include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" -#if !defined(__ARM_EABI__) && !defined(__mips__) +#if !defined(__ARM_EABI__) && !defined(__mips__) && !defined(__riscv) // FP state is not part of user ABI for Linux ARM. // In case of MIPS and RISCV Linux FP state is already part of ucontext_t // so 'float_state' is not required. diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc index ea161b6dc..1f19d3bb6 100644 --- a/src/client/linux/microdump_writer/microdump_writer.cc +++ b/src/client/linux/microdump_writer/microdump_writer.cc @@ -335,9 +335,17 @@ class MicrodumpWriter { const char kArch[] = "mips64"; # else # error "This mips ABI is currently not supported (n32)" -#endif +# endif +#elif defined(__riscv) +# if __riscv_xlen == 32 + const char kArch[] = "riscv32"; +# elif __riscv_xlen == 64 + const char kArch[] = "riscv64"; +# else +# error "Unexpected __riscv_xlen" +# endif #else -#error "This code has not been ported to your platform yet" +# error "This code has not been ported to your platform yet" #endif LogAppend("O "); diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc index 9420e051e..2c507c1bf 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper.cc @@ -111,8 +111,11 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { #elif defined(__mips__) stack_pointer = reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); +#elif defined(__riscv) + stack_pointer = reinterpret_cast( + info->mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP]); #else -#error "This code hasn't been ported to your platform yet." +# error "This code hasn't been ported to your platform yet." #endif info->stack_pointer = reinterpret_cast(stack_pointer); return true; @@ -207,19 +210,22 @@ bool LinuxCoreDumper::EnumerateThreads() { info.tgid = status->pr_pgrp; info.ppid = status->pr_ppid; #if defined(__mips__) -#if defined(__ANDROID__) +# if defined(__ANDROID__) for (int i = EF_R0; i <= EF_R31; i++) info.mcontext.gregs[i - EF_R0] = status->pr_reg[i]; -#else // __ANDROID__ +# else // __ANDROID__ for (int i = EF_REG0; i <= EF_REG31; i++) info.mcontext.gregs[i - EF_REG0] = status->pr_reg[i]; -#endif // __ANDROID__ +# endif // __ANDROID__ info.mcontext.mdlo = status->pr_reg[EF_LO]; info.mcontext.mdhi = status->pr_reg[EF_HI]; info.mcontext.pc = status->pr_reg[EF_CP0_EPC]; -#else // __mips__ +#elif defined(__riscv) + memcpy(&info.mcontext.__gregs, status->pr_reg, + sizeof(info.mcontext.__gregs)); +#else // __riscv memcpy(&info.regs, status->pr_reg, sizeof(info.regs)); -#endif // __mips__ +#endif if (first_thread) { crash_thread_ = pid; crash_signal_ = status->pr_info.si_signo; diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h index db8f36eee..2d5b2e52b 100644 --- a/src/client/linux/minidump_writer/linux_dumper.h +++ b/src/client/linux/minidump_writer/linux_dumper.h @@ -59,10 +59,12 @@ namespace google_breakpad { // Typedef for our parsing of the auxv variables in /proc/pid/auxv. #if defined(__i386) || defined(__ARM_EABI__) || \ - (defined(__mips__) && _MIPS_SIM == _ABIO32) + (defined(__mips__) && _MIPS_SIM == _ABIO32) || \ + (defined(__riscv) && __riscv_xlen == 32) typedef Elf32_auxv_t elf_aux_entry; #elif defined(__x86_64) || defined(__aarch64__) || \ - (defined(__mips__) && _MIPS_SIM != _ABIO32) + (defined(__mips__) && _MIPS_SIM != _ABIO32) || \ + (defined(__riscv) && __riscv_xlen == 64) typedef Elf64_auxv_t elf_aux_entry; #endif diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc index 1cd86faf3..bc1e4fbef 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc @@ -50,6 +50,8 @@ #define TID_PTR_REGISTER "rcx" #elif defined(__mips__) #define TID_PTR_REGISTER "$1" +#elif defined(__riscv) +#define TID_PTR_REGISTER "x4" #else #error This test has not been ported to this platform. #endif diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc index 28d77b8ad..718fab7c5 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc @@ -297,8 +297,11 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { #elif defined(__mips__) stack_pointer = reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); +#elif defined(__riscv) + stack_pointer = reinterpret_cast( + info->mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP]); #else -#error "This code hasn't been ported to your platform yet." +# error "This code hasn't been ported to your platform yet." #endif info->stack_pointer = reinterpret_cast(stack_pointer); diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index 7e760e992..a8455165d 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -463,6 +463,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) { #elif defined(__mips__) pid_t* process_tid_location = reinterpret_cast(one_thread.mcontext.gregs[1]); +#elif defined(__riscv) + pid_t* process_tid_location = + reinterpret_cast(one_thread.mcontext.__gregs[4]); #else #error This test has not been ported to this platform. #endif @@ -560,6 +563,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) { uintptr_t heap_addr = thread_info.regs.rcx; #elif defined(__mips__) uintptr_t heap_addr = thread_info.mcontext.gregs[1]; +#elif defined(__riscv) + uintptr_t heap_addr = thread_info.mcontext.__gregs[4]; #else #error This test has not been ported to this platform. #endif diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index d722be946..a5f9b8416 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -1137,9 +1137,7 @@ class MinidumpWriter { sys_close(fd); cpus_present.IntersectWith(cpus_possible); - int cpu_count = cpus_present.GetCount(); - if (cpu_count > 255) - cpu_count = 255; + int cpu_count = std::min(255, cpus_present.GetCount()); sys_info->number_of_processors = static_cast(cpu_count); } } @@ -1255,6 +1253,59 @@ class MinidumpWriter { sys_close(fd); } + return true; + } +#elif defined(__riscv) + bool WriteCPUInformation(MDRawSystemInfo* sys_info) { + // processor_architecture should always be set, do this first +# if __riscv_xlen == 32 + sys_info->processor_architecture = MD_CPU_ARCHITECTURE_RISCV; +# elif __riscv_xlen == 64 + sys_info->processor_architecture = MD_CPU_ARCHITECTURE_RISCV64; +# else +# error "Unexpected __riscv_xlen" +# endif + + // /proc/cpuinfo is not readable under various sandboxed environments + // (e.g. Android services with the android:isolatedProcess attribute) + // prepare for this by setting default values now, which will be + // returned when this happens. + // + // Note: Bogus values are used to distinguish between failures (to + // read /sys and /proc files) and really badly configured kernels. + sys_info->number_of_processors = 0; + sys_info->processor_level = 0U; + sys_info->processor_revision = 42; + sys_info->cpu.other_cpu_info.processor_features[0] = 0; + sys_info->cpu.other_cpu_info.processor_features[1] = 0; + + // Counting the number of CPUs involves parsing two sysfs files, + // because the content of /proc/cpuinfo will only mirror the number + // of 'online' cores, and thus will vary with time. + // See http://www.kernel.org/doc/Documentation/cputopology.txt + { + CpuSet cpus_present; + CpuSet cpus_possible; + + int fd = sys_open("/sys/devices/system/cpu/present", + O_RDONLY | O_CLOEXEC, 0); + if (fd >= 0) { + cpus_present.ParseSysFile(fd); + sys_close(fd); + + fd = sys_open("/sys/devices/system/cpu/possible", + O_RDONLY | O_CLOEXEC, 0); + if (fd >= 0) { + cpus_possible.ParseSysFile(fd); + sys_close(fd); + + cpus_present.IntersectWith(cpus_possible); + int cpu_count = std::min(255, cpus_present.GetCount()); + sys_info->number_of_processors = static_cast(cpu_count); + } + } + } + return true; } #else diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index ab37a88b0..2601d29b6 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -716,6 +716,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) { #elif defined(__mips__) context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = invalid_stack_pointer; +#elif defined(__riscv) + context.context.uc_mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP] = + invalid_stack_pointer; #else # error "This code has not been ported to your platform yet." #endif diff --git a/src/common/linux/breakpad_getcontext.S b/src/common/linux/breakpad_getcontext.S index e261b302c..286047bf5 100644 --- a/src/common/linux/breakpad_getcontext.S +++ b/src/common/linux/breakpad_getcontext.S @@ -526,8 +526,102 @@ breakpad_getcontext: .cfi_endproc .size breakpad_getcontext, . - breakpad_getcontext +#elif defined(__riscv) + +# define SIG_BLOCK 0 +# define _NSIG8 8 +# define __NR_rt_sigprocmask 135 + + .text + .globl breakpad_getcontext + .type breakpad_getcontext, @function + .align 0 + .cfi_startproc +breakpad_getcontext: + REG_S ra, MCONTEXT_GREGS_PC(a0) + REG_S ra, MCONTEXT_GREGS_RA(a0) + REG_S sp, MCONTEXT_GREGS_SP(a0) + REG_S gp, MCONTEXT_GREGS_SP(a0) + REG_S tp, MCONTEXT_GREGS_TP(a0) + REG_S t0, MCONTEXT_GREGS_T0(a0) + REG_S t1, MCONTEXT_GREGS_T1(a0) + REG_S t2, MCONTEXT_GREGS_T2(a0) + REG_S s0, MCONTEXT_GREGS_S0(a0) + REG_S s1, MCONTEXT_GREGS_S1(a0) + REG_S a0, MCONTEXT_GREGS_A0(a0) + REG_S a1, MCONTEXT_GREGS_A1(a0) + REG_S a2, MCONTEXT_GREGS_A2(a0) + REG_S a3, MCONTEXT_GREGS_A3(a0) + REG_S a4, MCONTEXT_GREGS_A4(a0) + REG_S a5, MCONTEXT_GREGS_A5(a0) + REG_S a6, MCONTEXT_GREGS_A6(a0) + REG_S a7, MCONTEXT_GREGS_A7(a0) + REG_S s2, MCONTEXT_GREGS_S2(a0) + REG_S s3, MCONTEXT_GREGS_S3(a0) + REG_S s4, MCONTEXT_GREGS_S4(a0) + REG_S s5, MCONTEXT_GREGS_S5(a0) + REG_S s6, MCONTEXT_GREGS_S6(a0) + REG_S s7, MCONTEXT_GREGS_S7(a0) + REG_S s8, MCONTEXT_GREGS_S8(a0) + REG_S s9, MCONTEXT_GREGS_S9(a0) + REG_S s10, MCONTEXT_GREGS_S10(a0) + REG_S s11, MCONTEXT_GREGS_S11(a0) + REG_S t3, MCONTEXT_GREGS_T3(a0) + REG_S t4, MCONTEXT_GREGS_T4(a0) + REG_S t5, MCONTEXT_GREGS_T5(a0) + REG_S t6 , MCONTEXT_GREGS_T6(a0) +# ifndef __riscv_float_abi_soft + frsr a1 + + FREG_S ft0, MCONTEXT_FPREGS_FT0(a0) + FREG_S ft1, MCONTEXT_FPREGS_FT1(a0) + FREG_S ft2, MCONTEXT_FPREGS_FT2(a0) + FREG_S ft3, MCONTEXT_FPREGS_FT3(a0) + FREG_S ft4, MCONTEXT_FPREGS_FT4(a0) + FREG_S ft5, MCONTEXT_FPREGS_FT5(a0) + FREG_S ft6, MCONTEXT_FPREGS_FT6(a0) + FREG_S ft7, MCONTEXT_FPREGS_FT7(a0) + FREG_S fs0, MCONTEXT_FPREGS_FS0(a0) + FREG_S fs1, MCONTEXT_FPREGS_FS1(a0) + FREG_S fa0, MCONTEXT_FPREGS_FA0(a0) + FREG_S fa1, MCONTEXT_FPREGS_FA1(a0) + FREG_S fa2, MCONTEXT_FPREGS_FA2(a0) + FREG_S fa3, MCONTEXT_FPREGS_FA3(a0) + FREG_S fa4, MCONTEXT_FPREGS_FA4(a0) + FREG_S fa5, MCONTEXT_FPREGS_FA5(a0) + FREG_S fa6, MCONTEXT_FPREGS_FA6(a0) + FREG_S fa7, MCONTEXT_FPREGS_FA7(a0) + FREG_S fs2, MCONTEXT_FPREGS_FS2(a0) + FREG_S fs3, MCONTEXT_FPREGS_FS3(a0) + FREG_S fs4, MCONTEXT_FPREGS_FS4(a0) + FREG_S fs5, MCONTEXT_FPREGS_FS5(a0) + FREG_S fs6, MCONTEXT_FPREGS_FS6(a0) + FREG_S fs7, MCONTEXT_FPREGS_FS7(a0) + FREG_S fs8, MCONTEXT_FPREGS_FS8(a0) + FREG_S fs9, MCONTEXT_FPREGS_FS9(a0) + FREG_S fs10, MCONTEXT_FPREGS_FS10(a0) + FREG_S fs11, MCONTEXT_FPREGS_FS11(a0) + FREG_S ft8, MCONTEXT_FPREGS_FT8(a0) + FREG_S ft9, MCONTEXT_FPREGS_FT9(a0) + FREG_S ft10, MCONTEXT_FPREGS_FT10(a0) + FREG_S ft11, MCONTEXT_FPREGS_FT11(a0) + + sw a1, MCONTEXT_FPC_CSR(a0) +# endif // __riscv_float_abi_soft + mv a1, zero + add a2, a0, UCONTEXT_SIGMASK_OFFSET + li a3, _NSIG8 + mv a0, zero + li a7, __NR_rt_sigprocmask + ecall + mv a0, zero + ret + + .cfi_endproc + .size breakpad_getcontext, . - breakpad_getcontext + #else -#error "This file has not been ported for your CPU!" +# error "This file has not been ported for your CPU!" #endif #if defined(__aarch64__) diff --git a/src/common/linux/breakpad_getcontext_unittest.cc b/src/common/linux/breakpad_getcontext_unittest.cc index 9d869f7e5..573ddd88c 100644 --- a/src/common/linux/breakpad_getcontext_unittest.cc +++ b/src/common/linux/breakpad_getcontext_unittest.cc @@ -113,6 +113,25 @@ TEST(AndroidUContext, GRegsOffset) { ASSERT_EQ(static_cast(MCONTEXT_FPC_CSR), offsetof(ucontext_t,uc_mcontext.fpc_csr)); +#elif defined(__riscv) + ASSERT_EQ(static_cast(MCONTEXT_GREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.__gregs[0])); + +#define CHECK_REG(x) \ + ASSERT_EQ(static_cast(MCONTEXT_##x##_OFFSET), \ + offsetof(ucontext_t,uc_mcontext.__gregs[REG_##x])) + CHECK_REG(PC) + CHECK_REG(RA) + CHECK_REG(SP) + CHECK_REG(S0) + CHECK_REG(S1) + CHECK_REG(S2) + + ASSERT_EQ(static_cast(MCONTEXT_FPREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.__fpregs)); + + ASSERT_EQ(static_cast(MCONTEXT_FPC_CSR), + offsetof(ucontext_t,uc_mcontext.__fpregs.__fcsr)); #elif defined(__x86_64__) COMPILE_ASSERT_EQ(static_cast(MCONTEXT_GREGS_OFFSET), diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc index 9c2c0ad2a..7e4446070 100644 --- a/src/common/linux/memory_mapped_file.cc +++ b/src/common/linux/memory_mapped_file.cc @@ -64,7 +64,8 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) { } #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__mips__) && _MIPS_SIM == _ABI64) + (defined(__mips__) && _MIPS_SIM == _ABI64) || \ + (defined(__riscv) && __riscv_xlen == 64) struct kernel_stat st; if (sys_fstat(fd, &st) == -1 || st.st_size < 0) { diff --git a/src/common/linux/ucontext_constants.h b/src/common/linux/ucontext_constants.h index 4218bb232..3dcdecb08 100644 --- a/src/common/linux/ucontext_constants.h +++ b/src/common/linux/ucontext_constants.h @@ -145,8 +145,107 @@ #endif #define FPREGS_OFFSET_MXCSR 24 +#elif defined(__riscv) + +#if __riscv_xlen == 32 +#define UCONTEXT_SIGMASK_OFFSET 20 +#define MCONTEXT_GREGS_OFFSET 148 +#define MCONTEXT_GREGS_SIZE 4 +#define REG_S sw +#elif __riscv_xlen == 64 +#define UCONTEXT_SIGMASK_OFFSET 40 +#define MCONTEXT_GREGS_OFFSET 168 +#define MCONTEXT_GREGS_SIZE 8 +#define REG_S sd #else -#error "This header has not been ported for your CPU" +#error "Unexpected __riscv_xlen" +#endif + +#define MCONTEXT_GREGS_PC MCONTEXT_GREGS_OFFSET + 0*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_RA MCONTEXT_GREGS_OFFSET + 1*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_SP MCONTEXT_GREGS_OFFSET + 2*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_GP MCONTEXT_GREGS_OFFSET + 3*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_TP MCONTEXT_GREGS_OFFSET + 4*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T0 MCONTEXT_GREGS_OFFSET + 5*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T1 MCONTEXT_GREGS_OFFSET + 6*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T2 MCONTEXT_GREGS_OFFSET + 7*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S0 MCONTEXT_GREGS_OFFSET + 8*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S1 MCONTEXT_GREGS_OFFSET + 9*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A0 MCONTEXT_GREGS_OFFSET + 10*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A1 MCONTEXT_GREGS_OFFSET + 11*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A2 MCONTEXT_GREGS_OFFSET + 12*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A3 MCONTEXT_GREGS_OFFSET + 13*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A4 MCONTEXT_GREGS_OFFSET + 14*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A5 MCONTEXT_GREGS_OFFSET + 15*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A6 MCONTEXT_GREGS_OFFSET + 16*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_A7 MCONTEXT_GREGS_OFFSET + 17*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S2 MCONTEXT_GREGS_OFFSET + 18*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S3 MCONTEXT_GREGS_OFFSET + 19*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S4 MCONTEXT_GREGS_OFFSET + 20*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S5 MCONTEXT_GREGS_OFFSET + 21*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S6 MCONTEXT_GREGS_OFFSET + 22*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S7 MCONTEXT_GREGS_OFFSET + 23*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S8 MCONTEXT_GREGS_OFFSET + 24*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S9 MCONTEXT_GREGS_OFFSET + 25*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S10 MCONTEXT_GREGS_OFFSET + 26*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_S11 MCONTEXT_GREGS_OFFSET + 27*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T3 MCONTEXT_GREGS_OFFSET + 28*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T4 MCONTEXT_GREGS_OFFSET + 29*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T5 MCONTEXT_GREGS_OFFSET + 30*MCONTEXT_GREGS_SIZE +#define MCONTEXT_GREGS_T6 MCONTEXT_GREGS_OFFSET + 31*MCONTEXT_GREGS_SIZE + +#define MCONTEXT_FPREGS_OFFSET MCONTEXT_GREGS_OFFSET + 32*MCONTEXT_GREGS_SIZE + +#if __riscv_flen == 32 +#define MCONTEXT_FPREGS_SIZE 4 +#define FREG_S fsw +#elif __riscv_flen == 64 +#define MCONTEXT_FPREGS_SIZE 8 +#define FREG_S fsd +#elif __riscv_flen == 128 +#define MCONTEXT_FPREGS_SIZE 16 +#define FREG_S fsq +#else +#error "Unexpected __riscv_flen" +#endif + +#define MCONTEXT_FPREGS_FT0 MCONTEXT_FPREGS_OFFSET + 0*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT1 MCONTEXT_FPREGS_OFFSET + 1*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT2 MCONTEXT_FPREGS_OFFSET + 2*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT3 MCONTEXT_FPREGS_OFFSET + 3*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT4 MCONTEXT_FPREGS_OFFSET + 4*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT5 MCONTEXT_FPREGS_OFFSET + 5*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT6 MCONTEXT_FPREGS_OFFSET + 6*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT7 MCONTEXT_FPREGS_OFFSET + 7*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS0 MCONTEXT_FPREGS_OFFSET + 8*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS1 MCONTEXT_FPREGS_OFFSET + 9*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA0 MCONTEXT_FPREGS_OFFSET + 10*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA1 MCONTEXT_FPREGS_OFFSET + 11*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA2 MCONTEXT_FPREGS_OFFSET + 12*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA3 MCONTEXT_FPREGS_OFFSET + 13*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA4 MCONTEXT_FPREGS_OFFSET + 14*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA5 MCONTEXT_FPREGS_OFFSET + 15*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA6 MCONTEXT_FPREGS_OFFSET + 16*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FA7 MCONTEXT_FPREGS_OFFSET + 17*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS2 MCONTEXT_FPREGS_OFFSET + 18*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS3 MCONTEXT_FPREGS_OFFSET + 19*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS4 MCONTEXT_FPREGS_OFFSET + 20*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS5 MCONTEXT_FPREGS_OFFSET + 21*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS6 MCONTEXT_FPREGS_OFFSET + 22*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS7 MCONTEXT_FPREGS_OFFSET + 23*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS8 MCONTEXT_FPREGS_OFFSET + 24*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS9 MCONTEXT_FPREGS_OFFSET + 25*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS10 MCONTEXT_FPREGS_OFFSET + 26*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FS11 MCONTEXT_FPREGS_OFFSET + 27*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT8 MCONTEXT_FPREGS_OFFSET + 28*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT9 MCONTEXT_FPREGS_OFFSET + 29*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT10 MCONTEXT_FPREGS_OFFSET + 30*MCONTEXT_FPREGS_SIZE +#define MCONTEXT_FPREGS_FT11 MCONTEXT_FPREGS_OFFSET + 31*MCONTEXT_FPREGS_SIZE + +#define MCONTEXT_FPC_CSR MCONTEXT_FPREGS_OFFSET + 32*MCONTEXT_FPREGS_SIZE + +#else +# error "This header has not been ported for your CPU" #endif #endif // GOOGLEBREAKPAD_COMMON_ANDROID_UCONTEXT_CONSTANTS_H diff --git a/src/google_breakpad/common/minidump_cpu_riscv.h b/src/google_breakpad/common/minidump_cpu_riscv.h new file mode 100644 index 000000000..94d061175 --- /dev/null +++ b/src/google_breakpad/common/minidump_cpu_riscv.h @@ -0,0 +1,168 @@ +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on RISCV and RISCV64. These files may be read on any platform + * provided that the alignments of these structures on the processing system + * are identical to the alignments of these structures on the producing + * system. For this reason, precise-sized types are used. The structures + * defined by this file have been laid out to minimize alignment problems by + * ensuring that all members are aligned on their natural boundaries. + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. + * + * Author: Iacopo Colonnelli + */ + +/* + * RISCV and RISCV64 support + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_RISCV_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_RISCV_H__ + +#include "google_breakpad/common/breakpad_types.h" + +#define MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT 32 +#if defined(__riscv) +# if __riscv_flen == 32 +typedef uint32_t riscv_fpr_size; +# elif __riscv_flen == 64 +typedef uint64_t riscv_fpr_size; +# elif __riscv_flen == 128 +typedef uint128_struct riscv_fpr_size; +# else +# error "Unexpected __riscv_flen" +# endif +#else +typedef uint32_t riscv_fpr_size; +#endif + +#define MD_CONTEXT_RISCV_GPR_COUNT 32 + +typedef struct { + /* 32 floating point registers, f0 .. f31. */ + riscv_fpr_size regs[MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT]; + uint32_t fpcsr; +} MDFloatingSaveAreaRISCV; + +enum MDRISCVRegisterNumbers { + MD_CONTEXT_RISCV_REG_PC = 0, + MD_CONTEXT_RISCV_REG_RA = 1, + MD_CONTEXT_RISCV_REG_SP = 2, +}; + +/* For (MDRawContextRISCV).context_flags. These values indicate the type of + * context stored in the structure. */ +#define MD_CONTEXT_RISCV 0x00800000 +#define MD_CONTEXT_RISCV_INTEGER (MD_CONTEXT_RISCV | 0x00000001) +#define MD_CONTEXT_RISCV_FLOATING_POINT (MD_CONTEXT_RISCV | 0x00000004) +#define MD_CONTEXT_RISCV_FULL (MD_CONTEXT_RISCV_INTEGER | \ + MD_CONTEXT_RISCV_FLOATING_POINT) + +typedef struct { + /* Determines which fields of this struct are populated */ + uint32_t context_flags; + + uint32_t pc; + uint32_t ra; + uint32_t sp; + uint32_t gp; + uint32_t tp; + uint32_t t0; + uint32_t t1; + uint32_t t2; + uint32_t s0; + uint32_t s1; + uint32_t a0; + uint32_t a1; + uint32_t a2; + uint32_t a3; + uint32_t a4; + uint32_t a5; + uint32_t a6; + uint32_t a7; + uint32_t s2; + uint32_t s3; + uint32_t s4; + uint32_t s5; + uint32_t s6; + uint32_t s7; + uint32_t s8; + uint32_t s9; + uint32_t s10; + uint32_t s11; + uint32_t t3; + uint32_t t4; + uint32_t t5; + uint32_t t6; + + MDFloatingSaveAreaRISCV float_save; +} MDRawContextRISCV; + +/* For (MDRawContextRISCV64).context_flags. These values indicate the type of + * context stored in the structure. */ +#define MD_CONTEXT_RISCV64 0x08000000 +#define MD_CONTEXT_RISCV64_INTEGER (MD_CONTEXT_RISCV64 | 0x00000001) +#define MD_CONTEXT_RISCV64_FLOATING_POINT (MD_CONTEXT_RISCV64 | 0x00000004) +#define MD_CONTEXT_RISCV64_FULL (MD_CONTEXT_RISCV64_INTEGER | \ + MD_CONTEXT_RISCV64_FLOATING_POINT) + +typedef struct { + /* Determines which fields of this struct are populated */ + uint32_t context_flags; + + uint64_t pc; + uint64_t ra; + uint64_t sp; + uint64_t gp; + uint64_t tp; + uint64_t t0; + uint64_t t1; + uint64_t t2; + uint64_t s0; + uint64_t s1; + uint64_t a0; + uint64_t a1; + uint64_t a2; + uint64_t a3; + uint64_t a4; + uint64_t a5; + uint64_t a6; + uint64_t a7; + uint64_t s2; + uint64_t s3; + uint64_t s4; + uint64_t s5; + uint64_t s6; + uint64_t s7; + uint64_t s8; + uint64_t s9; + uint64_t s10; + uint64_t s11; + uint64_t t3; + uint64_t t4; + uint64_t t5; + uint64_t t6; + + MDFloatingSaveAreaRISCV float_save; +} MDRawContextRISCV64; + + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_RISCV_H__ */ diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 3e86f7c8a..9edead934 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -117,6 +117,7 @@ typedef struct { #include "minidump_cpu_mips.h" #include "minidump_cpu_ppc.h" #include "minidump_cpu_ppc64.h" +#include "minidump_cpu_riscv.h" #include "minidump_cpu_sparc.h" #include "minidump_cpu_x86.h" @@ -683,6 +684,8 @@ typedef enum { MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */ MD_CPU_ARCHITECTURE_ARM64_OLD = 0x8003, /* Breakpad-defined value for ARM64 */ MD_CPU_ARCHITECTURE_MIPS64 = 0x8004, /* Breakpad-defined value for MIPS64 */ + MD_CPU_ARCHITECTURE_RISCV = 0x8005, /* Breakpad-defined value for RISCV */ + MD_CPU_ARCHITECTURE_RISCV64 = 0x8006, /* Breakpad-defined value for RISCV64 */ MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */ } MDCPUArchitecture; diff --git a/src/google_breakpad/processor/dump_context.h b/src/google_breakpad/processor/dump_context.h index 90f066b89..7a1c643e2 100644 --- a/src/google_breakpad/processor/dump_context.h +++ b/src/google_breakpad/processor/dump_context.h @@ -53,14 +53,16 @@ class DumpContext : public DumpObject { // Returns raw CPU-specific context data for the named CPU type. If the // context data does not match the CPU type or does not exist, returns NULL. - const MDRawContextAMD64* GetContextAMD64() const; - const MDRawContextARM* GetContextARM() const; - const MDRawContextARM64* GetContextARM64() const; - const MDRawContextMIPS* GetContextMIPS() const; - const MDRawContextPPC* GetContextPPC() const; - const MDRawContextPPC64* GetContextPPC64() const; - const MDRawContextSPARC* GetContextSPARC() const; - const MDRawContextX86* GetContextX86() const; + const MDRawContextAMD64* GetContextAMD64() const; + const MDRawContextARM* GetContextARM() const; + const MDRawContextARM64* GetContextARM64() const; + const MDRawContextMIPS* GetContextMIPS() const; + const MDRawContextPPC* GetContextPPC() const; + const MDRawContextPPC64* GetContextPPC64() const; + const MDRawContextSPARC* GetContextSPARC() const; + const MDRawContextX86* GetContextX86() const; + const MDRawContextRISCV* GetContextRISCV() const; + const MDRawContextRISCV64* GetContextRISCV64() const; // A convenience method to get the instruction pointer out of the // MDRawContext, since it varies per-CPU architecture. @@ -86,6 +88,8 @@ class DumpContext : public DumpObject { void SetContextARM(MDRawContextARM* arm); void SetContextARM64(MDRawContextARM64* arm64); void SetContextMIPS(MDRawContextMIPS* ctx_mips); + void SetContextRISCV(MDRawContextRISCV* riscv); + void SetContextRISCV64(MDRawContextRISCV64* riscv64); // Free the CPU-specific context structure. void FreeContext(); @@ -93,17 +97,19 @@ class DumpContext : public DumpObject { private: // The CPU-specific context structure. union { - MDRawContextBase* base; - MDRawContextX86* x86; - MDRawContextPPC* ppc; - MDRawContextPPC64* ppc64; - MDRawContextAMD64* amd64; + MDRawContextBase* base; + MDRawContextX86* x86; + MDRawContextPPC* ppc; + MDRawContextPPC64* ppc64; + MDRawContextAMD64* amd64; // on Solaris SPARC, sparc is defined as a numeric constant, // so variables can NOT be named as sparc - MDRawContextSPARC* ctx_sparc; - MDRawContextARM* arm; - MDRawContextARM64* arm64; - MDRawContextMIPS* ctx_mips; + MDRawContextSPARC* ctx_sparc; + MDRawContextARM* arm; + MDRawContextARM64* arm64; + MDRawContextMIPS* ctx_mips; + MDRawContextRISCV* riscv; + MDRawContextRISCV64* riscv64; } context_; // Store this separately because of the weirdo AMD64 context diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h index 363913bf6..91f1d0cb1 100644 --- a/src/google_breakpad/processor/stack_frame_cpu.h +++ b/src/google_breakpad/processor/stack_frame_cpu.h @@ -402,6 +402,118 @@ struct StackFrameMIPS : public StackFrame { int context_validity; }; +struct StackFrameRISCV : public StackFrame { + + enum ContextValidity { + CONTEXT_VALID_NONE = 0, + CONTEXT_VALID_PC = 1 << 0, + CONTEXT_VALID_RA = 1 << 1, + CONTEXT_VALID_SP = 1 << 2, + CONTEXT_VALID_GP = 1 << 3, + CONTEXT_VALID_TP = 1 << 4, + CONTEXT_VALID_T0 = 1 << 5, + CONTEXT_VALID_T1 = 1 << 6, + CONTEXT_VALID_T2 = 1 << 7, + CONTEXT_VALID_S0 = 1 << 8, + CONTEXT_VALID_S1 = 1 << 9, + CONTEXT_VALID_A0 = 1 << 10, + CONTEXT_VALID_A1 = 1 << 11, + CONTEXT_VALID_A2 = 1 << 12, + CONTEXT_VALID_A3 = 1 << 13, + CONTEXT_VALID_A4 = 1 << 14, + CONTEXT_VALID_A5 = 1 << 15, + CONTEXT_VALID_A6 = 1 << 16, + CONTEXT_VALID_A7 = 1 << 17, + CONTEXT_VALID_S2 = 1 << 18, + CONTEXT_VALID_S3 = 1 << 19, + CONTEXT_VALID_S4 = 1 << 20, + CONTEXT_VALID_S5 = 1 << 21, + CONTEXT_VALID_S6 = 1 << 22, + CONTEXT_VALID_S7 = 1 << 23, + CONTEXT_VALID_S8 = 1 << 24, + CONTEXT_VALID_S9 = 1 << 25, + CONTEXT_VALID_S10 = 1 << 26, + CONTEXT_VALID_S11 = 1 << 27, + CONTEXT_VALID_T3 = 1 << 28, + CONTEXT_VALID_T4 = 1 << 29, + CONTEXT_VALID_T5 = 1 << 30, + CONTEXT_VALID_T6 = 1 << 31, + CONTEXT_VALID_ALL = ~CONTEXT_VALID_NONE + }; + + StackFrameRISCV() : context(), context_validity(CONTEXT_VALID_NONE) {} + + // Register state. This is only fully valid for the topmost frame in a + // stack. In other frames, which registers are present depends on what + // debugging information were available. Refer to 'context_validity' below. + MDRawContextRISCV context; + + // For each register in context whose value has been recovered, + // the corresponding CONTEXT_VALID_ bit in 'context_validity' is set. + // + // context_validity's type should actually be ContextValidity, but + // type int is used instead because the bitwise inclusive or operator + // yields an int when applied to enum values, and C++ doesn't + // silently convert from ints to enums. + int context_validity; +}; + +struct StackFrameRISCV64 : public StackFrame { + + enum ContextValidity { + CONTEXT_VALID_NONE = 0, + CONTEXT_VALID_PC = 1 << 0, + CONTEXT_VALID_RA = 1 << 1, + CONTEXT_VALID_SP = 1 << 2, + CONTEXT_VALID_GP = 1 << 3, + CONTEXT_VALID_TP = 1 << 4, + CONTEXT_VALID_T0 = 1 << 5, + CONTEXT_VALID_T1 = 1 << 6, + CONTEXT_VALID_T2 = 1 << 7, + CONTEXT_VALID_S0 = 1 << 8, + CONTEXT_VALID_S1 = 1 << 9, + CONTEXT_VALID_A0 = 1 << 10, + CONTEXT_VALID_A1 = 1 << 11, + CONTEXT_VALID_A2 = 1 << 12, + CONTEXT_VALID_A3 = 1 << 13, + CONTEXT_VALID_A4 = 1 << 14, + CONTEXT_VALID_A5 = 1 << 15, + CONTEXT_VALID_A6 = 1 << 16, + CONTEXT_VALID_A7 = 1 << 17, + CONTEXT_VALID_S2 = 1 << 18, + CONTEXT_VALID_S3 = 1 << 19, + CONTEXT_VALID_S4 = 1 << 20, + CONTEXT_VALID_S5 = 1 << 21, + CONTEXT_VALID_S6 = 1 << 22, + CONTEXT_VALID_S7 = 1 << 23, + CONTEXT_VALID_S8 = 1 << 24, + CONTEXT_VALID_S9 = 1 << 25, + CONTEXT_VALID_S10 = 1 << 26, + CONTEXT_VALID_S11 = 1 << 27, + CONTEXT_VALID_T3 = 1 << 28, + CONTEXT_VALID_T4 = 1 << 29, + CONTEXT_VALID_T5 = 1 << 30, + CONTEXT_VALID_T6 = 1 << 31, + CONTEXT_VALID_ALL = ~CONTEXT_VALID_NONE + }; + + StackFrameRISCV64() : context(), context_validity(CONTEXT_VALID_NONE) {} + + // Register state. This is only fully valid for the topmost frame in a + // stack. In other frames, which registers are present depends on what + // debugging information were available. Refer to 'context_validity' below. + MDRawContextRISCV64 context; + + // For each register in context whose value has been recovered, + // the corresponding CONTEXT_VALID_ bit in 'context_validity' is set. + // + // context_validity's type should actually be ContextValidity, but + // type int is used instead because the bitwise inclusive or operator + // yields an int when applied to enum values, and C++ doesn't + // silently convert from ints to enums. + int context_validity; +}; + } // namespace google_breakpad #endif // GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_CPU_H__ diff --git a/src/processor/dump_context.cc b/src/processor/dump_context.cc index 70798d1e8..a8ab00840 100644 --- a/src/processor/dump_context.cc +++ b/src/processor/dump_context.cc @@ -139,6 +139,24 @@ const MDRawContextMIPS* DumpContext::GetContextMIPS() const { return context_.ctx_mips; } +const MDRawContextRISCV* DumpContext::GetContextRISCV() const { + if (GetContextCPU() != MD_CONTEXT_RISCV) { + BPLOG(ERROR) << "DumpContext cannot get RISCV context"; + return NULL; + } + + return context_.riscv; +} + +const MDRawContextRISCV64* DumpContext::GetContextRISCV64() const { + if (GetContextCPU() != MD_CONTEXT_RISCV64) { + BPLOG(ERROR) << "DumpContext cannot get RISCV64 context"; + return NULL; + } + + return context_.riscv64; +} + bool DumpContext::GetInstructionPointer(uint64_t* ip) const { BPLOG_IF(ERROR, !ip) << "DumpContext::GetInstructionPointer requires |ip|"; assert(ip); @@ -175,6 +193,12 @@ bool DumpContext::GetInstructionPointer(uint64_t* ip) const { case MD_CONTEXT_MIPS64: *ip = GetContextMIPS()->epc; break; + case MD_CONTEXT_RISCV: + *ip = GetContextRISCV()->pc; + break; + case MD_CONTEXT_RISCV64: + *ip = GetContextRISCV64()->pc; + break; default: // This should never happen. BPLOG(ERROR) << "Unknown CPU architecture in GetInstructionPointer"; @@ -219,6 +243,12 @@ bool DumpContext::GetStackPointer(uint64_t* sp) const { case MD_CONTEXT_MIPS64: *sp = GetContextMIPS()->iregs[MD_CONTEXT_MIPS_REG_SP]; break; + case MD_CONTEXT_RISCV: + *sp = GetContextRISCV()->sp; + break; + case MD_CONTEXT_RISCV64: + *sp = GetContextRISCV64()->sp; + break; default: // This should never happen. BPLOG(ERROR) << "Unknown CPU architecture in GetStackPointer"; @@ -263,6 +293,14 @@ void DumpContext::SetContextMIPS(MDRawContextMIPS* ctx_mips) { context_.ctx_mips = ctx_mips; } +void DumpContext::SetContextRISCV(MDRawContextRISCV* riscv) { + context_.riscv = riscv; +} + +void DumpContext::SetContextRISCV64(MDRawContextRISCV64* riscv64) { + context_.riscv64 = riscv64; +} + void DumpContext::FreeContext() { switch (GetContextCPU()) { case MD_CONTEXT_X86: @@ -298,6 +336,14 @@ void DumpContext::FreeContext() { delete context_.ctx_mips; break; + case MD_CONTEXT_RISCV: + delete context_.riscv; + break; + + case MD_CONTEXT_RISCV64: + delete context_.riscv64; + break; + default: // There is no context record (valid_ is false) or there's a // context record for an unknown CPU (shouldn't happen, only known @@ -654,6 +700,195 @@ void DumpContext::Print() { break; } + case MD_CONTEXT_RISCV: { + const MDRawContextRISCV* context_riscv = GetContextRISCV(); + printf("MDRawContextRISCV\n"); + printf(" context_flags = 0x%x\n", + context_riscv->context_flags); + + printf(" pc = 0x%" PRIx32 "\n", + context_riscv->pc); + printf(" ra = 0x%" PRIx32 "\n", + context_riscv->ra); + printf(" sp = 0x%" PRIx32 "\n", + context_riscv->sp); + printf(" gp = 0x%" PRIx32 "\n", + context_riscv->gp); + printf(" tp = 0x%" PRIx32 "\n", + context_riscv->tp); + printf(" t0 = 0x%" PRIx32 "\n", + context_riscv->t0); + printf(" t1 = 0x%" PRIx32 "\n", + context_riscv->t1); + printf(" t2 = 0x%" PRIx32 "\n", + context_riscv->t2); + printf(" s0 = 0x%" PRIx32 "\n", + context_riscv->s0); + printf(" s1 = 0x%" PRIx32 "\n", + context_riscv->s1); + printf(" a0 = 0x%" PRIx32 "\n", + context_riscv->a0); + printf(" a1 = 0x%" PRIx32 "\n", + context_riscv->a1); + printf(" a2 = 0x%" PRIx32 "\n", + context_riscv->a2); + printf(" a3 = 0x%" PRIx32 "\n", + context_riscv->a3); + printf(" a4 = 0x%" PRIx32 "\n", + context_riscv->a4); + printf(" a5 = 0x%" PRIx32 "\n", + context_riscv->a5); + printf(" a6 = 0x%" PRIx32 "\n", + context_riscv->a6); + printf(" a7 = 0x%" PRIx32 "\n", + context_riscv->a7); + printf(" s2 = 0x%" PRIx32 "\n", + context_riscv->s2); + printf(" s3 = 0x%" PRIx32 "\n", + context_riscv->s3); + printf(" s4 = 0x%" PRIx32 "\n", + context_riscv->s4); + printf(" s5 = 0x%" PRIx32 "\n", + context_riscv->s5); + printf(" s6 = 0x%" PRIx32 "\n", + context_riscv->s6); + printf(" s7 = 0x%" PRIx32 "\n", + context_riscv->s7); + printf(" s8 = 0x%" PRIx32 "\n", + context_riscv->s8); + printf(" s9 = 0x%" PRIx32 "\n", + context_riscv->s9); + printf(" s10 = 0x%" PRIx32 "\n", + context_riscv->s10); + printf(" s11 = 0x%" PRIx32 "\n", + context_riscv->s11); + printf(" t3 = 0x%" PRIx32 "\n", + context_riscv->t3); + printf(" t4 = 0x%" PRIx32 "\n", + context_riscv->t4); + printf(" t5 = 0x%" PRIx32 "\n", + context_riscv->t5); + printf(" t6 = 0x%" PRIx32 "\n", + context_riscv->t6); + +#if defined(__riscv) + for (unsigned int freg_index = 0; + freg_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; ++freg_index) { + riscv_fpr_size fp_value = context_riscv->float_save.regs[freg_index]; +# if __riscv_flen == 32 + printf(" float_save.regs[%2d] = 0x%" PRIx32 "\n", + freg_index, fp_value); +# elif __riscv_flen == 64 + printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n", + freg_index, fp_value); +# elif __riscv_flen == 128 + printf(" float_save.regs[%2d] = 0x%" PRIx64 "%" PRIx64 "\n", + freg_index, fp_value.high, fp_value.low); +# else +# error "Unexpected __riscv_flen" +# endif + } + printf(" float_save.fpcsr = 0x%" PRIx32 "\n", + context_riscv->float_save.fpcsr); +#endif + break; + } + + case MD_CONTEXT_RISCV64: { + const MDRawContextRISCV64* context_riscv64 = GetContextRISCV64(); + printf("MDRawContextRISCV64\n"); + printf(" context_flags = 0x%x\n", + context_riscv64->context_flags); + + printf(" pc = 0x%" PRIx64 "\n", + context_riscv64->pc); + printf(" ra = 0x%" PRIx64 "\n", + context_riscv64->ra); + printf(" sp = 0x%" PRIx64 "\n", + context_riscv64->sp); + printf(" gp = 0x%" PRIx64 "\n", + context_riscv64->gp); + printf(" tp = 0x%" PRIx64 "\n", + context_riscv64->tp); + printf(" t0 = 0x%" PRIx64 "\n", + context_riscv64->t0); + printf(" t1 = 0x%" PRIx64 "\n", + context_riscv64->t1); + printf(" t2 = 0x%" PRIx64 "\n", + context_riscv64->t2); + printf(" s0 = 0x%" PRIx64 "\n", + context_riscv64->s0); + printf(" s1 = 0x%" PRIx64 "\n", + context_riscv64->s1); + printf(" a0 = 0x%" PRIx64 "\n", + context_riscv64->a0); + printf(" a1 = 0x%" PRIx64 "\n", + context_riscv64->a1); + printf(" a2 = 0x%" PRIx64 "\n", + context_riscv64->a2); + printf(" a3 = 0x%" PRIx64 "\n", + context_riscv64->a3); + printf(" a4 = 0x%" PRIx64 "\n", + context_riscv64->a4); + printf(" a5 = 0x%" PRIx64 "\n", + context_riscv64->a5); + printf(" a6 = 0x%" PRIx64 "\n", + context_riscv64->a6); + printf(" a7 = 0x%" PRIx64 "\n", + context_riscv64->a7); + printf(" s2 = 0x%" PRIx64 "\n", + context_riscv64->s2); + printf(" s3 = 0x%" PRIx64 "\n", + context_riscv64->s3); + printf(" s4 = 0x%" PRIx64 "\n", + context_riscv64->s4); + printf(" s5 = 0x%" PRIx64 "\n", + context_riscv64->s5); + printf(" s6 = 0x%" PRIx64 "\n", + context_riscv64->s6); + printf(" s7 = 0x%" PRIx64 "\n", + context_riscv64->s7); + printf(" s8 = 0x%" PRIx64 "\n", + context_riscv64->s8); + printf(" s9 = 0x%" PRIx64 "\n", + context_riscv64->s9); + printf(" s10 = 0x%" PRIx64 "\n", + context_riscv64->s10); + printf(" s11 = 0x%" PRIx64 "\n", + context_riscv64->s11); + printf(" t3 = 0x%" PRIx64 "\n", + context_riscv64->t3); + printf(" t4 = 0x%" PRIx64 "\n", + context_riscv64->t4); + printf(" t5 = 0x%" PRIx64 "\n", + context_riscv64->t5); + printf(" t6 = 0x%" PRIx64 "\n", + context_riscv64->t6); + +#if defined(__riscv) + for (unsigned int freg_index = 0; + freg_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; ++freg_index) { + riscv_fpr_size fp_value = context_riscv64->float_save.regs[freg_index]; +# if __riscv_flen == 32 + printf(" float_save.regs[%2d] = 0x%" PRIx32 "\n", + freg_index, fp_value); +# elif __riscv_flen == 64 + printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n", + freg_index, fp_value); +# elif __riscv_flen == 128 + printf(" float_save.regs[%2d] = 0x%" + PRIx64 "%" PRIx64 "\n", + freg_index, fp_value.high, fp_value.low); +# else +# error "Unexpected __riscv_flen" +# endif + } + printf(" float_save.fpcsr = 0x%" PRIx32 "\n", + context_riscv64->float_save.fpcsr); +#endif + break; + } + default: { break; } diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index d9e3e3232..d56db98e9 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -95,6 +95,10 @@ bool IsContextSizeUnique(uint32_t context_size) { num_matching_contexts++; if (context_size == sizeof(MDRawContextMIPS)) num_matching_contexts++; + if (context_size == sizeof(MDRawContextRISCV)) + num_matching_contexts++; + if (context_size == sizeof(MDRawContextRISCV64)) + num_matching_contexts++; return num_matching_contexts == 1; } @@ -1169,6 +1173,163 @@ bool MinidumpContext::Read(uint32_t expected_size) { break; } + case MD_CONTEXT_RISCV: { + if (expected_size != sizeof(MDRawContextRISCV)) { + BPLOG(ERROR) << "MinidumpContext RISCV size mismatch, " + << expected_size + << " != " + << sizeof(MDRawContextRISCV); + return false; + } + + scoped_ptr context_riscv(new MDRawContextRISCV()); + + // Set the context_flags member, which has already been read, and + // read the rest of the structure beginning with the first member + // after context_flags. + context_riscv->context_flags = context_flags; + + size_t flags_size = sizeof(context_riscv->context_flags); + uint8_t* context_after_flags = + reinterpret_cast(context_riscv.get()) + flags_size; + if (!minidump_->ReadBytes(context_after_flags, + sizeof(MDRawContextRISCV) - flags_size)) { + BPLOG(ERROR) << "MinidumpContext could not read RISCV context"; + return false; + } + + // Do this after reading the entire MDRawContext structure because + // GetSystemInfo may seek minidump to a new position. + if (!CheckAgainstSystemInfo(cpu_type)) { + BPLOG(ERROR) << "MinidumpContext RISCV does not match system info"; + return false; + } + + if (minidump_->swap()) { + Swap(&context_riscv->pc); + Swap(&context_riscv->ra); + Swap(&context_riscv->sp); + Swap(&context_riscv->gp); + Swap(&context_riscv->tp); + Swap(&context_riscv->t0); + Swap(&context_riscv->t1); + Swap(&context_riscv->t2); + Swap(&context_riscv->s0); + Swap(&context_riscv->s1); + Swap(&context_riscv->a0); + Swap(&context_riscv->a1); + Swap(&context_riscv->a2); + Swap(&context_riscv->a3); + Swap(&context_riscv->a4); + Swap(&context_riscv->a5); + Swap(&context_riscv->a6); + Swap(&context_riscv->a7); + Swap(&context_riscv->s2); + Swap(&context_riscv->s3); + Swap(&context_riscv->s4); + Swap(&context_riscv->s5); + Swap(&context_riscv->s6); + Swap(&context_riscv->s7); + Swap(&context_riscv->s8); + Swap(&context_riscv->s9); + Swap(&context_riscv->s10); + Swap(&context_riscv->s11); + Swap(&context_riscv->t3); + Swap(&context_riscv->t4); + Swap(&context_riscv->t5); + Swap(&context_riscv->t6); + + for (int fpr_index = 0; + fpr_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; + ++fpr_index) { + Swap(&context_riscv->float_save.regs[fpr_index]); + } + Swap(&context_riscv->float_save.fpcsr); + } + SetContextRISCV(context_riscv.release()); + + break; + } + + case MD_CONTEXT_RISCV64: { + if (expected_size != sizeof(MDRawContextRISCV64)) { + BPLOG(ERROR) << "MinidumpContext RISCV64 size mismatch, " + << expected_size + << " != " + << sizeof(MDRawContextRISCV64); + return false; + } + + scoped_ptr context_riscv64( + new MDRawContextRISCV64()); + + // Set the context_flags member, which has already been read, and + // read the rest of the structure beginning with the first member + // after context_flags. + context_riscv64->context_flags = context_flags; + + size_t flags_size = sizeof(context_riscv64->context_flags); + uint8_t* context_after_flags = + reinterpret_cast(context_riscv64.get()) + flags_size; + if (!minidump_->ReadBytes(context_after_flags, + sizeof(MDRawContextRISCV64) - flags_size)) { + BPLOG(ERROR) << "MinidumpContext could not read RISCV context"; + return false; + } + + // Do this after reading the entire MDRawContext structure because + // GetSystemInfo may seek minidump to a new position. + if (!CheckAgainstSystemInfo(cpu_type)) { + BPLOG(ERROR) << "MinidumpContext RISCV does not match system info"; + return false; + } + + if (minidump_->swap()) { + Swap(&context_riscv64->pc); + Swap(&context_riscv64->ra); + Swap(&context_riscv64->sp); + Swap(&context_riscv64->gp); + Swap(&context_riscv64->tp); + Swap(&context_riscv64->t0); + Swap(&context_riscv64->t1); + Swap(&context_riscv64->t2); + Swap(&context_riscv64->s0); + Swap(&context_riscv64->s1); + Swap(&context_riscv64->a0); + Swap(&context_riscv64->a1); + Swap(&context_riscv64->a2); + Swap(&context_riscv64->a3); + Swap(&context_riscv64->a4); + Swap(&context_riscv64->a5); + Swap(&context_riscv64->a6); + Swap(&context_riscv64->a7); + Swap(&context_riscv64->s2); + Swap(&context_riscv64->s3); + Swap(&context_riscv64->s4); + Swap(&context_riscv64->s5); + Swap(&context_riscv64->s6); + Swap(&context_riscv64->s7); + Swap(&context_riscv64->s8); + Swap(&context_riscv64->s9); + Swap(&context_riscv64->s10); + Swap(&context_riscv64->s11); + Swap(&context_riscv64->t3); + Swap(&context_riscv64->t4); + Swap(&context_riscv64->t5); + Swap(&context_riscv64->t6); + + for (int fpr_index = 0; + fpr_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; + ++fpr_index) { + Swap(&context_riscv64->float_save.regs[fpr_index]); + } + Swap(&context_riscv64->float_save.fpcsr); + } + SetContextRISCV64(context_riscv64.release()); + + break; + } + default: { // Unknown context type - Don't log as an error yet. Let the // caller work that out. @@ -1261,6 +1422,16 @@ bool MinidumpContext::CheckAgainstSystemInfo(uint32_t context_cpu_type) { if (system_info_cpu_type == MD_CPU_ARCHITECTURE_MIPS64) return_value = true; break; + + case MD_CONTEXT_RISCV: + if (system_info_cpu_type == MD_CPU_ARCHITECTURE_RISCV) + return_value = true; + break; + + case MD_CONTEXT_RISCV64: + if (system_info_cpu_type == MD_CPU_ARCHITECTURE_RISCV64) + return_value = true; + break; } BPLOG_IF(ERROR, !return_value) << "MinidumpContext CPU " << @@ -3772,6 +3943,14 @@ string MinidumpSystemInfo::GetCPU() { cpu = "arm64"; break; + case MD_CPU_ARCHITECTURE_RISCV: + cpu = "riscv"; + break; + + case MD_CPU_ARCHITECTURE_RISCV64: + cpu = "riscv64"; + break; + default: BPLOG(ERROR) << "MinidumpSystemInfo unknown CPU for architecture " << HexString(system_info_.processor_architecture); @@ -5381,6 +5560,12 @@ bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t* context_cpu_flags) { case MD_CPU_ARCHITECTURE_SPARC: *context_cpu_flags = MD_CONTEXT_SPARC; break; + case MD_CPU_ARCHITECTURE_RISCV: + *context_cpu_flags = MD_CONTEXT_RISCV; + break; + case MD_CPU_ARCHITECTURE_RISCV64: + *context_cpu_flags = MD_CONTEXT_RISCV64; + break; case MD_CPU_ARCHITECTURE_UNKNOWN: *context_cpu_flags = 0; break; diff --git a/src/processor/processor.gyp b/src/processor/processor.gyp index f812b1ec9..f1e473fc9 100644 --- a/src/processor/processor.gyp +++ b/src/processor/processor.gyp @@ -165,6 +165,8 @@ 'stackwalker_arm_unittest.cc', 'stackwalker_mips_unittest.cc', 'stackwalker_mips64_unittest.cc', + 'stackwalker_riscv_unittest.cc', + 'stackwalker_riscv64_unittest.cc', 'stackwalker_unittest_utils.h', 'stackwalker_x86_unittest.cc', 'static_address_map_unittest.cc', diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index cf1114d96..a1b6364d1 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -149,7 +149,8 @@ static void PrintStackContents(const string& indent, const StackFrameARM* frame_arm = static_cast(frame); const StackFrameARM* prev_frame_arm = static_cast(prev_frame); - if ((frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP) && + if ((frame_arm->context_validity & + StackFrameARM::CONTEXT_VALID_SP) && (prev_frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP)) { stack_begin = frame_arm->context.iregs[13]; stack_end = prev_frame_arm->context.iregs[13]; @@ -160,12 +161,39 @@ static void PrintStackContents(const string& indent, static_cast(frame); const StackFrameARM64* prev_frame_arm64 = static_cast(prev_frame); - if ((frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_SP) && + if ((frame_arm64->context_validity & + StackFrameARM64::CONTEXT_VALID_SP) && (prev_frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_SP)) { stack_begin = frame_arm64->context.iregs[31]; stack_end = prev_frame_arm64->context.iregs[31]; } + } else if (cpu == "riscv") { + word_length = 4; + const StackFrameRISCV* frame_riscv = + static_cast(frame); + const StackFrameRISCV* prev_frame_riscv = + static_cast(prev_frame); + if ((frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_SP) && + (prev_frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_SP)) { + stack_begin = frame_riscv->context.sp; + stack_end = prev_frame_riscv->context.sp; + } + } else if (cpu == "riscv64") { + word_length = 8; + const StackFrameRISCV64* frame_riscv64 = + static_cast(frame); + const StackFrameRISCV64* prev_frame_riscv64 = + static_cast(prev_frame); + if ((frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_SP) && + (prev_frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_SP)) { + stack_begin = frame_riscv64->context.sp; + stack_end = prev_frame_riscv64->context.sp; + } } if (!word_length || !stack_begin || !stack_end) return; @@ -636,6 +664,270 @@ static void PrintStack(const CallStack* stack, sequence = PrintRegister64( "s7", frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S7], sequence); + } else if (cpu == "riscv") { + const StackFrameRISCV* frame_riscv = + reinterpret_cast(frame); + + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_PC) + sequence = PrintRegister( + "pc", frame_riscv->context.pc, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_RA) + sequence = PrintRegister( + "ra", frame_riscv->context.ra, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_SP) + sequence = PrintRegister( + "sp", frame_riscv->context.sp, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_GP) + sequence = PrintRegister( + "gp", frame_riscv->context.gp, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_TP) + sequence = PrintRegister( + "tp", frame_riscv->context.tp, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T0) + sequence = PrintRegister( + "t0", frame_riscv->context.t0, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T1) + sequence = PrintRegister( + "t1", frame_riscv->context.t1, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T2) + sequence = PrintRegister( + "t2", frame_riscv->context.t2, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S0) + sequence = PrintRegister( + "s0", frame_riscv->context.s0, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S1) + sequence = PrintRegister( + "s1", frame_riscv->context.s1, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A0) + sequence = PrintRegister( + "a0", frame_riscv->context.a0, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A1) + sequence = PrintRegister( + "a1", frame_riscv->context.a1, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A2) + sequence = PrintRegister( + "a2", frame_riscv->context.a2, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A3) + sequence = PrintRegister( + "a3", frame_riscv->context.a3, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A4) + sequence = PrintRegister( + "a4", frame_riscv->context.a4, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A5) + sequence = PrintRegister( + "a5", frame_riscv->context.a5, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A6) + sequence = PrintRegister( + "a6", frame_riscv->context.a6, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_A7) + sequence = PrintRegister( + "a7", frame_riscv->context.a7, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S2) + sequence = PrintRegister( + "s2", frame_riscv->context.s2, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S3) + sequence = PrintRegister( + "s3", frame_riscv->context.s3, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S4) + sequence = PrintRegister( + "s4", frame_riscv->context.s4, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S5) + sequence = PrintRegister( + "s5", frame_riscv->context.s5, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S6) + sequence = PrintRegister( + "s6", frame_riscv->context.s6, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S7) + sequence = PrintRegister( + "s7", frame_riscv->context.s7, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S8) + sequence = PrintRegister( + "s8", frame_riscv->context.s8, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S9) + sequence = PrintRegister( + "s9", frame_riscv->context.s9, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S10) + sequence = PrintRegister( + "s10", frame_riscv->context.s10, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_S11) + sequence = PrintRegister( + "s11", frame_riscv->context.s11, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T3) + sequence = PrintRegister( + "t3", frame_riscv->context.t3, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T4) + sequence = PrintRegister( + "t4", frame_riscv->context.t4, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T5) + sequence = PrintRegister( + "t5", frame_riscv->context.t5, sequence); + if (frame_riscv->context_validity & + StackFrameRISCV::CONTEXT_VALID_T6) + sequence = PrintRegister( + "t6", frame_riscv->context.t6, sequence); + } else if (cpu == "riscv64") { + const StackFrameRISCV64* frame_riscv64 = + reinterpret_cast(frame); + + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_PC) + sequence = PrintRegister64( + "pc", frame_riscv64->context.pc, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_RA) + sequence = PrintRegister64( + "ra", frame_riscv64->context.ra, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_SP) + sequence = PrintRegister64( + "sp", frame_riscv64->context.sp, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_GP) + sequence = PrintRegister64( + "gp", frame_riscv64->context.gp, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_TP) + sequence = PrintRegister64( + "tp", frame_riscv64->context.tp, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T0) + sequence = PrintRegister64( + "t0", frame_riscv64->context.t0, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T1) + sequence = PrintRegister64( + "t1", frame_riscv64->context.t1, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T2) + sequence = PrintRegister64( + "t2", frame_riscv64->context.t2, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S0) + sequence = PrintRegister64( + "s0", frame_riscv64->context.s0, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S1) + sequence = PrintRegister64( + "s1", frame_riscv64->context.s1, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A0) + sequence = PrintRegister64( + "a0", frame_riscv64->context.a0, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A1) + sequence = PrintRegister64( + "a1", frame_riscv64->context.a1, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A2) + sequence = PrintRegister64( + "a2", frame_riscv64->context.a2, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A3) + sequence = PrintRegister64( + "a3", frame_riscv64->context.a3, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A4) + sequence = PrintRegister64( + "a4", frame_riscv64->context.a4, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A5) + sequence = PrintRegister64( + "a5", frame_riscv64->context.a5, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A6) + sequence = PrintRegister64( + "a6", frame_riscv64->context.a6, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_A7) + sequence = PrintRegister64( + "a7", frame_riscv64->context.a7, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S2) + sequence = PrintRegister64( + "s2", frame_riscv64->context.s2, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S3) + sequence = PrintRegister64( + "s3", frame_riscv64->context.s3, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S4) + sequence = PrintRegister64( + "s4", frame_riscv64->context.s4, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S5) + sequence = PrintRegister64( + "s5", frame_riscv64->context.s5, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S6) + sequence = PrintRegister64( + "s6", frame_riscv64->context.s6, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S7) + sequence = PrintRegister64( + "s7", frame_riscv64->context.s7, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S8) + sequence = PrintRegister64( + "s8", frame_riscv64->context.s8, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S9) + sequence = PrintRegister64( + "s9", frame_riscv64->context.s9, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S10) + sequence = PrintRegister64( + "s10", frame_riscv64->context.s10, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S11) + sequence = PrintRegister64( + "s11", frame_riscv64->context.s11, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T3) + sequence = PrintRegister64( + "t3", frame_riscv64->context.t3, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T4) + sequence = PrintRegister64( + "t4", frame_riscv64->context.t4, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T5) + sequence = PrintRegister64( + "t5", frame_riscv64->context.t5, sequence); + if (frame_riscv64->context_validity & + StackFrameRISCV64::CONTEXT_VALID_T6) + sequence = PrintRegister64( + "t6", frame_riscv64->context.t6, sequence); } } printf("\n Found by: %s\n", frame->trust_description().c_str()); diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index 13f89b171..e607b7212 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -54,6 +54,8 @@ #include "processor/stackwalker_arm.h" #include "processor/stackwalker_arm64.h" #include "processor/stackwalker_mips.h" +#include "processor/stackwalker_riscv.h" +#include "processor/stackwalker_riscv64.h" namespace google_breakpad { @@ -270,6 +272,20 @@ Stackwalker* Stackwalker::StackwalkerForCPU( memory, modules, frame_symbolizer); break; + + case MD_CONTEXT_RISCV: + cpu_stackwalker = new StackwalkerRISCV(system_info, + context->GetContextRISCV(), + memory, modules, + frame_symbolizer); + break; + + case MD_CONTEXT_RISCV64: + cpu_stackwalker = new StackwalkerRISCV64(system_info, + context->GetContextRISCV64(), + memory, modules, + frame_symbolizer); + break; } BPLOG_IF(ERROR, !cpu_stackwalker) << "Unknown CPU type " << HexString(cpu) << diff --git a/src/processor/stackwalker_riscv.cc b/src/processor/stackwalker_riscv.cc new file mode 100644 index 000000000..3d8a64f4f --- /dev/null +++ b/src/processor/stackwalker_riscv.cc @@ -0,0 +1,535 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv.cc: riscv-specific stackwalker. + * + * See stackwalker_riscv.h for documentation. + * + * Author: Iacopo Colonnelli + */ + +#include "common/scoped_ptr.h" +#include "google_breakpad/processor/call_stack.h" +#include "google_breakpad/processor/code_modules.h" +#include "google_breakpad/processor/memory_region.h" +#include "google_breakpad/processor/stack_frame_cpu.h" +#include "google_breakpad/processor/system_info.h" +#include "processor/cfi_frame_info.h" +#include "processor/logging.h" +#include "processor/stackwalker_riscv.h" + +namespace google_breakpad { + +StackwalkerRISCV::StackwalkerRISCV(const SystemInfo* system_info, + const MDRawContextRISCV* context, + MemoryRegion* memory, + const CodeModules* modules, + StackFrameSymbolizer* resolver_helper) + : Stackwalker(system_info, memory, modules, resolver_helper), + context_(context), + context_frame_validity_(StackFrameRISCV::CONTEXT_VALID_ALL) { +} + + +StackFrame* StackwalkerRISCV::GetContextFrame() { + if (!context_) { + BPLOG(ERROR) << "Can't get context frame without context"; + return NULL; + } + + StackFrameRISCV* frame = new StackFrameRISCV(); + + frame->context = *context_; + frame->context_validity = context_frame_validity_; + frame->trust = StackFrame::FRAME_TRUST_CONTEXT; + frame->instruction = frame->context.pc; + + return frame; +} + +StackFrameRISCV* StackwalkerRISCV::GetCallerByCFIFrameInfo( + const vector& frames, + CFIFrameInfo* cfi_frame_info) { + StackFrameRISCV* last_frame = + static_cast(frames.back()); + + // Populate a dictionary with the valid register values in last_frame. + CFIFrameInfo::RegisterValueMap callee_registers; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_PC) + callee_registers["pc"] = last_frame->context.pc; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_RA) + callee_registers["ra"] = last_frame->context.ra; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_SP) + callee_registers["sp"] = last_frame->context.sp; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_GP) + callee_registers["gp"] = last_frame->context.gp; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_TP) + callee_registers["tp"] = last_frame->context.tp; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T0) + callee_registers["t0"] = last_frame->context.t0; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T1) + callee_registers["t1"] = last_frame->context.t1; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T2) + callee_registers["t2"] = last_frame->context.t2; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S0) + callee_registers["s0"] = last_frame->context.s0; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S1) + callee_registers["s1"] = last_frame->context.s1; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A0) + callee_registers["a0"] = last_frame->context.a0; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A1) + callee_registers["a1"] = last_frame->context.a1; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A2) + callee_registers["a2"] = last_frame->context.a2; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A3) + callee_registers["a3"] = last_frame->context.a3; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A4) + callee_registers["a4"] = last_frame->context.a4; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A5) + callee_registers["a5"] = last_frame->context.a5; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A6) + callee_registers["a6"] = last_frame->context.a6; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_A7) + callee_registers["a7"] = last_frame->context.a7; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S2) + callee_registers["s2"] = last_frame->context.s2; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S3) + callee_registers["s3"] = last_frame->context.s3; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S4) + callee_registers["s4"] = last_frame->context.s4; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S5) + callee_registers["s5"] = last_frame->context.s5; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S6) + callee_registers["s6"] = last_frame->context.s6; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S7) + callee_registers["s7"] = last_frame->context.s7; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S8) + callee_registers["s8"] = last_frame->context.s8; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S9) + callee_registers["s9"] = last_frame->context.s9; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S10) + callee_registers["s10"] = last_frame->context.s10; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_S11) + callee_registers["s11"] = last_frame->context.s11; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T3) + callee_registers["t3"] = last_frame->context.t3; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T4) + callee_registers["t4"] = last_frame->context.t4; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T5) + callee_registers["t5"] = last_frame->context.t5; + if (last_frame->context_validity & StackFrameRISCV::CONTEXT_VALID_T6) + callee_registers["t6"] = last_frame->context.t6; + + // Use the STACK CFI data to recover the caller's register values. + CFIFrameInfo::RegisterValueMap caller_registers; + if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_, + &caller_registers)) { + return NULL; + } + + // Construct a new stack frame given the values the CFI recovered. + CFIFrameInfo::RegisterValueMap::iterator entry; + scoped_ptr frame(new StackFrameRISCV()); + entry = caller_registers.find("pc"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_PC; + frame->context.pc = entry->second; + } else{ + // If the CFI doesn't recover the PC explicitly, then use .ra. + entry = caller_registers.find(".ra"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_PC; + frame->context.pc = entry->second; + } + } + entry = caller_registers.find("ra"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_RA; + frame->context.ra = entry->second; + } + entry = caller_registers.find("sp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_SP; + frame->context.sp = entry->second; + } else { + // If the CFI doesn't recover the SP explicitly, then use .cfa. + entry = caller_registers.find(".cfa"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_SP; + frame->context.sp = entry->second; + } + } + entry = caller_registers.find("gp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_GP; + frame->context.gp = entry->second; + } + entry = caller_registers.find("tp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_TP; + frame->context.tp = entry->second; + } + entry = caller_registers.find("t0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T0; + frame->context.t0 = entry->second; + } + entry = caller_registers.find("t1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T1; + frame->context.t1 = entry->second; + } + entry = caller_registers.find("t2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T2; + frame->context.t2 = entry->second; + } + entry = caller_registers.find("s0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S0; + frame->context.s0 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S0) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S0; + frame->context.s0 = last_frame->context.s0; + } + entry = caller_registers.find("s1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S1; + frame->context.s1 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S1) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S1; + frame->context.s1 = last_frame->context.s1; + } + entry = caller_registers.find("a0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A0; + frame->context.a0 = entry->second; + } + entry = caller_registers.find("a1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A1; + frame->context.a1 = entry->second; + } + entry = caller_registers.find("a2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A2; + frame->context.a2 = entry->second; + } + entry = caller_registers.find("a3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A3; + frame->context.a3 = entry->second; + } + entry = caller_registers.find("a4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A4; + frame->context.a4 = entry->second; + } + entry = caller_registers.find("a5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A5; + frame->context.a5 = entry->second; + } + entry = caller_registers.find("a6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A6; + frame->context.a6 = entry->second; + } + entry = caller_registers.find("a7"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_A7; + frame->context.a7 = entry->second; + } + entry = caller_registers.find("s2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S2; + frame->context.s2 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S2) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S2; + frame->context.s2 = last_frame->context.s2; + } + entry = caller_registers.find("s3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S3; + frame->context.s3 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S3) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S3; + frame->context.s3 = last_frame->context.s3; + } + entry = caller_registers.find("s4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S4; + frame->context.s4 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S4) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S4; + frame->context.s4 = last_frame->context.s4; + } + entry = caller_registers.find("s5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S5; + frame->context.s5 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S5) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S5; + frame->context.s5 = last_frame->context.s5; + } + entry = caller_registers.find("s6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S6; + frame->context.s6 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S6) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S6; + frame->context.s6 = last_frame->context.s6; + } + entry = caller_registers.find("s7"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S7; + frame->context.s7 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S7) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S7; + frame->context.s7 = last_frame->context.s7; + } + entry = caller_registers.find("s8"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S8; + frame->context.s8 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S8) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S8; + frame->context.s8 = last_frame->context.s8; + } + entry = caller_registers.find("s9"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S9; + frame->context.s9 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S9) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S9; + frame->context.s9 = last_frame->context.s9; + } + entry = caller_registers.find("s10"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S10; + frame->context.s10 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S10) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S10; + frame->context.s10 = last_frame->context.s10; + } + entry = caller_registers.find("s11"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S11; + frame->context.s11 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV::CONTEXT_VALID_S11) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_S11; + frame->context.s11 = last_frame->context.s11; + } + entry = caller_registers.find("t3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T3; + frame->context.t3 = entry->second; + } + entry = caller_registers.find("t4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T4; + frame->context.t4 = entry->second; + } + entry = caller_registers.find("t5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T5; + frame->context.t5 = entry->second; + } + entry = caller_registers.find("t6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV::CONTEXT_VALID_T6; + frame->context.t6 = entry->second; + } + + // If we didn't recover the PC and the SP, then the frame isn't very useful. + static const uint64_t essentials = (StackFrameRISCV::CONTEXT_VALID_SP + | StackFrameRISCV::CONTEXT_VALID_PC); + if ((frame->context_validity & essentials) != essentials) + return NULL; + + frame->trust = StackFrame::FRAME_TRUST_CFI; + return frame.release(); +} + +StackFrameRISCV* StackwalkerRISCV::GetCallerByStackScan( + const vector& frames) { + StackFrameRISCV* last_frame = + static_cast(frames.back()); + uint32_t last_sp = last_frame->context.sp; + uint32_t caller_sp, caller_pc; + + if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, + last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT)) { + // No plausible return address was found. + return NULL; + } + + // ScanForReturnAddress found a reasonable return address. Advance + // sp to the location above the one where the return address was + // found. + caller_sp += 4; + + // Create a new stack frame (ownership will be transferred to the caller) + // and fill it in. + StackFrameRISCV* frame = new StackFrameRISCV(); + + frame->trust = StackFrame::FRAME_TRUST_SCAN; + frame->context = last_frame->context; + frame->context.pc = caller_pc; + frame->context.sp = caller_sp; + frame->context_validity = StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP; + + return frame; +} + + StackFrameRISCV* StackwalkerRISCV::GetCallerByFramePointer( + const vector& frames) { + StackFrameRISCV* last_frame = + static_cast(frames.back()); + + uint32_t last_fp = last_frame->context.s0; + + uint32_t caller_fp = 0; + if (last_fp && !memory_->GetMemoryAtAddress(last_fp, &caller_fp)) { + BPLOG(ERROR) << "Unable to read caller_fp from last_fp: 0x" + << std::hex << last_fp; + return NULL; + } + + uint32_t caller_ra = 0; + if (last_fp && !memory_->GetMemoryAtAddress(last_fp + 4, &caller_ra)) { + BPLOG(ERROR) << "Unable to read caller_ra from last_fp + 4: 0x" + << std::hex << (last_fp + 4); + return NULL; + } + + uint32_t caller_sp = last_fp ? last_fp + 8 : last_frame->context.s0; + + // Create a new stack frame (ownership will be transferred to the caller) + // and fill it in. + StackFrameRISCV* frame = new StackFrameRISCV(); + + frame->trust = StackFrame::FRAME_TRUST_FP; + frame->context = last_frame->context; + frame->context.s0 = caller_fp; + frame->context.sp = caller_sp; + frame->context.pc = last_frame->context.ra; + frame->context.ra = caller_ra; + frame->context_validity = StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_RA | + StackFrameRISCV::CONTEXT_VALID_S0 | + StackFrameRISCV::CONTEXT_VALID_SP; + return frame; +} + +StackFrame* StackwalkerRISCV::GetCallerFrame(const CallStack* stack, + bool stack_scan_allowed) { + if (!memory_ || !stack) { + BPLOG(ERROR) << "Can't get caller frame without memory or stack"; + return NULL; + } + + const vector& frames = *stack->frames(); + StackFrameRISCV* last_frame = + static_cast(frames.back()); + scoped_ptr frame; + + // Try to recover caller information from CFI. + scoped_ptr cfi_frame_info( + frame_symbolizer_->FindCFIFrameInfo(last_frame)); + if (cfi_frame_info.get()) + frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get())); + + // If CFI failed, or there wasn't CFI available, fall back to frame pointer. + if (!frame.get()) + frame.reset(GetCallerByFramePointer(frames)); + + // If everything failed, fall back to stack scanning. + if (stack_scan_allowed && !frame.get()) + frame.reset(GetCallerByStackScan(frames)); + + // If nothing worked, tell the caller. + if (!frame.get()) + return NULL; + + // Should we terminate the stack walk? (end-of-stack or broken invariant) + if (TerminateWalk(frame->context.pc, frame->context.sp, + last_frame->context.sp, + last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT)) { + return NULL; + } + + // The new frame's context's PC is the return address, which is one + // instruction past the instruction that caused us to arrive at the callee. + // RISCV instructions have a uniform 4-byte encoding, so subtracting 4 off + // the return address gets back to the beginning of the call instruction. + // Callers that require the exact return address value may access + // frame->context.pc. + frame->instruction = frame->context.pc - 4; + + return frame.release(); +} + +} // namespace google_breakpad diff --git a/src/processor/stackwalker_riscv.h b/src/processor/stackwalker_riscv.h new file mode 100644 index 000000000..863914d88 --- /dev/null +++ b/src/processor/stackwalker_riscv.h @@ -0,0 +1,100 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv.h: riscv-specific stackwalker. + * + * Provides stack frames given riscv register context and a memory region + * corresponding to a riscv stack. + * + * Author: Iacopo Colonnelli + */ + +#ifndef PROCESSOR_STACKWALKER_RISCV_H__ +#define PROCESSOR_STACKWALKER_RISCV_H__ + +#include "google_breakpad/common/minidump_format.h" +#include "google_breakpad/processor/stackwalker.h" + +namespace google_breakpad { + +class CodeModules; + +class StackwalkerRISCV : public Stackwalker { +public: + // Context is a riscv context object that gives access to riscv-specific + // register state corresponding to the innermost called frame to be + // included in the stack. The other arguments are passed directly + // through to the base Stackwalker constructor. + StackwalkerRISCV(const SystemInfo* system_info, + const MDRawContextRISCV* context, + MemoryRegion* memory, + const CodeModules* modules, + StackFrameSymbolizer* frame_symbolizer); + + // Change the context validity mask of the frame returned by + // GetContextFrame to VALID. This is only for use by unit tests; the + // default behavior is correct for all application code. + void SetContextFrameValidity(int valid) { + context_frame_validity_ = valid; + } + +private: + // Implementation of Stackwalker, using riscv context and stack conventions. + virtual StackFrame* GetContextFrame(); + virtual StackFrame* GetCallerFrame( + const CallStack* stack, bool stack_scan_allowed); + + // Use cfi_frame_info (derived from STACK CFI records) to construct + // the frame that called frames.back(). The caller takes ownership + // of the returned frame. Return NULL on failure. + StackFrameRISCV* GetCallerByCFIFrameInfo( + const vector& frames, CFIFrameInfo* cfi_frame_info); + + // Use the frame pointer. The caller takes ownership of the returned frame. + // Return NULL on failure. + StackFrameRISCV* GetCallerByFramePointer( + const vector& frames); + + // Scan the stack for plausible return addresses. The caller takes ownership + // of the returned frame. Return NULL on failure. + StackFrameRISCV* GetCallerByStackScan( + const vector& frames); + + // Stores the CPU context corresponding to the innermost stack frame to + // be returned by GetContextFrame. + const MDRawContextRISCV* context_; + + // Validity mask for youngest stack frame. This is always + // CONTEXT_VALID_ALL in real use; it is only changeable for the sake of + // unit tests. + int context_frame_validity_; +}; + +} // namespace google_breakpad + +#endif // PROCESSOR_STACKWALKER_RISCV_H__ diff --git a/src/processor/stackwalker_riscv64.cc b/src/processor/stackwalker_riscv64.cc new file mode 100644 index 000000000..d97bad631 --- /dev/null +++ b/src/processor/stackwalker_riscv64.cc @@ -0,0 +1,535 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv64.cc: riscv64-specific stackwalker. + * + * See stackwalker_riscv64.h for documentation. + * + * Author: Iacopo Colonnelli + */ + +#include "common/scoped_ptr.h" +#include "google_breakpad/processor/call_stack.h" +#include "google_breakpad/processor/code_modules.h" +#include "google_breakpad/processor/memory_region.h" +#include "google_breakpad/processor/stack_frame_cpu.h" +#include "google_breakpad/processor/system_info.h" +#include "processor/cfi_frame_info.h" +#include "processor/logging.h" +#include "processor/stackwalker_riscv64.h" + +namespace google_breakpad { + +StackwalkerRISCV64::StackwalkerRISCV64(const SystemInfo* system_info, + const MDRawContextRISCV64* context, + MemoryRegion* memory, + const CodeModules* modules, + StackFrameSymbolizer* resolver_helper) + : Stackwalker(system_info, memory, modules, resolver_helper), + context_(context), + context_frame_validity_(StackFrameRISCV::CONTEXT_VALID_ALL) { +} + + +StackFrame* StackwalkerRISCV64::GetContextFrame() { + if (!context_) { + BPLOG(ERROR) << "Can't get context frame without context"; + return NULL; + } + + StackFrameRISCV64* frame = new StackFrameRISCV64(); + + frame->context = *context_; + frame->context_validity = context_frame_validity_; + frame->trust = StackFrame::FRAME_TRUST_CONTEXT; + frame->instruction = frame->context.pc; + + return frame; +} + +StackFrameRISCV64* StackwalkerRISCV64::GetCallerByCFIFrameInfo( + const vector& frames, + CFIFrameInfo* cfi_frame_info) { + StackFrameRISCV64* last_frame = + static_cast(frames.back()); + + // Populate a dictionary with the valid register values in last_frame. + CFIFrameInfo::RegisterValueMap callee_registers; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_PC) + callee_registers["pc"] = last_frame->context.pc; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_RA) + callee_registers["ra"] = last_frame->context.ra; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_SP) + callee_registers["sp"] = last_frame->context.sp; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_GP) + callee_registers["gp"] = last_frame->context.gp; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_TP) + callee_registers["tp"] = last_frame->context.tp; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T0) + callee_registers["t0"] = last_frame->context.t0; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T1) + callee_registers["t1"] = last_frame->context.t1; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T2) + callee_registers["t2"] = last_frame->context.t2; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S0) + callee_registers["s0"] = last_frame->context.s0; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S1) + callee_registers["s1"] = last_frame->context.s1; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A0) + callee_registers["a0"] = last_frame->context.a0; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A1) + callee_registers["a1"] = last_frame->context.a1; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A2) + callee_registers["a2"] = last_frame->context.a2; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A3) + callee_registers["a3"] = last_frame->context.a3; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A4) + callee_registers["a4"] = last_frame->context.a4; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A5) + callee_registers["a5"] = last_frame->context.a5; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A6) + callee_registers["a6"] = last_frame->context.a6; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_A7) + callee_registers["a7"] = last_frame->context.a7; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S2) + callee_registers["s2"] = last_frame->context.s2; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S3) + callee_registers["s3"] = last_frame->context.s3; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S4) + callee_registers["s4"] = last_frame->context.s4; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S5) + callee_registers["s5"] = last_frame->context.s5; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S6) + callee_registers["s6"] = last_frame->context.s6; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S7) + callee_registers["s7"] = last_frame->context.s7; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S8) + callee_registers["s8"] = last_frame->context.s8; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S9) + callee_registers["s9"] = last_frame->context.s9; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S10) + callee_registers["s10"] = last_frame->context.s10; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_S11) + callee_registers["s11"] = last_frame->context.s11; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T3) + callee_registers["t3"] = last_frame->context.t3; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T4) + callee_registers["t4"] = last_frame->context.t4; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T5) + callee_registers["t5"] = last_frame->context.t5; + if (last_frame->context_validity & StackFrameRISCV64::CONTEXT_VALID_T6) + callee_registers["t6"] = last_frame->context.t6; + + // Use the STACK CFI data to recover the caller's register values. + CFIFrameInfo::RegisterValueMap caller_registers; + if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_, + &caller_registers)) { + return NULL; + } + + // Construct a new stack frame given the values the CFI recovered. + CFIFrameInfo::RegisterValueMap::iterator entry; + scoped_ptr frame(new StackFrameRISCV64()); + entry = caller_registers.find("pc"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_PC; + frame->context.pc = entry->second; + } else{ + // If the CFI doesn't recover the PC explicitly, then use .ra. + entry = caller_registers.find(".ra"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_PC; + frame->context.pc = entry->second; + } + } + entry = caller_registers.find("ra"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_RA; + frame->context.ra = entry->second; + } + entry = caller_registers.find("sp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_SP; + frame->context.sp = entry->second; + } else { + // If the CFI doesn't recover the SP explicitly, then use .cfa. + entry = caller_registers.find(".cfa"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_SP; + frame->context.sp = entry->second; + } + } + entry = caller_registers.find("gp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_GP; + frame->context.gp = entry->second; + } + entry = caller_registers.find("tp"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_TP; + frame->context.tp = entry->second; + } + entry = caller_registers.find("t0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T0; + frame->context.t0 = entry->second; + } + entry = caller_registers.find("t1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T1; + frame->context.t1 = entry->second; + } + entry = caller_registers.find("t2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T2; + frame->context.t2 = entry->second; + } + entry = caller_registers.find("s0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S0; + frame->context.s0 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S0) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S0; + frame->context.s0 = last_frame->context.s0; + } + entry = caller_registers.find("s1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S1; + frame->context.s1 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S1) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S1; + frame->context.s1 = last_frame->context.s1; + } + entry = caller_registers.find("a0"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A0; + frame->context.a0 = entry->second; + } + entry = caller_registers.find("a1"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A1; + frame->context.a1 = entry->second; + } + entry = caller_registers.find("a2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A2; + frame->context.a2 = entry->second; + } + entry = caller_registers.find("a3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A3; + frame->context.a3 = entry->second; + } + entry = caller_registers.find("a4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A4; + frame->context.a4 = entry->second; + } + entry = caller_registers.find("a5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A5; + frame->context.a5 = entry->second; + } + entry = caller_registers.find("a6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A6; + frame->context.a6 = entry->second; + } + entry = caller_registers.find("a7"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_A7; + frame->context.a7 = entry->second; + } + entry = caller_registers.find("s2"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S2; + frame->context.s2 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S2) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S2; + frame->context.s2 = last_frame->context.s2; + } + entry = caller_registers.find("s3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S3; + frame->context.s3 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S3) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S3; + frame->context.s3 = last_frame->context.s3; + } + entry = caller_registers.find("s4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S4; + frame->context.s4 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S4) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S4; + frame->context.s4 = last_frame->context.s4; + } + entry = caller_registers.find("s5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S5; + frame->context.s5 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S5) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S5; + frame->context.s5 = last_frame->context.s5; + } + entry = caller_registers.find("s6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S6; + frame->context.s6 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S6) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S6; + frame->context.s6 = last_frame->context.s6; + } + entry = caller_registers.find("s7"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S7; + frame->context.s7 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S7) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S7; + frame->context.s7 = last_frame->context.s7; + } + entry = caller_registers.find("s8"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S8; + frame->context.s8 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S8) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S8; + frame->context.s8 = last_frame->context.s8; + } + entry = caller_registers.find("s9"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S9; + frame->context.s9 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S9) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S9; + frame->context.s9 = last_frame->context.s9; + } + entry = caller_registers.find("s10"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S10; + frame->context.s10 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S10) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S10; + frame->context.s10 = last_frame->context.s10; + } + entry = caller_registers.find("s11"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S11; + frame->context.s11 = entry->second; + } else if (last_frame->context_validity & + StackFrameRISCV64::CONTEXT_VALID_S11) { + // Since the register is callee-saves, assume the callee + // has not yet changed it. + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_S11; + frame->context.s11 = last_frame->context.s11; + } + entry = caller_registers.find("t3"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T3; + frame->context.t3 = entry->second; + } + entry = caller_registers.find("t4"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T4; + frame->context.t4 = entry->second; + } + entry = caller_registers.find("t5"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T5; + frame->context.t5 = entry->second; + } + entry = caller_registers.find("t6"); + if (entry != caller_registers.end()) { + frame->context_validity |= StackFrameRISCV64::CONTEXT_VALID_T6; + frame->context.t6 = entry->second; + } + + // If we didn't recover the PC and the SP, then the frame isn't very useful. + static const uint64_t essentials = (StackFrameRISCV64::CONTEXT_VALID_SP + | StackFrameRISCV64::CONTEXT_VALID_PC); + if ((frame->context_validity & essentials) != essentials) + return NULL; + + frame->trust = StackFrame::FRAME_TRUST_CFI; + return frame.release(); +} + +StackFrameRISCV64* StackwalkerRISCV64::GetCallerByStackScan( + const vector& frames) { + StackFrameRISCV64* last_frame = + static_cast(frames.back()); + uint64_t last_sp = last_frame->context.sp; + uint64_t caller_sp, caller_pc; + + if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, + last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT)) { + // No plausible return address was found. + return NULL; + } + + // ScanForReturnAddress found a reasonable return address. Advance + // sp to the location above the one where the return address was + // found. + caller_sp += 8; + + // Create a new stack frame (ownership will be transferred to the caller) + // and fill it in. + StackFrameRISCV64* frame = new StackFrameRISCV64(); + + frame->trust = StackFrame::FRAME_TRUST_SCAN; + frame->context = last_frame->context; + frame->context.pc = caller_pc; + frame->context.sp = caller_sp; + frame->context_validity = StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP; + + return frame; +} + +StackFrameRISCV64* StackwalkerRISCV64::GetCallerByFramePointer( + const vector& frames) { + StackFrameRISCV64* last_frame = + static_cast(frames.back()); + + uint64_t last_fp = last_frame->context.s0; + + uint64_t caller_fp = 0; + if (last_fp && !memory_->GetMemoryAtAddress(last_fp, &caller_fp)) { + BPLOG(ERROR) << "Unable to read caller_fp from last_fp: 0x" + << std::hex << last_fp; + return NULL; + } + + uint64_t caller_ra = 0; + if (last_fp && !memory_->GetMemoryAtAddress(last_fp + 8, &caller_ra)) { + BPLOG(ERROR) << "Unable to read caller_ra from last_fp + 8: 0x" + << std::hex << (last_fp + 8); + return NULL; + } + + uint64_t caller_sp = last_fp ? last_fp + 16 : last_frame->context.s0; + + // Create a new stack frame (ownership will be transferred to the caller) + // and fill it in. + StackFrameRISCV64* frame = new StackFrameRISCV64(); + + frame->trust = StackFrame::FRAME_TRUST_FP; + frame->context = last_frame->context; + frame->context.s0 = caller_fp; + frame->context.sp = caller_sp; + frame->context.pc = last_frame->context.ra; + frame->context.ra = caller_ra; + frame->context_validity = StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_RA | + StackFrameRISCV64::CONTEXT_VALID_S0 | + StackFrameRISCV64::CONTEXT_VALID_SP; + return frame; +} + +StackFrame* StackwalkerRISCV64::GetCallerFrame(const CallStack* stack, + bool stack_scan_allowed) { + if (!memory_ || !stack) { + BPLOG(ERROR) << "Can't get caller frame without memory or stack"; + return NULL; + } + + const vector& frames = *stack->frames(); + StackFrameRISCV64* last_frame = + static_cast(frames.back()); + scoped_ptr frame; + + // Try to recover caller information from CFI. + scoped_ptr cfi_frame_info( + frame_symbolizer_->FindCFIFrameInfo(last_frame)); + if (cfi_frame_info.get()) + frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get())); + + // If CFI failed, or there wasn't CFI available, fall back to frame pointer. + if (!frame.get()) + frame.reset(GetCallerByFramePointer(frames)); + + // If everything failed, fall back to stack scanning. + if (stack_scan_allowed && !frame.get()) + frame.reset(GetCallerByStackScan(frames)); + + // If nothing worked, tell the caller. + if (!frame.get()) + return NULL; + + // Should we terminate the stack walk? (end-of-stack or broken invariant) + if (TerminateWalk(frame->context.pc, frame->context.sp, + last_frame->context.sp, + last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT)) { + return NULL; + } + + // The new frame's context's PC is the return address, which is one + // instruction past the instruction that caused us to arrive at the callee. + // RISCV instructions have a uniform 4-byte encoding, so subtracting 4 off + // the return address gets back to the beginning of the call instruction. + // Callers that require the exact return address value may access + // frame->context.pc. + frame->instruction = frame->context.pc - 4; + + return frame.release(); +} + +} // namespace google_breakpad diff --git a/src/processor/stackwalker_riscv64.h b/src/processor/stackwalker_riscv64.h new file mode 100644 index 000000000..89ab12ff6 --- /dev/null +++ b/src/processor/stackwalker_riscv64.h @@ -0,0 +1,100 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv64.h: riscv64-specific stackwalker. + * + * Provides stack frames given riscv64 register context and a memory region + * corresponding to a riscv64 stack. + * + * Author: Iacopo Colonnelli + */ + +#ifndef PROCESSOR_STACKWALKER_RISCV64_H__ +#define PROCESSOR_STACKWALKER_RISCV64_H__ + +#include "google_breakpad/common/minidump_format.h" +#include "google_breakpad/processor/stackwalker.h" + +namespace google_breakpad { + +class CodeModules; + +class StackwalkerRISCV64 : public Stackwalker { +public: + // Context is a riscv context object that gives access to riscv-specific + // register state corresponding to the innermost called frame to be + // included in the stack. The other arguments are passed directly + // through to the base Stackwalker constructor. + StackwalkerRISCV64(const SystemInfo* system_info, + const MDRawContextRISCV64* context, + MemoryRegion* memory, + const CodeModules* modules, + StackFrameSymbolizer* frame_symbolizer); + + // Change the context validity mask of the frame returned by + // GetContextFrame to VALID. This is only for use by unit tests; the + // default behavior is correct for all application code. + void SetContextFrameValidity(int valid) { + context_frame_validity_ = valid; + } + +private: + // Implementation of Stackwalker, using riscv context and stack conventions. + virtual StackFrame* GetContextFrame(); + virtual StackFrame* GetCallerFrame( + const CallStack* stack, bool stack_scan_allowed); + + // Use cfi_frame_info (derived from STACK CFI records) to construct + // the frame that called frames.back(). The caller takes ownership + // of the returned frame. Return NULL on failure. + StackFrameRISCV64* GetCallerByCFIFrameInfo( + const vector& frames, CFIFrameInfo* cfi_frame_info); + + // Use the frame pointer. The caller takes ownership of the returned frame. + // Return NULL on failure. + StackFrameRISCV64* GetCallerByFramePointer( + const vector& frames); + + // Scan the stack for plausible return addresses. The caller takes ownership + // of the returned frame. Return NULL on failure. + StackFrameRISCV64* GetCallerByStackScan( + const vector& frames); + + // Stores the CPU context corresponding to the innermost stack frame to + // be returned by GetContextFrame. + const MDRawContextRISCV64* context_; + + // Validity mask for youngest stack frame. This is always + // CONTEXT_VALID_ALL in real use; it is only changeable for the sake of + // unit tests. + int context_frame_validity_; +}; + +} // namespace google_breakpad + +#endif // PROCESSOR_STACKWALKER_RISCV64_H__ diff --git a/src/processor/stackwalker_riscv64_unittest.cc b/src/processor/stackwalker_riscv64_unittest.cc new file mode 100644 index 000000000..73c062642 --- /dev/null +++ b/src/processor/stackwalker_riscv64_unittest.cc @@ -0,0 +1,883 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv64_unittest.cc: Unit tests for StackwalkerRISCV64 class. + * + * Author: Iacopo Colonnelli + */ + +#include +#include +#include + +#include "breakpad_googletest_includes.h" +#include "common/test_assembler.h" +#include "common/using_std_string.h" +#include "google_breakpad/common/minidump_format.h" +#include "google_breakpad/processor/basic_source_line_resolver.h" +#include "google_breakpad/processor/call_stack.h" +#include "google_breakpad/processor/code_module.h" +#include "google_breakpad/processor/source_line_resolver_interface.h" +#include "google_breakpad/processor/stack_frame_cpu.h" +#include "processor/stackwalker_unittest_utils.h" +#include "processor/stackwalker_riscv64.h" +#include "processor/windows_frame_info.h" + +using google_breakpad::BasicSourceLineResolver; +using google_breakpad::CallStack; +using google_breakpad::CodeModule; +using google_breakpad::StackFrameSymbolizer; +using google_breakpad::StackFrame; +using google_breakpad::StackFrameRISCV64; +using google_breakpad::Stackwalker; +using google_breakpad::StackwalkerRISCV64; +using google_breakpad::SystemInfo; +using google_breakpad::WindowsFrameInfo; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; +using std::vector; +using testing::_; +using testing::AnyNumber; +using testing::DoAll; +using testing::Return; +using testing::SetArgumentPointee; +using testing::Test; + +class StackwalkerRISCV64Fixture { +public: + StackwalkerRISCV64Fixture() + : stack_section(kLittleEndian), + // Give the two modules reasonable standard locations and names + // for tests to play with. + module1(0x40000000, 0x10000, "module1", "version1"), + module2(0x50000000, 0x10000, "module2", "version2") { + // Identify the system as an iOS system. + system_info.os = "iOS"; + system_info.os_short = "ios"; + system_info.cpu = "riscv64"; + system_info.cpu_info = ""; + + // Put distinctive values in the raw CPU context. + BrandContext(&raw_context); + + // Create some modules with some stock debugging information. + modules.Add(&module1); + modules.Add(&module2); + + // By default, none of the modules have symbol info; call + // SetModuleSymbols to override this. + EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _)) + .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND)); + + // Avoid GMOCK WARNING "Uninteresting mock function call - returning + // directly" for FreeSymbolData(). + EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber()); + + // Reset max_frames_scanned since it's static. + Stackwalker::set_max_frames_scanned(1024); + } + + // Set the Breakpad symbol information that supplier should return for + // MODULE to INFO. + void SetModuleSymbols(MockCodeModule* module, const string& info) { + size_t buffer_size; + char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size); + EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _)) + .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer), + SetArgumentPointee<4>(buffer_size), + Return(MockSymbolSupplier::FOUND))); + } + + // Populate stack_region with the contents of stack_section. Use + // stack_section.start() as the region's starting address. + void RegionFromSection() { + string contents; + ASSERT_TRUE(stack_section.GetContents(&contents)); + stack_region.Init(stack_section.start().Value(), contents); + } + + // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking. + void BrandContext(MDRawContextRISCV64 *raw_context) { + uint8_t x = 173; + for (size_t i = 0; i < sizeof(*raw_context); i++) + reinterpret_cast(raw_context)[i] = (x += 17); + } + + SystemInfo system_info; + MDRawContextRISCV64 raw_context; + Section stack_section; + MockMemoryRegion stack_region; + MockCodeModule module1; + MockCodeModule module2; + MockCodeModules modules; + MockSymbolSupplier supplier; + BasicSourceLineResolver resolver; + CallStack call_stack; + const vector* frames; +}; + +class SanityCheck: public StackwalkerRISCV64Fixture, public Test { }; + +TEST_F(SanityCheck, NoResolver) { + // Since the context's frame pointer is garbage, the stack walk will end after + // the first frame. + StackFrameSymbolizer frame_symbolizer(NULL, NULL); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, &modules, + &frame_symbolizer); + // This should succeed even without a resolver or supplier. + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + StackFrameRISCV64 *frame = static_cast(frames->at(0)); + // Check that the values from the original raw context made it + // through to the context in the stack frame. + EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context))); +} + +class GetContextFrame: public StackwalkerRISCV64Fixture, public Test { }; + +// The stackwalker should be able to produce the context frame even +// without stack memory present. +TEST_F(GetContextFrame, NoStackMemory) { + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, NULL, &modules, + &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + StackFrameRISCV64 *frame = static_cast(frames->at(0)); + // Check that the values from the original raw context made it + // through to the context in the stack frame. + EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context))); +} + +class GetCallerFrame: public StackwalkerRISCV64Fixture, public Test { }; + +TEST_F(GetCallerFrame, ScanWithoutSymbols) { + // When the stack walker resorts to scanning the stack, + // only addresses located within loaded modules are + // considered valid return addresses. + // Force scanning through three frames to ensure that the + // stack pointer is set properly in scan-recovered frames. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(16, 0) // space + + .D64(0x40090000) // junk that's not + .D64(0x60000000) // a return address + + .D64(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(16, 0) // space + + .D64(0xF0000000) // more junk + .D64(0x0000000D) + + .D64(return_address2) // actual return address + // frame 2 + .Mark(&frame2_sp) + .Append(64, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, &modules, + &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(3U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV64::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV64 *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + + StackFrameRISCV64 *frame2 = static_cast(frames->at(2)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame2->context_validity); + EXPECT_EQ(return_address2, frame2->context.pc); + EXPECT_EQ(frame2_sp.Value(), frame2->context.sp); +} + +TEST_F(GetCallerFrame, ScanWithFunctionSymbols) { + // During stack scanning, if a potential return address + // is located within a loaded module that has symbols, + // it is only considered a valid return address if it + // lies within a function's bounds. + stack_section.start() = 0x80000000; + uint64_t return_address = 0x50000200; + Label frame1_sp; + + stack_section + // frame 0 + .Append(16, 0) // space + + .D64(0x40090000) // junk that's not + .D64(0x60000000) // a return address + + .D64(0x40001000) // a couple of plausible addresses + .D64(0x5000F000) // that are not within functions + + .D64(return_address) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(64, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40000200; + raw_context.sp = stack_section.start().Value(); + + SetModuleSymbols(&module1, + // The youngest frame's function. + "FUNC 100 400 10 monotreme\n"); + SetModuleSymbols(&module2, + // The calling frame's function. + "FUNC 100 400 10 marsupial\n"); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV64::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + EXPECT_EQ("monotreme", frame0->function_name); + EXPECT_EQ(0x40000100ULL, frame0->function_base); + + StackFrameRISCV64 *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + EXPECT_EQ("marsupial", frame1->function_name); + EXPECT_EQ(0x50000100ULL, frame1->function_base); +} + +TEST_F(GetCallerFrame, ScanFirstFrame) { + // If the stackwalker resorts to stack scanning, it will scan much + // farther to find the caller of the context frame. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(32, 0) // space + + .D64(0x40090000) // junk that's not + .D64(0x60000000) // a return address + + .Append(96, 0) // more space + + .D64(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(32, 0) // space + + .D64(0xF0000000) // more junk + .D64(0x0000000D) + + .Append(336, 0) // more space + + .D64(return_address2) // actual return address + // (won't be found) + // frame 2 + .Mark(&frame2_sp) + .Append(64, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV64::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV64 *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); +} + +// Test that set_max_frames_scanned prevents using stack scanning +// to find caller frames. +TEST_F(GetCallerFrame, ScanningNotAllowed) { + // When the stack walker resorts to scanning the stack, + // only addresses located within loaded modules are + // considered valid return addresses. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(16, 0) // space + + .D64(0x40090000) // junk that's not + .D64(0x60000000) // a return address + + .D64(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(16, 0) // space + + .D64(0xF0000000) // more junk + .D64(0x0000000D) + + .D64(return_address2) // actual return address + // frame 2 + .Mark(&frame2_sp) + .Append(64, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + Stackwalker::set_max_frames_scanned(0); + + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(1U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV64::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); +} + +class GetFramesByFramePointer: + public StackwalkerRISCV64Fixture, + public Test { }; + +TEST_F(GetFramesByFramePointer, OnlyFramePointer) { + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + Label frame1_fp, frame2_fp; + stack_section + // frame 0 + .Append(64, 0) // Whatever values on the stack. + .D64(0x0000000D) // junk that's not + .D64(0xF0000000) // a return address. + + .Mark(&frame1_fp) // Next fp will point to the next value. + .D64(frame2_fp) // Save current frame pointer. + .D64(return_address2) // Save current link register. + .Mark(&frame1_sp) + + // frame 1 + .Append(64, 0) // Whatever values on the stack. + .D64(0x0000000D) // junk that's not + .D64(0xF0000000) // a return address. + + .Mark(&frame2_fp) + .D64(0) + .D64(0) + .Mark(&frame2_sp) + + // frame 2 + .Append(64, 0) // Whatever values on the stack. + .D64(0x0000000D) // junk that's not + .D64(0xF0000000); // a return address. + RegionFromSection(); + + + raw_context.pc = 0x40005510; + raw_context.ra = return_address1; + raw_context.s0 = frame1_fp.Value(); + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, + &stack_region, &modules, &frame_symbolizer); + + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(3U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV64::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV64 *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_RA | + StackFrameRISCV64::CONTEXT_VALID_S0 | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(return_address2, frame1->context.ra); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + EXPECT_EQ(frame2_fp.Value(), frame1->context.s0); + + StackFrameRISCV64 *frame2 = static_cast(frames->at(2)); + EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust); + ASSERT_EQ((StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_RA | + StackFrameRISCV64::CONTEXT_VALID_S0 | + StackFrameRISCV64::CONTEXT_VALID_SP), + frame2->context_validity); + EXPECT_EQ(return_address2, frame2->context.pc); + EXPECT_EQ(0U, frame2->context.ra); + EXPECT_EQ(frame2_sp.Value(), frame2->context.sp); + EXPECT_EQ(0U, frame2->context.s0); +} + +struct CFIFixture: public StackwalkerRISCV64Fixture { + CFIFixture() { + // Provide a bunch of STACK CFI records; we'll walk to the caller + // from every point in this series, expecting to find the same set + // of register values. + SetModuleSymbols(&module1, + // The youngest frame's function. + "FUNC 4000 1000 10 enchiridion\n" + // Initially, nothing has been pushed on the stack, + // and the return address is still in the return + // address register (ra). + "STACK CFI INIT 4000 100 .cfa: sp 0 + .ra: ra\n" + // Push s1, s2, the frame pointer (s0) and the + // return address register. + "STACK CFI 4001 .cfa: sp 32 + .ra: .cfa -8 + ^" + " s1: .cfa -32 + ^ s2: .cfa -24 + ^ " + " s0: .cfa -16 + ^\n" + // Save s1..s4 in a1..a4: verify that we populate + // the youngest frame with all the values we have. + "STACK CFI 4002 s1: a1 s2: a2 s3: a3 s4: a4\n" + // Restore s1..s4. Save the non-callee-saves register a2. + "STACK CFI 4003 .cfa: sp 40 + a2: .cfa 40 - ^" + " s1: s1 s2: s2 s3: s3 s4: s4\n" + // Move the .cfa back eight bytes, to point at the return + // address, and restore the sp explicitly. + "STACK CFI 4005 .cfa: sp 32 + a2: .cfa 32 - ^" + " s0: .cfa 8 - ^ .ra: .cfa ^ sp: .cfa 8 +\n" + // Recover the PC explicitly from a new stack slot; + // provide garbage for the .ra. + "STACK CFI 4006 .cfa: sp 40 + pc: .cfa 40 - ^\n" + + // The calling function. + "FUNC 5000 1000 10 epictetus\n" + // Mark it as end of stack. + "STACK CFI INIT 5000 1000 .cfa: 0 .ra: 0\n" + + // A function whose CFI makes the stack pointer + // go backwards. + "FUNC 6000 1000 20 palinal\n" + "STACK CFI INIT 6000 1000 .cfa: sp 8 - .ra: ra\n" + + // A function with CFI expressions that can't be + // evaluated. + "FUNC 7000 1000 20 rhetorical\n" + "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n"); + + // Provide some distinctive values for the caller's registers. + expected.pc = 0x0000000040005510L; + expected.sp = 0x0000000080000000L; + expected.s1 = 0x5e68b5d5b5d55e68L; + expected.s2 = 0x34f3ebd1ebd134f3L; + expected.s3 = 0x74bca31ea31e74bcL; + expected.s4 = 0x16b32dcb2dcb16b3L; + expected.s5 = 0x21372ada2ada2137L; + expected.s6 = 0x557dbbbbbbbb557dL; + expected.s7 = 0x8ca748bf48bf8ca7L; + expected.s8 = 0x21f0ab46ab4621f0L; + expected.s9 = 0x146732b732b71467L; + expected.s10 = 0xa673645fa673645fL; + expected.s11 = 0xa673645fa673645fL; + expected.s0 = 0xe11081128112e110L; + + // Expect CFI to recover all callee-saves registers. Since CFI is the + // only stack frame construction technique we have, aside from the + // context frame itself, there's no way for us to have a set of valid + // registers smaller than this. + expected_validity = (StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP | + StackFrameRISCV64::CONTEXT_VALID_S1 | + StackFrameRISCV64::CONTEXT_VALID_S2 | + StackFrameRISCV64::CONTEXT_VALID_S3 | + StackFrameRISCV64::CONTEXT_VALID_S4 | + StackFrameRISCV64::CONTEXT_VALID_S5 | + StackFrameRISCV64::CONTEXT_VALID_S6 | + StackFrameRISCV64::CONTEXT_VALID_S7 | + StackFrameRISCV64::CONTEXT_VALID_S8 | + StackFrameRISCV64::CONTEXT_VALID_S9 | + StackFrameRISCV64::CONTEXT_VALID_S10 | + StackFrameRISCV64::CONTEXT_VALID_S11 | + StackFrameRISCV64::CONTEXT_VALID_S0); + + // By default, context frames provide all registers, as normal. + context_frame_validity = StackFrameRISCV64::CONTEXT_VALID_ALL; + + // By default, registers are unchanged. + raw_context = expected; + } + + // Walk the stack, using stack_section as the contents of the stack + // and raw_context as the current register values. (Set the stack + // pointer to the stack's starting address.) Expect two stack + // frames; in the older frame, expect the callee-saves registers to + // have values matching those in 'expected'. + void CheckWalk() { + RegionFromSection(); + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + walker.SetContextFrameValidity(context_frame_validity); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV64 *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(context_frame_validity, frame0->context_validity); + EXPECT_EQ("enchiridion", frame0->function_name); + EXPECT_EQ(0x0000000040004000UL, frame0->function_base); + + StackFrameRISCV64 *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust); + ASSERT_EQ(expected_validity, frame1->context_validity); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_A2) + EXPECT_EQ(expected.a2, frame1->context.a2); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S1) + EXPECT_EQ(expected.s1, frame1->context.s1); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S2) + EXPECT_EQ(expected.s2, frame1->context.s2); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S3) + EXPECT_EQ(expected.s3, frame1->context.s3); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S4) + EXPECT_EQ(expected.s4, frame1->context.s4); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S5) + EXPECT_EQ(expected.s5, frame1->context.s5); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S6) + EXPECT_EQ(expected.s6, frame1->context.s6); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S7) + EXPECT_EQ(expected.s7, frame1->context.s7); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S8) + EXPECT_EQ(expected.s8, frame1->context.s8); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S9) + EXPECT_EQ(expected.s9, frame1->context.s9); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S10) + EXPECT_EQ(expected.s10, frame1->context.s10); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S11) + EXPECT_EQ(expected.s11, frame1->context.s11); + if (expected_validity & StackFrameRISCV64::CONTEXT_VALID_S0) + EXPECT_EQ(expected.s0, frame1->context.s0); + + // We would never have gotten a frame in the first place if the SP + // and PC weren't valid or ->instruction weren't set. + EXPECT_EQ(expected.sp, frame1->context.sp); + EXPECT_EQ(expected.pc, frame1->context.pc); + EXPECT_EQ(expected.pc, frame1->instruction + 4); + EXPECT_EQ("epictetus", frame1->function_name); + } + + // The values we expect to find for the caller's registers. + MDRawContextRISCV64 expected; + + // The validity mask for expected. + int expected_validity; + + // The validity mask to impose on the context frame. + int context_frame_validity; +}; + +class CFI: public CFIFixture, public Test { }; + +TEST_F(CFI, At4000) { + stack_section.start() = expected.sp; + raw_context.pc = 0x0000000040004000L; + raw_context.ra = 0x0000000040005510L; + CheckWalk(); +} + +TEST_F(CFI, At4001) { + Label frame1_sp = expected.sp; + stack_section + .D64(0x5e68b5d5b5d55e68L) // saved s1 + .D64(0x34f3ebd1ebd134f3L) // saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004001L; + // distinct callee s1, s2 and s0 + raw_context.s1 = 0xadc9f635a635adc9L; + raw_context.s2 = 0x623135ac35ac6231L; + raw_context.s0 = 0x5fc4be14be145fc4L; + CheckWalk(); +} + +// As above, but unwind from a context that has only the PC and SP. +TEST_F(CFI, At4001LimitedValidity) { + Label frame1_sp = expected.sp; + stack_section + .D64(0x5e68b5d5b5d55e68L) // saved s1 + .D64(0x34f3ebd1ebd134f3L) // saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + context_frame_validity = StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP; + raw_context.pc = 0x0000000040004001L; + raw_context.s0 = 0x5fc4be14be145fc4L; + + expected_validity = (StackFrameRISCV64::CONTEXT_VALID_PC | + StackFrameRISCV64::CONTEXT_VALID_SP | + StackFrameRISCV64::CONTEXT_VALID_S0 | + StackFrameRISCV64::CONTEXT_VALID_S1 | + StackFrameRISCV64::CONTEXT_VALID_S2); + CheckWalk(); +} + +TEST_F(CFI, At4002) { + Label frame1_sp = expected.sp; + stack_section + .D64(0xff3dfb81fb81ff3dL) // no longer saved s1 + .D64(0x34f3ebd1ebd134f3L) // no longer saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004002L; + raw_context.a1 = 0x5e68b5d5b5d55e68L; // saved s1 + raw_context.a2 = 0x34f3ebd1ebd134f3L; // saved s2 + raw_context.a3 = 0x74bca31ea31e74bcL; // saved s3 + raw_context.a4 = 0x16b32dcb2dcb16b3L; // saved s4 + raw_context.s1 = 0xadc9f635a635adc9L; // distinct callee s1 + raw_context.s2 = 0x623135ac35ac6231L; // distinct callee s2 + raw_context.s3 = 0xac4543564356ac45L; // distinct callee s3 + raw_context.s4 = 0x2561562f562f2561L; // distinct callee s4 + // distinct callee s0 + raw_context.s0 = 0x5fc4be14be145fc4L; + CheckWalk(); +} + +TEST_F(CFI, At4003) { + Label frame1_sp = expected.sp; + stack_section + .D64(0xdd5a48c848c8dd5aL) // saved a2 (even though it's not callee-saves) + .D64(0xff3dfb81fb81ff3dL) // no longer saved s1 + .D64(0x34f3ebd1ebd134f3L) // no longer saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004003L; + // distinct callee a2 and fp + raw_context.a2 = 0xfb756319fb756319L; + raw_context.s0 = 0x5fc4be14be145fc4L; + // caller's a2 + expected.a2 = 0xdd5a48c848c8dd5aL; + expected_validity |= StackFrameRISCV64::CONTEXT_VALID_A2; + CheckWalk(); +} + +// We have no new rule at module offset 0x4004, so the results here should +// be the same as those at module offset 0x4003. +TEST_F(CFI, At4004) { + Label frame1_sp = expected.sp; + stack_section + .D64(0xdd5a48c848c8dd5aL) // saved a2 (even though it's not callee-saves) + .D64(0xff3dfb81fb81ff3dL) // no longer saved s1 + .D64(0x34f3ebd1ebd134f3L) // no longer saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004004L; + // distinct callee a2 and s0 + raw_context.a2 = 0xfb756319fb756319L; + raw_context.s0 = 0x5fc4be14be145fc4L; + // caller's a2 + expected.a2 = 0xdd5a48c848c8dd5aL; + expected_validity |= StackFrameRISCV64::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Here we move the .cfa, but provide an explicit rule to recover the SP, +// so again there should be no change in the registers recovered. +TEST_F(CFI, At4005) { + Label frame1_sp = expected.sp; + stack_section + .D64(0xdd5a48c848c8dd5aL) // saved a2 (even though it's not callee-saves) + .D64(0xff3dfb81fb81ff3dL) // no longer saved s1 + .D64(0x34f3ebd1ebd134f3L) // no longer saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0x0000000040005510L) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004005L; + raw_context.a2 = 0xfb756319fb756319L; // distinct callee a2 + expected.a2 = 0xdd5a48c848c8dd5aL; // caller's a2 + expected_validity |= StackFrameRISCV64::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Here we provide an explicit rule for the PC, and have the saved .ra be +// bogus. +TEST_F(CFI, At4006) { + Label frame1_sp = expected.sp; + stack_section + .D64(0x0000000040005510L) // saved pc + .D64(0xdd5a48c848c8dd5aL) // saved a2 (even though it's not callee-saves) + .D64(0xff3dfb81fb81ff3dL) // no longer saved s1 + .D64(0x34f3ebd1ebd134f3L) // no longer saved s2 + .D64(0xe11081128112e110L) // saved s0 + .D64(0xf8d157835783f8d1L) // .ra rule recovers this, which is garbage + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x0000000040004006L; + raw_context.a2 = 0xfb756319fb756319L; // distinct callee a2 + expected.a2 = 0xdd5a48c848c8dd5aL; // caller's a2 + expected_validity |= StackFrameRISCV64::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Check that we reject rules that would cause the stack pointer to +// move in the wrong direction. +TEST_F(CFI, RejectBackwards) { + raw_context.pc = 0x0000000040006000L; + raw_context.sp = 0x0000000080000000L; + raw_context.ra = 0x0000000040005510L; + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); +} + +// Check that we reject rules whose expressions' evaluation fails. +TEST_F(CFI, RejectBadExpressions) { + raw_context.pc = 0x0000000040007000L; + raw_context.sp = 0x0000000080000000L; + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV64 walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); +} diff --git a/src/processor/stackwalker_riscv_unittest.cc b/src/processor/stackwalker_riscv_unittest.cc new file mode 100644 index 000000000..f4a6b79cc --- /dev/null +++ b/src/processor/stackwalker_riscv_unittest.cc @@ -0,0 +1,883 @@ +// Copyright 2013 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* stackwalker_riscv_unittest.cc: Unit tests for StackwalkerRISCV class. + * + * Author: Iacopo Colonnelli + */ + +#include +#include +#include + +#include "breakpad_googletest_includes.h" +#include "common/test_assembler.h" +#include "common/using_std_string.h" +#include "google_breakpad/common/minidump_format.h" +#include "google_breakpad/processor/basic_source_line_resolver.h" +#include "google_breakpad/processor/call_stack.h" +#include "google_breakpad/processor/code_module.h" +#include "google_breakpad/processor/source_line_resolver_interface.h" +#include "google_breakpad/processor/stack_frame_cpu.h" +#include "processor/stackwalker_unittest_utils.h" +#include "processor/stackwalker_riscv.h" +#include "processor/windows_frame_info.h" + +using google_breakpad::BasicSourceLineResolver; +using google_breakpad::CallStack; +using google_breakpad::CodeModule; +using google_breakpad::StackFrameSymbolizer; +using google_breakpad::StackFrame; +using google_breakpad::StackFrameRISCV; +using google_breakpad::Stackwalker; +using google_breakpad::StackwalkerRISCV; +using google_breakpad::SystemInfo; +using google_breakpad::WindowsFrameInfo; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; +using std::vector; +using testing::_; +using testing::AnyNumber; +using testing::DoAll; +using testing::Return; +using testing::SetArgumentPointee; +using testing::Test; + +class StackwalkerRISCVFixture { +public: + StackwalkerRISCVFixture() + : stack_section(kLittleEndian), + // Give the two modules reasonable standard locations and names + // for tests to play with. + module1(0x40000000, 0x10000, "module1", "version1"), + module2(0x50000000, 0x10000, "module2", "version2") { + // Identify the system as an iOS system. + system_info.os = "iOS"; + system_info.os_short = "ios"; + system_info.cpu = "riscv"; + system_info.cpu_info = ""; + + // Put distinctive values in the raw CPU context. + BrandContext(&raw_context); + + // Create some modules with some stock debugging information. + modules.Add(&module1); + modules.Add(&module2); + + // By default, none of the modules have symbol info; call + // SetModuleSymbols to override this. + EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _)) + .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND)); + + // Avoid GMOCK WARNING "Uninteresting mock function call - returning + // directly" for FreeSymbolData(). + EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber()); + + // Reset max_frames_scanned since it's static. + Stackwalker::set_max_frames_scanned(1024); + } + + // Set the Breakpad symbol information that supplier should return for + // MODULE to INFO. + void SetModuleSymbols(MockCodeModule* module, const string& info) { + size_t buffer_size; + char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size); + EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _)) + .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer), + SetArgumentPointee<4>(buffer_size), + Return(MockSymbolSupplier::FOUND))); + } + + // Populate stack_region with the contents of stack_section. Use + // stack_section.start() as the region's starting address. + void RegionFromSection() { + string contents; + ASSERT_TRUE(stack_section.GetContents(&contents)); + stack_region.Init(stack_section.start().Value(), contents); + } + + // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking. + void BrandContext(MDRawContextRISCV *raw_context) { + uint8_t x = 173; + for (size_t i = 0; i < sizeof(*raw_context); i++) + reinterpret_cast(raw_context)[i] = (x += 17); + } + + SystemInfo system_info; + MDRawContextRISCV raw_context; + Section stack_section; + MockMemoryRegion stack_region; + MockCodeModule module1; + MockCodeModule module2; + MockCodeModules modules; + MockSymbolSupplier supplier; + BasicSourceLineResolver resolver; + CallStack call_stack; + const vector* frames; +}; + +class SanityCheck: public StackwalkerRISCVFixture, public Test { }; + +TEST_F(SanityCheck, NoResolver) { + // Since the context's frame pointer is garbage, the stack walk will end after + // the first frame. + StackFrameSymbolizer frame_symbolizer(NULL, NULL); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + // This should succeed even without a resolver or supplier. + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + StackFrameRISCV *frame = static_cast(frames->at(0)); + // Check that the values from the original raw context made it + // through to the context in the stack frame. + EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context))); +} + +class GetContextFrame: public StackwalkerRISCVFixture, public Test { }; + +// The stackwalker should be able to produce the context frame even +// without stack memory present. +TEST_F(GetContextFrame, NoStackMemory) { + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, NULL, &modules, + &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + StackFrameRISCV *frame = static_cast(frames->at(0)); + // Check that the values from the original raw context made it + // through to the context in the stack frame. + EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context))); +} + +class GetCallerFrame: public StackwalkerRISCVFixture, public Test { }; + +TEST_F(GetCallerFrame, ScanWithoutSymbols) { + // When the stack walker resorts to scanning the stack, + // only addresses located within loaded modules are + // considered valid return addresses. + // Force scanning through three frames to ensure that the + // stack pointer is set properly in scan-recovered frames. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(8, 0) // space + + .D32(0x40090000) // junk that's not + .D32(0x60000000) // a return address + + .D32(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(8, 0) // space + + .D32(0xF0000000) // more junk + .D32(0x0000000D) + + .D32(return_address2) // actual return address + // frame 2 + .Mark(&frame2_sp) + .Append(32, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(3U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + + StackFrameRISCV *frame2 = static_cast(frames->at(2)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP), + frame2->context_validity); + EXPECT_EQ(return_address2, frame2->context.pc); + EXPECT_EQ(frame2_sp.Value(), frame2->context.sp); +} + +TEST_F(GetCallerFrame, ScanWithFunctionSymbols) { + // During stack scanning, if a potential return address + // is located within a loaded module that has symbols, + // it is only considered a valid return address if it + // lies within a function's bounds. + stack_section.start() = 0x80000000; + uint64_t return_address = 0x50000200; + Label frame1_sp; + + stack_section + // frame 0 + .Append(8, 0) // space + + .D32(0x40090000) // junk that's not + .D32(0x60000000) // a return address + + .D32(0x40001000) // a couple of plausible addresses + .D32(0x5000F000) // that are not within functions + + .D32(return_address) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(32, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40000200; + raw_context.sp = stack_section.start().Value(); + + SetModuleSymbols(&module1, + // The youngest frame's function. + "FUNC 100 400 10 monotreme\n"); + SetModuleSymbols(&module2, + // The calling frame's function. + "FUNC 100 400 10 marsupial\n"); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + EXPECT_EQ("monotreme", frame0->function_name); + EXPECT_EQ(0x40000100UL, frame0->function_base); + + StackFrameRISCV *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + EXPECT_EQ("marsupial", frame1->function_name); + EXPECT_EQ(0x50000100UL, frame1->function_base); +} + +TEST_F(GetCallerFrame, ScanFirstFrame) { + // If the stackwalker resorts to stack scanning, it will scan much + // farther to find the caller of the context frame. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(16, 0) // space + + .D32(0x40090000) // junk that's not + .D32(0x60000000) // a return address + + .Append(48, 0) // more space + + .D32(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(16, 0) // space + + .D32(0xF0000000) // more junk + .D32(0x0000000D) + + .Append(168, 0) // more space + + .D32(return_address2) // actual return address + // (won't be found) + // frame 2 + .Mark(&frame2_sp) + .Append(32, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); +} + +// Test that set_max_frames_scanned prevents using stack scanning +// to find caller frames. +TEST_F(GetCallerFrame, ScanningNotAllowed) { + // When the stack walker resorts to scanning the stack, + // only addresses located within loaded modules are + // considered valid return addresses. + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + stack_section + // frame 0 + .Append(8, 0) // space + + .D32(0x40090000) // junk that's not + .D32(0x60000000) // a return address + + .D32(return_address1) // actual return address + // frame 1 + .Mark(&frame1_sp) + .Append(8, 0) // space + + .D32(0xF0000000) // more junk + .D32(0x0000000D) + + .D32(return_address2) // actual return address + // frame 2 + .Mark(&frame2_sp) + .Append(32, 0); // end of stack + RegionFromSection(); + + raw_context.pc = 0x40005510; + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + Stackwalker::set_max_frames_scanned(0); + + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(1U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); +} + +class GetFramesByFramePointer: + public StackwalkerRISCVFixture, + public Test { }; + +TEST_F(GetFramesByFramePointer, OnlyFramePointer) { + stack_section.start() = 0x80000000; + uint64_t return_address1 = 0x50000100; + uint64_t return_address2 = 0x50000900; + Label frame1_sp, frame2_sp; + Label frame1_fp, frame2_fp; + stack_section + // frame 0 + .Append(32, 0) // Whatever values on the stack. + .D32(0x0000000D) // junk that's not + .D32(0xF0000000) // a return address. + + .Mark(&frame1_fp) // Next fp will point to the next value. + .D32(frame2_fp) // Save current frame pointer. + .D32(return_address2) // Save current link register. + .Mark(&frame1_sp) + + // frame 1 + .Append(32, 0) // Whatever values on the stack. + .D32(0x0000000D) // junk that's not + .D32(0xF0000000) // a return address. + + .Mark(&frame2_fp) + .D32(0) + .D32(0) + .Mark(&frame2_sp) + + // frame 2 + .Append(32, 0) // Whatever values on the stack. + .D32(0x0000000D) // junk that's not + .D32(0xF0000000); // a return address. + RegionFromSection(); + + + raw_context.pc = 0x40005510; + raw_context.ra = return_address1; + raw_context.s0 = frame1_fp.Value(); + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, + &stack_region, &modules, &frame_symbolizer); + + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(2U, modules_without_symbols.size()); + ASSERT_EQ("module1", modules_without_symbols[0]->debug_file()); + ASSERT_EQ("module2", modules_without_symbols[1]->debug_file()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(3U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(StackFrameRISCV::CONTEXT_VALID_ALL, + frame0->context_validity); + EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context))); + + StackFrameRISCV *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_RA | + StackFrameRISCV::CONTEXT_VALID_S0 | + StackFrameRISCV::CONTEXT_VALID_SP), + frame1->context_validity); + EXPECT_EQ(return_address1, frame1->context.pc); + EXPECT_EQ(return_address2, frame1->context.ra); + EXPECT_EQ(frame1_sp.Value(), frame1->context.sp); + EXPECT_EQ(frame2_fp.Value(), frame1->context.s0); + + StackFrameRISCV *frame2 = static_cast(frames->at(2)); + EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust); + ASSERT_EQ((StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_RA | + StackFrameRISCV::CONTEXT_VALID_S0 | + StackFrameRISCV::CONTEXT_VALID_SP), + frame2->context_validity); + EXPECT_EQ(return_address2, frame2->context.pc); + EXPECT_EQ(0U, frame2->context.ra); + EXPECT_EQ(frame2_sp.Value(), frame2->context.sp); + EXPECT_EQ(0U, frame2->context.s0); +} + +struct CFIFixture: public StackwalkerRISCVFixture { + CFIFixture() { + // Provide a bunch of STACK CFI records; we'll walk to the caller + // from every point in this series, expecting to find the same set + // of register values. + SetModuleSymbols(&module1, + // The youngest frame's function. + "FUNC 4000 1000 10 enchiridion\n" + // Initially, nothing has been pushed on the stack, + // and the return address is still in the return + // address register (ra). + "STACK CFI INIT 4000 100 .cfa: sp 0 + .ra: ra\n" + // Push s1, s2, the frame pointer (s0) and the + // return address register. + "STACK CFI 4001 .cfa: sp 16 + .ra: .cfa -4 + ^" + " s1: .cfa -16 + ^ s2: .cfa -12 + ^ " + " s0: .cfa -8 + ^\n" + // Save s1..s4 in a1..a4: verify that we populate + // the youngest frame with all the values we have. + "STACK CFI 4002 s1: a1 s2: a2 s3: a3 s4: a4\n" + // Restore s1..s4. Save the non-callee-saves register a2. + "STACK CFI 4003 .cfa: sp 20 + a2: .cfa 20 - ^" + " s1: s1 s2: s2 s3: s3 s4: s4\n" + // Move the .cfa back eight bytes, to point at the return + // address, and restore the sp explicitly. + "STACK CFI 4005 .cfa: sp 16 + a2: .cfa 16 - ^" + " s0: .cfa 4 - ^ .ra: .cfa ^ sp: .cfa 4 +\n" + // Recover the PC explicitly from a new stack slot; + // provide garbage for the .ra. + "STACK CFI 4006 .cfa: sp 20 + pc: .cfa 20 - ^\n" + + // The calling function. + "FUNC 5000 1000 10 epictetus\n" + // Mark it as end of stack. + "STACK CFI INIT 5000 1000 .cfa: 0 .ra: 0\n" + + // A function whose CFI makes the stack pointer + // go backwards. + "FUNC 6000 1000 20 palinal\n" + "STACK CFI INIT 6000 1000 .cfa: sp 4 - .ra: ra\n" + + // A function with CFI expressions that can't be + // evaluated. + "FUNC 7000 1000 20 rhetorical\n" + "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n"); + + // Provide some distinctive values for the caller's registers. + expected.pc = 0x40005510; + expected.sp = 0x80000000; + expected.s1 = 0xb5d55e68; + expected.s2 = 0xebd134f3; + expected.s3 = 0xa31e74bc; + expected.s4 = 0x2dcb16b3; + expected.s5 = 0x2ada2137; + expected.s6 = 0xbbbb557d; + expected.s7 = 0x48bf8ca7; + expected.s8 = 0xab4621f0; + expected.s9 = 0x32b71467; + expected.s10 = 0xa673645f; + expected.s11 = 0xa673645f; + expected.s0 = 0x8112e110; + + // Expect CFI to recover all callee-saves registers. Since CFI is the + // only stack frame construction technique we have, aside from the + // context frame itself, there's no way for us to have a set of valid + // registers smaller than this. + expected_validity = (StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP | + StackFrameRISCV::CONTEXT_VALID_S1 | + StackFrameRISCV::CONTEXT_VALID_S2 | + StackFrameRISCV::CONTEXT_VALID_S3 | + StackFrameRISCV::CONTEXT_VALID_S4 | + StackFrameRISCV::CONTEXT_VALID_S5 | + StackFrameRISCV::CONTEXT_VALID_S6 | + StackFrameRISCV::CONTEXT_VALID_S7 | + StackFrameRISCV::CONTEXT_VALID_S8 | + StackFrameRISCV::CONTEXT_VALID_S9 | + StackFrameRISCV::CONTEXT_VALID_S10 | + StackFrameRISCV::CONTEXT_VALID_S11 | + StackFrameRISCV::CONTEXT_VALID_S0); + + // By default, context frames provide all registers, as normal. + context_frame_validity = StackFrameRISCV::CONTEXT_VALID_ALL; + + // By default, registers are unchanged. + raw_context = expected; + } + + // Walk the stack, using stack_section as the contents of the stack + // and raw_context as the current register values. (Set the stack + // pointer to the stack's starting address.) Expect two stack + // frames; in the older frame, expect the callee-saves registers to + // have values matching those in 'expected'. + void CheckWalk() { + RegionFromSection(); + raw_context.sp = stack_section.start().Value(); + + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + walker.SetContextFrameValidity(context_frame_validity); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(2U, frames->size()); + + StackFrameRISCV *frame0 = static_cast(frames->at(0)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust); + ASSERT_EQ(context_frame_validity, frame0->context_validity); + EXPECT_EQ("enchiridion", frame0->function_name); + EXPECT_EQ(0x40004000U, frame0->function_base); + + StackFrameRISCV *frame1 = static_cast(frames->at(1)); + EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust); + ASSERT_EQ(expected_validity, frame1->context_validity); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_A2) + EXPECT_EQ(expected.a2, frame1->context.a2); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S1) + EXPECT_EQ(expected.s1, frame1->context.s1); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S2) + EXPECT_EQ(expected.s2, frame1->context.s2); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S3) + EXPECT_EQ(expected.s3, frame1->context.s3); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S4) + EXPECT_EQ(expected.s4, frame1->context.s4); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S5) + EXPECT_EQ(expected.s5, frame1->context.s5); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S6) + EXPECT_EQ(expected.s6, frame1->context.s6); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S7) + EXPECT_EQ(expected.s7, frame1->context.s7); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S8) + EXPECT_EQ(expected.s8, frame1->context.s8); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S9) + EXPECT_EQ(expected.s9, frame1->context.s9); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S10) + EXPECT_EQ(expected.s10, frame1->context.s10); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S11) + EXPECT_EQ(expected.s11, frame1->context.s11); + if (expected_validity & StackFrameRISCV::CONTEXT_VALID_S0) + EXPECT_EQ(expected.s0, frame1->context.s0); + + // We would never have gotten a frame in the first place if the SP + // and PC weren't valid or ->instruction weren't set. + EXPECT_EQ(expected.sp, frame1->context.sp); + EXPECT_EQ(expected.pc, frame1->context.pc); + EXPECT_EQ(expected.pc, frame1->instruction + 4); + EXPECT_EQ("epictetus", frame1->function_name); + } + + // The values we expect to find for the caller's registers. + MDRawContextRISCV expected; + + // The validity mask for expected. + int expected_validity; + + // The validity mask to impose on the context frame. + int context_frame_validity; +}; + +class CFI: public CFIFixture, public Test { }; + +TEST_F(CFI, At4000) { + stack_section.start() = expected.sp; + raw_context.pc = 0x40004000; + raw_context.ra = 0x40005510; + CheckWalk(); +} + +TEST_F(CFI, At4001) { + Label frame1_sp = expected.sp; + stack_section + .D32(0xb5d55e68) // saved s1 + .D32(0xebd134f3) // saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004001; + // distinct callee s1, s2 and s0 + raw_context.s1 = 0xa635adc9; + raw_context.s2 = 0x35ac6231; + raw_context.s0 = 0xbe145fc4; + CheckWalk(); +} + +// As above, but unwind from a context that has only the PC and SP. +TEST_F(CFI, At4001LimitedValidity) { + Label frame1_sp = expected.sp; + stack_section + .D32(0xb5d55e68) // saved s1 + .D32(0xebd134f3) // saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + context_frame_validity = StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP; + raw_context.pc = 0x40004001; + raw_context.s0 = 0xbe145fc4; + + expected_validity = (StackFrameRISCV::CONTEXT_VALID_PC | + StackFrameRISCV::CONTEXT_VALID_SP | + StackFrameRISCV::CONTEXT_VALID_S0 | + StackFrameRISCV::CONTEXT_VALID_S1 | + StackFrameRISCV::CONTEXT_VALID_S2); + CheckWalk(); +} + +TEST_F(CFI, At4002) { + Label frame1_sp = expected.sp; + stack_section + .D32(0xfb81ff3d) // no longer saved s1 + .D32(0xebd134f3) // no longer saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004002; + raw_context.a1 = 0xb5d55e68; // saved a1 + raw_context.a2 = 0xebd134f3; // saved a2 + raw_context.a3 = 0xa31e74bc; // saved a3 + raw_context.a4 = 0x2dcb16b3; // saved a4 + raw_context.s1 = 0xa635adc9; // distinct callee s1 + raw_context.s2 = 0x35ac6231; // distinct callee s2 + raw_context.s3 = 0x4356ac45; // distinct callee s3 + raw_context.s4 = 0x562f2561; // distinct callee s4 + // distinct callee s0 + raw_context.s0 = 0xbe145fc4; + CheckWalk(); +} + +TEST_F(CFI, At4003) { + Label frame1_sp = expected.sp; + stack_section + .D32(0x48c8dd5a) // saved a2 (even though it's not callee-saves) + .D32(0xfb81ff3d) // no longer saved s1 + .D32(0xebd134f3) // no longer saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004003; + // distinct callee a2 and fp + raw_context.a2 = 0xfb756319; + raw_context.s0 = 0xbe145fc4; + // caller's a2 + expected.a2 = 0x48c8dd5a; + expected_validity |= StackFrameRISCV::CONTEXT_VALID_A2; + CheckWalk(); +} + +// We have no new rule at module offset 0x4004, so the results here should +// be the same as those at module offset 0x4003. +TEST_F(CFI, At4004) { + Label frame1_sp = expected.sp; + stack_section + .D32(0x48c8dd5a) // saved a2 (even though it's not callee-saves) + .D32(0xfb81ff3d) // no longer saved s1 + .D32(0xebd134f3) // no longer saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004004; + // distinct callee a2 and s0 + raw_context.a2 = 0xfb756319; + raw_context.s0 = 0xbe145fc4; + // caller's a2 + expected.a2 = 0x48c8dd5a; + expected_validity |= StackFrameRISCV::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Here we move the .cfa, but provide an explicit rule to recover the SP, +// so again there should be no change in the registers recovered. +TEST_F(CFI, At4005) { + Label frame1_sp = expected.sp; + stack_section + .D32(0x48c8dd5a) // saved a2 (even though it's not callee-saves) + .D32(0xfb81ff3d) // no longer saved s1 + .D32(0xebd134f3) // no longer saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x40005510) // return address + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004005; + raw_context.a2 = 0xfb756319; // distinct callee a2 + expected.a2 = 0x48c8dd5a; // caller's a2 + expected_validity |= StackFrameRISCV::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Here we provide an explicit rule for the PC, and have the saved .ra be +// bogus. +TEST_F(CFI, At4006) { + Label frame1_sp = expected.sp; + stack_section + .D32(0x40005510) // saved pc + .D32(0x48c8dd5a) // saved a2 (even though it's not callee-saves) + .D32(0xfb81ff3d) // no longer saved s1 + .D32(0xebd134f3) // no longer saved s2 + .D32(0x8112e110) // saved s0 + .D32(0x5783f8d1) // .ra rule recovers this, which is garbage + .Mark(&frame1_sp); // This effectively sets stack_section.start(). + raw_context.pc = 0x40004006; + raw_context.a2 = 0xfb756319; // distinct callee a2 + expected.a2 = 0x48c8dd5a; // caller's a2 + expected_validity |= StackFrameRISCV::CONTEXT_VALID_A2; + CheckWalk(); +} + +// Check that we reject rules that would cause the stack pointer to +// move in the wrong direction. +TEST_F(CFI, RejectBackwards) { + raw_context.pc = 0x40006000; + raw_context.sp = 0x80000000; + raw_context.ra = 0x40005510; + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); +} + +// Check that we reject rules whose expressions' evaluation fails. +TEST_F(CFI, RejectBadExpressions) { + raw_context.pc = 0x40007000; + raw_context.sp = 0x80000000; + StackFrameSymbolizer frame_symbolizer(&supplier, &resolver); + StackwalkerRISCV walker(&system_info, &raw_context, &stack_region, + &modules, &frame_symbolizer); + vector modules_without_symbols; + vector modules_with_corrupt_symbols; + ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols, + &modules_with_corrupt_symbols)); + ASSERT_EQ(0U, modules_without_symbols.size()); + ASSERT_EQ(0U, modules_with_corrupt_symbols.size()); + frames = call_stack.frames(); + ASSERT_EQ(1U, frames->size()); +} diff --git a/src/third_party/curl/curlbuild.h b/src/third_party/curl/curlbuild.h index 595df4e45..2fb1d0204 100644 --- a/src/third_party/curl/curlbuild.h +++ b/src/third_party/curl/curlbuild.h @@ -156,7 +156,8 @@ /* The size of `long', as computed by sizeof. */ #if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) || \ defined(__aarch64__) || (defined(__mips__) && _MIPS_SIM == _ABI64) || \ - defined(__powerpc64__) || defined(__s390x__) || defined(__LP64__) + defined(__powerpc64__) || defined(__s390x__) || defined(__LP64__) || \ + (defined(__riscv) && __riscv_xlen == 64) #define CURL_SIZEOF_LONG 8 #else #define CURL_SIZEOF_LONG 4 diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 522b9d1c0..a4ddbe8e9 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -76,6 +76,8 @@ #define ELF_ARCH EM_MIPS #elif defined(__aarch64__) #define ELF_ARCH EM_AARCH64 +#elif defined(__riscv) + #define ELF_ARCH EM_RISCV #endif #if defined(__arm__) @@ -83,7 +85,7 @@ // containing core registers, while they use 'user_regs_struct' on other // architectures. This file-local typedef simplifies the source code. typedef user_regs user_regs_struct; -#elif defined (__mips__) +#elif defined (__mips__) || defined(__riscv) // This file-local typedef simplifies the source code. typedef gregset_t user_regs_struct; #endif @@ -258,7 +260,7 @@ typedef struct prpsinfo { /* Information about process */ unsigned char pr_zomb; /* Zombie */ signed char pr_nice; /* Nice val */ unsigned long pr_flag; /* Flags */ -#if defined(__x86_64__) || defined(__mips__) +#if defined(__x86_64__) || defined(__mips__) || defined(__riscv) uint32_t pr_uid; /* User ID */ uint32_t pr_gid; /* Group ID */ #else @@ -305,7 +307,7 @@ struct CrashedProcess { struct Thread { pid_t tid; -#if defined(__mips__) +#if defined(__mips__) || defined(__riscv) mcontext_t mcontext; #else user_regs_struct regs; @@ -532,6 +534,71 @@ ParseThreadRegisters(CrashedProcess::Thread* thread, thread->mcontext.fpc_eir = rawregs->float_save.fir; #endif } +#elif defined(__riscv) +static void +ParseThreadRegisters(CrashedProcess::Thread* thread, + const MinidumpMemoryRange& range) { +# if __riscv_xlen == 32 + const MDRawContextRISCV* rawregs = range.GetData(0); +# elif __riscv_xlen == 64 + const MDRawContextRISCV64* rawregs = range.GetData(0); +# else +# error "Unexpected __riscv_xlen" +# endif + + thread->mcontext.__gregs[0] = rawregs->pc; + thread->mcontext.__gregs[1] = rawregs->ra; + thread->mcontext.__gregs[2] = rawregs->sp; + thread->mcontext.__gregs[3] = rawregs->gp; + thread->mcontext.__gregs[4] = rawregs->tp; + thread->mcontext.__gregs[5] = rawregs->t0; + thread->mcontext.__gregs[6] = rawregs->t1; + thread->mcontext.__gregs[7] = rawregs->t2; + thread->mcontext.__gregs[8] = rawregs->s0; + thread->mcontext.__gregs[9] = rawregs->s1; + thread->mcontext.__gregs[10] = rawregs->a0; + thread->mcontext.__gregs[11] = rawregs->a1; + thread->mcontext.__gregs[12] = rawregs->a2; + thread->mcontext.__gregs[13] = rawregs->a3; + thread->mcontext.__gregs[14] = rawregs->a4; + thread->mcontext.__gregs[15] = rawregs->a5; + thread->mcontext.__gregs[16] = rawregs->a6; + thread->mcontext.__gregs[17] = rawregs->a7; + thread->mcontext.__gregs[18] = rawregs->s2; + thread->mcontext.__gregs[19] = rawregs->s3; + thread->mcontext.__gregs[20] = rawregs->s4; + thread->mcontext.__gregs[21] = rawregs->s5; + thread->mcontext.__gregs[22] = rawregs->s6; + thread->mcontext.__gregs[23] = rawregs->s7; + thread->mcontext.__gregs[24] = rawregs->s8; + thread->mcontext.__gregs[25] = rawregs->s9; + thread->mcontext.__gregs[26] = rawregs->s10; + thread->mcontext.__gregs[27] = rawregs->s11; + thread->mcontext.__gregs[28] = rawregs->t3; + thread->mcontext.__gregs[29] = rawregs->t4; + thread->mcontext.__gregs[30] = rawregs->t5; + thread->mcontext.__gregs[31] = rawregs->t6; + +# if __riscv_flen == 32 + for (int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; ++i) { + thread->mcontext.__fpregs.__f.__f[i] = rawregs->float_save.regs[i]; + } + thread->mcontext.__fpregs.__f.__fcsr = rawregs->float_save.fpcsr; +# elif __riscv_flen == 64 + for (int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; ++i) { + thread->mcontext.__fpregs.__d.__f[i] = rawregs->float_save.regs[i]; + } + thread->mcontext.__fpregs.__d.__fcsr = rawregs->float_save.fpcsr; +# elif __riscv_flen == 128 + for (int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; ++i) { + thread->mcontext.__fpregs.__q.__f[2*i] = rawregs->float_save.regs[i].high; + thread->mcontext.__fpregs.__q.__f[2*i+1] = rawregs->float_save.regs[i].low; + } + thread->mcontext.__fpregs.__q.__fcsr = rawregs->float_save.fpcsr; +# else +# error "Unexpected __riscv_flen" +# endif +} #else #error "This code has not been ported to your platform yet" #endif @@ -621,6 +688,22 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo, # else # error "This mips ABI is currently not supported (n32)" # endif +#elif defined(__riscv) +# if __riscv_xlen == 32 + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_RISCV) { + fprintf(stderr, + "This version of minidump-2-core only supports RISCV.\n"); + exit(1); + } +# elif __riscv_xlen == 64 + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_RISCV64) { + fprintf(stderr, + "This version of minidump-2-core only supports RISCV64.\n"); + exit(1); + } +# else +# error "Unexpected __riscv_xlen" +# endif #else #error "This code has not been ported to your platform yet" #endif @@ -648,6 +731,10 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo, ? "MIPS" : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS64 ? "MIPS64" + : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_RISCV + ? "RISCV" + : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_RISCV64 + ? "RISCV64" : "???", sysinfo->number_of_processors, sysinfo->processor_level, @@ -925,6 +1012,8 @@ WriteThread(const Options& options, const CrashedProcess::Thread& thread, pr.pr_pid = thread.tid; #if defined(__mips__) memcpy(&pr.pr_reg, &thread.mcontext.gregs, sizeof(user_regs_struct)); +#elif defined(__riscv) + memcpy(&pr.pr_reg, &thread.mcontext.__gregs, sizeof(user_regs_struct)); #else memcpy(&pr.pr_reg, &thread.regs, sizeof(user_regs_struct)); #endif From e3af4457b8355fcf1814e6dfb6073a848b44a282 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 22 Sep 2022 19:33:12 +0000 Subject: [PATCH 119/195] Clean up module_unittest This change rewrites the tests to have `Module` as a prefix and rearranges them a little. This is prep for adding this file to breakpad_unittests Chromium-side. Bug: google-breakpad:751 Change-Id: I8a77f60a0080d06af13dd30d9cf7627dce045d90 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3915004 Reviewed-by: Mark Mentovai --- src/common/module_unittest.cc | 140 +++++++++++++++++----------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index de52ceffa..5b44f97ca 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -67,7 +67,7 @@ static Module::Function* generate_duplicate_function(StringView name) { #define MODULE_ID "id-string" #define MODULE_CODE_ID "code-id-string" -TEST(Write, Header) { +TEST(Module, WriteHeader) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); m.Write(s, ALL_SYMBOL_DATA); @@ -76,7 +76,7 @@ TEST(Write, Header) { contents.c_str()); } -TEST(Write, HeaderCodeId) { +TEST(Module, WriteHeaderCodeId) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, MODULE_CODE_ID); m.Write(s, ALL_SYMBOL_DATA); @@ -86,7 +86,7 @@ TEST(Write, HeaderCodeId) { contents.c_str()); } -TEST(Write, OneLineFunc) { +TEST(Module, WriteOneLineFunc) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -111,7 +111,7 @@ TEST(Write, OneLineFunc) { contents.c_str()); } -TEST(Write, RelativeLoadAddress) { +TEST(Module, WriteRelativeLoadAddress) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -169,7 +169,7 @@ TEST(Write, RelativeLoadAddress) { contents.c_str()); } -TEST(Write, OmitUnusedFiles) { +TEST(Module, WriteOmitUnusedFiles) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Create some source files. @@ -220,7 +220,7 @@ TEST(Write, OmitUnusedFiles) { contents.c_str()); } -TEST(Write, NoCFI) { +TEST(Module, WriteNoCFI) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -266,7 +266,7 @@ TEST(Write, NoCFI) { contents.c_str()); } -TEST(Construct, AddFunction) { +TEST(Module, ConstructAddFunction) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -308,7 +308,62 @@ TEST(Construct, AddFunction) { EXPECT_EQ((size_t) 2, vec.size()); } -TEST(Construct, AddFrames) { +TEST(Module, WriteOutOfRangeAddresses) { + stringstream s; + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); + + // Specify an allowed address range, representing a PT_LOAD segment in a + // module. + vector address_ranges = { + Module::Range(0x2000ULL, 0x1000ULL), + }; + m.SetAddressRanges(address_ranges); + + // Add three stack frames (one lower, one in, and one higher than the allowed + // address range). Only the middle frame should be captured. + Module::StackFrameEntry* entry1 = new Module::StackFrameEntry(); + entry1->address = 0x1000ULL; + entry1->size = 0x100ULL; + m.AddStackFrameEntry(entry1); + Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); + entry2->address = 0x2000ULL; + entry2->size = 0x100ULL; + m.AddStackFrameEntry(entry2); + Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); + entry3->address = 0x3000ULL; + entry3->size = 0x100ULL; + m.AddStackFrameEntry(entry3); + + // Add a function outside the allowed range. + Module::File* file = m.FindFile("file_name.cc"); + Module::Function* function = new Module::Function( + "function_name", 0x4000ULL); + Module::Range range(0x4000ULL, 0x1000ULL); + function->ranges.push_back(range); + function->parameter_size = 0x100ULL; + Module::Line line = { 0x4000ULL, 0x100ULL, file, 67519080 }; + function->lines.push_back(line); + m.AddFunction(function); + + // Add an extern outside the allowed range. + Module::Extern* extern1 = new Module::Extern(0x5000ULL); + extern1->name = "_xyz"; + m.AddExtern(extern1); + + m.Write(s, ALL_SYMBOL_DATA); + + EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n" + "STACK CFI INIT 2000 100 \n", + s.str().c_str()); + + // Cleanup - Prevent Memory Leak errors. + delete (extern1); + delete (function); + delete (entry3); + delete (entry1); +} + +TEST(Module, ConstructAddFrames) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -395,7 +450,7 @@ TEST(Construct, AddFrames) { EXPECT_THAT(entries[2]->rule_changes, ContainerEq(entry3_changes)); } -TEST(Construct, UniqueFiles) { +TEST(Module, ConstructUniqueFiles) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); Module::File* file1 = m.FindFile("foo"); Module::File* file2 = m.FindFile(string("bar")); @@ -408,7 +463,7 @@ TEST(Construct, UniqueFiles) { EXPECT_TRUE(m.FindExistingFile("baz") == NULL); } -TEST(Construct, DuplicateFunctions) { +TEST(Module, ConstructDuplicateFunctions) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -430,7 +485,7 @@ TEST(Construct, DuplicateFunctions) { contents.c_str()); } -TEST(Construct, FunctionsWithSameAddress) { +TEST(Module, ConstructFunctionsWithSameAddress) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -453,7 +508,7 @@ TEST(Construct, FunctionsWithSameAddress) { // Externs should be written out as PUBLIC records, sorted by // address. -TEST(Construct, Externs) { +TEST(Module, ConstructExterns) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -478,7 +533,7 @@ TEST(Construct, Externs) { // Externs with the same address should only keep the first entry // added. -TEST(Construct, DuplicateExterns) { +TEST(Module, ConstructDuplicateExterns) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -502,7 +557,7 @@ TEST(Construct, DuplicateExterns) { // If there exists an extern and a function at the same address, only write // out the FUNC entry. -TEST(Construct, FunctionsAndExternsWithSameAddress) { +TEST(Module, ConstructFunctionsAndExternsWithSameAddress) { stringstream s; Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); @@ -534,7 +589,7 @@ TEST(Construct, FunctionsAndExternsWithSameAddress) { // If there exists an extern and a function at the same address, only write // out the FUNC entry. For ARM THUMB, the extern that comes from the ELF // symbol section has bit 0 set. -TEST(Construct, FunctionsAndThumbExternsWithSameAddress) { +TEST(Module, ConstructFunctionsAndThumbExternsWithSameAddress) { stringstream s; Module m(MODULE_NAME, MODULE_OS, "arm", MODULE_ID); @@ -569,58 +624,3 @@ TEST(Construct, FunctionsAndThumbExternsWithSameAddress) { "PUBLIC cc00 0 arm_func\n", contents.c_str()); } - -TEST(Write, OutOfRangeAddresses) { - stringstream s; - Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); - - // Specify an allowed address range, representing a PT_LOAD segment in a - // module. - vector address_ranges = { - Module::Range(0x2000ULL, 0x1000ULL), - }; - m.SetAddressRanges(address_ranges); - - // Add three stack frames (one lower, one in, and one higher than the allowed - // address range). Only the middle frame should be captured. - Module::StackFrameEntry* entry1 = new Module::StackFrameEntry(); - entry1->address = 0x1000ULL; - entry1->size = 0x100ULL; - m.AddStackFrameEntry(entry1); - Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); - entry2->address = 0x2000ULL; - entry2->size = 0x100ULL; - m.AddStackFrameEntry(entry2); - Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); - entry3->address = 0x3000ULL; - entry3->size = 0x100ULL; - m.AddStackFrameEntry(entry3); - - // Add a function outside the allowed range. - Module::File* file = m.FindFile("file_name.cc"); - Module::Function* function = new Module::Function( - "function_name", 0x4000ULL); - Module::Range range(0x4000ULL, 0x1000ULL); - function->ranges.push_back(range); - function->parameter_size = 0x100ULL; - Module::Line line = { 0x4000ULL, 0x100ULL, file, 67519080 }; - function->lines.push_back(line); - m.AddFunction(function); - - // Add an extern outside the allowed range. - Module::Extern* extern1 = new Module::Extern(0x5000ULL); - extern1->name = "_xyz"; - m.AddExtern(extern1); - - m.Write(s, ALL_SYMBOL_DATA); - - EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n" - "STACK CFI INIT 2000 100 \n", - s.str().c_str()); - - // Cleanup - Prevent Memory Leak errors. - delete (extern1); - delete (function); - delete (entry3); - delete (entry1); -} From bcffe4fe60097fcb4252256204444381430494e4 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 30 Sep 2022 14:12:02 +0200 Subject: [PATCH 120/195] test: exploitability: Fix preprocessor guards for Linux Guard the Linux specific tests by checking for __linux__, as it does not only not work on Windows but not on macOS either. Change-Id: I0e710a6da8e6686f11bc8ea23e07ac19f3b4beb2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3928026 Reviewed-by: Mike Frysinger --- src/processor/exploitability_unittest.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index db3dc687a..b5e7feef2 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -37,12 +37,12 @@ #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/minidump_processor.h" #include "google_breakpad/processor/process_state.h" -#ifndef _WIN32 +#ifdef __linux__ #include "processor/exploitability_linux.h" -#endif // _WIN32 +#endif // __linux__ #include "processor/simple_symbol_supplier.h" -#ifndef _WIN32 +#ifdef __linux__ namespace google_breakpad { class ExploitabilityLinuxTest : public ExploitabilityLinux { @@ -64,15 +64,15 @@ class ExploitabilityLinuxTestMinidumpContext : public MinidumpContext { }; } // namespace google_breakpad -#endif // _WIN32 +#endif // __linux__ namespace { using google_breakpad::BasicSourceLineResolver; -#ifndef _WIN32 +#ifdef __linux__ using google_breakpad::ExploitabilityLinuxTest; using google_breakpad::ExploitabilityLinuxTestMinidumpContext; -#endif // _WIN32 +#endif // __linux__ using google_breakpad::MinidumpProcessor; using google_breakpad::ProcessState; using google_breakpad::SimpleSymbolSupplier; @@ -171,7 +171,7 @@ TEST(ExploitabilityTest, TestLinuxEngine) { ExploitabilityFor("linux_executable_heap.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp")); -#ifndef _WIN32 +#ifdef __linux__ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, ExploitabilityFor("linux_write_to_nonwritable_module.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, @@ -182,10 +182,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) { ExploitabilityFor("linux_write_to_outside_module_via_math.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING, ExploitabilityFor("linux_write_to_under_4k.dmp")); -#endif // _WIN32 +#endif // __linux__ } -#ifndef _WIN32 +#ifdef __linux__ TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) { ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 0, 5, NULL)); uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0}; @@ -299,6 +299,6 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) { context, &write_address)); } -#endif // _WIN32 +#endif // __linux__ } // namespace From 6289830b67c6765ec9bf1a2d1b8d249b6b845411 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 7 Oct 2022 10:43:07 +0200 Subject: [PATCH 121/195] Add DisassemblerObjdump. This extracts the existing objdump-based disassembler engine used in ExploitabilityLinux into a seperate reusable class, and adds support for most common address operand formats. This is a precursor to using DisassemblerObjdump to handle address resolution for non-canonical address dereferences on amd64. Bug: 901847 Change-Id: I1a06a86fc2e7c76b4d0e79eca5f8a6c501379f47 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3720740 Reviewed-by: Ivan Penkov Reviewed-by: Ivan Penkov --- Makefile.am | 20 + Makefile.in | 85 + aclocal.m4 | 4 +- configure | 4716 ++++++++++------- configure.ac | 14 +- src/config.h.in | 21 +- src/processor/disassembler_objdump.cc | 520 ++ src/processor/disassembler_objdump.h | 142 + .../disassembler_objdump_unittest.cc | 464 ++ src/processor/exploitability_linux.cc | 355 +- src/processor/exploitability_linux.h | 36 - src/processor/exploitability_unittest.cc | 126 - src/processor/processor.gyp | 3 + 13 files changed, 4163 insertions(+), 2343 deletions(-) create mode 100644 src/processor/disassembler_objdump.cc create mode 100644 src/processor/disassembler_objdump.h create mode 100644 src/processor/disassembler_objdump_unittest.cc diff --git a/Makefile.am b/Makefile.am index 281bc5222..0f571bcfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -237,6 +237,8 @@ src_libbreakpad_a_SOURCES = \ src/processor/contained_range_map.h \ src/processor/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ src/processor/dump_context.cc \ @@ -390,6 +392,7 @@ check_PROGRAMS += \ src/processor/basic_source_line_resolver_unittest \ src/processor/cfi_frame_info_unittest \ src/processor/contained_range_map_unittest \ + src/processor/disassembler_objdump_unittest \ src/processor/disassembler_x86_unittest \ src/processor/exploitability_unittest \ src/processor/fast_source_line_resolver_unittest \ @@ -873,6 +876,7 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ src/processor/process_state.o \ + src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -909,6 +913,19 @@ src_processor_exploitability_unittest_LDADD = \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +src_processor_disassembler_objdump_unittest_SOURCES = \ + src/processor/disassembler_objdump_unittest.cc +src_processor_disassembler_objdump_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_processor_disassembler_objdump_unittest_LDADD = \ + src/processor/disassembler_objdump.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_processor_disassembler_x86_unittest_SOURCES = \ src/processor/disassembler_x86_unittest.cc src_processor_disassembler_x86_unittest_CPPFLAGS = \ @@ -992,6 +1009,7 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1141,6 +1159,7 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o \ + src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -1366,6 +1385,7 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ diff --git a/Makefile.in b/Makefile.in index 729498824..b373cc8c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -176,6 +176,7 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest \ @@ -278,6 +279,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest$(EXEEXT) \ @@ -449,6 +451,8 @@ am__src_libbreakpad_a_SOURCES_DIST = \ src/processor/contained_range_map.h \ src/processor/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ src/processor/dump_context.cc src/processor/dump_object.cc \ @@ -525,6 +529,7 @@ am__src_libbreakpad_a_SOURCES_DIST = \ @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.$(OBJEXT) \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.$(OBJEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.$(OBJEXT) \ @@ -959,6 +964,20 @@ src_processor_contained_range_map_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_DEPENDENCIES = \ @DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o +am__src_processor_disassembler_objdump_unittest_SOURCES_DIST = \ + src/processor/disassembler_objdump_unittest.cc +@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_objdump_unittest_OBJECTS = src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.$(OBJEXT) +src_processor_disassembler_objdump_unittest_OBJECTS = \ + $(am_src_processor_disassembler_objdump_unittest_OBJECTS) +@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_DEPENDENCIES = \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ +@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) am__src_processor_disassembler_x86_unittest_SOURCES_DIST = \ src/processor/disassembler_x86_unittest.cc @DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT) @@ -978,6 +997,7 @@ src_processor_exploitability_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES = src/processor/convert_old_arm64_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ @@ -1143,6 +1163,7 @@ src_processor_minidump_processor_unittest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ @@ -1188,6 +1209,7 @@ src_processor_minidump_stackwalk_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ @@ -1411,6 +1433,7 @@ src_processor_stackwalker_selftest_OBJECTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ @@ -1885,6 +1908,8 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/processor/$(DEPDIR)/client_linux_linux_client_unittest_shlib-proc_maps_linux.Po \ src/processor/$(DEPDIR)/contained_range_map_unittest.Po \ src/processor/$(DEPDIR)/convert_old_arm64_context.Po \ + src/processor/$(DEPDIR)/disassembler_objdump.Po \ + src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po \ src/processor/$(DEPDIR)/disassembler_x86.Po \ src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Po \ src/processor/$(DEPDIR)/dump_context.Po \ @@ -2038,6 +2063,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_processor_basic_source_line_resolver_unittest_SOURCES) \ $(src_processor_cfi_frame_info_unittest_SOURCES) \ $(src_processor_contained_range_map_unittest_SOURCES) \ + $(src_processor_disassembler_objdump_unittest_SOURCES) \ $(src_processor_disassembler_x86_unittest_SOURCES) \ $(src_processor_exploitability_unittest_SOURCES) \ $(src_processor_fast_source_line_resolver_unittest_SOURCES) \ @@ -2097,6 +2123,7 @@ DIST_SOURCES = \ $(am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST) \ $(am__src_processor_cfi_frame_info_unittest_SOURCES_DIST) \ $(am__src_processor_contained_range_map_unittest_SOURCES_DIST) \ + $(am__src_processor_disassembler_objdump_unittest_SOURCES_DIST) \ $(am__src_processor_disassembler_x86_unittest_SOURCES_DIST) \ $(am__src_processor_exploitability_unittest_SOURCES_DIST) \ $(am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST) \ @@ -2649,6 +2676,8 @@ CLEANFILES = $(am__append_12) @DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map.h \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.h \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.h \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.h \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.cc \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.cc \ @@ -3172,6 +3201,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ @@ -3208,6 +3238,21 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ @DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_SOURCES = \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest.cc + +@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_CPPFLAGS = \ +@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) + +@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_LDADD = \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ +@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ +@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + @DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_SOURCES = \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest.cc @@ -3301,6 +3346,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ @@ -3470,6 +3516,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ @@ -3721,6 +3768,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ +@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ @DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ @@ -4356,6 +4404,9 @@ src/processor/cfi_frame_info.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/convert_old_arm64_context.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) +src/processor/disassembler_objdump.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/disassembler_x86.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -4970,6 +5021,13 @@ src/processor/contained_range_map_unittest.$(OBJEXT): \ src/processor/contained_range_map_unittest$(EXEEXT): $(src_processor_contained_range_map_unittest_OBJECTS) $(src_processor_contained_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_contained_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp) @rm -f src/processor/contained_range_map_unittest$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_processor_contained_range_map_unittest_OBJECTS) $(src_processor_contained_range_map_unittest_LDADD) $(LIBS) +src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) + +src/processor/disassembler_objdump_unittest$(EXEEXT): $(src_processor_disassembler_objdump_unittest_OBJECTS) $(src_processor_disassembler_objdump_unittest_DEPENDENCIES) $(EXTRA_src_processor_disassembler_objdump_unittest_DEPENDENCIES) src/processor/$(am__dirstamp) + @rm -f src/processor/disassembler_objdump_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_processor_disassembler_objdump_unittest_OBJECTS) $(src_processor_disassembler_objdump_unittest_LDADD) $(LIBS) src/processor/disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -5704,6 +5762,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/client_linux_linux_client_unittest_shlib-proc_maps_linux.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/contained_range_map_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/convert_old_arm64_context.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_objdump.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_x86.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/dump_context.Po@am__quote@ # am--include-marker @@ -7482,6 +7542,20 @@ src/processor/cfi_frame_info_unittest-cfi_frame_info_unittest.obj: src/processor @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi` +src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.o: src/processor/disassembler_objdump_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_objdump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Tpo -c -o src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.o `test -f 'src/processor/disassembler_objdump_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_objdump_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Tpo src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_objdump_unittest.cc' object='src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_objdump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.o `test -f 'src/processor/disassembler_objdump_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_objdump_unittest.cc + +src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.obj: src/processor/disassembler_objdump_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_objdump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Tpo -c -o src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.obj `if test -f 'src/processor/disassembler_objdump_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_objdump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_objdump_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Tpo src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_objdump_unittest.cc' object='src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_objdump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.obj `if test -f 'src/processor/disassembler_objdump_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_objdump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_objdump_unittest.cc'; fi` + src/processor/disassembler_x86_unittest-disassembler_x86_unittest.o: src/processor/disassembler_x86_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/disassembler_x86_unittest-disassembler_x86_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Po @@ -9131,6 +9205,13 @@ src/processor/contained_range_map_unittest.log: src/processor/contained_range_ma --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/processor/disassembler_objdump_unittest.log: src/processor/disassembler_objdump_unittest$(EXEEXT) + @p='src/processor/disassembler_objdump_unittest$(EXEEXT)'; \ + b='src/processor/disassembler_objdump_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/disassembler_x86_unittest.log: src/processor/disassembler_x86_unittest$(EXEEXT) @p='src/processor/disassembler_x86_unittest$(EXEEXT)'; \ b='src/processor/disassembler_x86_unittest'; \ @@ -9887,6 +9968,8 @@ distclean: distclean-am -rm -f src/processor/$(DEPDIR)/client_linux_linux_client_unittest_shlib-proc_maps_linux.Po -rm -f src/processor/$(DEPDIR)/contained_range_map_unittest.Po -rm -f src/processor/$(DEPDIR)/convert_old_arm64_context.Po + -rm -f src/processor/$(DEPDIR)/disassembler_objdump.Po + -rm -f src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po -rm -f src/processor/$(DEPDIR)/disassembler_x86.Po -rm -f src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Po -rm -f src/processor/$(DEPDIR)/dump_context.Po @@ -10239,6 +10322,8 @@ maintainer-clean: maintainer-clean-am -rm -f src/processor/$(DEPDIR)/client_linux_linux_client_unittest_shlib-proc_maps_linux.Po -rm -f src/processor/$(DEPDIR)/contained_range_map_unittest.Po -rm -f src/processor/$(DEPDIR)/convert_old_arm64_context.Po + -rm -f src/processor/$(DEPDIR)/disassembler_objdump.Po + -rm -f src/processor/$(DEPDIR)/disassembler_objdump_unittest-disassembler_objdump_unittest.Po -rm -f src/processor/$(DEPDIR)/disassembler_x86.Po -rm -f src/processor/$(DEPDIR)/disassembler_x86_unittest-disassembler_x86_unittest.Po -rm -f src/processor/$(DEPDIR)/dump_context.Po diff --git a/aclocal.m4 b/aclocal.m4 index f0d013ba0..009cc48ed 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/configure b/configure index 787b1b259..22f0a0264 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for breakpad 0.1. +# Generated by GNU Autoconf 2.71 for breakpad 0.1. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,42 +169,53 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +223,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,18 +255,19 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: google-breakpad-dev@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -294,6 +295,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +313,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -325,7 +335,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +344,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,12 +383,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -390,18 +401,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -413,9 +433,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +462,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -486,7 +506,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -500,6 +520,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +537,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -588,40 +619,36 @@ PACKAGE_URL='' ac_unique_file="README.md" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -876,8 +903,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -918,9 +943,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -944,9 +969,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1157,9 +1182,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1173,9 +1198,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1219,9 +1244,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1237,7 +1262,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1301,7 +1326,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1516,9 +1541,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1546,7 +1571,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1554,7 +1580,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1564,9 +1590,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF breakpad configure 0.1 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1583,14 +1609,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1598,14 +1624,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1627,7 +1654,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1635,14 +1662,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1658,14 +1686,14 @@ fi ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1673,14 +1701,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1690,47 +1719,38 @@ fi } # ac_fn_cxx_try_compile -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_try_run +} # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- @@ -1738,14 +1758,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1753,17 +1773,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1778,139 +1799,18 @@ fi } # ac_fn_c_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## --------------------------------------------------- ## -## Report this to google-breakpad-dev@googlegroups.com ## -## --------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1918,16 +1818,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1945,35 +1838,56 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by breakpad $as_me 0.1, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2006,8 +1920,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2042,7 +1960,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2077,11 +1995,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2092,8 +2012,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2117,7 +2037,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2125,14 +2045,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2140,15 +2060,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2156,8 +2076,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2171,63 +2091,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2237,138 +2142,746 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_aux_dir= -for ac_dir in autotools "$srcdir"/autotools; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="compile ar-lib missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/autotools" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2387,21 +2900,22 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2423,7 +2937,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2437,20 +2952,25 @@ am__api_version='1.16' # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2460,13 +2980,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2474,12 +2994,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2495,7 +3015,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2505,8 +3025,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2516,8 +3036,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2571,8 +3091,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -2591,12 +3111,14 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then + + if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL @@ -2604,8 +3126,8 @@ if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -2625,11 +3147,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -2637,11 +3160,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2652,11 +3179,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2665,11 +3192,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -2677,11 +3205,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2692,11 +3224,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2704,8 +3236,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2717,25 +3249,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -2746,7 +3284,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -2756,18 +3294,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -2775,11 +3314,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2790,24 +3333,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -2823,12 +3367,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2842,7 +3386,8 @@ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -2852,12 +3397,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -2869,8 +3415,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -2905,14 +3451,10 @@ fi VERSION='0.1' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -2958,29 +3500,29 @@ _am_tools='gnutar plaintar pax cpio none' # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 -$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 -$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. @@ -3055,14 +3597,15 @@ $as_echo_n "checking how to create a ustar tar archive... " >&6; } done rm -rf conftest.dir - if ${am_cv_prog_tar_ustar+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else $as_nop am_cv_prog_tar_ustar=$_am_tool fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -$as_echo "$am_cv_prog_tar_ustar" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } @@ -3128,17 +3671,18 @@ fi ac_config_headers="$ac_config_headers src/config.h" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : +if test ${enable_maintainer_mode+y} +then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else +else $as_nop USE_MAINTAINER_MODE=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' @@ -3151,12 +3695,21 @@ fi + + + + + + + + + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out @@ -3192,11 +3745,12 @@ esac fi done rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3222,11 +3776,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3234,11 +3789,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3249,11 +3808,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3262,11 +3821,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3274,11 +3834,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3289,11 +3853,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3301,8 +3865,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3315,11 +3879,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3327,11 +3892,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3342,11 +3911,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3355,11 +3924,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3368,15 +3938,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3392,33 +3966,144 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3426,11 +4111,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3441,28 +4130,25 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$CC" && break - done fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3470,11 +4156,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3485,50 +4175,48 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3538,7 +4226,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3546,7 +4234,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3558,9 +4246,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3581,11 +4269,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3602,7 +4291,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3618,44 +4307,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3669,15 +4360,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3686,7 +4377,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3698,8 +4389,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3707,10 +4398,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3718,39 +4409,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3764,11 +4456,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3777,31 +4470,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3811,29 +4505,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3842,57 +4540,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3907,94 +4608,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4003,21 +4754,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4045,8 +4798,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4064,11 +4817,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4175,8 +4929,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4191,16 +4945,18 @@ fi -if test -n "$ac_tool_prefix"; then + + if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -4208,11 +4964,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4223,11 +4983,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4240,11 +5000,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -4252,11 +5013,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4267,11 +5032,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4283,8 +5048,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -4293,11 +5058,12 @@ fi : ${AR=ar} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4309,12 +5075,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int some_variable = 0; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar @@ -4323,7 +5090,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib @@ -4334,7 +5101,7 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.lib libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4342,8 +5109,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -$as_echo "$am_cv_ar_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) @@ -4371,11 +5138,12 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4480,8 +5248,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if @@ -4503,11 +5271,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4515,11 +5284,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4530,11 +5303,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4543,11 +5316,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4555,11 +5329,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4570,11 +5348,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4582,8 +5360,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4596,11 +5374,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4608,11 +5387,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4623,11 +5406,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4636,11 +5419,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4649,15 +5433,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4673,18 +5461,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4695,11 +5483,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4707,11 +5496,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4722,11 +5515,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4739,11 +5532,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4751,11 +5545,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4766,11 +5564,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4782,34 +5580,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4819,20 +5721,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -4842,29 +5745,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4873,57 +5780,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4938,94 +5848,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -5034,21 +5994,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -5076,8 +6038,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -5095,11 +6057,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -5206,8 +6169,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -5227,40 +6190,36 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5272,10 +6231,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5285,7 +6245,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -5297,29 +6258,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5331,10 +6287,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5344,11 +6301,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5359,6 +6317,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5369,15 +6333,16 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5385,11 +6350,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5400,11 +6369,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5413,15 +6382,16 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -5429,11 +6399,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5444,11 +6418,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5460,8 +6434,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5471,7 +6445,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -5481,7 +6455,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -5491,20 +6465,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -5514,29 +6489,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -5545,57 +6524,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -5610,6 +6592,100 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5618,11 +6694,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -5729,8 +6806,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if @@ -5747,11 +6824,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -5759,11 +6837,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5774,11 +6856,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5787,11 +6869,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -5799,11 +6882,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5814,11 +6901,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5826,8 +6913,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5838,9 +6925,10 @@ fi # Check whether --enable-m32 was given. -if test "${enable_m32+set}" = set; then : +if test ${enable_m32+y} +then : enableval=$enable_m32; -else +else $as_nop enable_m32=no fi @@ -5849,12 +6937,43 @@ if test "x$enable_m32" = xyes; then CXXFLAGS="${CXXFLAGS} -m32" fi +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -5862,10 +6981,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -5874,13 +6998,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5908,16 +7032,17 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -5928,10 +7053,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -5940,13 +7070,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5975,135 +7105,26 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : +if test ${enable_largefile+y} +then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC @@ -6117,44 +7138,47 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_CC=' -n32'; break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6163,22 +7187,23 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 @@ -6187,43 +7212,43 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=64; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6232,22 +7257,23 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 @@ -6256,40 +7282,37 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=1; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi - - fi @@ -6315,33 +7338,31 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 -$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +printf %s "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_join (); int -main () +main (void) { return pthread_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" @@ -6406,24 +7427,25 @@ for flag in $ax_pthread_flags; do case $flag in none) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -$as_echo_n "checking whether pthreads work without any flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +printf %s "checking whether pthreads work without any flags... " >&6; } ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 -$as_echo_n "checking whether pthreads work with $flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +printf %s "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ax_pthread_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ax_pthread_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else @@ -6431,11 +7453,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6447,11 +7473,11 @@ fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -$as_echo "$ax_pthread_config" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +printf "%s\n" "$ax_pthread_config" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6461,8 +7487,8 @@ fi ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 -$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +printf %s "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac @@ -6487,7 +7513,7 @@ $as_echo_n "checking for the pthreads library -l$flag... " >&6; } static void routine(void* a) {a=0;} static void* start_routine(void* a) {return a;} int -main () +main (void) { pthread_t th; pthread_attr_t attr; pthread_join(th, 0); @@ -6499,17 +7525,18 @@ pthread_t th; pthread_attr_t attr; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi @@ -6527,46 +7554,45 @@ if test "x$ax_pthread_ok" = xyes; then CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -$as_echo_n "checking for joinable pthread attribute... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +printf %s "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int attr=$attr; return attr; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : attr_name=$attr; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 -$as_echo "$attr_name" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +printf "%s\n" "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then -cat >>confdefs.h <<_ACEOF -#define PTHREAD_CREATE_JOINABLE $attr_name -_ACEOF +printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $attr_name" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 -$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +printf %s "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 -$as_echo "${flag}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +printf "%s\n" "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi @@ -6580,11 +7606,12 @@ $as_echo "${flag}" >&6; } do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PTHREAD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else @@ -6592,11 +7619,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6607,11 +7638,11 @@ fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -$as_echo "$PTHREAD_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf "%s\n" "$PTHREAD_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6633,7 +7664,7 @@ fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then -$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h : else @@ -6647,47 +7678,49 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default" +if test "x$ac_cv_header_a_out_h" = xyes +then : + printf "%s\n" "#define HAVE_A_OUT_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_random_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h +fi -for ac_header in a.out.h sys/mman.h sys/random.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" +if test "x$ac_cv_func_arc4random" = xyes +then : + printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "getcontext" "ac_cv_func_getcontext" +if test "x$ac_cv_func_getcontext" = xyes +then : + printf "%s\n" "#define HAVE_GETCONTEXT 1" >>confdefs.h -done +fi +ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" +if test "x$ac_cv_func_getrandom" = xyes +then : + printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h -for ac_func in arc4random getcontext getrandom memfd_create -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create" +if test "x$ac_cv_func_memfd_create" = xyes +then : + printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h fi -done if test "x$ac_cv_func_getcontext" = xyes; then HAVE_GETCONTEXT_TRUE= @@ -6714,11 +7747,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } -if ${ax_cv_cxx_compile_cxx11+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +printf %s "checking whether $CXX supports C++11 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7008,15 +8042,16 @@ namespace cxx11 _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ax_cv_cxx_compile_cxx11=yes -else +else $as_nop ax_cv_cxx_compile_cxx11=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 -$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi @@ -7025,12 +8060,13 @@ $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval \${$cachevar+:} false; then : - $as_echo_n "(cached) " >&6 -else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7322,17 +8358,18 @@ namespace cxx11 _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval $cachevar=yes -else +else $as_nop eval $cachevar=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS="$ac_save_CXXFLAGS" fi eval ac_res=\$$cachevar - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes @@ -7353,12 +8390,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu else if test x$ac_success = xno; then HAVE_CXX11=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -$as_echo "$as_me: No compiler with C++11 support was found" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 -$as_echo "#define HAVE_CXX11 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h fi @@ -7373,11 +8410,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 -$as_echo_n "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } -if ${ax_cv_check_cxxflags___Werror_unknown_warning_option+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 +printf %s "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } +if test ${ax_cv_check_cxxflags___Werror_unknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option" @@ -7385,28 +8423,30 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ax_cv_check_cxxflags___Werror_unknown_warning_option=yes -else +else $as_nop ax_cv_check_cxxflags___Werror_unknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 -$as_echo "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } -if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes +then : ax_compiler_flags_test="-Werror=unknown-warning-option" -else +else $as_nop ax_compiler_flags_test="" @@ -7417,12 +8457,13 @@ fi for flag in -Wmissing-braces -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-compare -Wunused-local-typedefs -Wunused-variable -Wvla ; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_${ax_compiler_flags_test}_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_${ax_compiler_flags_test}_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS ${ax_compiler_flags_test} $flag" @@ -7430,58 +8471,61 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${WARN_CXXFLAGS+:} false; then : +if test ${WARN_CXXFLAGS+y} +then : case " $WARN_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5 (: WARN_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append WARN_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop WARN_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5 (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -7497,16 +8541,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC defined in fcntl.h" >&5 -$as_echo_n "checking for O_CLOEXEC defined in fcntl.h... " >&6; } -if ${ac_cv_defined_O_CLOEXEC_fcntl_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC defined in fcntl.h" >&5 +printf %s "checking for O_CLOEXEC defined in fcntl.h... " >&6; } +if test ${ac_cv_defined_O_CLOEXEC_fcntl_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifdef O_CLOEXEC @@ -7519,20 +8564,22 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_defined_O_CLOEXEC_fcntl_h=yes -else +else $as_nop ac_cv_defined_O_CLOEXEC_fcntl_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined_O_CLOEXEC_fcntl_h" >&5 -$as_echo "$ac_cv_defined_O_CLOEXEC_fcntl_h" >&6; } -if test $ac_cv_defined_O_CLOEXEC_fcntl_h != "no"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined_O_CLOEXEC_fcntl_h" >&5 +printf "%s\n" "$ac_cv_defined_O_CLOEXEC_fcntl_h" >&6; } +if test $ac_cv_defined_O_CLOEXEC_fcntl_h != "no" +then : -else +else $as_nop -$as_echo "#define O_CLOEXEC 0" >>confdefs.h +printf "%s\n" "#define O_CLOEXEC 0" >>confdefs.h fi @@ -7582,9 +8629,10 @@ fi # Check whether --enable-processor was given. -if test "${enable_processor+set}" = set; then : +if test ${enable_processor+y} +then : enableval=$enable_processor; -else +else $as_nop enable_processor=yes fi @@ -7598,9 +8646,10 @@ fi # Check whether --enable-tools was given. -if test "${enable_tools+set}" = set; then : +if test ${enable_tools+y} +then : enableval=$enable_tools; -else +else $as_nop enable_tools=yes fi @@ -7618,9 +8667,10 @@ if test x$LINUX_HOST = xfalse -a "x$enable_processor" != xyes -a "x$enable_tools fi # Check whether --enable-system-test-libs was given. -if test "${enable_system_test_libs+set}" = set; then : +if test ${enable_system_test_libs+y} +then : enableval=$enable_system_test_libs; -else +else $as_nop enable_system_test_libs=no fi @@ -7645,9 +8695,10 @@ if test "x$enable_system_test_libs" = xyes; then fi # Check whether --enable-selftest was given. -if test "${enable_selftest+set}" = set; then : +if test ${enable_selftest+y} +then : enableval=$enable_selftest; -else +else $as_nop enable_selftest=no fi @@ -7662,9 +8713,10 @@ fi # Check whether --with-rustc-demangle was given. -if test "${with_rustc_demangle+set}" = set; then : +if test ${with_rustc_demangle+y} +then : withval=$with_rustc_demangle; -else +else $as_nop with_rustc_demangle=no fi @@ -7681,9 +8733,10 @@ if test "x${with_rustc_demangle}" != xno; then fi # Check whether --enable-system-rustc-demangle was given. -if test "${enable_system_rustc_demangle+set}" = set; then : +if test ${enable_system_rustc_demangle+y} +then : enableval=$enable_system_rustc_demangle; -else +else $as_nop enable_system_rustc_demangle=no fi @@ -7696,11 +8749,12 @@ if test "x${enable_system_rustc_demangle}" != xno; then RUSTC_DEMANGLE_CFLAGS="${RUSTC_DEMANGLE_BASE_CFLAGS}" RUSTC_DEMANGLE_LIBS="${RUSTC_DEMANGLE_BASE_LIBS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rustc_demangle in -lrustc_demangle" >&5 -$as_echo_n "checking for rustc_demangle in -lrustc_demangle... " >&6; } -if ${ac_cv_lib_rustc_demangle_rustc_demangle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rustc_demangle in -lrustc_demangle" >&5 +printf %s "checking for rustc_demangle in -lrustc_demangle... " >&6; } +if test ${ac_cv_lib_rustc_demangle_rustc_demangle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrustc_demangle $RUSTC_DEMANGLE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7709,54 +8763,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rustc_demangle (); int -main () +main (void) { return rustc_demangle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rustc_demangle_rustc_demangle=yes -else +else $as_nop ac_cv_lib_rustc_demangle_rustc_demangle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rustc_demangle_rustc_demangle" >&5 -$as_echo "$ac_cv_lib_rustc_demangle_rustc_demangle" >&6; } -if test "x$ac_cv_lib_rustc_demangle_rustc_demangle" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRUSTC_DEMANGLE 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rustc_demangle_rustc_demangle" >&5 +printf "%s\n" "$ac_cv_lib_rustc_demangle_rustc_demangle" >&6; } +if test "x$ac_cv_lib_rustc_demangle_rustc_demangle" = xyes +then : + printf "%s\n" "#define HAVE_LIBRUSTC_DEMANGLE 1" >>confdefs.h LIBS="-lrustc_demangle $LIBS" -else +else $as_nop as_fn_error $? "librustc_demangle.a must be present when --enable-system-rustc-demangle is specified" "$LINENO" 5 fi - for ac_header in rustc_demangle.h + for ac_header in rustc_demangle.h do : - ac_fn_c_check_header_mongrel "$LINENO" "rustc_demangle.h" "ac_cv_header_rustc_demangle_h" "$ac_includes_default" -if test "x$ac_cv_header_rustc_demangle_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RUSTC_DEMANGLE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "rustc_demangle.h" "ac_cv_header_rustc_demangle_h" "$ac_includes_default" +if test "x$ac_cv_header_rustc_demangle_h" = xyes +then : + printf "%s\n" "#define HAVE_RUSTC_DEMANGLE_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "rustc_demangle.h must be present when --enable-system-rustc-demangle is specified" "$LINENO" 5 fi done - fi @@ -7764,9 +8813,10 @@ fi # Check whether --with-tests-as-root was given. -if test "${with_tests_as_root+set}" = set; then : +if test ${with_tests_as_root+y} +then : withval=$with_tests_as_root; -else +else $as_nop with_tests_as_root=no fi @@ -7809,8 +8859,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -7840,15 +8890,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -7862,8 +8912,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7879,7 +8929,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -7890,14 +8940,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -7975,8 +9025,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -7999,14 +9049,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -8016,46 +9068,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -8064,13 +9116,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -8079,8 +9124,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -8092,30 +9141,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -8128,13 +9157,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -8161,18 +9191,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -8184,12 +9216,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -8220,7 +9253,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -8242,6 +9275,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -8255,6 +9292,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -8296,7 +9339,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -8305,7 +9348,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8368,7 +9411,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by breakpad $as_me 0.1, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8430,14 +9473,16 @@ $config_commands Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ breakpad config.status 0.1 -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -8477,15 +9522,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -8493,7 +9538,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -8502,7 +9547,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -8530,7 +9575,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -8544,7 +9589,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -8578,9 +9623,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -8916,7 +9961,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -8924,17 +9969,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -8951,7 +9996,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8975,9 +10020,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -9039,8 +10084,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -9084,9 +10129,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -9102,20 +10147,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -9135,7 +10180,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9155,8 +10200,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -9182,7 +10227,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -9194,7 +10239,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9216,7 +10261,7 @@ $as_echo X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9241,8 +10286,8 @@ $as_echo X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is @@ -9292,7 +10337,8 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff --git a/configure.ac b/configure.ac index cc153f33d..462d04369 100644 --- a/configure.ac +++ b/configure.ac @@ -27,9 +27,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_PREREQ(2.69) +AC_PREREQ([2.71]) -AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com) +AC_INIT([breakpad],[0.1],[google-breakpad-dev@googlegroups.com]) dnl Sanity check: the argument is just a file that should exist. AC_CONFIG_SRCDIR(README.md) AC_CONFIG_AUX_DIR(autotools) @@ -59,7 +59,15 @@ if test "x$enable_m32" = xyes; then CXXFLAGS="${CXXFLAGS} -m32" fi -AC_HEADER_STDC +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + AC_SYS_LARGEFILE AX_PTHREAD AC_CHECK_HEADERS([a.out.h sys/mman.h sys/random.h]) diff --git a/src/config.h.in b/src/config.h.in index ba6c520f7..940358cf6 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -18,18 +18,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `rustc_demangle' library (-lrustc_demangle). */ +#undef HAVE_LIBRUSTC_DEMANGLE + /* Define to 1 if you have the `memfd_create' function. */ #undef HAVE_MEMFD_CREATE -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD +/* Define to 1 if you have the header file. */ +#undef HAVE_RUSTC_DEMANGLE_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -82,17 +88,14 @@ your system. */ #undef PTHREAD_CREATE_JOINABLE -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc new file mode 100644 index 000000000..d7e4bec82 --- /dev/null +++ b/src/processor/disassembler_objdump.cc @@ -0,0 +1,520 @@ +// Copyright (c) 2022, Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// disassembler_objdump.: Disassembler that invokes objdump for disassembly. +// +// Author: Mark Brand + +#include "processor/disassembler_objdump.h" + +#ifdef __linux__ +#include +#include +#include +#include +#include +#include +#include + +#include "processor/logging.h" + +namespace google_breakpad { +namespace { +const size_t kMaxX86InstructionLength = 15; + +// Small RAII wrapper for temporary files. +// +// Example: +// ScopedTmpFile tmp("/tmp/tmpfile-XXXX"); +// if (tmp.Create()) { +// std::cerr << tmp.path() << std::endl; +// } +class ScopedTmpFile { + public: + // Initialize the ScopedTmpFile object - this does not create the temporary + // file yet. + ScopedTmpFile(const char* path_format); + ~ScopedTmpFile(); + + // Creates the temporary file, returns true on success. + bool Create(); + + // Writes bytes to the temporary file, returns true on success. + bool Write(const uint8_t* bytes, unsigned int bytes_len); + + // Returns the path of the temporary file. + string path() const { return path_; } + + private: + int fd_; + string path_; +}; + +ScopedTmpFile::ScopedTmpFile(const char* path_format) : path_(path_format) {} + +ScopedTmpFile::~ScopedTmpFile() { + if (fd_) { + close(fd_); + unlink(path_.c_str()); + } +} + +bool ScopedTmpFile::Create() { + fd_ = mkstemp(path_.data()); + if (fd_ < 0) { + unlink(path_.c_str()); + fd_ = 0; + path_ = ""; + return false; + } + + return true; +} + +bool ScopedTmpFile::Write(const uint8_t* bytes, unsigned int bytes_len) { + if (fd_) { + do { + ssize_t result = write(fd_, bytes, bytes_len); + if (result < 0) { + break; + } + + bytes += result; + bytes_len -= result; + } while (bytes_len); + } + + return bytes_len == 0; +} + +bool IsInstructionPrefix(const string& token) { + if (token == "lock" || token == "rep" || token == "repz" || + token == "repnz") { + return true; + } + return false; +} + +bool IsOperandSize(const string& token) { + if (token == "BYTE" || token == "WORD" || token == "DWORD" || + token == "QWORD" || token == "PTR") { + return true; + } + return false; +} + +bool GetSegmentAddressX86(const DumpContext& context, string segment_name, + uint64_t& address) { + if (segment_name == "ds") { + address = context.GetContextX86()->ds; + } else if (segment_name == "es") { + address = context.GetContextX86()->es; + } else if (segment_name == "fs") { + address = context.GetContextX86()->fs; + } else if (segment_name == "gs") { + address = context.GetContextX86()->gs; + } else { + BPLOG(ERROR) << "Unsupported segment register: " << segment_name; + return false; + } + + return true; +} + +bool GetSegmentAddressAMD64(const DumpContext& context, string segment_name, + uint64_t& address) { + if (segment_name == "ds") { + address = 0; + } else if (segment_name == "es") { + address = 0; + } else { + BPLOG(ERROR) << "Unsupported segment register: " << segment_name; + return false; + } + + return true; +} + +bool GetSegmentAddress(const DumpContext& context, string segment_name, + uint64_t& address) { + if (context.GetContextCPU() == MD_CONTEXT_X86) { + return GetSegmentAddressX86(context, segment_name, address); + } else if (context.GetContextCPU() == MD_CONTEXT_AMD64) { + return GetSegmentAddressAMD64(context, segment_name, address); + } else { + BPLOG(ERROR) << "Unsupported architecture for GetSegmentAddress\n"; + return false; + } +} + +bool GetRegisterValueX86(const DumpContext& context, string register_name, + uint64_t& value) { + if (register_name == "eax") { + value = context.GetContextX86()->eax; + } else if (register_name == "ebx") { + value = context.GetContextX86()->ebx; + } else if (register_name == "ecx") { + value = context.GetContextX86()->ecx; + } else if (register_name == "edx") { + value = context.GetContextX86()->edx; + } else if (register_name == "edi") { + value = context.GetContextX86()->edi; + } else if (register_name == "esi") { + value = context.GetContextX86()->esi; + } else if (register_name == "ebp") { + value = context.GetContextX86()->ebp; + } else if (register_name == "esp") { + value = context.GetContextX86()->esp; + } else if (register_name == "eip") { + value = context.GetContextX86()->eip; + } else { + BPLOG(ERROR) << "Unsupported register: " << register_name; + return false; + } + + return true; +} + +bool GetRegisterValueAMD64(const DumpContext& context, string register_name, + uint64_t& value) { + if (register_name == "rax") { + value = context.GetContextAMD64()->rax; + } else if (register_name == "rbx") { + value = context.GetContextAMD64()->rbx; + } else if (register_name == "rcx") { + value = context.GetContextAMD64()->rcx; + } else if (register_name == "rdx") { + value = context.GetContextAMD64()->rdx; + } else if (register_name == "rdi") { + value = context.GetContextAMD64()->rdi; + } else if (register_name == "rsi") { + value = context.GetContextAMD64()->rsi; + } else if (register_name == "rbp") { + value = context.GetContextAMD64()->rbp; + } else if (register_name == "rsp") { + value = context.GetContextAMD64()->rsp; + } else if (register_name == "r8") { + value = context.GetContextAMD64()->r8; + } else if (register_name == "r9") { + value = context.GetContextAMD64()->r9; + } else if (register_name == "r10") { + value = context.GetContextAMD64()->r10; + } else if (register_name == "r11") { + value = context.GetContextAMD64()->r11; + } else if (register_name == "r12") { + value = context.GetContextAMD64()->r12; + } else if (register_name == "r13") { + value = context.GetContextAMD64()->r13; + } else if (register_name == "r14") { + value = context.GetContextAMD64()->r14; + } else if (register_name == "r15") { + value = context.GetContextAMD64()->r15; + } else if (register_name == "rip") { + value = context.GetContextAMD64()->rip; + } else { + BPLOG(ERROR) << "Unsupported register: " << register_name; + return false; + } + + return true; +} + +// Lookup the value of `register_name` in `context`, store it into `value` on +// success. +// Support for non-full-size registers not implemented, since we're only using +// this to evaluate address expressions. +bool GetRegisterValue(const DumpContext& context, string register_name, + uint64_t& value) { + if (context.GetContextCPU() == MD_CONTEXT_X86) { + return GetRegisterValueX86(context, register_name, value); + } else if (context.GetContextCPU() == MD_CONTEXT_AMD64) { + return GetRegisterValueAMD64(context, register_name, value); + } else { + BPLOG(ERROR) << "Unsupported architecture for GetRegisterValue\n"; + return false; + } +} +} // namespace + +// static +bool DisassemblerObjdump::DisassembleInstruction(uint32_t cpu, + const uint8_t* raw_bytes, + unsigned int raw_bytes_len, + string& instruction) { + // Always initialize outputs + instruction = ""; + + if (!raw_bytes || raw_bytes_len == 0) { + // There's no need to perform any operation in this case, as there's + // clearly no instruction there. + return false; + } + + string architecture; + if (cpu == MD_CONTEXT_X86) { + architecture = "i386"; + } else if (cpu == MD_CONTEXT_AMD64) { + architecture = "i386:x86-64"; + } else { + BPLOG(ERROR) << "Unsupported architecture."; + return false; + } + + // Create two temporary files, one for the raw instruction bytes to pass to + // objdump, and one for the output, and write the bytes to the input file. + ScopedTmpFile raw_bytes_file("/tmp/breakpad_mem_region-raw_bytes-XXXXXX"); + ScopedTmpFile disassembly_file("/tmp/breakpad_mem_region-disassembly-XXXXXX"); + if (!raw_bytes_file.Create() || !disassembly_file.Create() || + !raw_bytes_file.Write(raw_bytes, raw_bytes_len)) { + BPLOG(ERROR) << "Failed creating temporary files."; + return false; + } + + char cmd[1024] = {0}; + snprintf(cmd, 1024, + "objdump -D --no-show-raw-insn -b binary -M intel -m %s %s > %s", + architecture.c_str(), raw_bytes_file.path().c_str(), + disassembly_file.path().c_str()); + if (system(cmd)) { + BPLOG(ERROR) << "Failed to call objdump."; + return false; + } + + // Pipe each output line into the string until the string contains the first + // instruction from objdump. + std::ifstream objdump_stream(disassembly_file.path()); + + // Match the instruction line, from: + // 0: lock cmpxchg DWORD PTR [esi+0x10],eax + // extract the string "lock cmpxchg DWORD PTR [esi+0x10],eax" + std::regex instruction_regex( + "^\\s+[0-9a-f]+:\\s+" // " 0:" + "((?:\\s*\\S*)+)$"); // "lock cmpxchg..." + + std::string line; + std::smatch match; + do { + if (!getline(objdump_stream, line)) { + BPLOG(INFO) << "Failed to find instruction in objdump output."; + return false; + } + } while (!std::regex_match(line, match, instruction_regex)); + + instruction = match[1].str(); + + return true; +} + +// static +bool DisassemblerObjdump::TokenizeInstruction(const string& instruction, + string& operation, string& dest, + string& src) { + // Always initialize outputs. + operation = ""; + dest = ""; + src = ""; + + // Split the instruction into tokens by either whitespace or comma. + std::regex token_regex("((?:[^\\s,]+)|,)(?:\\s)*"); + std::sregex_iterator tokens_begin(instruction.begin(), instruction.end(), + token_regex); + + bool found_comma = false; + for (auto tokens_iter = tokens_begin; tokens_iter != std::sregex_iterator(); + ++tokens_iter) { + auto token = (*tokens_iter)[1].str(); + if (operation.size() == 0) { + if (IsInstructionPrefix(token)) + continue; + operation = token; + } else if (dest.size() == 0) { + if (IsOperandSize(token)) + continue; + dest = token; + } else if (!found_comma) { + if (token == ",") { + found_comma = true; + } else { + BPLOG(ERROR) << "Failed to parse operands from objdump output, expected" + " comma but found \"" + << token << "\""; + return false; + } + } else if (src.size() == 0) { + if (IsOperandSize(token)) + continue; + src = token; + } else { + if (token == ",") { + BPLOG(ERROR) << "Failed to parse operands from objdump output, found " + "unexpected comma after last operand."; + return false; + } else { + // We just ignore other junk after the last operand unless it's a + // comma, which would indicate we're probably still in the middle + // of the operands and something has gone wrong + } + } + } + + if (found_comma && src.size() == 0) { + BPLOG(ERROR) << "Failed to parse operands from objdump output, found comma " + "but no src operand."; + return false; + } + + return true; +} + +// static +bool DisassemblerObjdump::CalculateAddress(const DumpContext& context, + const string& expression, + uint64_t& address) { + address = 0; + + // Extract the components of the expression. + // fs:[esi+edi*4+0x80] -> ["fs", "esi", "edi", "4", "-", "0x80"] + std::regex expression_regex( + "^(?:(\\ws):)?" // "fs:" + "\\[(\\w+)" // "[esi" + "(?:\\+(\\w+)(?:\\*(\\d+)))?" // "+edi*4" + "(?:([\\+-])(0x[0-9a-f]+))?" // "-0x80" + "\\]$"); // "]" + + std::smatch match; + if (!std::regex_match(expression, match, expression_regex) || + match.size() != 7) { + return false; + } + + string segment_name = match[1].str(); + string register_name = match[2].str(); + string index_name = match[3].str(); + string index_stride = match[4].str(); + string offset_sign = match[5].str(); + string offset = match[6].str(); + + uint64_t segment_address = 0; + uint64_t register_value = 0; + uint64_t index_value = 0; + uint64_t index_stride_value = 1; + uint64_t offset_value = 0; + + if (segment_name.size() && + !GetSegmentAddress(context, segment_name, segment_address)) { + return false; + } + + if (!GetRegisterValue(context, register_name, register_value)) { + return false; + } + + if (index_name.size() && + !GetRegisterValue(context, index_name, index_value)) { + return false; + } + + if (index_stride.size()) { + index_stride_value = strtoull(index_stride.c_str(), nullptr, 0); + } + + if (offset.size()) { + offset_value = strtoull(offset.c_str(), nullptr, 0); + } + + address = + segment_address + register_value + (index_value * index_stride_value); + if (offset_sign == "+") { + address += offset_value; + } else if (offset_sign == "-") { + address -= offset_value; + } + + return true; +} + +DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu, + const MemoryRegion* memory_region, + uint64_t address) { + if (address < memory_region->GetBase() || + memory_region->GetBase() + memory_region->GetSize() <= address) { + return; + } + + uint8_t ip_bytes[kMaxX86InstructionLength] = {0}; + size_t ip_bytes_length; + for (ip_bytes_length = 0; ip_bytes_length < kMaxX86InstructionLength; + ++ip_bytes_length) { + // We have to read byte-by-byte here, since we still want to try and + // disassemble an instruction even if we don't have enough bytes. + if (!memory_region->GetMemoryAtAddress(address + ip_bytes_length, + &ip_bytes[ip_bytes_length])) { + break; + } + } + + string instruction; + if (!DisassembleInstruction(cpu, ip_bytes, kMaxX86InstructionLength, + instruction)) { + return; + } + + if (!TokenizeInstruction(instruction, operation_, dest_, src_)) { + return; + } +} + +bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context, + uint64_t& address) { + return CalculateAddress(context, src_, address); +} + +bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, + uint64_t& address) { + return CalculateAddress(context, dest_, address); +} +} // namespace google_breakpad + +#else // __linux__ +namespace google_breakpad { +DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu, + const MemoryRegion* memory_region, + uint64_t address) {} + +bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context, + uint64_t* address) { + return false; +} + +bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, + uint64_t* address) { + return false; +} +} // namespace google_breakpad + +#endif // __linux__ \ No newline at end of file diff --git a/src/processor/disassembler_objdump.h b/src/processor/disassembler_objdump.h new file mode 100644 index 000000000..7db1e1110 --- /dev/null +++ b/src/processor/disassembler_objdump.h @@ -0,0 +1,142 @@ +// Copyright (c) 2022, Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// disassembler_objdump.h: Disassembler that invokes objdump for disassembly. +// +// Author: Mark Brand + +#ifndef GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_OBJDUMP_H_ +#define GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_OBJDUMP_H_ + +#include + +#include "common/using_std_string.h" +#include "google_breakpad/common/breakpad_types.h" +#include "google_breakpad/processor/dump_context.h" +#include "google_breakpad/processor/memory_region.h" + +namespace google_breakpad { + +// Uses objdump to disassemble a single instruction. +// +// Currently supports disassembly for x86 and x86_64 on linux hosts only; on +// unsupported platform or for unsupported architectures disassembly will fail. +// +// If disassembly is successful, then this allows extracting the instruction +// opcode, source and destination operands, and computing the source and +// destination addresses for instructions that operate on memory. +// +// Example: +// DisassemblerObjdump disassembler(context->GetContextCPU(), memory_region, +// instruction_ptr); +// if (disassembler.IsValid()) { +// uint64_t src_address = 0; +// std::cerr << disassembler.operation() << " " << disassembler.src() +// << ", " << disassembler.dest() << std::endl; +// if (disassembler.CalculateSrcAddress(*context, src_address)) { +// std::cerr << "[src_address = " << std::hex << src_address << "]\n"; +// } +// } +class DisassemblerObjdump { + public: + // Construct an ObjdumpDisassembler for the provided `cpu` type, where this is + // one of MD_CONTEXT_X86 or MD_CONTEXT_AMD64. Provided that `address` is + // within `memory_region`, and the memory referenced is a valid instruction, + // this will then be initialized with the disassembly for that instruction. + DisassemblerObjdump(uint32_t cpu, + const MemoryRegion* memory_region, + uint64_t address); + ~DisassemblerObjdump() = default; + + // If the source operand of the instruction is a memory operand, compute the + // address referred to by the operand, and store this in `address`. On success + // returns true, otherwise (if computation fails, or if the source operand is + // not a memory operand) returns false and sets `address` to 0. + bool CalculateSrcAddress(const DumpContext& context, uint64_t& address); + + // If the destination operand of the instruction is a memory operand, compute + // the address referred to by the operand, and store this in `address`. On + // success returns true, otherwise (if computation fails, or if the source + // operand is not a memory operand) returns false and sets `address` to 0. + bool CalculateDestAddress(const DumpContext& context, uint64_t& address); + + // If the instruction was disassembled successfully, this will be true. + bool IsValid() const { return operation_.size() != 0; } + + // Returns the operation part of the disassembly, without any prefixes: + // "pop" eax + // lock "xchg" eax, edx + const string& operation() const { return operation_; } + + // Returns the destination operand of the disassembly, without memory operand + // size prefixes: + // mov DWORD PTR "[rax + 16]", edx + const string& dest() const { return dest_; } + + // Returns the source operand of the disassembly, without memory operand + // size prefixes: + // mov rax, QWORD PTR "[rdx]" + const string& src() const { return src_; } + + private: + friend class DisassemblerObjdumpForTest; + + // Writes out the provided `raw_bytes` to a temporary file, and executes objdump + // to disassemble according to `cpu`, which must be either MD_CONTEXT_X86 or + // MD_CONTEXT_AMD64. Once objdump has completed, parses out the instruction + // string from the first instruction in the output and stores it in + // `instruction`. + static bool DisassembleInstruction(uint32_t cpu, const uint8_t* raw_bytes, + unsigned int raw_bytes_len, + string& instruction); + + // Splits an `instruction` into three parts, the "main" `operation` and + // the `dest` and `src` operands. + // Example: + // instruction = "lock cmpxchg QWORD PTR [rdi], rsi" + // operation = "cmpxchg", dest = "[rdi]", src = "rsi" + static bool TokenizeInstruction(const string& instruction, string& operation, + string& dest, string& src); + + // Compute the address referenced by `expression` in `context`. + // Supports memory operands in the form + // (segment:)[base_reg(+index_reg*index_stride)(+-offset)] + // Returns false if evaluation fails, or if the operand is not a supported + // memory operand. + static bool CalculateAddress(const DumpContext& context, + const string& expression, + uint64_t& address); + + // The parsed components of the disassembly for the instruction. + string operation_ = ""; + string dest_ = ""; + string src_ = ""; +}; +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_OBJDUMP_H_ \ No newline at end of file diff --git a/src/processor/disassembler_objdump_unittest.cc b/src/processor/disassembler_objdump_unittest.cc new file mode 100644 index 000000000..781b60ecf --- /dev/null +++ b/src/processor/disassembler_objdump_unittest.cc @@ -0,0 +1,464 @@ +// Copyright (c) 2022, Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include "breakpad_googletest_includes.h" + +#include "google_breakpad/common/breakpad_types.h" +#include "google_breakpad/common/minidump_cpu_amd64.h" +#include "google_breakpad/common/minidump_cpu_x86.h" +#include "google_breakpad/processor/dump_context.h" +#include "google_breakpad/processor/memory_region.h" +#include "processor/disassembler_objdump.h" + +namespace google_breakpad { +class DisassemblerObjdumpForTest : public DisassemblerObjdump { + public: + using DisassemblerObjdump::CalculateAddress; + using DisassemblerObjdump::DisassembleInstruction; + using DisassemblerObjdump::TokenizeInstruction; +}; + +class TestMemoryRegion : public MemoryRegion { + public: + TestMemoryRegion(uint64_t base, std::vector bytes); + ~TestMemoryRegion() override = default; + + uint64_t GetBase() const override; + uint32_t GetSize() const override; + + bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const override; + bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const override; + bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const override; + bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const override; + + void Print() const override; + + private: + uint64_t base_; + std::vector bytes_; +}; + +TestMemoryRegion::TestMemoryRegion(uint64_t address, std::vector bytes) + : base_(address), bytes_(bytes) {} + +uint64_t TestMemoryRegion::GetBase() const { + return base_; +} + +uint32_t TestMemoryRegion::GetSize() const { + return static_cast(bytes_.size()); +} + +bool TestMemoryRegion::GetMemoryAtAddress(uint64_t address, + uint8_t* value) const { + if (address < GetBase() || + address + sizeof(uint8_t) > GetBase() + GetSize()) { + return false; + } + + memcpy(value, &bytes_[address - GetBase()], sizeof(uint8_t)); + return true; +} + +// We don't use the following functions, so no need to implement. +bool TestMemoryRegion::GetMemoryAtAddress(uint64_t address, + uint16_t* value) const { + return false; +} + +bool TestMemoryRegion::GetMemoryAtAddress(uint64_t address, + uint32_t* value) const { + return false; +} + +bool TestMemoryRegion::GetMemoryAtAddress(uint64_t address, + uint64_t* value) const { + return false; +} + +void TestMemoryRegion::Print() const {} + +const uint32_t kX86TestDs = 0x01000000; +const uint32_t kX86TestEs = 0x02000000; +const uint32_t kX86TestFs = 0x03000000; +const uint32_t kX86TestGs = 0x04000000; +const uint32_t kX86TestEax = 0x00010101; +const uint32_t kX86TestEbx = 0x00020202; +const uint32_t kX86TestEcx = 0x00030303; +const uint32_t kX86TestEdx = 0x00040404; +const uint32_t kX86TestEsi = 0x00050505; +const uint32_t kX86TestEdi = 0x00060606; +const uint32_t kX86TestEsp = 0x00070707; +const uint32_t kX86TestEbp = 0x00080808; +const uint32_t kX86TestEip = 0x23230000; + +const uint64_t kAMD64TestRax = 0x0000010101010101ul; +const uint64_t kAMD64TestRbx = 0x0000020202020202ul; +const uint64_t kAMD64TestRcx = 0x0000030303030303ul; +const uint64_t kAMD64TestRdx = 0x0000040404040404ul; +const uint64_t kAMD64TestRsi = 0x0000050505050505ul; +const uint64_t kAMD64TestRdi = 0x0000060606060606ul; +const uint64_t kAMD64TestRsp = 0x0000070707070707ul; +const uint64_t kAMD64TestRbp = 0x0000080808080808ul; +const uint64_t kAMD64TestR8 = 0x0000090909090909ul; +const uint64_t kAMD64TestR9 = 0x00000a0a0a0a0a0aul; +const uint64_t kAMD64TestR10 = 0x00000b0b0b0b0b0bul; +const uint64_t kAMD64TestR11 = 0x00000c0c0c0c0c0cul; +const uint64_t kAMD64TestR12 = 0x00000d0d0d0d0d0dul; +const uint64_t kAMD64TestR13 = 0x00000e0e0e0e0e0eul; +const uint64_t kAMD64TestR14 = 0x00000f0f0f0f0f0ful; +const uint64_t kAMD64TestR15 = 0x0000001010101010ul; +const uint64_t kAMD64TestRip = 0x0000000023230000ul; + +class TestDumpContext : public DumpContext { + public: + TestDumpContext(bool x86_64 = false); + ~TestDumpContext() override; +}; + +TestDumpContext::TestDumpContext(bool x86_64) { + if (!x86_64) { + MDRawContextX86* raw_context = new MDRawContextX86(); + memset(raw_context, 0, sizeof(raw_context)); + + raw_context->context_flags = MD_CONTEXT_X86_FULL; + + raw_context->ds = kX86TestDs; + raw_context->es = kX86TestEs; + raw_context->fs = kX86TestFs; + raw_context->gs = kX86TestGs; + raw_context->eax = kX86TestEax; + raw_context->ebx = kX86TestEbx; + raw_context->ecx = kX86TestEcx; + raw_context->edx = kX86TestEdx; + raw_context->esi = kX86TestEsi; + raw_context->edi = kX86TestEdi; + raw_context->esp = kX86TestEsp; + raw_context->ebp = kX86TestEbp; + raw_context->eip = kX86TestEip; + + SetContextFlags(raw_context->context_flags); + SetContextX86(raw_context); + this->valid_ = true; + } else { + MDRawContextAMD64* raw_context = new MDRawContextAMD64(); + memset(raw_context, 0, sizeof(raw_context)); + + raw_context->context_flags = MD_CONTEXT_AMD64_FULL; + + raw_context->rax = kAMD64TestRax; + raw_context->rbx = kAMD64TestRbx; + raw_context->rcx = kAMD64TestRcx; + raw_context->rdx = kAMD64TestRdx; + raw_context->rsi = kAMD64TestRsi; + raw_context->rdi = kAMD64TestRdi; + raw_context->rsp = kAMD64TestRsp; + raw_context->rbp = kAMD64TestRbp; + raw_context->r8 = kAMD64TestR8; + raw_context->r9 = kAMD64TestR9; + raw_context->r10 = kAMD64TestR10; + raw_context->r11 = kAMD64TestR11; + raw_context->r12 = kAMD64TestR12; + raw_context->r13 = kAMD64TestR13; + raw_context->r14 = kAMD64TestR14; + raw_context->r15 = kAMD64TestR15; + raw_context->rip = kAMD64TestRip; + + SetContextFlags(raw_context->context_flags); + SetContextAMD64(raw_context); + this->valid_ = true; + } +} + +TestDumpContext::~TestDumpContext() { + FreeContext(); +} + +TEST(DisassemblerObjdumpTest, DisassembleInstructionX86) { + string instruction; + ASSERT_FALSE(DisassemblerObjdumpForTest::DisassembleInstruction( + MD_CONTEXT_X86, nullptr, 0, instruction)); + std::vector pop_eax = {0x58}; + ASSERT_TRUE(DisassemblerObjdumpForTest::DisassembleInstruction( + MD_CONTEXT_X86, pop_eax.data(), pop_eax.size(), instruction)); + ASSERT_EQ(instruction, "pop eax"); +} + +TEST(DisassemblerObjdumpTest, DisassembleInstructionAMD64) { + string instruction; + ASSERT_FALSE(DisassemblerObjdumpForTest::DisassembleInstruction( + MD_CONTEXT_AMD64, nullptr, 0, instruction)); + std::vector pop_rax = {0x58}; + ASSERT_TRUE(DisassemblerObjdumpForTest::DisassembleInstruction( + MD_CONTEXT_AMD64, pop_rax.data(), pop_rax.size(), instruction)); + ASSERT_EQ(instruction, "pop rax"); +} + +TEST(DisassemblerObjdumpTest, TokenizeInstruction) { + string operation, dest, src; + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "pop eax", operation, dest, src)); + ASSERT_EQ(operation, "pop"); + ASSERT_EQ(dest, "eax"); + + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov eax, ebx", operation, dest, src)); + ASSERT_EQ(operation, "mov"); + ASSERT_EQ(dest, "eax"); + ASSERT_EQ(src, "ebx"); + + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "pop rax", operation, dest, src)); + ASSERT_EQ(operation, "pop"); + ASSERT_EQ(dest, "rax"); + + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov rax, rbx", operation, dest, src)); + ASSERT_EQ(operation, "mov"); + ASSERT_EQ(dest, "rax"); + ASSERT_EQ(src, "rbx"); + + // Test the three parsing failure paths + ASSERT_FALSE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov rax,", operation, dest, src)); + ASSERT_FALSE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov rax rbx", operation, dest, src)); + ASSERT_FALSE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov rax, rbx, rcx", operation, dest, src)); + + // This is of course a nonsense instruction, but test that we do remove + // multiple instruction prefixes and can handle multiple memory operands. + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "rep lock mov DWORD PTR rax, QWORD PTR rbx", operation, dest, src)); + ASSERT_EQ(operation, "mov"); + ASSERT_EQ(dest, "rax"); + ASSERT_EQ(src, "rbx"); + + // Test that we ignore junk following a valid instruction + ASSERT_TRUE(DisassemblerObjdumpForTest::TokenizeInstruction( + "mov rax, rbx ; junk here", operation, dest, src)); + ASSERT_EQ(operation, "mov"); + ASSERT_EQ(dest, "rax"); + ASSERT_EQ(src, "rbx"); +} + +namespace x86 { +const TestMemoryRegion load_reg(kX86TestEip, {0x8b, 0x06}); // mov eax, [esi]; + +const TestMemoryRegion load_reg_index(kX86TestEip, + {0x8b, 0x04, + 0xbe}); // mov eax, [esi+edi*4]; + +const TestMemoryRegion load_reg_offset(kX86TestEip, + {0x8b, 0x46, + 0x10}); // mov eax, [esi+0x10]; + +const TestMemoryRegion load_reg_index_offset( + kX86TestEip, + {0x8b, 0x44, 0xbe, 0xf0}); // mov eax, [esi+edi*4-0x10]; + +const TestMemoryRegion rep_stosb(kX86TestEip, {0xf3, 0xaa}); // rep stosb; + +const TestMemoryRegion lock_cmpxchg(kX86TestEip, + {0xf0, 0x0f, 0xb1, 0x46, + 0x10}); // lock cmpxchg [esi + 0x10], eax; + +const TestMemoryRegion call_reg_offset(kX86TestEip, + {0xff, 0x96, 0x99, 0x99, 0x99, + 0x09}); // call [esi+0x9999999]; +} // namespace x86 + +TEST(DisassemblerObjdumpTest, X86LoadReg) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::load_reg, kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kX86TestEsi); +} + +TEST(DisassemblerObjdumpTest, X86LoadRegIndex) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::load_reg_index, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kX86TestEsi + (kX86TestEdi * 4)); +} + +TEST(DisassemblerObjdumpTest, X86LoadRegOffset) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::load_reg_offset, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kX86TestEsi + 0x10); +} + +TEST(DisassemblerObjdumpTest, X86LoadRegIndexOffset) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::load_reg_index_offset, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kX86TestEsi + (kX86TestEdi * 4) - 0x10); +} + +TEST(DisassemblerObjdumpTest, X86RepStosb) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::rep_stosb, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kX86TestEs + kX86TestEdi); +} + +TEST(DisassemblerObjdumpTest, X86LockCmpxchg) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::lock_cmpxchg, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kX86TestEsi + 0x10); +} + +TEST(DisassemblerObjdumpTest, X86CallRegOffset) { + TestDumpContext context; + DisassemblerObjdump dis(context.GetContextCPU(), &x86::call_reg_offset, + kX86TestEip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kX86TestEsi + 0x9999999); +} + +namespace amd64 { +const TestMemoryRegion load_reg(kAMD64TestRip, + {0x48, 0x8b, 0x06}); // mov rax, [rsi]; + +const TestMemoryRegion load_reg_index(kAMD64TestRip, + {0x48, 0x8b, 0x04, + 0xbe}); // mov rax, [rsi+rdi*4]; + +const TestMemoryRegion load_rip_relative(kAMD64TestRip, + {0x48, 0x8b, 0x05, 0x10, 0x00, 0x00, + 0x00}); // mov rax, [rip+0x10]; + +const TestMemoryRegion load_reg_index_offset( + kAMD64TestRip, + {0x48, 0x8b, 0x44, 0xbe, 0xf0}); // mov rax, [rsi+rdi*4-0x10]; + +const TestMemoryRegion rep_stosb(kAMD64TestRip, {0xf3, 0xaa}); // rep stosb; + +const TestMemoryRegion lock_cmpxchg(kAMD64TestRip, + {0xf0, 0x48, 0x0f, 0xb1, 0x46, + 0x10}); // lock cmpxchg [rsi + 0x10], rax; + +const TestMemoryRegion call_reg_offset(kAMD64TestRip, + {0xff, 0x96, 0x99, 0x99, 0x99, + 0x09}); // call [rsi+0x9999999]; +} // namespace amd64 + +TEST(DisassemblerObjdumpTest, AMD64LoadReg) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::load_reg, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kAMD64TestRsi); +} + +TEST(DisassemblerObjdumpTest, AMD64LoadRegIndex) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::load_reg_index, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kAMD64TestRsi + (kAMD64TestRdi * 4)); +} + +TEST(DisassemblerObjdumpTest, AMD64LoadRipRelative) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::load_rip_relative, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kAMD64TestRip + 0x10); +} + +TEST(DisassemblerObjdumpTest, AMD64LoadRegIndexOffset) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), + &amd64::load_reg_index_offset, kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_FALSE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_TRUE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(src_address, kAMD64TestRsi + (kAMD64TestRdi * 4) - 0x10); +} + +TEST(DisassemblerObjdumpTest, AMD64RepStosb) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::rep_stosb, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kAMD64TestRdi); +} + +TEST(DisassemblerObjdumpTest, AMD64LockCmpxchg) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::lock_cmpxchg, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kAMD64TestRsi + 0x10); +} + +TEST(DisassemblerObjdumpTest, AMD64CallRegOffset) { + TestDumpContext context(true); + DisassemblerObjdump dis(context.GetContextCPU(), &amd64::call_reg_offset, + kAMD64TestRip); + uint64_t src_address = 0, dest_address = 0; + ASSERT_TRUE(dis.CalculateDestAddress(context, dest_address)); + ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); + ASSERT_EQ(dest_address, kAMD64TestRsi + 0x9999999); +} +} // namespace google_breakpad \ No newline at end of file diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 30e799fc6..44195a2a6 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -35,21 +35,13 @@ #include "processor/exploitability_linux.h" -#ifndef _WIN32 -#include -#include -#include - -#include -#include -#endif // _WIN32 - #include #include "google_breakpad/common/minidump_exception_linux.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/stack_frame.h" +#include "processor/disassembler_objdump.h" #include "processor/logging.h" namespace { @@ -67,11 +59,6 @@ constexpr char kStackCheckFailureFunction[] = "__stack_chk_fail"; // can determine that the call would overflow the target buffer. constexpr char kBoundsCheckFailureFunction[] = "__chk_fail"; -#ifndef _WIN32 -const unsigned int MAX_INSTRUCTION_LEN = 15; -const unsigned int MAX_OBJDUMP_BUFFER_LEN = 4096; -#endif // _WIN32 - } // namespace namespace google_breakpad { @@ -198,69 +185,30 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { BPLOG(INFO) << "No exception or architecture data."; return false; } - // Check architecture and set architecture variable to corresponding flag - // in objdump. - switch (context->GetContextCPU()) { - case MD_CONTEXT_X86: - architecture = "i386"; - break; - case MD_CONTEXT_AMD64: - architecture = "i386:x86-64"; - break; - default: - // Unsupported architecture. Note that ARM architectures are not - // supported because objdump does not support ARM. - return false; - } - - // Get memory region around instruction pointer and the number of bytes - // before and after the instruction pointer in the memory region. - const uint8_t* raw_memory = memory_region->GetMemory(); - const uint64_t base = memory_region->GetBase(); - if (base > instruction_ptr) { - BPLOG(ERROR) << "Memory region base value exceeds instruction pointer."; - return false; - } - const uint64_t offset = instruction_ptr - base; - if (memory_region->GetSize() < MAX_INSTRUCTION_LEN + offset) { - BPLOG(INFO) << "Not enough bytes left to guarantee complete instruction."; - return false; - } - - // Convert bytes into objdump output. - char objdump_output_buffer[MAX_OBJDUMP_BUFFER_LEN] = {0}; - DisassembleBytes(architecture, - raw_memory + offset, - MAX_INSTRUCTION_LEN, - MAX_OBJDUMP_BUFFER_LEN, - objdump_output_buffer); - string line; - if (!GetObjdumpInstructionLine(objdump_output_buffer, &line)) { + DisassemblerObjdump disassembler(context->GetContextCPU(), memory_region, + instruction_ptr); + if (!disassembler.IsValid()) { + BPLOG(INFO) << "Disassembling fault instruction failed."; return false; } - // Convert objdump instruction line into the operation and operands. - string instruction = ""; - string dest = ""; - string src = ""; - TokenizeObjdumpInstruction(line, &instruction, &dest, &src); - - // Check if the operation is a write to memory. First, the instruction - // must one that can write to memory. Second, the write destination - // must be a spot in memory rather than a register. Since there are no - // symbols from objdump, the destination will be enclosed by brackets. - if (dest.size() > 2 && dest.at(0) == '[' && dest.at(dest.size() - 1) == ']' && - (!instruction.compare("mov") || !instruction.compare("inc") || - !instruction.compare("dec") || !instruction.compare("and") || - !instruction.compare("or") || !instruction.compare("xor") || - !instruction.compare("not") || !instruction.compare("neg") || - !instruction.compare("add") || !instruction.compare("sub") || - !instruction.compare("shl") || !instruction.compare("shr"))) { - // Strip away enclosing brackets from the destination address. - dest = dest.substr(1, dest.size() - 2); + // Check if the operation is a write to memory. + // First, the instruction must one that can write to memory. + auto instruction = disassembler.operation(); + if (!instruction.compare("mov") || !instruction.compare("inc") || + !instruction.compare("dec") || !instruction.compare("and") || + !instruction.compare("or") || !instruction.compare("xor") || + !instruction.compare("not") || !instruction.compare("neg") || + !instruction.compare("add") || !instruction.compare("sub") || + !instruction.compare("shl") || !instruction.compare("shr")) { uint64_t write_address = 0; - CalculateAddress(dest, *context, &write_address); + + // Check that the destination is a memory address. CalculateDestAddress will + // return false if the destination is not a memory address. + if (!disassembler.CalculateDestAddress(*context, write_address)) { + return false; + } // If the program crashed as a result of a write, the destination of // the write must have been an address that did not permit writing. @@ -268,270 +216,13 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { // the crash does not suggest exploitability for writes with such a // low target address. return write_address > 4096; - } -#endif // _WIN32 - return false; -} - -#ifndef _WIN32 -bool ExploitabilityLinux::CalculateAddress(const string& address_expression, - const DumpContext& context, - uint64_t* write_address) { - // The destination should be the format reg+a or reg-a, where reg - // is a register and a is a hexadecimal constant. Although more complex - // expressions can make valid instructions, objdump's disassembly outputs - // it in this simpler format. - // TODO(liuandrew): Handle more complex formats, should they arise. - - if (!write_address) { - BPLOG(ERROR) << "Null parameter."; - return false; - } - - // Clone parameter into a non-const string. - string expression = address_expression; - - // Parse out the constant that is added to the address (if it exists). - size_t delim = expression.find('+'); - bool positive_add_constant = true; - // Check if constant is subtracted instead of added. - if (delim == string::npos) { - positive_add_constant = false; - delim = expression.find('-'); - } - uint32_t add_constant = 0; - // Save constant and remove it from the expression. - if (delim != string::npos) { - if (!sscanf(expression.substr(delim + 1).c_str(), "%x", &add_constant)) { - BPLOG(ERROR) << "Failed to scan constant."; - return false; - } - expression = expression.substr(0, delim); - } - - // Set the the write address to the corresponding register. - // TODO(liuandrew): Add support for partial registers, such as - // the rax/eax/ax/ah/al chain. - switch (context.GetContextCPU()) { - case MD_CONTEXT_X86: - if (!expression.compare("eax")) { - *write_address = context.GetContextX86()->eax; - } else if (!expression.compare("ebx")) { - *write_address = context.GetContextX86()->ebx; - } else if (!expression.compare("ecx")) { - *write_address = context.GetContextX86()->ecx; - } else if (!expression.compare("edx")) { - *write_address = context.GetContextX86()->edx; - } else if (!expression.compare("edi")) { - *write_address = context.GetContextX86()->edi; - } else if (!expression.compare("esi")) { - *write_address = context.GetContextX86()->esi; - } else if (!expression.compare("ebp")) { - *write_address = context.GetContextX86()->ebp; - } else if (!expression.compare("esp")) { - *write_address = context.GetContextX86()->esp; - } else if (!expression.compare("eip")) { - *write_address = context.GetContextX86()->eip; - } else { - BPLOG(ERROR) << "Unsupported register"; - return false; - } - break; - case MD_CONTEXT_AMD64: - if (!expression.compare("rax")) { - *write_address = context.GetContextAMD64()->rax; - } else if (!expression.compare("rbx")) { - *write_address = context.GetContextAMD64()->rbx; - } else if (!expression.compare("rcx")) { - *write_address = context.GetContextAMD64()->rcx; - } else if (!expression.compare("rdx")) { - *write_address = context.GetContextAMD64()->rdx; - } else if (!expression.compare("rdi")) { - *write_address = context.GetContextAMD64()->rdi; - } else if (!expression.compare("rsi")) { - *write_address = context.GetContextAMD64()->rsi; - } else if (!expression.compare("rbp")) { - *write_address = context.GetContextAMD64()->rbp; - } else if (!expression.compare("rsp")) { - *write_address = context.GetContextAMD64()->rsp; - } else if (!expression.compare("rip")) { - *write_address = context.GetContextAMD64()->rip; - } else if (!expression.compare("r8")) { - *write_address = context.GetContextAMD64()->r8; - } else if (!expression.compare("r9")) { - *write_address = context.GetContextAMD64()->r9; - } else if (!expression.compare("r10")) { - *write_address = context.GetContextAMD64()->r10; - } else if (!expression.compare("r11")) { - *write_address = context.GetContextAMD64()->r11; - } else if (!expression.compare("r12")) { - *write_address = context.GetContextAMD64()->r12; - } else if (!expression.compare("r13")) { - *write_address = context.GetContextAMD64()->r13; - } else if (!expression.compare("r14")) { - *write_address = context.GetContextAMD64()->r14; - } else if (!expression.compare("r15")) { - *write_address = context.GetContextAMD64()->r15; - } else { - BPLOG(ERROR) << "Unsupported register"; - return false; - } - break; - default: - // This should not occur since the same switch condition - // should have terminated this method. - return false; - } - - // Add or subtract constant from write address (if applicable). - *write_address = - positive_add_constant ? - *write_address + add_constant : *write_address - add_constant; - - return true; -} - -// static -bool ExploitabilityLinux::GetObjdumpInstructionLine( - const char* objdump_output_buffer, - string* instruction_line) { - // Put buffer data into stream to output line-by-line. - std::stringstream objdump_stream; - objdump_stream.str(string(objdump_output_buffer)); - - // Pipe each output line into the string until the string contains the first - // instruction from objdump. All lines before the "<.data>:" section are - // skipped. Loop until the line shows the first instruction or there are no - // lines left. - bool data_section_seen = false; - do { - if (!getline(objdump_stream, *instruction_line)) { - BPLOG(INFO) << "Objdump instructions not found"; - return false; - } - if (instruction_line->find("<.data>:") != string::npos) { - data_section_seen = true; - } - } while (!data_section_seen || instruction_line->find("0:") == string::npos); - // This first instruction contains the above substring. - - return true; -} - -bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string& line, - string* operation, - string* dest, - string* src) { - if (!operation || !dest || !src) { - BPLOG(ERROR) << "Null parameters passed."; - return false; - } - - // Set all pointer values to empty strings. - *operation = ""; - *dest = ""; - *src = ""; - - // Tokenize the objdump line. - vector tokens; - std::istringstream line_stream(line); - copy(std::istream_iterator(line_stream), - std::istream_iterator(), - std::back_inserter(tokens)); - - // Regex for the data in hex form. Each byte is two hex digits. - regex_t regex; - regcomp(®ex, "^[[:xdigit:]]{2}$", REG_EXTENDED | REG_NOSUB); - - // Find and set the location of the operator. The operator appears - // directly after the chain of bytes that define the instruction. The - // operands will be the last token, given that the instruction has operands. - // If not, the operator is the last token. The loop skips the first token - // because the first token is the instruction number (namely "0:"). - string operands = ""; - for (size_t i = 1; i < tokens.size(); i++) { - // Check if current token no longer is in byte format. - if (regexec(®ex, tokens[i].c_str(), 0, NULL, 0)) { - // instruction = tokens[i]; - *operation = tokens[i]; - // If the operator is the last token, there are no operands. - if (i != tokens.size() - 1) { - operands = tokens[tokens.size() - 1]; - } - break; - } - } - regfree(®ex); - - if (operation->empty()) { - BPLOG(ERROR) << "Failed to parse out operation from objdump instruction."; - return false; - } - - // Split operands into source and destination (if applicable). - if (!operands.empty()) { - size_t delim = operands.find(','); - if (delim == string::npos) { - *dest = operands; - } else { - *dest = operands.substr(0, delim); - *src = operands.substr(delim + 1); - } - } - return true; -} - -bool ExploitabilityLinux::DisassembleBytes(const string& architecture, - const uint8_t* raw_bytes, - const unsigned int raw_bytes_len, - const unsigned int buffer_len, - char* objdump_output_buffer) { - if (!raw_bytes || !objdump_output_buffer || - raw_bytes_len > MAX_INSTRUCTION_LEN) { - BPLOG(ERROR) << "Bad input parameters."; - return false; - } - - // Write raw bytes around instruction pointer to a temporary file to - // pass as an argument to objdump. - char raw_bytes_tmpfile[] = "/tmp/breakpad_mem_region-raw_bytes-XXXXXX"; - int raw_bytes_fd = mkstemp(raw_bytes_tmpfile); - if (raw_bytes_fd < 0) { - BPLOG(ERROR) << "Failed to create tempfile."; - unlink(raw_bytes_tmpfile); - return false; - } - // Casting raw_bytes_len to `ssize_t` won't cause a sign flip, since we check - // its bounds above. - if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != (ssize_t)raw_bytes_len) { - BPLOG(ERROR) << "Writing of raw bytes failed."; - unlink(raw_bytes_tmpfile); + } else { return false; } - char cmd[1024] = {0}; - snprintf(cmd, - 1024, - "objdump -D -b binary -M intel -m %s %s", - architecture.c_str(), - raw_bytes_tmpfile); - FILE* objdump_fp = popen(cmd, "r"); - if (!objdump_fp) { - unlink(raw_bytes_tmpfile); - BPLOG(ERROR) << "Failed to call objdump."; - return false; - } - if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) { - pclose(objdump_fp); - unlink(raw_bytes_tmpfile); - BPLOG(ERROR) << "Failed to read objdump output."; - return false; - } - pclose(objdump_fp); - unlink(raw_bytes_tmpfile); - return true; -} #endif // _WIN32 + return false; +} bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) { MinidumpLinuxMapsList* linux_maps_list = dump_->GetLinuxMapsList(); diff --git a/src/processor/exploitability_linux.h b/src/processor/exploitability_linux.h index c5ed25724..7603e4565 100644 --- a/src/processor/exploitability_linux.h +++ b/src/processor/exploitability_linux.h @@ -75,42 +75,6 @@ class ExploitabilityLinux : public Exploitability { // instruction is at a spot in memory that prohibits writes. bool EndedOnIllegalWrite(uint64_t instruction_ptr); -#ifndef _WIN32 - // Disassembles raw bytes via objdump and pipes the output into the provided - // buffer, given the desired architecture, the file from which objdump will - // read, and the buffer length. The method returns whether the disassembly - // was a success, and the caller owns all pointers. - static bool DisassembleBytes(const string& architecture, - const uint8_t* raw_bytes, - const unsigned int raw_bytes_len, - const unsigned int MAX_OBJDUMP_BUFFER_LEN, - char* objdump_output_buffer); - - // Parses the objdump output given in |objdump_output_buffer| and extracts - // the line of the first instruction into |instruction_line|. Returns true - // when the instruction line is successfully extracted. - static bool GetObjdumpInstructionLine( - const char* objdump_output_buffer, - string* instruction_line); - - // Tokenizes out the operation and operands from a line of instruction - // disassembled by objdump. This method modifies the pointers to match the - // tokens of the instruction, and returns if the tokenizing was a success. - // The caller owns all pointers. - static bool TokenizeObjdumpInstruction(const string& line, - string* operation, - string* dest, - string* src); - - // Calculates the effective address of an expression in the form reg+a or - // reg-a, where 'reg' is a register and 'a' is a constant, and writes the - // result in the pointer. The method returns whether the calculation was - // a success. The caller owns the pointer. - static bool CalculateAddress(const string& address_expression, - const DumpContext& context, - uint64_t* write_address); -#endif // _WIN32 - // Checks if the stack pointer points to a memory mapping that is not // labelled as the stack. bool StackPointerOffStack(uint64_t stack_ptr); diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index b5e7feef2..bc1823c67 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -44,15 +44,6 @@ #ifdef __linux__ namespace google_breakpad { - -class ExploitabilityLinuxTest : public ExploitabilityLinux { - public: - using ExploitabilityLinux::CalculateAddress; - using ExploitabilityLinux::DisassembleBytes; - using ExploitabilityLinux::GetObjdumpInstructionLine; - using ExploitabilityLinux::TokenizeObjdumpInstruction; -}; - class ExploitabilityLinuxTestMinidumpContext : public MinidumpContext { public: explicit ExploitabilityLinuxTestMinidumpContext( @@ -70,7 +61,6 @@ namespace { using google_breakpad::BasicSourceLineResolver; #ifdef __linux__ -using google_breakpad::ExploitabilityLinuxTest; using google_breakpad::ExploitabilityLinuxTestMinidumpContext; #endif // __linux__ using google_breakpad::MinidumpProcessor; @@ -185,120 +175,4 @@ TEST(ExploitabilityTest, TestLinuxEngine) { #endif // __linux__ } -#ifdef __linux__ -TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) { - ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 0, 5, NULL)); - uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0}; - char buffer[1024] = {0}; - ASSERT_TRUE(ExploitabilityLinuxTest::DisassembleBytes( - "i386:x86-64", bytes, std::extent::value, 1024, buffer)); - std::stringstream objdump_stream; - objdump_stream.str(string(buffer)); - string line = ""; - while (line.find("<.data>") == string::npos) - getline(objdump_stream, line); - getline(objdump_stream, line); - ASSERT_EQ(line, " 0:\tc7 00 05 00 00 00 \tmov DWORD PTR [rax],0x5"); -} - -TEST(ExploitabilityLinuxUtilsTest, GetObjdumpInstructionLine) { - string disassebly = - "\n" - "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n" - "// Trying to confuse the parser 0:\n" - "\n" - "Disassembly of section .data:\n" - "\n" - "0000000000000000 <.data>:\n" - " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n" - " 6:\t5d \tpop rbp\n" - " 7:\tc3 \tret \n" - " 8:\t55 \tpush rbp\n" - " 9:\t48 89 e5 \tmov rbp,rsp\n" - " c:\t53 \tpush rbx\n" - " d:\t48 \trex.W\n" - " e:\t81 \t.byte 0x81\n"; - string line; - EXPECT_TRUE(ExploitabilityLinuxTest::GetObjdumpInstructionLine( - disassebly.c_str(), &line)); - EXPECT_EQ(" 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1", line); - - // There is no "0:" after "<.data>:". Expected to return false. - disassebly = - "\n" - "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n" - "// Trying to confuse the parser 0:\n" - "\n" - "Disassembly of section .data:\n" - "\n" - " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n" - " 6:\t5d \tpop rbp\n" - " 7:\tc3 \tret \n" - " 8:\t55 \tpush rbp\n" - " 9:\t48 89 e5 \tmov rbp,rsp\n" - " d:\t48 \trex.W\n" - "0000000000000000 <.data>:\n" - " c:\t53 \tpush rbx\n"; - EXPECT_FALSE(ExploitabilityLinuxTest::GetObjdumpInstructionLine( - disassebly.c_str(), &line)); -} - -TEST(ExploitabilityLinuxUtilsTest, TokenizeObjdumpInstructionTest) { - ASSERT_FALSE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction("", - NULL, - NULL, - NULL)); - string line = "0: c7 00 05 00 00 00 mov DWORD PTR [rax],0x5"; - string operation = ""; - string dest = ""; - string src = ""; - ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line, - &operation, - &dest, - &src)); - ASSERT_EQ(operation, "mov"); - ASSERT_EQ(dest, "[rax]"); - ASSERT_EQ(src, "0x5"); - line = "0: c3 ret"; - ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line, - &operation, - &dest, - &src)); - ASSERT_EQ(operation, "ret"); - ASSERT_EQ(dest, ""); - ASSERT_EQ(src, ""); - line = "0: 5f pop rdi"; - ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line, - &operation, - &dest, - &src)); - ASSERT_EQ(operation, "pop"); - ASSERT_EQ(dest, "rdi"); - ASSERT_EQ(src, ""); -} - -TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) { - MDRawContextAMD64 raw_context; - raw_context.rdx = 12345; - ExploitabilityLinuxTestMinidumpContext context(raw_context); - ASSERT_EQ(context.GetContextAMD64()->rdx, 12345U); - ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("", context, NULL)); - uint64_t write_address = 0; - ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx-0x4D2", - context, - &write_address)); - ASSERT_EQ(write_address, 11111U); - ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx+0x4D2", - context, - &write_address)); - ASSERT_EQ(write_address, 13579U); - ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("rdx+rax", - context, - &write_address)); - ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("0x3482+0x4D2", - context, - &write_address)); -} -#endif // __linux__ - } // namespace diff --git a/src/processor/processor.gyp b/src/processor/processor.gyp index f1e473fc9..146220f21 100644 --- a/src/processor/processor.gyp +++ b/src/processor/processor.gyp @@ -51,6 +51,8 @@ 'contained_range_map.h', 'convert_old_arm64_context.cc', 'convert_old_arm64_context.h', + 'disassembler_objdump.cc', + 'disassembler_objdump.h', 'disassembler_x86.cc', 'disassembler_x86.h', 'dump_context.cc', @@ -147,6 +149,7 @@ 'basic_source_line_resolver_unittest.cc', 'cfi_frame_info_unittest.cc', 'contained_range_map_unittest.cc', + 'disassembler_objdump_unittest.cc', 'disassembler_x86_unittest.cc', 'exploitability_unittest.cc', 'fast_source_line_resolver_unittest.cc', From 57d1743662b7fde305ea59225093d109e07c9997 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 7 Oct 2022 10:44:20 +0200 Subject: [PATCH 122/195] Fixup non-canonical fault addresses for amd64. This uses DisassemblerObjdump to add a processing step in MinidumpProcessor to compute the true faulting address from register state and disassembly of the fault instruction when the fault address is suspicious (-1). Bug: 901847 Change-Id: Ia1f77d542c4055c82ce2504db8c84a9e52001866 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3932957 Reviewed-by: Ivan Penkov --- .../processor/minidump_processor.h | 6 +- src/processor/minidump_processor.cc | 89 +++++++++++++++++- src/processor/minidump_processor_unittest.cc | 19 ++++ .../testdata/write_av_non_canonical.dmp | Bin 0 -> 27561 bytes 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 src/processor/testdata/write_av_non_canonical.dmp diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h index aa44e86c1..137ef4444 100644 --- a/src/google_breakpad/processor/minidump_processor.h +++ b/src/google_breakpad/processor/minidump_processor.h @@ -101,8 +101,10 @@ class MinidumpProcessor { // exception, if this information is available. This will be a code // address when the crash was caused by problems such as illegal // instructions or divisions by zero, or a data address when the crash - // was caused by a memory access violation. - static string GetCrashReason(Minidump* dump, uint64_t* address); + // was caused by a memory access violation. If enable_objdump is set, this + // may use disassembly to compute the faulting address. + static string GetCrashReason(Minidump* dump, uint64_t* address, + bool enable_objdump); // This function returns true if the passed-in error code is // something unrecoverable(i.e. retry should not happen). For diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index a80baf457..bf561dfa4 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -43,6 +44,7 @@ #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/exploitability.h" #include "google_breakpad/processor/stack_frame_symbolizer.h" +#include "processor/disassembler_objdump.h" #include "processor/logging.h" #include "processor/stackwalker_x86.h" #include "processor/symbolic_constants_win.h" @@ -117,7 +119,7 @@ ProcessResult MinidumpProcessor::Process( has_requesting_thread = exception->GetThreadID(&requesting_thread_id); process_state->crash_reason_ = GetCrashReason( - dump, &process_state->crash_address_); + dump, &process_state->crash_address_, enable_objdump_); process_state->exception_record_.set_code( exception->exception()->exception_record.exception_code, @@ -758,8 +760,82 @@ bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump, return true; } +static bool IsCanonicalAddress(uint64_t address) { + uint64_t sign_bit = (address >> 63) & 1; + for (int shift = 48; shift < 63; ++shift) { + if (sign_bit != ((address >> shift) & 1)) { + return false; + } + } + return true; +} + +static void CalculateFaultAddressFromInstruction(Minidump* dump, + uint64_t* address) { + MinidumpException* exception = dump->GetException(); + if (exception == NULL) { + BPLOG(INFO) << "Failed to get exception."; + return; + } + + MinidumpContext* context = exception->GetContext(); + if (context == NULL) { + BPLOG(INFO) << "Failed to get exception context."; + return; + } + + uint64_t instruction_ptr = 0; + if (!context->GetInstructionPointer(&instruction_ptr)) { + BPLOG(INFO) << "Failed to get instruction pointer."; + return; + } + + // Get memory region containing instruction pointer. + MinidumpMemoryList* memory_list = dump->GetMemoryList(); + MinidumpMemoryRegion* memory_region = + memory_list ? + memory_list->GetMemoryRegionForAddress(instruction_ptr) : NULL; + if (!memory_region) { + BPLOG(INFO) << "No memory region around instruction pointer."; + return; + } + + DisassemblerObjdump disassembler(context->GetContextCPU(), memory_region, + instruction_ptr); + fprintf(stderr, "%s %s %s\n", disassembler.operation().c_str(), + disassembler.src().c_str(), disassembler.dest().c_str()); + if (!disassembler.IsValid()) { + BPLOG(INFO) << "Disassembling fault instruction failed."; + return; + } + + // It's possible that we reach here when the faulting address is already + // correct, so we only update it if we find that at least one of the src/dest + // addresses is non-canonical. If both are non-canonical, we arbitrarily set + // it to the larger of the two, as this is more likely to be a known poison + // value. + + bool valid_read, valid_write; + uint64_t read_address, write_address; + + valid_read = disassembler.CalculateSrcAddress(*context, read_address); + valid_read &= !IsCanonicalAddress(read_address); + + valid_write = disassembler.CalculateDestAddress(*context, write_address); + valid_write &= !IsCanonicalAddress(write_address); + + if (valid_read && valid_write) { + *address = read_address > write_address ? read_address : write_address; + } else if (valid_read) { + *address = read_address; + } else if (valid_write) { + *address = write_address; + } +} + // static -string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address) { +string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, + bool enable_objdump) { MinidumpException* exception = dump->GetException(); if (!exception) return ""; @@ -1985,6 +2061,15 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address) { *address = GetAddressForArchitecture( static_cast(raw_system_info->processor_architecture), *address); + + // For invalid accesses to non-canonical addresses, amd64 cpus don't provide + // the fault address, so recover it from the disassembly and register state + // if possible. + if (enable_objdump + && raw_system_info->processor_architecture == MD_CPU_ARCHITECTURE_AMD64 + && std::numeric_limits::max() == *address) { + CalculateFaultAddressFromInstruction(dump, address); + } } return reason; diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 6dfa54a64..1ca8c9fbd 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -799,6 +799,25 @@ TEST_F(MinidumpProcessorTest, TestFastFailException) { ASSERT_EQ(state.crash_reason(), "FAST_FAIL_FATAL_APP_EXIT"); } +#ifdef __linux__ +TEST_F(MinidumpProcessorTest, TestNonCanonicalAddress) { + // This tests if we can correctly fixup non-canonical address GPF fault + // addresses. + // Dump is captured from a toy executable and is readable by windbg. + MinidumpProcessor processor(nullptr, nullptr /*&supplier, &resolver*/); + processor.set_enable_objdump(true); + + string minidump_file = GetTestDataPath() + + "write_av_non_canonical.dmp"; + + ProcessState state; + ASSERT_EQ(processor.Process(minidump_file, &state), + google_breakpad::PROCESS_OK); + ASSERT_TRUE(state.crashed()); + ASSERT_EQ(state.crash_address(), 0xfefefefefefefefeU); +} +#endif // __linux__ + } // namespace int main(int argc, char* argv[]) { diff --git a/src/processor/testdata/write_av_non_canonical.dmp b/src/processor/testdata/write_av_non_canonical.dmp new file mode 100644 index 0000000000000000000000000000000000000000..02da25eebf828e4864c900fafbff722cf24f28a3 GIT binary patch literal 27561 zcmeG_30PIt*6RW)*uZs4oNt9gnug(6rl?rgp1yF(dXEYO5)}0YXxOW~rjMdg60X_oM>wbxqro^ya}_*Kuo?{2pc*Wv15eW|7rcGZ|&gg$WO%2TnX&XQ6O)`PRLbQ7>1&}FSH1MwLi{AbH%*xvt=2d>KiRUEq_dF0ka)dumprt_@LpYq-y83J*0)$DXpefy0D73VV09 zE+~)GoOfn0o;Eyq&v(@kMpwm25Vi3ncsFmx*gXzi>7t8ZC|&4oNDZlLFBn~wXTuVI zZ&PU)G@EH#&6P*_3@q@L2gO4XG=I%d0X5 zuBeKE!OJhX^i_*48d04Q!MX@qb-5hHL2BL#sq1mhS9uKdiD?dV_g5q}ZE5%6Xelp( zp>)NguIiAwida`lOSoZlOQ>C&a{9#%U8jmJf>vG5dPr(olR^n~>tRXhz2uA}7wmb} z1>39RGVZYG>TO1-XAV{9)J0=f4OHg`T69&`sq>#7{%IZ(C3S{-B0E8gf_B$$v*?OI zT^W&FUId-GR1ZN?bGb!V-F#ihJ_I*hI@Ap>dq3*czLmYa+K4WKp>)ynbwfy94|BfC zBjCxWBH)5kQqM>`PFBdPhkk}*w*3ItP{_Y(B?aJ8?wHsJ#5l$R)-IL*y>Xp#H*QjQXc4^_- zy0TOAag)0JkE&|7WcliDG=avjbqfz3hF&<`SodL8q`^mES)YG8-j<9raU7KxxcxPb zMnAyN(~;q_4h*3fE4m3dprKIqWuy_DvY4T!7t;(JLj@LEqr=t6F%r&$RGdBL;Vh#r z%rNuVESw=1VCuCvr=_{_EWFFdc%hk*rowofdj@BrsVFHAXhxcibCWEj%0fNo1$0ez zNST1M<$RQ%g>&3QoV%tPZJ8)B7x@`tqumJp=_o4?rI1x5F(?JAp5*x0R{RA3!<^gg8PW)QW}uhm7~d9H>=@bz3A9F#fu%Cb_&ey8 z##oVuxuEhbz_o>-gvR)FHkPx`Na+jx%{s?Gi=@WnhiAvxrks5i8I38M*^-+nrpD6B ziq^QsTN0e7s|@T)esz7DVl0`9o+-d}sywVKGw>?FYYyfx|2Qop-aO>a!BU@TkhxvXAm^Xp^)|i<2CMMG`uA6rZp^2@!ZcN z-+t!1`y5^|Xz#2739^zPD++#*2R^aP4d7v%Aedh0T)F~*3x2k+qt*q7Z~bI#Nk^tn z6#G6K!g0-?(ydze_nX(e|588a$_5HGdW+#sBR^a6lM2b$g3Q78BLiV7c(Em*mGVr) zaNCVvbJ{Ywyx)78rzOMFEu|eBXDKp=48z*NWC^^X6CGG^HU24^h+I| zm7A5GpOu=Cm!6;9$Co(;NY;T5Ms&$q)po?>v_T_slYL8R@H?|0GdDLtv3~sz51u+U zC2~mi&YUBwKD&!3rf22N%*stXH$ZgpJxycQ`g=ds`l?f|TEAm(t02)7)EOWf`|S6R zO}}}2!q%2uw{4ESc@dGNXU<9Ya**y8XrL^6AZ&zBLP=(Fwq$^MfQ-)uLo$W-gEI<^I}8K|Qvdzj#Szhh5{gUmx?s$oGaV^PMk(GG^rk zy>oQ@fCK0EOrN&5Xyn^_ZdgJjqS$X+6vt|Zpo-FLK$Jg_QnybEl`L%DKjxQmBzI^nyp`d9)XS^uTvZ)TS zb@TY?mNHdCw!TStcuI!IG(qY+9N@X#+{Kvq2mtNUbTj$w_WR6~^RofdOqZuqPymi6 z^gY!K#k-LK7<8$`%TY5AQ~LzfC@^p&Z>mwQDOAeRhE5T?_LTf_GC;9X0(cPToFd%S ziRo2N#bKUWs66VHRTRO=IF&S;u!2-NrNOgW#y`u(JYb^>3}HXbj3kSQj>5xNPc>7N zVp&qE{6?liIwiVChQ@mYAAPl7lz8}^^d?QMx8UrA+*A3L96nWXRQ&T-9E!9Co*esv9F z&TsWh$-%>>Zz?BDX&lq*^X3*gx)l9J;*{vKJpk|Qy>a&oPc3_l+6#>0)F}d7Zo1(~ z6t&aZmLS#^RF+P+G?92HX#Dqv*5&)0VL!Y$3{PSCCvp9#YBkri168+Y8>qIFoW}l9 zI>oEqYl_&vnz#H;+&-y4wH;KxU6QWxO&#s+nQkSJYpwn~iMQ$Dl2&$lm7jnU*eYD_ zBS;6-@O+vHg^qTw-y`|v;2p>kY>J~l!J(tczq8-K?R;|x4l4NhQoW)Eg8c#WYyYAB zl+tOtto?xMQ9G1Qmo8IeytGC7EA4O7`~{p3S@N#9N#lI@?8(3U%!e){KWdN4pW$7c zyn^@T6=k4bVrh?azkg*;C)3_&yg#my4=_jBnQ+VwT@n_?0N{GH$gx$W$s3Mv`=;X% z#Ww`CUO3a2oXY)Yc+1S`8IFgy%MtmG~(sOf~GePoVM)a?bacb;d1t)q>t7U>_^r3g*9T(a?|`7A@%$mi@#(&+o`Pa za?@R)u0Lpcg4_&Lgd8bQIYD|pc&QL;Z59H)dBgu z^Iv@(qnoO>-HUHk*h10-?}A+(Z_&6oZ_&rbu)f}+n1F3!Q{0%M;b_Rl?xTCX?p;i` zXj7NbMXy)IZF;NErr0hEP0@@gdUq|2Z+?vG8XZ|P&ow(Twuv*HvK%U%_K!lP)B0Gb zblP1Cl}`I%A=1BH{$aCF>1%1-Dg^)9y~jwW`CKUeeWBC8y<%->`}T+CUwhyf=?9OI zPOm&!?Jtp+esvvKA@1-lrhUJ~uP{WmUlsJ|drzQ`LIC`qaJlc}c|@fnKFhKWN%J

gB7jyt9omViPKnmM4T8?5-y`$hfD*M2{vv^&Zlg%&Lnea*Q z$RWkS72BVDH&m`Jgu^ftqK!+f^qkVT-<1DledV9V_9q=t_@ElSB8KAig$?g;`MKZA zGx?}+9Fa^T1?$QHfqMzZn}ek|Em>=GOd_+cn?!9GABeEL1*4 z90Tr~7qr((s^y?|K}iX}pbDJ-B#FE6Woc{J^n~3W&EFWA7$5GQ&-*^YZQ5wB)8bb{?hDgXa=MbFsgTs$Z&A-H-;IJ={F6E_m z`@gW;oAkLoPJCpdlfF=%50&fwlKHegmv?19c?Cb-eC`KdQ4qZHDO~ii3(Q%1L0qua z-VUn2-W+m~S*Pd;XBo;bgkIY_m8bBnb@CFluJ_NuNT{b$nE-~zI4s)T|@eM2=k>cGyP>>FE{nGvq8_Uq_pA+-nv3 zvg(P(KMAemJc`h%{Z)=~^NZfgzG8hOSJ!}umDY7cgaP9#nU2OCR9AIhOWV7&Kz-u; zAI`Shq4h&$O7+($K#rYWo7rlSLys#xU;5Z;zLib|sUE-3E5D}u#Lg1&8?VbvhFMqe zJ{_+&;-{I8@;NH=mM=2v$8bE6oIl-9dtKzHU6oSrD@0*CUItV3&_mJ#2)P-4g!MV` z*+M_zU@)Eh;F0oBdd+7sBIu(AJtW;~2jT6lFb=haE>#6Npj#ZQP~~Ypl0@IKom@YX z#a?~>NgU}-pd0*H5CsyMf|vEvLG-by;0K0|??Y3hr{W#0M_f*-kDv*XAB`$Z8^wHS z@;oS+U)JZ#19Fvv<=?JRClmord0Nk(zR0mJEc9EXey;h#-oIh}YGKv`rn7`s1}Q(&Yr4Xu{rvoTrC*@)V%G5t^?MX=qX!pREXHH| zbDx+INj%lqz;GMPdeU;)4%L$||3_n|>hm06y*En*4u53t_}V@xjxhL>c|gY%;g9Tb z!6j|v^K^P{G3h&Q9~vrFnJ&RU+!-tA+@j9=E*ivg=v=%lI6BH=hkQ!bF(mONbl`Ko ziYs$3x1Ia7$vy!iy633>w5@;I&U!kQNOEy zV>fI6!%lLGuM|GN)Sgaf6sPS^Q9Gu#XZgyfQ0;#88-5j# z=&7IEzKi+k<9`&K_Ou$w@|4~WoNuPC`(DP8sE1mw%K*^N4h8zZIOcQmtDLoB*XJ^D zAGC+I@~Qbw(|j{q zqkhTWb7H|m`60ckgFiYMjO(11ga_6Ju%&QUqVUm;F3}(eRK!ZAT>v z9=XwZw$?KME?4#Q*ynUU!gv~MQcymQ;d)ghr$>o?!qboyFUQDLIqHXQZI~oEkbjBm zdb-*-(FK!u-oX03%@|gQ9mOg@;@66^wOlI>Nq*)Yu7{h`d3{jp;i6c$l}yp~dWw_WK{C$~GtE1AbbrG)_VxP|Ee|2o zd?}yS<0}QB>-WvEC9sBo-C~&9r}bO?T(^FUoFIc$EPS<(>&Y^-ll-}-51(&OddWV1 zQYNjh<+WTd{eks%ju!^n6OJpN+L^D7gG=}W^h~K{`UD>+ZxNLACC`UbgkR+=okHcm z{b{CGyw(%tBS_^*&mYxqeGXNAz+NK6p!o6#wqNBcr}Fda6o95{+o5npR!Sr3c{!8>^gSKn4W8pgbFukz{^GD;4LX1&;S%#OXf7nJX z!h712F^g&hG0<~btL=@!;CM#LTgNfAdykrrJn9z@JV-~^gLtjSYY<*!5AB1}2l`79 z(#QNW1tuVzh&o6&!8E+|BmeZVehLKjo<8_L5pnc^WV+lJ0z5vQKe|5x^F|*wrm@yK zg!J)b`mjIACYn$|3L9v z#y-oLNc~3;Nn%G2fe8Zj`3pREZncY{U+fLMhm7^l!#Fa<^i|gWsC}PjW6mZ5iw#8A zU=TX>pZa&8d@@V%4e_i0jWHIYKl0qFMQxqihTbcyLl{PcJrMRl*aKk?ggp@Uz#ry; F{|E1dC6oXF literal 0 HcmV?d00001 From ef443fbf777fd001593d135af07f1ff2cfa3294e Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Wed, 12 Oct 2022 17:06:34 +0000 Subject: [PATCH 123/195] Changes FunctionNames.Mangled to check for regex instead of equality The demangled name has recently joined two angle brackets, where there was previously a space. This commit makes it possible for both options to pass, since they're both valid source. Bug: b:238678030 Test: Tested locally Fixed: b:243982778 Change-Id: Ic4464709fb8cc5c730a9d14a8627294b24ae70c3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3949474 Reviewed-by: Lei Zhang --- src/common/stabs_to_module_unittest.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc index 252724825..95bdb261f 100644 --- a/src/common/stabs_to_module_unittest.cc +++ b/src/common/stabs_to_module_unittest.cc @@ -210,10 +210,9 @@ TEST(FunctionNames, Mangled) { Module::Function *function = functions[0]; // This is GCC-specific, but we shouldn't be seeing STABS data anywhere // but Linux. - EXPECT_STREQ("std::vector >::" - "push_back(unsigned long long const&)", - function->name.str().c_str()); + EXPECT_THAT(function->name.str(), ::testing::ContainsRegex( + "std::vector\\s?>::" + "push_back\\(unsigned long long const&\\)")); EXPECT_EQ(0xf2cfda63cef7f46dLL, function->address); EXPECT_LT(0U, function->ranges[0].size); // should have used dummy size EXPECT_EQ(0U, function->parameter_size); From f9bf260e943bd833f7b3092b0652aaefb26fd62d Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Fri, 14 Oct 2022 00:15:45 +0000 Subject: [PATCH 124/195] enables C++17 mode Breakpad has started to use C++17 features, and needs to be compiled using C++17. Bug: b:238678030, b:243982778 Test: Locally, CQ Change-Id: Ia339f0815d2efd2a49fa9b788044b5b0163f95fa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3954471 Reviewed-by: Mark Mentovai Reviewed-by: Manoj Gupta Reviewed-by: Joshua Peraza --- Makefile.in | 2 +- configure | 616 ++++++++++++++++++++++++------------ configure.ac | 2 +- m4/ax_cxx_compile_stdcxx.m4 | 549 +++++++++++++++++++++++++++++--- src/config.h.in | 4 +- 5 files changed, 914 insertions(+), 259 deletions(-) diff --git a/Makefile.in b/Makefile.in index b373cc8c3..0d0ccba2c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2446,7 +2446,7 @@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ GTEST_CFLAGS = @GTEST_CFLAGS@ GTEST_LIBS = @GTEST_LIBS@ -HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/configure b/configure index 22f0a0264..d131f5a91 100755 --- a/configure +++ b/configure @@ -676,7 +676,7 @@ ANDROID_HOST_TRUE LINUX_HOST_FALSE LINUX_HOST_TRUE WARN_CXXFLAGS -HAVE_CXX11 +HAVE_CXX17 HAVE_MEMFD_CREATE_FALSE HAVE_MEMFD_CREATE_TRUE HAVE_GETCONTEXT_FALSE @@ -7740,20 +7740,31 @@ fi - ax_cxx_compile_cxx11_required=true + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -printf %s "checking whether $CXX supports C++11 features by default... " >&6; } -if test ${ax_cv_cxx_compile_cxx11+y} + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7764,7 +7775,11 @@ else $as_nop #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -7789,11 +7804,13 @@ namespace cxx11 struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -8041,319 +8058,501 @@ namespace cxx11 -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ax_cv_cxx_compile_cxx11=yes -else $as_nop - ax_cv_cxx_compile_cxx11=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 -printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes - fi - - - - if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -// If the compiler admits that it is not ready for C++11, why torture it? +// If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +#elif __cplusplus < 201402L && !defined _MSC_VER -#error "This is not a C++11 compiler" +#error "This is not a C++14 compiler" #else -namespace cxx11 +namespace cxx14 { - namespace test_static_assert + namespace test_polymorphic_lambdas { - template - struct check + int + test() { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } } - namespace test_final_override + namespace test_binary_literals { - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); } - namespace test_double_right_angle_brackets + namespace test_generalized_constexpr { - template < typename T > - struct check {}; + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); } - namespace test_decltype + namespace test_lambda_init_capture { int - f() + test() { - int a = 1; - decltype(a) b = 2; - return a + b; + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); } } - namespace test_type_deduction + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction { + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + template < typename T1, typename T2 > struct is_same { - static const bool value = false; + static constexpr auto value = false; }; template < typename T > struct is_same { - static const bool value = true; + static constexpr auto value = true; }; - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) + int + test() { - return a1 + a2; + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; } - int - test(const int c, volatile int v) + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); } } - namespace test_noexcept + namespace test_extended_static_assert { - int f() { return 0; } - int g() noexcept { return 0; } + static_assert (true); - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + } + + namespace test_auto_brace_init_list + { + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); } - namespace test_constexpr + namespace test_typename_in_template_template_parameter { - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; + return 42; } - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept + [[nodiscard]] int f2() { - return strlen_c_r(s, 0UL); + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); } - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases } - namespace test_rvalue_references + namespace test_general_range_based_for_loop { - template < int N > - struct answer + struct iter { - static constexpr int value = N; + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } }; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + struct sentinel + { + int i; + }; - void - test() + bool operator== (const iter& i, const sentinel& s) { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } } } - namespace test_uniform_initialization + namespace test_lambda_capture_asterisk_this_by_value { - struct test + struct t { - static const int zero {}; - static const int one {1}; + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } }; - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; } - namespace test_lambdas + namespace test_constexpr_if { - void - test1() + template + int f () { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } } - int - test2() + } + + namespace test_selection_statement_with_initializer + { + + int f() { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; + return 13; } - int - test3() + int f2() { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } } } - namespace test_variadic_templates + namespace test_template_argument_deduction_for_class_templates { - template - struct sum; - - template - struct sum + template + struct pair { - static constexpr auto value = N0 + sum::value; + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; }; - template <> - struct sum<> + void f() { - static constexpr auto value = 0; + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); } - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae + namespace test_exception_spec_type_system { - struct foo {}; + struct Good {}; + struct Bad {}; - template - using member = typename T::member_type; + void g1() noexcept; + void g2(); template - void func(...) {} + Bad + f(T*, T*); - template - void func(member*) {} + template + Good + f(T1*, T2*); - void test(); + static_assert (std::is_same_v); - void test() { func(0); } + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } } -} // namespace cxx11 +} // namespace cxx17 -#endif // __cplusplus >= 201103L +#endif // __cplusplus < 201703L && !defined _MSC_VER @@ -8365,14 +8564,21 @@ else $as_nop eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$ac_save_CXXFLAGS" + CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done @@ -8383,26 +8589,24 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ax_cxx_compile_cxx17_required = xtrue; then if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} else - if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} - else - HAVE_CXX11=1 - -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h - - fi + HAVE_CXX17=1 +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h fi + WARN_CXXFLAGS= ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' diff --git a/configure.ac b/configure.ac index 462d04369..69e23545f 100644 --- a/configure.ac +++ b/configure.ac @@ -75,7 +75,7 @@ AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create]) AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes]) AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes]) -AX_CXX_COMPILE_STDCXX(11, noext, mandatory) +AX_CXX_COMPILE_STDCXX(17, noext, mandatory) dnl Test supported warning flags. WARN_CXXFLAGS= diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index 079e17d2a..a3d964c69 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS @@ -9,14 +9,14 @@ # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXXFLAGS to -# enable support. VERSION may be '11' (for the C++11 standard) or '14' -# (for the C++14 standard). +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. +# preference for no added switch, and then for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is @@ -33,21 +33,26 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 15 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [], - [$1], [14], [], - [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -59,29 +64,35 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi + + m4_if([$2], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then - for switch in -std=gnu++$1 -std=gnu++0x; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" + [ac_save_CXX="$CXX" + CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) + CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi ac_success=yes break fi @@ -93,19 +104,27 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" - for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done @@ -115,18 +134,16 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) else - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - - AC_SUBST(HAVE_CXX$1) + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) fi + AC_SUBST(HAVE_CXX$1) ]) @@ -136,7 +153,6 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) - dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], @@ -144,6 +160,23 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + dnl Tests for new features in C++11 @@ -156,7 +189,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -181,11 +218,13 @@ namespace cxx11 struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -445,7 +484,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -514,7 +553,7 @@ namespace cxx14 } - namespace test_digit_seperators + namespace test_digit_separators { constexpr auto ten_million = 100'000'000; @@ -556,3 +595,415 @@ namespace cxx14 #endif // __cplusplus >= 201402L ]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER + +]]) diff --git a/src/config.h.in b/src/config.h.in index 940358cf6..8fd7b0aa3 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -6,8 +6,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_A_OUT_H -/* define if the compiler supports basic C++11 syntax */ -#undef HAVE_CXX11 +/* define if the compiler supports basic C++17 syntax */ +#undef HAVE_CXX17 /* Define to 1 if you have the `getcontext' function. */ #undef HAVE_GETCONTEXT From b90119e3f3fadf1c049610f9cab969446843b3a0 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Mon, 17 Oct 2022 18:15:05 +0000 Subject: [PATCH 125/195] replaces `sizeof(raw_context)` with `sizeof(*raw_context)` Using `sizeof(raw_context)` generates the following warning (which is an error in ChromeOS): ``` 'memset' call operates on objects of type 'MDRawContextX86' while the size is based on a different type 'MDRawContextX86 *' ``` This commit follows the implied advice of this warning and adjusts the expression. Bug: b:238678030, b:243982778 Test: Locally Change-Id: I26111c6ff7a1223223e6096a75ad52c48d941e89 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3960915 Reviewed-by: Joshua Peraza --- src/processor/disassembler_objdump_unittest.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/processor/disassembler_objdump_unittest.cc b/src/processor/disassembler_objdump_unittest.cc index 781b60ecf..4b4ce6c30 100644 --- a/src/processor/disassembler_objdump_unittest.cc +++ b/src/processor/disassembler_objdump_unittest.cc @@ -147,7 +147,7 @@ class TestDumpContext : public DumpContext { TestDumpContext::TestDumpContext(bool x86_64) { if (!x86_64) { MDRawContextX86* raw_context = new MDRawContextX86(); - memset(raw_context, 0, sizeof(raw_context)); + memset(raw_context, 0, sizeof(*raw_context)); raw_context->context_flags = MD_CONTEXT_X86_FULL; @@ -170,7 +170,7 @@ TestDumpContext::TestDumpContext(bool x86_64) { this->valid_ = true; } else { MDRawContextAMD64* raw_context = new MDRawContextAMD64(); - memset(raw_context, 0, sizeof(raw_context)); + memset(raw_context, 0, sizeof(*raw_context)); raw_context->context_flags = MD_CONTEXT_AMD64_FULL; @@ -461,4 +461,4 @@ TEST(DisassemblerObjdumpTest, AMD64CallRegOffset) { ASSERT_FALSE(dis.CalculateSrcAddress(context, src_address)); ASSERT_EQ(dest_address, kAMD64TestRsi + 0x9999999); } -} // namespace google_breakpad \ No newline at end of file +} // namespace google_breakpad From 73c29370ce9f81eeafa4e21035db0d2ad5d60d7a Mon Sep 17 00:00:00 2001 From: mingtaoxt xt Date: Wed, 19 Oct 2022 19:41:09 +0800 Subject: [PATCH 126/195] Update LSS dep to the latest commit Change-Id: I39e459f519922433de82c62385d08c6db34328f0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964165 Reviewed-by: Mike Frysinger --- DEPS | 2 +- default.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 797ceeb8c..3244e5434 100644 --- a/DEPS +++ b/DEPS @@ -51,7 +51,7 @@ deps = { # Linux syscall support. "src/src/third_party/lss": "https://chromium.googlesource.com/linux-syscall-support/" + - "@ce877209e11aa69dcfffbd53ef90ea1d07136521", + "@9719c1e1e676814c456b55f5f070eabad6709d31", } hooks = [ diff --git a/default.xml b/default.xml index b5215113e..154b3901f 100644 --- a/default.xml +++ b/default.xml @@ -32,7 +32,7 @@ Date: Wed, 19 Oct 2022 19:36:13 +0800 Subject: [PATCH 127/195] mainline version gcc-13 cannot use "uintptr_t" via "#include " Change-Id: I0049bb92658b4226e32783ad4d8271787deef5f3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964166 Reviewed-by: Mike Frysinger --- src/client/linux/handler/minidump_descriptor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h index 4349b88f3..d822c9d92 100644 --- a/src/client/linux/handler/minidump_descriptor.h +++ b/src/client/linux/handler/minidump_descriptor.h @@ -32,6 +32,7 @@ #include #include +#include #include #include "client/linux/handler/microdump_extra_info.h" From de086a98595f68715c1dce9860f77014a2a1b187 Mon Sep 17 00:00:00 2001 From: Konstantin Mandrika Date: Wed, 26 Oct 2022 20:16:26 +0000 Subject: [PATCH 128/195] Add support for compressed section headers to dump_syms. Change-Id: I019cc9ffd66850ec5259f6dfcd9af8ac6c37d2c0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3938926 Reviewed-by: Manoj Gupta Reviewed-by: Joshua Peraza --- Makefile.am | 6 ++- Makefile.in | 6 ++- src/common/dwarf_cu_to_module.cc | 10 +++++ src/common/dwarf_cu_to_module.h | 6 +++ src/common/linux/dump_symbols.cc | 77 +++++++++++++++++++++++++++++++- src/common/linux/elfutils.h | 35 +++++++++++++++ 6 files changed, 134 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0f571bcfa..7ef05e560 100644 --- a/Makefile.am +++ b/Makefile.am @@ -636,7 +636,8 @@ src_tools_linux_dump_syms_dump_syms_SOURCES = \ src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \ $(RUSTC_DEMANGLE_CFLAGS) src_tools_linux_dump_syms_dump_syms_LDADD = \ - $(RUSTC_DEMANGLE_LIBS) + $(RUSTC_DEMANGLE_LIBS) \ + -lz src_tools_linux_md2core_minidump_2_core_SOURCES = \ src/common/linux/memory_mapped_file.cc \ @@ -773,7 +774,8 @@ src_common_dumper_unittest_CPPFLAGS = \ src_common_dumper_unittest_LDADD = \ $(TEST_LIBS) \ $(RUSTC_DEMANGLE_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + -lz src_common_mac_macho_reader_unittest_SOURCES = \ src/common/dwarf_cfi_to_module.cc \ diff --git a/Makefile.in b/Makefile.in index 0d0ccba2c..c9a359f64 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2945,7 +2945,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -lz @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_SOURCES = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ @@ -3088,7 +3089,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -lz @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_SOURCES = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \ diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index f5293de49..a5a1fd069 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -123,6 +123,10 @@ DwarfCUToModule::FileContext::FileContext(const string& filename, } DwarfCUToModule::FileContext::~FileContext() { + for (std::vector::iterator i = uncompressed_sections_.begin(); + i != uncompressed_sections_.end(); ++i) { + delete[] *i; + } } void DwarfCUToModule::FileContext::AddSectionToSectionMap( @@ -130,6 +134,12 @@ void DwarfCUToModule::FileContext::AddSectionToSectionMap( section_map_[name] = std::make_pair(contents, length); } +void DwarfCUToModule::FileContext::AddManagedSectionToSectionMap( + const string& name, uint8_t* contents, uint64_t length) { + section_map_[name] = std::make_pair(contents, length); + uncompressed_sections_.push_back(contents); +} + void DwarfCUToModule::FileContext::ClearSectionMapForTest() { section_map_.clear(); } diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index f44be8ced..5a8001042 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -41,6 +41,7 @@ #include #include +#include #include "common/language.h" #include "common/module.h" @@ -82,6 +83,10 @@ class DwarfCUToModule: public RootDIEHandler { const uint8_t* contents, uint64_t length); + void AddManagedSectionToSectionMap(const string& name, + uint8_t* contents, + uint64_t length); + // Clear the section map for testing. void ClearSectionMapForTest(); @@ -114,6 +119,7 @@ class DwarfCUToModule: public RootDIEHandler { // Inter-compilation unit data used internally by the handlers. scoped_ptr file_private_; + std::vector uncompressed_sections_; }; // An abstract base class for handlers that handle DWARF range lists for diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 8ccbbbd10..7e639b0a8 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -46,8 +46,8 @@ #include #include #include +#include -#include #include #include #include @@ -281,6 +281,55 @@ class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler { google_breakpad::ByteReader* byte_reader_; }; +template +bool IsCompressedHeader(const typename ElfClass::Shdr* section) { + return (section->sh_flags & SHF_COMPRESSED) != 0; +} + +template +uint32_t GetCompressionHeader( + typename ElfClass::Chdr& compression_header, + const uint8_t* content, uint64_t size) { + const typename ElfClass::Chdr* header = + reinterpret_cast(content); + + if (size < sizeof (*header)) { + return 0; + } + + compression_header = *header; + return sizeof (*header); +} + +std::pair UncompressSectionContents( + const uint8_t* compressed_buffer, uint64_t compressed_size, uint64_t uncompressed_size) { + z_stream stream; + memset(&stream, 0, sizeof stream); + + stream.avail_in = compressed_size; + stream.avail_out = uncompressed_size; + stream.next_in = const_cast(compressed_buffer); + + google_breakpad::scoped_array uncompressed_buffer( + new uint8_t[uncompressed_size]); + + int status = inflateInit(&stream); + while (stream.avail_in != 0 && status == Z_OK) { + stream.next_out = + uncompressed_buffer.get() + uncompressed_size - stream.avail_out; + + if ((status = inflate(&stream, Z_FINISH)) != Z_STREAM_END) { + break; + } + + status = inflateReset(&stream); + } + + return inflateEnd(&stream) != Z_OK || status != Z_OK || stream.avail_out != 0 + ? std::make_pair(nullptr, 0) + : std::make_pair(uncompressed_buffer.release(), uncompressed_size); +} + template bool LoadDwarf(const string& dwarf_filename, const typename ElfClass::Ehdr* elf_header, @@ -311,7 +360,31 @@ bool LoadDwarf(const string& dwarf_filename, section->sh_name; const uint8_t* contents = GetOffset(elf_header, section->sh_offset); - file_context.AddSectionToSectionMap(name, contents, section->sh_size); + uint64_t size = section->sh_size; + + if (!IsCompressedHeader(section)) { + file_context.AddSectionToSectionMap(name, contents, size); + continue; + } + + typename ElfClass::Chdr chdr; + + uint32_t compression_header_size = + GetCompressionHeader(chdr, contents, size); + + if (compression_header_size == 0 || chdr.ch_size == 0) { + continue; + } + + contents += compression_header_size; + size -= compression_header_size; + + std::pair uncompressed = + UncompressSectionContents(contents, size, chdr.ch_size); + + if (uncompressed.first != nullptr && uncompressed.second != 0) { + file_context.AddManagedSectionToSectionMap(name, uncompressed.first, uncompressed.second); + } } // .debug_ranges and .debug_rnglists reader diff --git a/src/common/linux/elfutils.h b/src/common/linux/elfutils.h index d44d4762c..c6f1267bf 100644 --- a/src/common/linux/elfutils.h +++ b/src/common/linux/elfutils.h @@ -40,6 +40,39 @@ namespace google_breakpad { +typedef struct { + typedef Elf32_Word Type; + typedef Elf32_Word Size; + typedef Elf32_Addr Addr; + + static_assert(sizeof (Type) == 4); + static_assert(sizeof (Size) == 4); + static_assert(sizeof (Addr) == 4); + + Type ch_type; // Compression type + Size ch_size; // Uncompressed data size in bytes + Addr ch_addralign; // Uncompressed data alignment +} Elf32_Chdr; + +static_assert(sizeof (Elf32_Chdr) == 12); + +typedef struct { + typedef Elf64_Word Type; + typedef Elf64_Xword Size; + typedef Elf64_Addr Addr; + + static_assert(sizeof (Type) == 4); + static_assert(sizeof (Size) == 8); + static_assert(sizeof (Addr) == 8); + + Type ch_type; // Compression type + Type ch_reserved; // Padding + Size ch_size; // Uncompressed data size in bytes + Addr ch_addralign; // Uncompressed data alignment +} Elf64_Chdr; + +static_assert(sizeof (Elf64_Chdr) == 24); + // Traits classes so consumers can write templatized code to deal // with specific ELF bits. struct ElfClass32 { @@ -49,6 +82,7 @@ struct ElfClass32 { typedef Elf32_Nhdr Nhdr; typedef Elf32_Phdr Phdr; typedef Elf32_Shdr Shdr; + typedef Elf32_Chdr Chdr; typedef Elf32_Half Half; typedef Elf32_Off Off; typedef Elf32_Sym Sym; @@ -67,6 +101,7 @@ struct ElfClass64 { typedef Elf64_Nhdr Nhdr; typedef Elf64_Phdr Phdr; typedef Elf64_Shdr Shdr; + typedef Elf64_Chdr Chdr; typedef Elf64_Half Half; typedef Elf64_Off Off; typedef Elf64_Sym Sym; From 1f9903c161229c55670ae0f92fcbcca9c5fa6b68 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Thu, 27 Oct 2022 00:24:37 +0000 Subject: [PATCH 129/195] names anonymous structs in elfutils.h Fixed: chromium:1378800 Change-Id: I8215c091c72e796b1683753e2512d6e6adc4167f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3984802 Reviewed-by: Joshua Peraza --- src/common/linux/elfutils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/linux/elfutils.h b/src/common/linux/elfutils.h index c6f1267bf..130a8ac13 100644 --- a/src/common/linux/elfutils.h +++ b/src/common/linux/elfutils.h @@ -40,7 +40,7 @@ namespace google_breakpad { -typedef struct { +typedef struct Elf32_Chdr { typedef Elf32_Word Type; typedef Elf32_Word Size; typedef Elf32_Addr Addr; @@ -56,7 +56,7 @@ typedef struct { static_assert(sizeof (Elf32_Chdr) == 12); -typedef struct { +typedef struct Elf64_Chdr { typedef Elf64_Word Type; typedef Elf64_Xword Size; typedef Elf64_Addr Addr; From 989f86213449f653ddf83309c1644b70f9e16628 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Fri, 23 Sep 2022 20:46:59 +0000 Subject: [PATCH 130/195] Support marking folded symbols on Posix This is similar to the Windows change at https://chromium-review.googlesource.com/c/breakpad/breakpad/+/773418/ When a `Module` is created with `enable_multiple_field_` = true, all FUNCs and PUBLICs that share the same address will be collapsed into a single entry, and that entry will be marked with `m` for multiple in the final output. `enable_multiple_field_` is temporary just in case people are depending on the current behavior. Support for `dump_syms` executables will be added in a follow-up. Bug: google-breakpad:751 Change-Id: I631a148ed00138924c7bcb5ad6db8b9a6610dd03 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3905122 Reviewed-by: Mark Mentovai --- src/common/module.cc | 72 ++++++++++++++++++++---------- src/common/module.h | 22 +++++++++- src/common/module_unittest.cc | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+), 26 deletions(-) diff --git a/src/common/module.cc b/src/common/module.cc index 73c5f723e..4c427da1d 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -96,15 +96,19 @@ void Module::InlineOriginMap::SetReference(uint64_t offset, references_[offset] = specification_offset; } -Module::Module(const string& name, const string& os, - const string& architecture, const string& id, - const string& code_id /* = "" */) : - name_(name), - os_(os), - architecture_(architecture), - id_(id), - code_id_(code_id), - load_address_(0) { } +Module::Module(const string& name, + const string& os, + const string& architecture, + const string& id, + const string& code_id /* = "" */, + bool enable_multiple_field /* = false*/) + : name_(name), + os_(os), + architecture_(architecture), + id_(id), + code_id_(code_id), + load_address_(0), + enable_multiple_field_(enable_multiple_field) {} Module::~Module() { for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it) @@ -150,6 +154,12 @@ bool Module::AddFunction(Function* function) { it_ext = externs_.find(&arm_thumb_ext); } if (it_ext != externs_.end()) { + if (enable_multiple_field_) { + Extern* found_ext = *it_ext; + // If the PUBLIC is for the same symbol as the FUNC, don't mark multiple. + function->is_multiple |= + found_ext->name != function->name || found_ext->is_multiple; + } delete *it_ext; externs_.erase(it_ext); } @@ -164,12 +174,26 @@ bool Module::AddFunction(Function* function) { } } #endif - - std::pair ret = functions_.insert(function); - if (!ret.second && (*ret.first != function)) { - // Free the duplicate that was not inserted because this Module - // now owns it. - return false; + if (enable_multiple_field_) { + FunctionSet::iterator existing_function = std::find_if( + functions_.begin(), functions_.end(), + [&](Function* other) { return other->address == function->address; }); + if (existing_function != functions_.end()) { + (*existing_function)->is_multiple = true; + // Free the duplicate that was not inserted because this Module + // now owns it. + return false; + } + std::pair ret = functions_.insert(function); + // We just checked! + assert(ret.second); + } else { + std::pair ret = functions_.insert(function); + if (!ret.second && (*ret.first != function)) { + // Free the duplicate that was not inserted because this Module + // now owns it. + return false; + } } return true; } @@ -188,7 +212,8 @@ void Module::AddExtern(Extern* ext) { } std::pair ret = externs_.insert(ext); - if (!ret.second) { + if (!ret.second && enable_multiple_field_) { + (*ret.first)->is_multiple = true; // Free the duplicate that was not inserted because this Module // now owns it. delete ext; @@ -378,11 +403,10 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { vector::iterator line_it = func->lines.begin(); for (auto range_it = func->ranges.cbegin(); range_it != func->ranges.cend(); ++range_it) { - stream << "FUNC " << hex - << (range_it->address - load_address_) << " " - << range_it->size << " " - << func->parameter_size << " " - << func->name << dec << "\n"; + stream << "FUNC " << (func->is_multiple ? "m " : "") << hex + << (range_it->address - load_address_) << " " << range_it->size + << " " << func->parameter_size << " " << func->name << dec + << "\n"; if (!stream.good()) return ReportError(); @@ -422,9 +446,9 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { for (ExternSet::const_iterator extern_it = externs_.begin(); extern_it != externs_.end(); ++extern_it) { Extern* ext = *extern_it; - stream << "PUBLIC " << hex - << (ext->address - load_address_) << " 0 " - << ext->name << dec << "\n"; + stream << "PUBLIC " << (ext->is_multiple ? "m " : "") << hex + << (ext->address - load_address_) << " 0 " << ext->name << dec + << "\n"; } } diff --git a/src/common/module.h b/src/common/module.h index 05bdbfb72..f5031ea65 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -128,6 +128,9 @@ class Module { // Inlined call sites belonging to this functions. vector> inlines; + + // If this symbol has been folded with other symbols in the linked binary. + bool is_multiple = false; }; struct InlineOrigin { @@ -241,6 +244,8 @@ class Module { explicit Extern(const Address& address_input) : address(address_input) {} const Address address; string name; + // If this symbol has been folded with other symbols in the linked binary. + bool is_multiple = false; }; // A map from register names to postfix expressions that recover @@ -294,8 +299,14 @@ class Module { // Create a new module with the given name, operating system, // architecture, and ID string. - Module(const string& name, const string& os, const string& architecture, - const string& id, const string& code_id = ""); + // NB: `enable_multiple_field` is temporary while transitioning to enabling + // writing the multiple field permanently. + Module(const string& name, + const string& os, + const string& architecture, + const string& id, + const string& code_id = "", + bool enable_multiple_field = false); ~Module(); // Set the module's load address to LOAD_ADDRESS; addresses given @@ -471,6 +482,13 @@ class Module { ExternSet externs_; unordered_set common_strings_; + + // Whether symbols sharing an address should be collapsed into a single entry + // and marked with an `m` in the output. See + // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=751 and docs + // at + // https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md#records-3 + bool enable_multiple_field_; }; } // namespace google_breakpad diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 5b44f97ca..220add030 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -506,6 +506,34 @@ TEST(Module, ConstructFunctionsWithSameAddress) { contents.c_str()); } +// If multiple fields are enabled, only one function is included per address. +// The entry will be tagged with `m` to show that there are multiple symbols +// at that address. +// TODO(lgrey): Remove the non-multiple versions of these tests and remove the +// suffixes from the suffxed ones when removing `enable_multiple_field_`. +TEST(Module, ConstructFunctionsWithSameAddressMultiple) { + stringstream s; + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); + + // Two functions. + Module::Function* function1 = generate_duplicate_function("_without_form"); + Module::Function* function2 = generate_duplicate_function("_and_void"); + + m.AddFunction(function1); + // If this succeeds, we'll have a double-free with the `delete` below. Avoid + // that. + ASSERT_FALSE(m.AddFunction(function2)); + delete function2; + + m.Write(s, ALL_SYMBOL_DATA); + string contents = s.str(); + EXPECT_STREQ( + "MODULE os-name architecture id-string name with spaces\n" + "FUNC m d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99" + " _without_form\n", + contents.c_str()); +} + // Externs should be written out as PUBLIC records, sorted by // address. TEST(Module, ConstructExterns) { @@ -554,6 +582,29 @@ TEST(Module, ConstructDuplicateExterns) { "PUBLIC ffff 0 _xyz\n", contents.c_str()); } +// Externs with the same address have the `m` tag if the multiple field are +// enabled. +TEST(Module, ConstructDuplicateExternsMultiple) { + stringstream s; + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); + + // Two externs. + Module::Extern* extern1 = new Module::Extern(0xffff); + extern1->name = "_xyz"; + Module::Extern* extern2 = new Module::Extern(0xffff); + extern2->name = "_abc"; + + m.AddExtern(extern1); + m.AddExtern(extern2); + + m.Write(s, ALL_SYMBOL_DATA); + string contents = s.str(); + + EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " " MODULE_ID " " MODULE_NAME + "\n" + "PUBLIC m ffff 0 _xyz\n", + contents.c_str()); +} // If there exists an extern and a function at the same address, only write // out the FUNC entry. @@ -586,6 +637,37 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddress) { contents.c_str()); } +// If there exists an extern and a function at the same address, only write +// out the FUNC entry, and mark it with `m` if the multiple field is enabled. +TEST(Module, ConstructFunctionsAndExternsWithSameAddressMultiple) { + stringstream s; + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); + + // Two externs. + Module::Extern* extern1 = new Module::Extern(0xabc0); + extern1->name = "abc"; + Module::Extern* extern2 = new Module::Extern(0xfff0); + extern2->name = "xyz"; + + m.AddExtern(extern1); + m.AddExtern(extern2); + + Module::Function* function = new Module::Function("_xyz", 0xfff0); + Module::Range range(0xfff0, 0x10); + function->ranges.push_back(range); + function->parameter_size = 0; + m.AddFunction(function); + + m.Write(s, ALL_SYMBOL_DATA); + string contents = s.str(); + + EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " " MODULE_ID " " MODULE_NAME + "\n" + "FUNC m fff0 10 0 _xyz\n" + "PUBLIC abc0 0 abc\n", + contents.c_str()); +} + // If there exists an extern and a function at the same address, only write // out the FUNC entry. For ARM THUMB, the extern that comes from the ELF // symbol section has bit 0 set. From 442456a68cafc9325ef9e6f5bae8f425241ddaab Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 10 Nov 2022 17:54:16 -0800 Subject: [PATCH 131/195] Fix compile error in disassembler_objdump.cc for non-Linux build. A couple of pointer parameters should be references instead. Change-Id: Ic1850d9330194374f7fe2108815267ede6f3ca32 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4021971 Reviewed-by: Joshua Peraza --- src/processor/disassembler_objdump.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc index d7e4bec82..dfe10d58e 100644 --- a/src/processor/disassembler_objdump.cc +++ b/src/processor/disassembler_objdump.cc @@ -507,14 +507,14 @@ DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu, uint64_t address) {} bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context, - uint64_t* address) { + uint64_t& address) { return false; } bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, - uint64_t* address) { + uint64_t& address) { return false; } } // namespace google_breakpad -#endif // __linux__ \ No newline at end of file +#endif // __linux__ From 522bd2337a1804c0a4a80e1d33f5982dfe512266 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 17 Nov 2022 11:37:26 -0500 Subject: [PATCH 132/195] Speed up testing for multiple functions at an address on Posix The way this was originally written blows up on large enough targets (like...Chromium :/). This change adds a set for amortized constant time lookup of whether a FUNC already exists at a given address. Bug: google-breakpad:751 Change-Id: I10a322da70f769c106e1e5f5b2dc3dc3f79444fd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4031580 Reviewed-by: Mark Mentovai --- src/common/module.cc | 30 +++++++++++++----------------- src/common/module.h | 2 ++ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/common/module.cc b/src/common/module.cc index 4c427da1d..442b910dc 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -174,26 +174,22 @@ bool Module::AddFunction(Function* function) { } } #endif - if (enable_multiple_field_) { + if (enable_multiple_field_ && function_addresses_.count(function->address)) { FunctionSet::iterator existing_function = std::find_if( functions_.begin(), functions_.end(), [&](Function* other) { return other->address == function->address; }); - if (existing_function != functions_.end()) { - (*existing_function)->is_multiple = true; - // Free the duplicate that was not inserted because this Module - // now owns it. - return false; - } - std::pair ret = functions_.insert(function); - // We just checked! - assert(ret.second); - } else { - std::pair ret = functions_.insert(function); - if (!ret.second && (*ret.first != function)) { - // Free the duplicate that was not inserted because this Module - // now owns it. - return false; - } + assert(existing_function != functions_.end()); + (*existing_function)->is_multiple = true; + // Free the duplicate that was not inserted because this Module + // now owns it. + return false; + } + function_addresses_.emplace(function->address); + std::pair ret = functions_.insert(function); + if (!ret.second && (*ret.first != function)) { + // Free the duplicate that was not inserted because this Module + // now owns it. + return false; } return true; } diff --git a/src/common/module.h b/src/common/module.h index f5031ea65..a8fcc81e0 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -472,6 +472,8 @@ class Module { // point to. FileByNameMap files_; // This module's source files. FunctionSet functions_; // This module's functions. + // Used to quickly look up whether a function exists at a particular address. + unordered_set

function_addresses_; // The module owns all the call frame info entries that have been // added to it. From c7acbcef042cd3c7bc49efc8da879da8e2ef2f00 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Fri, 18 Nov 2022 10:48:12 -0800 Subject: [PATCH 133/195] Fix Windows native symbol uploads. - We were appending a CRLF to uploaded files, which is okay for Breakpad symbols but breaks binaries (PE/PDB). - Removed the CRLF after files in the request body to fix issue. Tested with Breakpad, PE, and PDB uploads. Change-Id: I95ee7c51bf981cdb2e55cc720a7813cf7afa21ce Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4038506 Reviewed-by: Joshua Peraza Reviewed-by: Zequan Wu --- src/common/windows/http_upload.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index 093cd71d6..088a5e54d 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -390,7 +390,6 @@ namespace { if (!contents.empty()) { request_body->append(&(contents[0]), contents.size()); } - request_body->append("\r\n"); return true; } From 4d0c21b9a5b57c083066cb9483313c0ddccd0751 Mon Sep 17 00:00:00 2001 From: Nelson Billing Date: Fri, 18 Nov 2022 10:55:30 -0800 Subject: [PATCH 134/195] Add a flag to google_converter to keep Breakpad/PE/PDB files after conversion. Change-Id: I8948e1aba598d42369d70ca1cc1168ce3841ab40 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4038509 Reviewed-by: Zequan Wu Reviewed-by: Joshua Peraza --- src/tools/windows/converter_exe/converter.cc | 47 +++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index 75bfdd552..75ec55b0f 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -304,7 +304,8 @@ static bool SafeToMakeExternalRequest(const MissingSymbolInfo& missing_info, // Converter options derived from command line parameters. struct ConverterOptions { - ConverterOptions() : report_fetch_failures(true), trace_symsrv(false) {} + ConverterOptions() + : report_fetch_failures(true), trace_symsrv(false), keep_files(false) {} ~ConverterOptions() { } @@ -354,6 +355,9 @@ struct ConverterOptions { // If set then SymSrv callbacks are logged to stderr. bool trace_symsrv; + // If set then Breakpad/PE/PDB files won't be deleted after processing. + bool keep_files; + private: // DISABLE_COPY_AND_ASSIGN ConverterOptions(const ConverterOptions&); @@ -435,7 +439,8 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, UploadSymbolFile(options.upload_symbols_url, options.api_key, missing_info.debug_file, missing_info.debug_identifier, converted_file, kSymbolUploadTypeBreakpad); - remove(converted_file.c_str()); + if (!options.keep_files) + remove(converted_file.c_str()); // Upload PDB/PE if we have them if (!symbol_file.empty()) { @@ -443,14 +448,16 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, missing_info.debug_file, missing_info.debug_identifier, symbol_file, kSymbolUploadTypePDB); - remove(symbol_file.c_str()); + if (!options.keep_files) + remove(symbol_file.c_str()); } if (!pe_file.empty()) { UploadSymbolFile(options.upload_symbols_url, options.api_key, missing_info.code_file, missing_info.debug_identifier, pe_file, kSymbolUploadTypePE); - remove(pe_file.c_str()); + if (!options.keep_files) + remove(pe_file.c_str()); } // Note: this does leave some directories behind that could be @@ -541,20 +548,23 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo& missing_info, UploadSymbolFile(options.upload_symbols_url, options.api_key, missing_info.debug_file, missing_info.debug_identifier, converted_file, kSymbolUploadTypeBreakpad); - remove(converted_file.c_str()); + if (!options.keep_files) + remove(converted_file.c_str()); // Upload PDB/PE if we have them if (!symbol_file.empty()) { UploadSymbolFile(options.upload_symbols_url, options.api_key, missing_info.debug_file, missing_info.debug_identifier, symbol_file, kSymbolUploadTypePDB); - remove(symbol_file.c_str()); + if (!options.keep_files) + remove(symbol_file.c_str()); } if (!pe_file.empty()) { UploadSymbolFile(options.upload_symbols_url, options.api_key, missing_info.code_file, missing_info.debug_identifier, pe_file, kSymbolUploadTypePE); - remove(pe_file.c_str()); + if (!options.keep_files) + remove(pe_file.c_str()); } // Note: this does leave some directories behind that could be @@ -732,6 +742,8 @@ static int usage(const char* program_name) { " prevent external symbol requests\n" " -tss If set then SymSrv callbacks will be\n" " traced to stderr.\n" + " -keep-files If set then don't delete Breakpad/PE/\n" + " PDB files after conversion.\n" " Note that any server specified by -f or -n that starts with \\filer\n" " will be treated as internal, and all others as external.\n", program_name); @@ -769,17 +781,21 @@ int main(int argc, char** argv) { ConverterOptions options; options.report_fetch_failures = true; - // All arguments are paired. - if (argc % 2 != 1) { - return usage(argv[0]); - } - string blacklist_regex_str; bool have_any_msss_servers = false; - for (int argi = 1; argi < argc; argi += 2) { + for (int argi = 1; argi < argc; argi++) { string option = argv[argi]; - string value = argv[argi + 1]; + if (option == "-tss") { + printf("Tracing SymSrv callbacks to stderr.\n"); + options.trace_symsrv = true; + continue; + } else if (option == "-keep-files") { + printf("Keeping Breakpad/PE/PDB files after conversion.\n"); + options.keep_files = true; + continue; + } + string value = argv[++argi]; if (option == "-f") { AddServer(value,& options.full_internal_msss_servers, & options.full_external_msss_servers); @@ -818,9 +834,6 @@ int main(int argc, char** argv) { printf("Getting the list of missing symbols from a file. Fetch failures" " will not be reported.\n"); options.report_fetch_failures = false; - } else if (option == "-tss") { - printf("Tracing SymSrv callbacks to stderr.\n"); - options.trace_symsrv = true; } else if (option == "-t") { if (!WindowsStringUtils::safe_mbstowcs( value, From 41474d905f705747cd0d2989c9ff41d85b3fcc8a Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 22 Nov 2022 05:08:05 -0500 Subject: [PATCH 135/195] Fix Linux ASan Afl build error. Bug: 1385147 Change-Id: I69ebfa1adbc1c2a17decf0079812c4f507e3332c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4046961 Reviewed-by: Mike Frysinger --- src/processor/exploitability_linux.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 44195a2a6..63a126560 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -158,6 +158,7 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() { bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { #ifdef _WIN32 BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method."; + return false; #else // Get memory region containing instruction pointer. MinidumpMemoryList* memory_list = dump_->GetMemoryList(); @@ -219,9 +220,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { } else { return false; } - #endif // _WIN32 - return false; } bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) { From 9aa786f03dbd1fca98eeae42c35c54d61b2a83b9 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 30 Sep 2022 13:55:51 +0200 Subject: [PATCH 136/195] Restructure Makefile conditionals/targets As the conditionals and targets was becoming quite hard to grasp with lots of conditionals applied unnecessarily to target properties, there were issues with targets being defined without any sources. This commit fixes that while restructuring the Makefile so that all targets are declared (conditionally if needed) upfront and then all the target properties are defined (source, flags, deps, etc.) Change-Id: I666d153c476fbf1aafabb89cee7af4eee5795ab6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3928024 Reviewed-by: Mike Frysinger --- Makefile.am | 413 ++--- Makefile.in | 4561 +++++++++++++++++++++++---------------------------- 2 files changed, 2281 insertions(+), 2693 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7ef05e560..b2953e5ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -118,6 +118,22 @@ TEST_LIBS = src/testing/libtesting.a TEST_DEPS = $(TEST_LIBS) endif + +## Setup test driver +if ANDROID_HOST +# Since Autotools 1.2, tests are run through a special "test driver" script. +# Unfortunately, it's not possible anymore to specify an alternative shell to +# run them on connected devices, so use a slightly modified version of the +# driver for Android. +LOG_DRIVER = $(top_srcdir)/android/test-driver +else +if TESTS_AS_ROOT +LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver +else +LOG_DRIVER = $(top_srcdir)/autotools/test-driver +endif !TESTS_AS_ROOT +endif !ANDROID_HOST + ## Libraries check_LIBRARIES = noinst_LIBRARIES = @@ -125,13 +141,17 @@ lib_LIBRARIES = libexec_PROGRAMS = bin_PROGRAMS = check_PROGRAMS = +noinst_PROGRAMS = +noinst_SCRIPTS = EXTRA_PROGRAMS = CLEANFILES = -check_LIBRARIES += src/testing/libtesting.a -check_PROGRAMS += src/common/safe_math_unittest - +# +# Tests helper library +# if !SYSTEM_TEST_LIBS +check_LIBRARIES += src/testing/libtesting.a +endif src_testing_libtesting_a_SOURCES = \ src/breakpad_googletest_includes.h \ src/testing/googletest/src/gtest-all.cc \ @@ -139,62 +159,171 @@ src_testing_libtesting_a_SOURCES = \ src/testing/googlemock/src/gmock-all.cc src_testing_libtesting_a_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -endif +# +# General +# Not specific to processor, client or tools +# + +check_PROGRAMS += src/common/safe_math_unittest + + +# +# Breakpad minidump and microdump +# processor library, tools and tests +# if !DISABLE_PROCESSOR + lib_LIBRARIES += src/libbreakpad.a pkgconfig_DATA += breakpad.pc noinst_LIBRARIES += src/third_party/libdisasm/libdisasm.a -endif +## Programs +bin_PROGRAMS += \ + src/processor/microdump_stackwalk \ + src/processor/minidump_dump \ + src/processor/minidump_stackwalk + +## Tests (binaries) +check_PROGRAMS += \ + src/common/test_assembler_unittest \ + src/common/dwarf/dwarf2reader_lineinfo_unittest \ + src/common/dwarf/dwarf2reader_splitfunctions_unittest \ + src/processor/address_map_unittest \ + src/processor/basic_source_line_resolver_unittest \ + src/processor/cfi_frame_info_unittest \ + src/processor/contained_range_map_unittest \ + src/processor/disassembler_objdump_unittest \ + src/processor/disassembler_x86_unittest \ + src/processor/exploitability_unittest \ + src/processor/fast_source_line_resolver_unittest \ + src/processor/map_serializers_unittest \ + src/processor/microdump_processor_unittest \ + src/processor/minidump_processor_unittest \ + src/processor/minidump_unittest \ + src/processor/static_address_map_unittest \ + src/processor/static_contained_range_map_unittest \ + src/processor/static_map_unittest \ + src/processor/static_range_map_unittest \ + src/processor/pathname_stripper_unittest \ + src/processor/postfix_evaluator_unittest \ + src/processor/proc_maps_linux_unittest \ + src/processor/range_map_truncate_lower_unittest \ + src/processor/range_map_truncate_upper_unittest \ + src/processor/range_map_unittest \ + src/processor/stackwalker_amd64_unittest \ + src/processor/stackwalker_arm_unittest \ + src/processor/stackwalker_arm64_unittest \ + src/processor/stackwalker_address_list_unittest \ + src/processor/stackwalker_mips_unittest \ + src/processor/stackwalker_mips64_unittest \ + src/processor/stackwalker_riscv_unittest \ + src/processor/stackwalker_riscv64_unittest \ + src/processor/stackwalker_x86_unittest \ + src/processor/synth_minidump_unittest +if SELFTEST +check_PROGRAMS += \ + src/processor/stackwalker_selftest +endif SELFTEST + +## Tests (scripts) +check_SCRIPTS = \ + src/processor/microdump_stackwalk_test \ + src/processor/microdump_stackwalk_machine_readable_test \ + src/processor/minidump_dump_test \ + src/processor/minidump_stackwalk_test \ + src/processor/minidump_stackwalk_machine_readable_test + +endif !DISABLE_PROCESSOR + + +# +# Breakpad client library and tests +# +# Currently Linux only, the macOS client +# is built using an Xcode project instead. +# if LINUX_HOST + lib_LIBRARIES += src/client/linux/libbreakpad_client.a pkgconfig_DATA += breakpad-client.pc -src_client_linux_libbreakpad_client_a_SOURCES = \ - src/client/linux/crash_generation/crash_generation_client.cc \ - src/client/linux/crash_generation/crash_generation_server.cc \ - src/client/linux/dump_writer_common/thread_info.cc \ - src/client/linux/dump_writer_common/ucontext_reader.cc \ - src/client/linux/handler/exception_handler.cc \ - src/client/linux/handler/exception_handler.h \ - src/client/linux/handler/minidump_descriptor.cc \ - src/client/linux/handler/minidump_descriptor.h \ - src/client/linux/log/log.cc \ - src/client/linux/log/log.h \ - src/client/linux/microdump_writer/microdump_writer.cc \ - src/client/linux/microdump_writer/microdump_writer.h \ - src/client/linux/minidump_writer/linux_core_dumper.cc \ - src/client/linux/minidump_writer/linux_dumper.cc \ - src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ - src/client/linux/minidump_writer/minidump_writer.cc \ - src/client/linux/minidump_writer/pe_file.cc \ - src/client/minidump_file_writer-inl.h \ - src/client/minidump_file_writer.cc \ - src/client/minidump_file_writer.h \ - src/common/convert_UTF.cc \ - src/common/convert_UTF.h \ - src/common/md5.cc \ - src/common/md5.h \ - src/common/string_conversion.cc \ - src/common/string_conversion.h \ - src/common/linux/elf_core_dump.cc \ - src/common/linux/elfutils.cc \ - src/common/linux/elfutils.h \ - src/common/linux/file_id.cc \ - src/common/linux/file_id.h \ - src/common/linux/guid_creator.cc \ - src/common/linux/guid_creator.h \ - src/common/linux/linux_libc_support.cc \ - src/common/linux/memory_mapped_file.cc \ - src/common/linux/safe_readlink.cc -if !HAVE_GETCONTEXT -src_client_linux_libbreakpad_client_a_SOURCES += \ - src/common/linux/breakpad_getcontext.S +check_PROGRAMS += \ + src/client/linux/linux_client_unittest \ + src/common/linux/google_crashdump_uploader_test + +EXTRA_PROGRAMS += \ + src/client/linux/linux_dumper_unittest_helper \ + src/client/linux/linux_client_unittest_shlib + +CLEANFILES += \ + src/client/linux/linux_dumper_unittest_helper \ + src/client/linux/linux_client_unittest_shlib + +endif LINUX_HOST + + +# +# Various Breakpad tools +# This includes symbol dumpers and uploaders +# +if !DISABLE_TOOLS + +if LINUX_HOST + +bin_PROGRAMS += \ + src/tools/linux/core2md/core2md \ + src/tools/linux/pid2md/pid2md \ + src/tools/linux/dump_syms/dump_syms \ + src/tools/linux/md2core/minidump-2-core \ + src/tools/linux/symupload/minidump_upload \ + src/tools/linux/symupload/sym_upload +if X86_HOST +bin_PROGRAMS += \ + src/tools/mac/dump_syms/dump_syms_mac endif +if HAVE_MEMFD_CREATE +libexec_PROGRAMS += \ + src/tools/linux/core_handler/core_handler +endif + +check_PROGRAMS += \ + src/common/dumper_unittest \ + src/tools/linux/md2core/minidump_2_core_unittest +if X86_HOST +check_PROGRAMS += \ + src/common/mac/macho_reader_unittest +endif + endif LINUX_HOST -if !DISABLE_PROCESSOR +endif !DISABLE_TOOLS + +TESTS = $(check_PROGRAMS) $(check_SCRIPTS) + +## Non-installables +noinst_SCRIPTS += $(check_SCRIPTS) + + +## Target definitions + +# All targets that were defined above should now be +# declared below. This should be done unconditionally +# so DO NOT wrap them in conditions! +# Execept for conditionally adding a specific file or +# flag that should only be added for a specific arch, +# system, etc. + +src_common_safe_math_unittest_SOURCES = \ + src/common/safe_math.h \ + src/common/safe_math_unittest.cc +src_common_safe_math_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_safe_math_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +# Breakpad processor library src_libbreakpad_a_SOURCES = \ src/google_breakpad/common/breakpad_types.h \ src/google_breakpad/common/minidump_format.h \ @@ -321,6 +450,7 @@ src_libbreakpad_a_SOURCES = \ src/processor/tokenize.cc \ src/processor/tokenize.h +# libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ src/third_party/libdisasm/ia32_implicit.c \ src/third_party/libdisasm/ia32_implicit.h \ @@ -349,134 +479,51 @@ src_third_party_libdisasm_libdisasm_a_SOURCES = \ src/third_party/libdisasm/x86_operand_list.c \ src/third_party/libdisasm/x86_operand_list.h -## Programs -bin_PROGRAMS += \ - src/processor/microdump_stackwalk \ - src/processor/minidump_dump \ - src/processor/minidump_stackwalk -endif !DISABLE_PROCESSOR - -if LINUX_HOST -EXTRA_PROGRAMS += \ - src/client/linux/linux_dumper_unittest_helper -CLEANFILES += \ - src/client/linux/linux_dumper_unittest_helper - -if !DISABLE_TOOLS -bin_PROGRAMS += \ - src/tools/linux/core2md/core2md \ - src/tools/linux/pid2md/pid2md \ - src/tools/linux/dump_syms/dump_syms \ - src/tools/linux/md2core/minidump-2-core \ - src/tools/linux/symupload/minidump_upload \ - src/tools/linux/symupload/sym_upload -if X86_HOST -bin_PROGRAMS += \ - src/tools/mac/dump_syms/dump_syms_mac -endif -if HAVE_MEMFD_CREATE -libexec_PROGRAMS += \ - src/tools/linux/core_handler/core_handler -endif -endif -endif LINUX_HOST - - -## Tests -if !DISABLE_PROCESSOR -check_PROGRAMS += \ - src/common/test_assembler_unittest \ - src/common/dwarf/dwarf2reader_lineinfo_unittest \ - src/common/dwarf/dwarf2reader_splitfunctions_unittest \ - src/processor/address_map_unittest \ - src/processor/basic_source_line_resolver_unittest \ - src/processor/cfi_frame_info_unittest \ - src/processor/contained_range_map_unittest \ - src/processor/disassembler_objdump_unittest \ - src/processor/disassembler_x86_unittest \ - src/processor/exploitability_unittest \ - src/processor/fast_source_line_resolver_unittest \ - src/processor/map_serializers_unittest \ - src/processor/microdump_processor_unittest \ - src/processor/minidump_processor_unittest \ - src/processor/minidump_unittest \ - src/processor/static_address_map_unittest \ - src/processor/static_contained_range_map_unittest \ - src/processor/static_map_unittest \ - src/processor/static_range_map_unittest \ - src/processor/pathname_stripper_unittest \ - src/processor/postfix_evaluator_unittest \ - src/processor/proc_maps_linux_unittest \ - src/processor/range_map_truncate_lower_unittest \ - src/processor/range_map_truncate_upper_unittest \ - src/processor/range_map_unittest \ - src/processor/stackwalker_amd64_unittest \ - src/processor/stackwalker_arm_unittest \ - src/processor/stackwalker_arm64_unittest \ - src/processor/stackwalker_address_list_unittest \ - src/processor/stackwalker_mips_unittest \ - src/processor/stackwalker_mips64_unittest \ - src/processor/stackwalker_riscv_unittest \ - src/processor/stackwalker_riscv64_unittest \ - src/processor/stackwalker_x86_unittest \ - src/processor/synth_minidump_unittest -endif - -if LINUX_HOST -EXTRA_PROGRAMS += \ - src/client/linux/linux_client_unittest_shlib -CLEANFILES += \ - src/client/linux/linux_client_unittest_shlib - -check_PROGRAMS += \ - src/client/linux/linux_client_unittest \ - src/common/linux/google_crashdump_uploader_test - -if !DISABLE_TOOLS -check_PROGRAMS += \ - src/common/dumper_unittest \ - src/tools/linux/md2core/minidump_2_core_unittest -if X86_HOST -check_PROGRAMS += \ - src/common/mac/macho_reader_unittest -endif -endif -endif LINUX_HOST - -if !DISABLE_PROCESSOR -if SELFTEST -check_PROGRAMS += \ - src/processor/stackwalker_selftest -endif SELFTEST -endif !DISABLE_PROCESSOR - -if !DISABLE_PROCESSOR -check_SCRIPTS = \ - src/processor/microdump_stackwalk_test \ - src/processor/microdump_stackwalk_machine_readable_test \ - src/processor/minidump_dump_test \ - src/processor/minidump_stackwalk_test \ - src/processor/minidump_stackwalk_machine_readable_test +# Breakpad client +src_client_linux_libbreakpad_client_a_SOURCES = \ + src/client/linux/crash_generation/crash_generation_client.cc \ + src/client/linux/crash_generation/crash_generation_server.cc \ + src/client/linux/dump_writer_common/thread_info.cc \ + src/client/linux/dump_writer_common/ucontext_reader.cc \ + src/client/linux/handler/exception_handler.cc \ + src/client/linux/handler/exception_handler.h \ + src/client/linux/handler/minidump_descriptor.cc \ + src/client/linux/handler/minidump_descriptor.h \ + src/client/linux/log/log.cc \ + src/client/linux/log/log.h \ + src/client/linux/microdump_writer/microdump_writer.cc \ + src/client/linux/microdump_writer/microdump_writer.h \ + src/client/linux/minidump_writer/linux_core_dumper.cc \ + src/client/linux/minidump_writer/linux_dumper.cc \ + src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ + src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ + src/client/minidump_file_writer-inl.h \ + src/client/minidump_file_writer.cc \ + src/client/minidump_file_writer.h \ + src/common/convert_UTF.cc \ + src/common/convert_UTF.h \ + src/common/md5.cc \ + src/common/md5.h \ + src/common/string_conversion.cc \ + src/common/string_conversion.h \ + src/common/linux/elf_core_dump.cc \ + src/common/linux/elfutils.cc \ + src/common/linux/elfutils.h \ + src/common/linux/file_id.cc \ + src/common/linux/file_id.h \ + src/common/linux/guid_creator.cc \ + src/common/linux/guid_creator.h \ + src/common/linux/linux_libc_support.cc \ + src/common/linux/memory_mapped_file.cc \ + src/common/linux/safe_readlink.cc +if !HAVE_GETCONTEXT +src_client_linux_libbreakpad_client_a_SOURCES += \ + src/common/linux/breakpad_getcontext.S endif -TESTS = $(check_PROGRAMS) $(check_SCRIPTS) - -if ANDROID_HOST -# Since Autotools 1.2, tests are run through a special "test driver" script. -# Unfortunately, it's not possible anymore to specify an alternative shell to -# run them on connected devices, so use a slightly modified version of the -# driver for Android. -LOG_DRIVER = $(top_srcdir)/android/test-driver -else -# The default Autotools test driver script. -if TESTS_AS_ROOT -LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver -else -LOG_DRIVER = $(top_srcdir)/autotools/test-driver -endif !TESTS_AS_ROOT -endif !ANDROID_HOST +# Client tests -if LINUX_HOST src_client_linux_linux_dumper_unittest_helper_SOURCES = \ src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc src_client_linux_linux_dumper_unittest_helper_LDFLAGS=$(PTHREAD_CFLAGS) @@ -584,7 +631,8 @@ src_client_linux_linux_client_unittest_LDADD = \ src_client_linux_linux_client_unittest_DEPENDENCIES = \ src/client/linux/linux_client_unittest_shlib -if !DISABLE_TOOLS +# Tools + src_tools_linux_core2md_core2md_SOURCES = \ src/tools/linux/core2md/core2md.cc @@ -592,14 +640,12 @@ src_tools_linux_core2md_core2md_LDADD = \ src/client/linux/libbreakpad_client.a \ src/common/path_helper.o -if HAVE_MEMFD_CREATE src_tools_linux_core_handler_core_handler_SOURCES = \ src/tools/linux/core_handler/core_handler.cc src_tools_linux_core_handler_core_handler_LDADD = \ src/client/linux/libbreakpad_client.a \ src/common/path_helper.o -endif src_tools_linux_pid2md_pid2md_SOURCES = \ src/tools/linux/pid2md/pid2md.cc @@ -700,15 +746,6 @@ src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \ src_tools_mac_dump_syms_dump_syms_mac_LDADD= \ $(RUSTC_DEMANGLE_LIBS) -src_common_safe_math_unittest_SOURCES = \ - src/common/safe_math.h \ - src/common/safe_math_unittest.cc -src_common_safe_math_unittest_CPPFLAGS = \ - $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_common_safe_math_unittest_LDADD = \ - $(TEST_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - src_common_dumper_unittest_SOURCES = \ src/common/byte_cursor_unittest.cc \ src/common/convert_UTF.cc \ @@ -809,7 +846,6 @@ src_common_mac_macho_reader_unittest_CPPFLAGS = \ src_common_mac_macho_reader_unittest_LDADD = \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -endif src_common_linux_google_crashdump_uploader_test_SOURCES = \ src/common/linux/google_crashdump_uploader.cc \ @@ -830,9 +866,6 @@ src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -endif LINUX_HOST - -if !DISABLE_PROCESSOR src_processor_address_map_unittest_SOURCES = \ src/processor/address_map_unittest.cc src_processor_address_map_unittest_LDADD = \ @@ -1324,10 +1357,6 @@ src_common_dwarf_dwarf2reader_splitfunctions_unittest_LDADD = \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -## Non-installables -noinst_PROGRAMS = -noinst_SCRIPTS = $(check_SCRIPTS) - src_processor_minidump_dump_SOURCES = \ src/processor/minidump_dump.cc src_processor_minidump_dump_LDADD = \ @@ -1421,8 +1450,6 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/tokenize.o \ src/third_party/libdisasm/libdisasm.a -endif !DISABLE_PROCESSOR - ## Additional files to be included in a source distribution ## ## find src/client src/common src/processor/testdata src/tools \ diff --git a/Makefile.in b/Makefile.in index c9a359f64..2461bd4ef 100644 --- a/Makefile.in +++ b/Makefile.in @@ -136,39 +136,27 @@ bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) check_PROGRAMS = src/common/safe_math_unittest$(EXEEXT) \ $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ $(am__EXEEXT_8) $(am__EXEEXT_9) +noinst_PROGRAMS = EXTRA_PROGRAMS = $(am__EXEEXT_1) -@DISABLE_PROCESSOR_FALSE@am__append_4 = src/libbreakpad.a -@DISABLE_PROCESSOR_FALSE@am__append_5 = breakpad.pc -@DISABLE_PROCESSOR_FALSE@am__append_6 = src/third_party/libdisasm/libdisasm.a -@LINUX_HOST_TRUE@am__append_7 = src/client/linux/libbreakpad_client.a -@LINUX_HOST_TRUE@am__append_8 = breakpad-client.pc -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__append_9 = \ -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/breakpad_getcontext.S - -@DISABLE_PROCESSOR_FALSE@am__append_10 = \ + +# +# Tests helper library +# +@SYSTEM_TEST_LIBS_FALSE@am__append_4 = src/testing/libtesting.a + +# +# Breakpad minidump and microdump +# processor library, tools and tests +# +@DISABLE_PROCESSOR_FALSE@am__append_5 = src/libbreakpad.a +@DISABLE_PROCESSOR_FALSE@am__append_6 = breakpad.pc +@DISABLE_PROCESSOR_FALSE@am__append_7 = src/third_party/libdisasm/libdisasm.a +@DISABLE_PROCESSOR_FALSE@am__append_8 = \ @DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk \ @DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump \ @DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk -@LINUX_HOST_TRUE@am__append_11 = src/client/linux/linux_dumper_unittest_helper \ -@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib -@LINUX_HOST_TRUE@am__append_12 = src/client/linux/linux_dumper_unittest_helper \ -@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_13 = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_14 = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac - -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_15 = \ -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler - -@DISABLE_PROCESSOR_FALSE@am__append_16 = \ +@DISABLE_PROCESSOR_FALSE@am__append_9 = \ @DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest \ @DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader_lineinfo_unittest \ @DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader_splitfunctions_unittest \ @@ -205,29 +193,68 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest -@LINUX_HOST_TRUE@am__append_17 = \ +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_10 = \ +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest + + +# +# Breakpad client library and tests +# +# Currently Linux only, the macOS client +# is built using an Xcode project instead. +# +@LINUX_HOST_TRUE@am__append_11 = src/client/linux/libbreakpad_client.a +@LINUX_HOST_TRUE@am__append_12 = breakpad-client.pc +@LINUX_HOST_TRUE@am__append_13 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_18 = \ +@LINUX_HOST_TRUE@am__append_14 = \ +@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ +@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib + +@LINUX_HOST_TRUE@am__append_15 = \ +@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ +@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib + + +# +# Various Breakpad tools +# This includes symbol dumpers and uploaders +# +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_16 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload + +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_17 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac + +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_18 = \ +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler + +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_19 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_19 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_20 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_20 = \ -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest +@HAVE_GETCONTEXT_FALSE@am__append_21 = \ +@HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__append_21 = src/common/linux/breakpad_getcontext.S \ -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/breakpad_getcontext_unittest.cc -@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \ -@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog -lm +@HAVE_GETCONTEXT_FALSE@am__append_22 = \ +@HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S \ +@HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext_unittest.cc +@ANDROID_HOST_TRUE@am__append_23 = \ +@ANDROID_HOST_TRUE@ -llog -lm -@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_23 = \ -@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog +@ANDROID_HOST_TRUE@am__append_24 = \ +@ANDROID_HOST_TRUE@ -llog -noinst_PROGRAMS = subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ @@ -307,12 +334,12 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) -@LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_6 = src/processor/stackwalker_selftest$(EXEEXT) +@LINUX_HOST_TRUE@am__EXEEXT_7 = src/client/linux/linux_client_unittest$(EXEEXT) \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test$(EXEEXT) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_7 = src/common/dumper_unittest$(EXEEXT) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_8 = src/common/dumper_unittest$(EXEEXT) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_8 = src/common/mac/macho_reader_unittest$(EXEEXT) -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_9 = src/processor/stackwalker_selftest$(EXEEXT) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_9 = src/common/mac/macho_reader_unittest$(EXEEXT) @DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__EXEEXT_10 = src/tools/linux/core_handler/core_handler$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -381,247 +408,103 @@ am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \ src/common/linux/safe_readlink.cc \ src/common/linux/breakpad_getcontext.S am__dirstamp = $(am__leading_dot)dirstamp -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__objects_1 = src/common/linux/breakpad_getcontext.$(OBJEXT) -@LINUX_HOST_TRUE@am_src_client_linux_libbreakpad_client_a_OBJECTS = src/client/linux/crash_generation/crash_generation_client.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/log/log.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/minidump_file_writer.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/string_conversion.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/elfutils.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/file_id.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/guid_creator.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.$(OBJEXT) \ -@LINUX_HOST_TRUE@ $(am__objects_1) +@HAVE_GETCONTEXT_FALSE@am__objects_1 = src/common/linux/breakpad_getcontext.$(OBJEXT) +am_src_client_linux_libbreakpad_client_a_OBJECTS = src/client/linux/crash_generation/crash_generation_client.$(OBJEXT) \ + src/client/linux/crash_generation/crash_generation_server.$(OBJEXT) \ + src/client/linux/dump_writer_common/thread_info.$(OBJEXT) \ + src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT) \ + src/client/linux/handler/exception_handler.$(OBJEXT) \ + src/client/linux/handler/minidump_descriptor.$(OBJEXT) \ + src/client/linux/log/log.$(OBJEXT) \ + src/client/linux/microdump_writer/microdump_writer.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \ + src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \ + src/client/linux/minidump_writer/pe_file.$(OBJEXT) \ + src/client/minidump_file_writer.$(OBJEXT) \ + src/common/convert_UTF.$(OBJEXT) src/common/md5.$(OBJEXT) \ + src/common/string_conversion.$(OBJEXT) \ + src/common/linux/elf_core_dump.$(OBJEXT) \ + src/common/linux/elfutils.$(OBJEXT) \ + src/common/linux/file_id.$(OBJEXT) \ + src/common/linux/guid_creator.$(OBJEXT) \ + src/common/linux/linux_libc_support.$(OBJEXT) \ + src/common/linux/memory_mapped_file.$(OBJEXT) \ + src/common/linux/safe_readlink.$(OBJEXT) $(am__objects_1) src_client_linux_libbreakpad_client_a_OBJECTS = \ $(am_src_client_linux_libbreakpad_client_a_OBJECTS) src_libbreakpad_a_AR = $(AR) $(ARFLAGS) src_libbreakpad_a_LIBADD = -am__src_libbreakpad_a_SOURCES_DIST = \ - src/google_breakpad/common/breakpad_types.h \ - src/google_breakpad/common/minidump_format.h \ - src/google_breakpad/common/minidump_size.h \ - src/google_breakpad/processor/basic_source_line_resolver.h \ - src/google_breakpad/processor/call_stack.h \ - src/google_breakpad/processor/code_module.h \ - src/google_breakpad/processor/code_modules.h \ - src/google_breakpad/processor/dump_context.h \ - src/google_breakpad/processor/dump_object.h \ - src/google_breakpad/processor/exploitability.h \ - src/google_breakpad/processor/fast_source_line_resolver.h \ - src/google_breakpad/processor/memory_region.h \ - src/google_breakpad/processor/microdump.h \ - src/google_breakpad/processor/microdump_processor.h \ - src/google_breakpad/processor/minidump.h \ - src/google_breakpad/processor/minidump_processor.h \ - src/google_breakpad/processor/process_result.h \ - src/google_breakpad/processor/process_state.h \ - src/google_breakpad/processor/proc_maps_linux.h \ - src/google_breakpad/processor/source_line_resolver_base.h \ - src/google_breakpad/processor/source_line_resolver_interface.h \ - src/google_breakpad/processor/stack_frame.h \ - src/google_breakpad/processor/stack_frame_cpu.h \ - src/google_breakpad/processor/stack_frame_symbolizer.h \ - src/google_breakpad/processor/stackwalker.h \ - src/google_breakpad/processor/symbol_supplier.h \ - src/google_breakpad/processor/system_info.h \ - src/processor/address_map-inl.h src/processor/address_map.h \ - src/processor/basic_code_module.h \ - src/processor/basic_code_modules.cc \ - src/processor/basic_code_modules.h \ - src/processor/basic_source_line_resolver_types.h \ - src/processor/basic_source_line_resolver.cc \ - src/processor/call_stack.cc src/processor/cfi_frame_info.cc \ - src/processor/cfi_frame_info.h \ - src/processor/contained_range_map-inl.h \ - src/processor/contained_range_map.h \ - src/processor/convert_old_arm64_context.cc \ - src/processor/convert_old_arm64_context.h \ - src/processor/disassembler_objdump.h \ - src/processor/disassembler_objdump.cc \ - src/processor/disassembler_x86.h \ - src/processor/disassembler_x86.cc \ - src/processor/dump_context.cc src/processor/dump_object.cc \ - src/processor/exploitability.cc \ - src/processor/exploitability_linux.h \ - src/processor/exploitability_linux.cc \ - src/processor/exploitability_win.h \ - src/processor/exploitability_win.cc \ - src/processor/fast_source_line_resolver_types.h \ - src/processor/fast_source_line_resolver.cc \ - src/processor/linked_ptr.h src/processor/logging.h \ - src/processor/logging.cc src/processor/map_serializers-inl.h \ - src/processor/map_serializers.h src/processor/microdump.cc \ - src/processor/microdump_processor.cc src/processor/minidump.cc \ - src/processor/minidump_processor.cc \ - src/processor/module_comparer.cc \ - src/processor/module_comparer.h src/processor/module_factory.h \ - src/processor/module_serializer.cc \ - src/processor/module_serializer.h \ - src/processor/pathname_stripper.cc \ - src/processor/pathname_stripper.h \ - src/processor/postfix_evaluator-inl.h \ - src/processor/postfix_evaluator.h \ - src/processor/process_state.cc \ - src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \ - src/processor/range_map.h \ - src/processor/simple_serializer-inl.h \ - src/processor/simple_serializer.h \ - src/processor/simple_symbol_supplier.cc \ - src/processor/simple_symbol_supplier.h \ - src/processor/windows_frame_info.h \ - src/processor/source_line_resolver_base_types.h \ - src/processor/source_line_resolver_base.cc \ - src/processor/stack_frame_cpu.cc \ - src/processor/stack_frame_symbolizer.cc \ - src/processor/stackwalk_common.cc \ - src/processor/stackwalk_common.h src/processor/stackwalker.cc \ - src/processor/stackwalker_amd64.cc \ - src/processor/stackwalker_amd64.h \ - src/processor/stackwalker_arm.cc \ - src/processor/stackwalker_arm.h \ - src/processor/stackwalker_arm64.cc \ - src/processor/stackwalker_arm64.h \ - src/processor/stackwalker_address_list.cc \ - src/processor/stackwalker_address_list.h \ - src/processor/stackwalker_mips.cc \ - src/processor/stackwalker_mips.h \ - src/processor/stackwalker_ppc.cc \ - src/processor/stackwalker_ppc.h \ - src/processor/stackwalker_ppc64.cc \ - src/processor/stackwalker_ppc64.h \ - src/processor/stackwalker_riscv.cc \ - src/processor/stackwalker_riscv.h \ - src/processor/stackwalker_riscv64.cc \ - src/processor/stackwalker_riscv64.h \ - src/processor/stackwalker_sparc.cc \ - src/processor/stackwalker_sparc.h \ - src/processor/stackwalker_x86.cc \ - src/processor/stackwalker_x86.h \ - src/processor/static_address_map-inl.h \ - src/processor/static_address_map.h \ - src/processor/static_contained_range_map-inl.h \ - src/processor/static_contained_range_map.h \ - src/processor/static_map_iterator-inl.h \ - src/processor/static_map_iterator.h \ - src/processor/static_map-inl.h src/processor/static_map.h \ - src/processor/static_range_map-inl.h \ - src/processor/static_range_map.h \ - src/processor/symbolic_constants_win.cc \ - src/processor/symbolic_constants_win.h \ - src/processor/tokenize.cc src/processor/tokenize.h -@DISABLE_PROCESSOR_FALSE@am_src_libbreakpad_a_OBJECTS = src/processor/basic_code_modules.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.$(OBJEXT) +am_src_libbreakpad_a_OBJECTS = \ + src/processor/basic_code_modules.$(OBJEXT) \ + src/processor/basic_source_line_resolver.$(OBJEXT) \ + src/processor/call_stack.$(OBJEXT) \ + src/processor/cfi_frame_info.$(OBJEXT) \ + src/processor/convert_old_arm64_context.$(OBJEXT) \ + src/processor/disassembler_objdump.$(OBJEXT) \ + src/processor/disassembler_x86.$(OBJEXT) \ + src/processor/dump_context.$(OBJEXT) \ + src/processor/dump_object.$(OBJEXT) \ + src/processor/exploitability.$(OBJEXT) \ + src/processor/exploitability_linux.$(OBJEXT) \ + src/processor/exploitability_win.$(OBJEXT) \ + src/processor/fast_source_line_resolver.$(OBJEXT) \ + src/processor/logging.$(OBJEXT) \ + src/processor/microdump.$(OBJEXT) \ + src/processor/microdump_processor.$(OBJEXT) \ + src/processor/minidump.$(OBJEXT) \ + src/processor/minidump_processor.$(OBJEXT) \ + src/processor/module_comparer.$(OBJEXT) \ + src/processor/module_serializer.$(OBJEXT) \ + src/processor/pathname_stripper.$(OBJEXT) \ + src/processor/process_state.$(OBJEXT) \ + src/processor/proc_maps_linux.$(OBJEXT) \ + src/processor/simple_symbol_supplier.$(OBJEXT) \ + src/processor/source_line_resolver_base.$(OBJEXT) \ + src/processor/stack_frame_cpu.$(OBJEXT) \ + src/processor/stack_frame_symbolizer.$(OBJEXT) \ + src/processor/stackwalk_common.$(OBJEXT) \ + src/processor/stackwalker.$(OBJEXT) \ + src/processor/stackwalker_amd64.$(OBJEXT) \ + src/processor/stackwalker_arm.$(OBJEXT) \ + src/processor/stackwalker_arm64.$(OBJEXT) \ + src/processor/stackwalker_address_list.$(OBJEXT) \ + src/processor/stackwalker_mips.$(OBJEXT) \ + src/processor/stackwalker_ppc.$(OBJEXT) \ + src/processor/stackwalker_ppc64.$(OBJEXT) \ + src/processor/stackwalker_riscv.$(OBJEXT) \ + src/processor/stackwalker_riscv64.$(OBJEXT) \ + src/processor/stackwalker_sparc.$(OBJEXT) \ + src/processor/stackwalker_x86.$(OBJEXT) \ + src/processor/symbolic_constants_win.$(OBJEXT) \ + src/processor/tokenize.$(OBJEXT) src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS) src_testing_libtesting_a_AR = $(AR) $(ARFLAGS) src_testing_libtesting_a_LIBADD = -am__src_testing_libtesting_a_SOURCES_DIST = \ - src/breakpad_googletest_includes.h \ - src/testing/googletest/src/gtest-all.cc \ - src/testing/googletest/src/gtest_main.cc \ - src/testing/googlemock/src/gmock-all.cc -@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/libtesting_a-gmock-all.$(OBJEXT) +am_src_testing_libtesting_a_OBJECTS = \ + src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ + src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ + src/testing/googlemock/src/libtesting_a-gmock-all.$(OBJEXT) src_testing_libtesting_a_OBJECTS = \ $(am_src_testing_libtesting_a_OBJECTS) src_third_party_libdisasm_libdisasm_a_AR = $(AR) $(ARFLAGS) src_third_party_libdisasm_libdisasm_a_LIBADD = -am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST = \ - src/third_party/libdisasm/ia32_implicit.c \ - src/third_party/libdisasm/ia32_implicit.h \ - src/third_party/libdisasm/ia32_insn.c \ - src/third_party/libdisasm/ia32_insn.h \ - src/third_party/libdisasm/ia32_invariant.c \ - src/third_party/libdisasm/ia32_invariant.h \ - src/third_party/libdisasm/ia32_modrm.c \ - src/third_party/libdisasm/ia32_modrm.h \ - src/third_party/libdisasm/ia32_opcode_tables.c \ - src/third_party/libdisasm/ia32_opcode_tables.h \ - src/third_party/libdisasm/ia32_operand.c \ - src/third_party/libdisasm/ia32_operand.h \ - src/third_party/libdisasm/ia32_reg.c \ - src/third_party/libdisasm/ia32_reg.h \ - src/third_party/libdisasm/ia32_settings.c \ - src/third_party/libdisasm/ia32_settings.h \ - src/third_party/libdisasm/libdis.h \ - src/third_party/libdisasm/qword.h \ - src/third_party/libdisasm/x86_disasm.c \ - src/third_party/libdisasm/x86_format.c \ - src/third_party/libdisasm/x86_imm.c \ - src/third_party/libdisasm/x86_imm.h \ - src/third_party/libdisasm/x86_insn.c \ - src/third_party/libdisasm/x86_misc.c \ - src/third_party/libdisasm/x86_operand_list.c \ - src/third_party/libdisasm/x86_operand_list.h -@DISABLE_PROCESSOR_FALSE@am_src_third_party_libdisasm_libdisasm_a_OBJECTS = src/third_party/libdisasm/ia32_implicit.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_disasm.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_format.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_insn.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_misc.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.$(OBJEXT) +am_src_third_party_libdisasm_libdisasm_a_OBJECTS = \ + src/third_party/libdisasm/ia32_implicit.$(OBJEXT) \ + src/third_party/libdisasm/ia32_insn.$(OBJEXT) \ + src/third_party/libdisasm/ia32_invariant.$(OBJEXT) \ + src/third_party/libdisasm/ia32_modrm.$(OBJEXT) \ + src/third_party/libdisasm/ia32_opcode_tables.$(OBJEXT) \ + src/third_party/libdisasm/ia32_operand.$(OBJEXT) \ + src/third_party/libdisasm/ia32_reg.$(OBJEXT) \ + src/third_party/libdisasm/ia32_settings.$(OBJEXT) \ + src/third_party/libdisasm/x86_disasm.$(OBJEXT) \ + src/third_party/libdisasm/x86_format.$(OBJEXT) \ + src/third_party/libdisasm/x86_imm.$(OBJEXT) \ + src/third_party/libdisasm/x86_insn.$(OBJEXT) \ + src/third_party/libdisasm/x86_misc.$(OBJEXT) \ + src/third_party/libdisasm/x86_operand_list.$(OBJEXT) src_third_party_libdisasm_libdisasm_a_OBJECTS = \ $(am_src_third_party_libdisasm_libdisasm_a_OBJECTS) am_src_client_linux_linux_client_unittest_OBJECTS = @@ -666,47 +549,46 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/processor/proc_maps_linux.cc \ src/common/linux/breakpad_getcontext.S \ src/common/linux/breakpad_getcontext_unittest.cc -@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__objects_3 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ -@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT) -@LINUX_HOST_TRUE@am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ -@LINUX_HOST_TRUE@ $(am__objects_2) \ -@LINUX_HOST_TRUE@ src/client/linux/handler/linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_core_dumper.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_core_dumper_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/tests/client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-convert_old_arm64_context.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-logging.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/processor/client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \ -@LINUX_HOST_TRUE@ $(am__objects_3) +am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ + src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ + src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) +@HAVE_GETCONTEXT_FALSE@am__objects_3 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ +@HAVE_GETCONTEXT_FALSE@ src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT) +am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ + $(am__objects_2) \ + src/client/linux/handler/linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \ + src/client/linux/microdump_writer/linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_core_dumper.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_core_dumper_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-pe_file.$(OBJEXT) \ + src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ + src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \ + src/common/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \ + src/common/tests/client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-convert_old_arm64_context.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-logging.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \ + src/processor/client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \ + $(am__objects_3) src_client_linux_linux_client_unittest_shlib_OBJECTS = \ $(am_src_client_linux_linux_client_unittest_shlib_OBJECTS) src_client_linux_linux_client_unittest_shlib_LINK = $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) \ $(src_client_linux_linux_client_unittest_shlib_LDFLAGS) \ $(LDFLAGS) -o $@ -am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST = src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc -@LINUX_HOST_TRUE@am_src_client_linux_linux_dumper_unittest_helper_OBJECTS = src/client/linux/minidump_writer/linux_dumper_unittest_helper-linux_dumper_unittest_helper.$(OBJEXT) +am_src_client_linux_linux_dumper_unittest_helper_OBJECTS = src/client/linux/minidump_writer/linux_dumper_unittest_helper-linux_dumper_unittest_helper.$(OBJEXT) src_client_linux_linux_dumper_unittest_helper_OBJECTS = \ $(am_src_client_linux_linux_dumper_unittest_helper_OBJECTS) src_client_linux_linux_dumper_unittest_helper_LDADD = $(LDADD) @@ -715,980 +597,655 @@ src_client_linux_linux_dumper_unittest_helper_LINK = $(CXXLD) \ $(CXXFLAGS) \ $(src_client_linux_linux_dumper_unittest_helper_LDFLAGS) \ $(LDFLAGS) -o $@ -am__src_common_dumper_unittest_SOURCES_DIST = \ - src/common/byte_cursor_unittest.cc src/common/convert_UTF.cc \ - src/common/dwarf_cfi_to_module.cc \ - src/common/dwarf_cfi_to_module_unittest.cc \ - src/common/dwarf_cu_to_module.cc \ - src/common/dwarf_cu_to_module_unittest.cc \ - src/common/dwarf_line_to_module.cc \ - src/common/dwarf_line_to_module_unittest.cc \ - src/common/dwarf_range_list_handler.cc src/common/language.cc \ - src/common/memory_range_unittest.cc src/common/module.cc \ - src/common/module_unittest.cc src/common/path_helper.cc \ - src/common/stabs_reader.cc src/common/stabs_reader_unittest.cc \ - src/common/stabs_to_module.cc \ - src/common/stabs_to_module_unittest.cc \ - src/common/string_conversion.cc \ - src/common/string_conversion_unittest.cc \ - src/common/test_assembler.cc src/common/dwarf/bytereader.cc \ - src/common/dwarf/bytereader.h \ - src/common/dwarf/bytereader-inl.h \ - src/common/dwarf/bytereader_unittest.cc \ - src/common/dwarf/cfi_assembler.cc \ - src/common/dwarf/cfi_assembler.h \ - src/common/dwarf/dwarf2diehandler.cc \ - src/common/dwarf/dwarf2diehandler_unittest.cc \ - src/common/dwarf/dwarf2reader.cc \ - src/common/dwarf/dwarf2reader.h src/common/dwarf/elf_reader.cc \ - src/common/dwarf/elf_reader.h \ - src/common/dwarf/dwarf2reader_cfi_unittest.cc \ - src/common/dwarf/dwarf2reader_die_unittest.cc \ - src/common/dwarf/dwarf2reader_test_common.h \ - src/common/linux/crc32.cc src/common/linux/dump_symbols.cc \ - src/common/linux/dump_symbols_unittest.cc \ - src/common/linux/elf_core_dump.cc \ - src/common/linux/elf_core_dump_unittest.cc \ - src/common/linux/elf_symbols_to_module.cc \ - src/common/linux/elf_symbols_to_module_unittest.cc \ - src/common/linux/elfutils.cc src/common/linux/file_id.cc \ - src/common/linux/file_id_unittest.cc \ - src/common/linux/linux_libc_support.cc \ - src/common/linux/memory_mapped_file.cc \ - src/common/linux/memory_mapped_file_unittest.cc \ - src/common/linux/safe_readlink.cc \ - src/common/linux/safe_readlink_unittest.cc \ - src/common/linux/synth_elf.cc \ - src/common/linux/synth_elf_unittest.cc \ - src/common/linux/tests/crash_generator.cc \ - src/common/linux/tests/crash_generator.h \ - src/common/testdata/func-line-pairing.h \ - src/common/tests/file_utils.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_dumper_unittest_OBJECTS = src/common/dumper_unittest-byte_cursor_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-convert_UTF.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_cfi_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_cu_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_line_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-dwarf_range_list_handler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-language.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-memory_range_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-stabs_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-stabs_reader_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-stabs_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-stabs_to_module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-string_conversion.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-string_conversion_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-bytereader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-bytereader_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-cfi_assembler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-dwarf2diehandler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-dwarf2reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-elf_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-crc32.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-dump_symbols.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-dump_symbols_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-elf_core_dump.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-elf_core_dump_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-elf_symbols_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-elf_symbols_to_module_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-elfutils.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-file_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-file_id_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-linux_libc_support.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-memory_mapped_file.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-memory_mapped_file_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-safe_readlink.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-safe_readlink_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-synth_elf.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dumper_unittest-synth_elf_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/dumper_unittest-crash_generator.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/dumper_unittest-file_utils.$(OBJEXT) +am_src_common_dumper_unittest_OBJECTS = \ + src/common/dumper_unittest-byte_cursor_unittest.$(OBJEXT) \ + src/common/dumper_unittest-convert_UTF.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_cfi_to_module.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_cu_to_module.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_line_to_module.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT) \ + src/common/dumper_unittest-dwarf_range_list_handler.$(OBJEXT) \ + src/common/dumper_unittest-language.$(OBJEXT) \ + src/common/dumper_unittest-memory_range_unittest.$(OBJEXT) \ + src/common/dumper_unittest-module.$(OBJEXT) \ + src/common/dumper_unittest-module_unittest.$(OBJEXT) \ + src/common/dumper_unittest-path_helper.$(OBJEXT) \ + src/common/dumper_unittest-stabs_reader.$(OBJEXT) \ + src/common/dumper_unittest-stabs_reader_unittest.$(OBJEXT) \ + src/common/dumper_unittest-stabs_to_module.$(OBJEXT) \ + src/common/dumper_unittest-stabs_to_module_unittest.$(OBJEXT) \ + src/common/dumper_unittest-string_conversion.$(OBJEXT) \ + src/common/dumper_unittest-string_conversion_unittest.$(OBJEXT) \ + src/common/dumper_unittest-test_assembler.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-bytereader.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-bytereader_unittest.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-cfi_assembler.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-dwarf2diehandler.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-dwarf2reader.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-elf_reader.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT) \ + src/common/dwarf/dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-crc32.$(OBJEXT) \ + src/common/linux/dumper_unittest-dump_symbols.$(OBJEXT) \ + src/common/linux/dumper_unittest-dump_symbols_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-elf_core_dump.$(OBJEXT) \ + src/common/linux/dumper_unittest-elf_core_dump_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-elf_symbols_to_module.$(OBJEXT) \ + src/common/linux/dumper_unittest-elf_symbols_to_module_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-elfutils.$(OBJEXT) \ + src/common/linux/dumper_unittest-file_id.$(OBJEXT) \ + src/common/linux/dumper_unittest-file_id_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-linux_libc_support.$(OBJEXT) \ + src/common/linux/dumper_unittest-memory_mapped_file.$(OBJEXT) \ + src/common/linux/dumper_unittest-memory_mapped_file_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-safe_readlink.$(OBJEXT) \ + src/common/linux/dumper_unittest-safe_readlink_unittest.$(OBJEXT) \ + src/common/linux/dumper_unittest-synth_elf.$(OBJEXT) \ + src/common/linux/dumper_unittest-synth_elf_unittest.$(OBJEXT) \ + src/common/linux/tests/dumper_unittest-crash_generator.$(OBJEXT) \ + src/common/tests/dumper_unittest-file_utils.$(OBJEXT) src_common_dumper_unittest_OBJECTS = \ $(am_src_common_dumper_unittest_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_DEPENDENCIES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) -am__src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES_DIST = \ - src/common/dwarf/dwarf2reader.h \ - src/common/dwarf/dwarf2reader_lineinfo_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_common_dwarf_dwarf2reader_lineinfo_unittest_OBJECTS = src/common/dwarf/dwarf2reader_lineinfo_unittest-dwarf2reader_lineinfo_unittest.$(OBJEXT) +src_common_dumper_unittest_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_common_dwarf_dwarf2reader_lineinfo_unittest_OBJECTS = src/common/dwarf/dwarf2reader_lineinfo_unittest-dwarf2reader_lineinfo_unittest.$(OBJEXT) src_common_dwarf_dwarf2reader_lineinfo_unittest_OBJECTS = \ $(am_src_common_dwarf_dwarf2reader_lineinfo_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_lineinfo_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/bytereader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/elf_reader.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES_DIST = \ - src/common/dwarf/dwarf2reader.h \ - src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_common_dwarf_dwarf2reader_splitfunctions_unittest_OBJECTS = src/common/dwarf/dwarf2reader_splitfunctions_unittest-dwarf2reader_splitfunctions_unittest.$(OBJEXT) +src_common_dwarf_dwarf2reader_lineinfo_unittest_DEPENDENCIES = \ + src/common/dwarf/bytereader.o src/common/dwarf/dwarf2reader.o \ + src/common/dwarf/elf_reader.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_common_dwarf_dwarf2reader_splitfunctions_unittest_OBJECTS = src/common/dwarf/dwarf2reader_splitfunctions_unittest-dwarf2reader_splitfunctions_unittest.$(OBJEXT) src_common_dwarf_dwarf2reader_splitfunctions_unittest_OBJECTS = $(am_src_common_dwarf_dwarf2reader_splitfunctions_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_splitfunctions_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/bytereader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/elf_reader.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_common_linux_google_crashdump_uploader_test_SOURCES_DIST = \ - src/common/linux/google_crashdump_uploader.cc \ - src/common/linux/google_crashdump_uploader_test.cc \ - src/common/linux/libcurl_wrapper.cc -@LINUX_HOST_TRUE@am_src_common_linux_google_crashdump_uploader_test_OBJECTS = src/common/linux/google_crashdump_uploader_test-google_crashdump_uploader.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test-google_crashdump_uploader_test.$(OBJEXT) \ -@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT) +src_common_dwarf_dwarf2reader_splitfunctions_unittest_DEPENDENCIES = \ + src/common/dwarf/bytereader.o src/common/dwarf/dwarf2reader.o \ + src/common/dwarf/elf_reader.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_common_linux_google_crashdump_uploader_test_OBJECTS = src/common/linux/google_crashdump_uploader_test-google_crashdump_uploader.$(OBJEXT) \ + src/common/linux/google_crashdump_uploader_test-google_crashdump_uploader_test.$(OBJEXT) \ + src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT) src_common_linux_google_crashdump_uploader_test_OBJECTS = \ $(am_src_common_linux_google_crashdump_uploader_test_OBJECTS) -@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \ -@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ -@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) -am__src_common_mac_macho_reader_unittest_SOURCES_DIST = \ - src/common/dwarf_cfi_to_module.cc \ - src/common/dwarf_cu_to_module.cc \ - src/common/dwarf_line_to_module.cc src/common/language.cc \ - src/common/md5.cc src/common/module.cc \ - src/common/path_helper.cc src/common/stabs_reader.cc \ - src/common/stabs_to_module.cc src/common/test_assembler.cc \ - src/common/dwarf/bytereader.cc \ - src/common/dwarf/cfi_assembler.cc \ - src/common/dwarf/dwarf2diehandler.cc \ - src/common/dwarf/dwarf2reader.cc \ - src/common/dwarf/elf_reader.cc \ - src/common/mac/arch_utilities.cc src/common/mac/file_id.cc \ - src/common/mac/macho_id.cc src/common/mac/macho_reader.cc \ - src/common/mac/macho_reader_unittest.cc \ - src/common/mac/macho_utilities.cc \ - src/common/mac/macho_walker.cc src/common/tests/file_utils.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-language.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-md5.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-stabs_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-stabs_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac_macho_reader_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/mac_macho_reader_unittest-bytereader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/mac_macho_reader_unittest-cfi_assembler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/mac_macho_reader_unittest-dwarf2reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/mac_macho_reader_unittest-elf_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-arch_utilities.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-file_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-macho_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-macho_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-macho_reader_unittest.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-macho_utilities.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest-macho_walker.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/mac_macho_reader_unittest-file_utils.$(OBJEXT) +src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-language.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-md5.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-module.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-path_helper.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-stabs_reader.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-stabs_to_module.$(OBJEXT) \ + src/common/mac_macho_reader_unittest-test_assembler.$(OBJEXT) \ + src/common/dwarf/mac_macho_reader_unittest-bytereader.$(OBJEXT) \ + src/common/dwarf/mac_macho_reader_unittest-cfi_assembler.$(OBJEXT) \ + src/common/dwarf/mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT) \ + src/common/dwarf/mac_macho_reader_unittest-dwarf2reader.$(OBJEXT) \ + src/common/dwarf/mac_macho_reader_unittest-elf_reader.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-arch_utilities.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-file_id.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-macho_id.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-macho_reader.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-macho_reader_unittest.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-macho_utilities.$(OBJEXT) \ + src/common/mac/macho_reader_unittest-macho_walker.$(OBJEXT) \ + src/common/tests/mac_macho_reader_unittest-file_utils.$(OBJEXT) src_common_mac_macho_reader_unittest_OBJECTS = \ $(am_src_common_mac_macho_reader_unittest_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_DEPENDENCIES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) -am__src_common_safe_math_unittest_SOURCES_DIST = \ - src/common/safe_math.h src/common/safe_math_unittest.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_safe_math_unittest_OBJECTS = src/common/safe_math_unittest-safe_math_unittest.$(OBJEXT) +src_common_mac_macho_reader_unittest_DEPENDENCIES = \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_common_safe_math_unittest_OBJECTS = \ + src/common/safe_math_unittest-safe_math_unittest.$(OBJEXT) src_common_safe_math_unittest_OBJECTS = \ $(am_src_common_safe_math_unittest_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_DEPENDENCIES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) -am__src_common_test_assembler_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc src/common/test_assembler.h \ - src/common/test_assembler_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_common_test_assembler_unittest_OBJECTS = src/common/test_assembler_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest-test_assembler_unittest.$(OBJEXT) +src_common_safe_math_unittest_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_common_test_assembler_unittest_OBJECTS = \ + src/common/test_assembler_unittest-test_assembler.$(OBJEXT) \ + src/common/test_assembler_unittest-test_assembler_unittest.$(OBJEXT) src_common_test_assembler_unittest_OBJECTS = \ $(am_src_common_test_assembler_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_address_map_unittest_SOURCES_DIST = \ - src/processor/address_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_address_map_unittest_OBJECTS = src/processor/address_map_unittest.$(OBJEXT) +src_common_test_assembler_unittest_DEPENDENCIES = \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_address_map_unittest_OBJECTS = \ + src/processor/address_map_unittest.$(OBJEXT) src_processor_address_map_unittest_OBJECTS = \ $(am_src_processor_address_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o -am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST = \ - src/processor/basic_source_line_resolver_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT) +src_processor_address_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o +am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT) src_processor_basic_source_line_resolver_unittest_OBJECTS = $(am_src_processor_basic_source_line_resolver_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_DEPENDENCIES = src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_cfi_frame_info_unittest_SOURCES_DIST = \ - src/processor/cfi_frame_info_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT) +src_processor_basic_source_line_resolver_unittest_DEPENDENCIES = \ + src/processor/basic_source_line_resolver.o \ + src/processor/cfi_frame_info.o \ + src/processor/pathname_stripper.o src/processor/logging.o \ + src/processor/source_line_resolver_base.o \ + src/processor/tokenize.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT) src_processor_cfi_frame_info_unittest_OBJECTS = \ $(am_src_processor_cfi_frame_info_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_contained_range_map_unittest_SOURCES_DIST = \ - src/processor/contained_range_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_contained_range_map_unittest_OBJECTS = src/processor/contained_range_map_unittest.$(OBJEXT) +src_processor_cfi_frame_info_unittest_DEPENDENCIES = \ + src/processor/cfi_frame_info.o src/processor/logging.o \ + src/processor/pathname_stripper.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_contained_range_map_unittest_OBJECTS = \ + src/processor/contained_range_map_unittest.$(OBJEXT) src_processor_contained_range_map_unittest_OBJECTS = \ $(am_src_processor_contained_range_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o -am__src_processor_disassembler_objdump_unittest_SOURCES_DIST = \ - src/processor/disassembler_objdump_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_objdump_unittest_OBJECTS = src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.$(OBJEXT) +src_processor_contained_range_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o +am_src_processor_disassembler_objdump_unittest_OBJECTS = src/processor/disassembler_objdump_unittest-disassembler_objdump_unittest.$(OBJEXT) src_processor_disassembler_objdump_unittest_OBJECTS = \ $(am_src_processor_disassembler_objdump_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_disassembler_x86_unittest_SOURCES_DIST = \ - src/processor/disassembler_x86_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT) +src_processor_disassembler_objdump_unittest_DEPENDENCIES = \ + src/processor/disassembler_objdump.o \ + src/processor/dump_context.o src/processor/dump_object.o \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT) src_processor_disassembler_x86_unittest_OBJECTS = \ $(am_src_processor_disassembler_x86_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_exploitability_unittest_SOURCES_DIST = \ - src/processor/exploitability_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_exploitability_unittest_OBJECTS = src/processor/exploitability_unittest-exploitability_unittest.$(OBJEXT) +src_processor_disassembler_x86_unittest_DEPENDENCIES = \ + src/processor/disassembler_x86.o \ + src/third_party/libdisasm/libdisasm.a $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_exploitability_unittest_OBJECTS = src/processor/exploitability_unittest-exploitability_unittest.$(OBJEXT) src_processor_exploitability_unittest_OBJECTS = \ $(am_src_processor_exploitability_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES = src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST = \ - src/processor/fast_source_line_resolver_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT) +src_processor_exploitability_unittest_DEPENDENCIES = \ + src/processor/convert_old_arm64_context.o \ + src/processor/minidump_processor.o \ + src/processor/process_state.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ + src/processor/dump_context.o src/processor/dump_object.o \ + src/processor/logging.o src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT) src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fast_source_line_resolver_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = src/processor/fast_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_map_serializers_unittest_SOURCES_DIST = \ - src/processor/map_serializers_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_map_serializers_unittest_OBJECTS = src/processor/map_serializers_unittest-map_serializers_unittest.$(OBJEXT) +src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = \ + src/processor/fast_source_line_resolver.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/cfi_frame_info.o src/processor/module_comparer.o \ + src/processor/module_serializer.o \ + src/processor/pathname_stripper.o src/processor/logging.o \ + src/processor/source_line_resolver_base.o \ + src/processor/tokenize.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_map_serializers_unittest_OBJECTS = src/processor/map_serializers_unittest-map_serializers_unittest.$(OBJEXT) src_processor_map_serializers_unittest_OBJECTS = \ $(am_src_processor_map_serializers_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_microdump_processor_unittest_SOURCES_DIST = \ - src/processor/microdump_processor_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT) +src_processor_map_serializers_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT) src_processor_microdump_processor_unittest_OBJECTS = \ $(am_src_processor_microdump_processor_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_microdump_stackwalk_SOURCES_DIST = \ - src/processor/microdump_stackwalk.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_stackwalk_OBJECTS = src/processor/microdump_stackwalk.$(OBJEXT) +src_processor_microdump_processor_unittest_DEPENDENCIES = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/cfi_frame_info.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/logging.o \ + src/processor/microdump.o src/processor/microdump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_microdump_stackwalk_OBJECTS = \ + src/processor/microdump_stackwalk.$(OBJEXT) src_processor_microdump_stackwalk_OBJECTS = \ $(am_src_processor_microdump_stackwalk_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a -am__src_processor_minidump_dump_SOURCES_DIST = \ - src/processor/minidump_dump.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_dump_OBJECTS = src/processor/minidump_dump.$(OBJEXT) +src_processor_microdump_stackwalk_DEPENDENCIES = \ + src/common/path_helper.o src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/cfi_frame_info.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/logging.o \ + src/processor/microdump.o src/processor/microdump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalk_common.o src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a +am_src_processor_minidump_dump_OBJECTS = \ + src/processor/minidump_dump.$(OBJEXT) src_processor_minidump_dump_OBJECTS = \ $(am_src_processor_minidump_dump_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o -am__src_processor_minidump_processor_unittest_SOURCES_DIST = \ - src/processor/minidump_processor_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_processor_unittest_OBJECTS = src/processor/minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT) +src_processor_minidump_dump_DEPENDENCIES = src/common/path_helper.o \ + src/processor/basic_code_modules.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/dump_context.o src/processor/dump_object.o \ + src/processor/logging.o src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o +am_src_processor_minidump_processor_unittest_OBJECTS = src/processor/minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT) src_processor_minidump_processor_unittest_OBJECTS = \ $(am_src_processor_minidump_processor_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_minidump_stackwalk_SOURCES_DIST = \ - src/processor/minidump_stackwalk.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_stackwalk_OBJECTS = src/processor/minidump_stackwalk.$(OBJEXT) +src_processor_minidump_processor_unittest_DEPENDENCIES = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump_processor.o src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o src/processor/proc_maps_linux.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_minidump_stackwalk_OBJECTS = \ + src/processor/minidump_stackwalk.$(OBJEXT) src_processor_minidump_stackwalk_OBJECTS = \ $(am_src_processor_minidump_stackwalk_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a -am__src_processor_minidump_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/minidump_unittest.cc \ - src/processor/synth_minidump.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_unittest_OBJECTS = src/common/processor_minidump_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest-minidump_unittest.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest-synth_minidump.$(OBJEXT) +src_processor_minidump_stackwalk_DEPENDENCIES = \ + src/common/path_helper.o src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump.o src/processor/minidump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o src/processor/proc_maps_linux.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalk_common.o src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a +am_src_processor_minidump_unittest_OBJECTS = src/common/processor_minidump_unittest-test_assembler.$(OBJEXT) \ + src/processor/minidump_unittest-minidump_unittest.$(OBJEXT) \ + src/processor/minidump_unittest-synth_minidump.$(OBJEXT) src_processor_minidump_unittest_OBJECTS = \ $(am_src_processor_minidump_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_pathname_stripper_unittest_SOURCES_DIST = \ - src/processor/pathname_stripper_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_pathname_stripper_unittest_OBJECTS = src/processor/pathname_stripper_unittest.$(OBJEXT) +src_processor_minidump_unittest_DEPENDENCIES = \ + src/processor/basic_code_modules.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/dump_context.o src/processor/dump_object.o \ + src/processor/logging.o src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_pathname_stripper_unittest_OBJECTS = \ + src/processor/pathname_stripper_unittest.$(OBJEXT) src_processor_pathname_stripper_unittest_OBJECTS = \ $(am_src_processor_pathname_stripper_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_postfix_evaluator_unittest_SOURCES_DIST = \ - src/processor/postfix_evaluator_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_postfix_evaluator_unittest_OBJECTS = src/processor/postfix_evaluator_unittest.$(OBJEXT) +src_processor_pathname_stripper_unittest_DEPENDENCIES = \ + src/processor/pathname_stripper.o $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_postfix_evaluator_unittest_OBJECTS = \ + src/processor/postfix_evaluator_unittest.$(OBJEXT) src_processor_postfix_evaluator_unittest_OBJECTS = \ $(am_src_processor_postfix_evaluator_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_proc_maps_linux_unittest_SOURCES_DIST = \ - src/processor/proc_maps_linux.cc \ - src/processor/proc_maps_linux_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_proc_maps_linux_unittest_OBJECTS = src/processor/proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT) +src_processor_postfix_evaluator_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_proc_maps_linux_unittest_OBJECTS = src/processor/proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT) \ + src/processor/proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT) src_processor_proc_maps_linux_unittest_OBJECTS = \ $(am_src_processor_proc_maps_linux_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_range_map_truncate_lower_unittest_SOURCES_DIST = \ - src/processor/range_map_truncate_lower_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_truncate_lower_unittest_OBJECTS = src/processor/range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.$(OBJEXT) +src_processor_proc_maps_linux_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + src/third_party/libdisasm/libdisasm.a $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_range_map_truncate_lower_unittest_OBJECTS = src/processor/range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.$(OBJEXT) src_processor_range_map_truncate_lower_unittest_OBJECTS = \ $(am_src_processor_range_map_truncate_lower_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_range_map_truncate_upper_unittest_SOURCES_DIST = \ - src/processor/range_map_truncate_upper_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_truncate_upper_unittest_OBJECTS = src/processor/range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.$(OBJEXT) +src_processor_range_map_truncate_lower_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_range_map_truncate_upper_unittest_OBJECTS = src/processor/range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.$(OBJEXT) src_processor_range_map_truncate_upper_unittest_OBJECTS = \ $(am_src_processor_range_map_truncate_upper_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_range_map_unittest_SOURCES_DIST = \ - src/processor/range_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_unittest_OBJECTS = src/processor/range_map_unittest.$(OBJEXT) +src_processor_range_map_truncate_upper_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_range_map_unittest_OBJECTS = \ + src/processor/range_map_unittest.$(OBJEXT) src_processor_range_map_unittest_OBJECTS = \ $(am_src_processor_range_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_address_list_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_address_list_unittest_OBJECTS = src/common/processor_stackwalker_address_list_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT) +src_processor_range_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_address_list_unittest_OBJECTS = src/common/processor_stackwalker_address_list_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT) src_processor_stackwalker_address_list_unittest_OBJECTS = \ $(am_src_processor_stackwalker_address_list_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_amd64_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_amd64_unittest_OBJECTS = src/common/processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT) +src_processor_stackwalker_address_list_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_amd64_unittest_OBJECTS = src/common/processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT) src_processor_stackwalker_amd64_unittest_OBJECTS = \ $(am_src_processor_stackwalker_amd64_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_arm64_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm64_unittest_OBJECTS = src/common/processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT) +src_processor_stackwalker_amd64_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_arm64_unittest_OBJECTS = src/common/processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT) src_processor_stackwalker_arm64_unittest_OBJECTS = \ $(am_src_processor_stackwalker_arm64_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_arm_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_arm_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm_unittest_OBJECTS = src/common/processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT) +src_processor_stackwalker_arm64_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_arm_unittest_OBJECTS = src/common/processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT) src_processor_stackwalker_arm_unittest_OBJECTS = \ $(am_src_processor_stackwalker_arm_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_mips64_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips64_unittest_OBJECTS = src/common/processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT) +src_processor_stackwalker_arm_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_mips64_unittest_OBJECTS = src/common/processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT) src_processor_stackwalker_mips64_unittest_OBJECTS = \ $(am_src_processor_stackwalker_mips64_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_mips_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_mips_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips_unittest_OBJECTS = src/common/processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT) +src_processor_stackwalker_mips64_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_mips_unittest_OBJECTS = src/common/processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT) src_processor_stackwalker_mips_unittest_OBJECTS = \ $(am_src_processor_stackwalker_mips_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_riscv64_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_riscv64_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_riscv64_unittest_OBJECTS = src/common/processor_stackwalker_riscv64_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.$(OBJEXT) +src_processor_stackwalker_mips_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_riscv64_unittest_OBJECTS = src/common/processor_stackwalker_riscv64_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_riscv64_unittest-stackwalker_riscv64_unittest.$(OBJEXT) src_processor_stackwalker_riscv64_unittest_OBJECTS = \ $(am_src_processor_stackwalker_riscv64_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_riscv_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_riscv_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_riscv_unittest_OBJECTS = src/common/processor_stackwalker_riscv_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.$(OBJEXT) +src_processor_stackwalker_riscv64_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_riscv_unittest_OBJECTS = src/common/processor_stackwalker_riscv_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_riscv_unittest-stackwalker_riscv_unittest.$(OBJEXT) src_processor_stackwalker_riscv_unittest_OBJECTS = \ $(am_src_processor_stackwalker_riscv_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_selftest_SOURCES_DIST = \ - src/processor/stackwalker_selftest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_selftest_OBJECTS = src/processor/stackwalker_selftest.$(OBJEXT) +src_processor_stackwalker_riscv_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_selftest_OBJECTS = \ + src/processor/stackwalker_selftest.$(OBJEXT) src_processor_stackwalker_selftest_OBJECTS = \ $(am_src_processor_stackwalker_selftest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_stackwalker_x86_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc \ - src/processor/stackwalker_x86_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) +src_processor_stackwalker_selftest_DEPENDENCIES = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump.o src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \ + src/processor/stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) src_processor_stackwalker_x86_unittest_OBJECTS = \ $(am_src_processor_stackwalker_x86_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_static_address_map_unittest_SOURCES_DIST = \ - src/processor/static_address_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_static_address_map_unittest_OBJECTS = src/processor/static_address_map_unittest-static_address_map_unittest.$(OBJEXT) +src_processor_stackwalker_x86_unittest_DEPENDENCIES = \ + src/libbreakpad.a $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_static_address_map_unittest_OBJECTS = src/processor/static_address_map_unittest-static_address_map_unittest.$(OBJEXT) src_processor_static_address_map_unittest_OBJECTS = \ $(am_src_processor_static_address_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_static_contained_range_map_unittest_SOURCES_DIST = \ - src/processor/static_contained_range_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_static_contained_range_map_unittest_OBJECTS = src/processor/static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT) +src_processor_static_address_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_static_contained_range_map_unittest_OBJECTS = src/processor/static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT) src_processor_static_contained_range_map_unittest_OBJECTS = $(am_src_processor_static_contained_range_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_static_map_unittest_SOURCES_DIST = \ - src/processor/static_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_static_map_unittest_OBJECTS = src/processor/static_map_unittest-static_map_unittest.$(OBJEXT) +src_processor_static_contained_range_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_static_map_unittest_OBJECTS = src/processor/static_map_unittest-static_map_unittest.$(OBJEXT) src_processor_static_map_unittest_OBJECTS = \ $(am_src_processor_static_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_static_range_map_unittest_SOURCES_DIST = \ - src/processor/static_range_map_unittest.cc -@DISABLE_PROCESSOR_FALSE@am_src_processor_static_range_map_unittest_OBJECTS = src/processor/static_range_map_unittest-static_range_map_unittest.$(OBJEXT) +src_processor_static_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_static_range_map_unittest_OBJECTS = src/processor/static_range_map_unittest-static_range_map_unittest.$(OBJEXT) src_processor_static_range_map_unittest_OBJECTS = \ $(am_src_processor_static_range_map_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_processor_synth_minidump_unittest_SOURCES_DIST = \ - src/common/test_assembler.cc src/common/test_assembler.h \ - src/processor/synth_minidump_unittest.cc \ - src/processor/synth_minidump.cc src/processor/synth_minidump.h -@DISABLE_PROCESSOR_FALSE@am_src_processor_synth_minidump_unittest_OBJECTS = src/common/processor_synth_minidump_unittest-test_assembler.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest-synth_minidump.$(OBJEXT) +src_processor_static_range_map_unittest_DEPENDENCIES = \ + src/processor/logging.o src/processor/pathname_stripper.o \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_processor_synth_minidump_unittest_OBJECTS = src/common/processor_synth_minidump_unittest-test_assembler.$(OBJEXT) \ + src/processor/synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT) \ + src/processor/synth_minidump_unittest-synth_minidump.$(OBJEXT) src_processor_synth_minidump_unittest_OBJECTS = \ $(am_src_processor_synth_minidump_unittest_OBJECTS) -@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_DEPENDENCIES = \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \ -@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) -am__src_tools_linux_core2md_core2md_SOURCES_DIST = \ - src/tools/linux/core2md/core2md.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_core2md_core2md_OBJECTS = src/tools/linux/core2md/core2md.$(OBJEXT) +src_processor_synth_minidump_unittest_DEPENDENCIES = \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_tools_linux_core2md_core2md_OBJECTS = \ + src/tools/linux/core2md/core2md.$(OBJEXT) src_tools_linux_core2md_core2md_OBJECTS = \ $(am_src_tools_linux_core2md_core2md_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o -am__src_tools_linux_core_handler_core_handler_SOURCES_DIST = \ - src/tools/linux/core_handler/core_handler.cc -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am_src_tools_linux_core_handler_core_handler_OBJECTS = src/tools/linux/core_handler/core_handler.$(OBJEXT) +src_tools_linux_core2md_core2md_DEPENDENCIES = \ + src/client/linux/libbreakpad_client.a src/common/path_helper.o +am_src_tools_linux_core_handler_core_handler_OBJECTS = \ + src/tools/linux/core_handler/core_handler.$(OBJEXT) src_tools_linux_core_handler_core_handler_OBJECTS = \ $(am_src_tools_linux_core_handler_core_handler_OBJECTS) -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_DEPENDENCIES = src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/common/path_helper.o -am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST = \ - src/common/dwarf_cfi_to_module.cc \ - src/common/dwarf_cu_to_module.cc \ - src/common/dwarf_line_to_module.cc \ - src/common/dwarf_range_list_handler.cc src/common/language.cc \ - src/common/module.cc src/common/path_helper.cc \ - src/common/stabs_reader.cc src/common/stabs_to_module.cc \ - src/common/dwarf/bytereader.cc \ - src/common/dwarf/dwarf2diehandler.cc \ - src/common/dwarf/dwarf2reader.cc \ - src/common/dwarf/elf_reader.cc src/common/linux/crc32.cc \ - src/common/linux/dump_symbols.cc \ - src/common/linux/dump_symbols.h \ - src/common/linux/elf_symbols_to_module.cc \ - src/common/linux/elf_symbols_to_module.h \ - src/common/linux/elfutils.cc src/common/linux/file_id.cc \ - src/common/linux/linux_libc_support.cc \ - src/common/linux/memory_mapped_file.cc \ - src/common/linux/safe_readlink.cc \ - src/tools/linux/dump_syms/dump_syms.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_dump_syms_dump_syms_OBJECTS = src/common/tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-dwarf_line_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-language.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-stabs_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_linux_dump_syms_dump_syms-stabs_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_linux_dump_syms_dump_syms-bytereader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_linux_dump_syms_dump_syms-dwarf2diehandler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_linux_dump_syms_dump_syms-dwarf2reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_linux_dump_syms_dump_syms-elf_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-crc32.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-dump_symbols.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-elf_symbols_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-elfutils.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-file_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-linux_libc_support.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-memory_mapped_file.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tools_linux_dump_syms_dump_syms-safe_readlink.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms-dump_syms.$(OBJEXT) +src_tools_linux_core_handler_core_handler_DEPENDENCIES = \ + src/client/linux/libbreakpad_client.a src/common/path_helper.o +am_src_tools_linux_dump_syms_dump_syms_OBJECTS = src/common/tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-dwarf_line_to_module.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-language.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-module.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-path_helper.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-stabs_reader.$(OBJEXT) \ + src/common/tools_linux_dump_syms_dump_syms-stabs_to_module.$(OBJEXT) \ + src/common/dwarf/tools_linux_dump_syms_dump_syms-bytereader.$(OBJEXT) \ + src/common/dwarf/tools_linux_dump_syms_dump_syms-dwarf2diehandler.$(OBJEXT) \ + src/common/dwarf/tools_linux_dump_syms_dump_syms-dwarf2reader.$(OBJEXT) \ + src/common/dwarf/tools_linux_dump_syms_dump_syms-elf_reader.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-crc32.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-dump_symbols.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-elf_symbols_to_module.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-elfutils.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-file_id.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-linux_libc_support.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-memory_mapped_file.$(OBJEXT) \ + src/common/linux/tools_linux_dump_syms_dump_syms-safe_readlink.$(OBJEXT) \ + src/tools/linux/dump_syms/dump_syms-dump_syms.$(OBJEXT) src_tools_linux_dump_syms_dump_syms_OBJECTS = \ $(am_src_tools_linux_dump_syms_dump_syms_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_DEPENDENCIES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) +src_tools_linux_dump_syms_dump_syms_DEPENDENCIES = \ + $(am__DEPENDENCIES_1) src_tools_linux_dump_syms_dump_syms_LINK = $(CXXLD) \ $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST = \ - src/common/linux/memory_mapped_file.cc \ - src/common/path_helper.cc \ - src/tools/linux/md2core/minidump-2-core.cc \ - src/tools/linux/md2core/minidump_memory_range.h -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_OBJECTS = src/common/linux/memory_mapped_file.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.$(OBJEXT) +am_src_tools_linux_md2core_minidump_2_core_OBJECTS = \ + src/common/linux/memory_mapped_file.$(OBJEXT) \ + src/common/path_helper.$(OBJEXT) \ + src/tools/linux/md2core/minidump-2-core.$(OBJEXT) src_tools_linux_md2core_minidump_2_core_OBJECTS = \ $(am_src_tools_linux_md2core_minidump_2_core_OBJECTS) src_tools_linux_md2core_minidump_2_core_LDADD = $(LDADD) -am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST = \ - src/tools/linux/md2core/minidump_memory_range_unittest.cc -@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = src/tools/linux/md2core/minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT) +am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = src/tools/linux/md2core/minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT) src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = $(am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS) -@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES = \ -@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ -@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) -am__src_tools_linux_pid2md_pid2md_SOURCES_DIST = \ - src/tools/linux/pid2md/pid2md.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_pid2md_pid2md_OBJECTS = src/tools/linux/pid2md/pid2md.$(OBJEXT) +src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES = \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_src_tools_linux_pid2md_pid2md_OBJECTS = \ + src/tools/linux/pid2md/pid2md.$(OBJEXT) src_tools_linux_pid2md_pid2md_OBJECTS = \ $(am_src_tools_linux_pid2md_pid2md_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o -am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST = \ - src/common/linux/http_upload.cc src/common/path_helper.cc \ - src/tools/linux/symupload/minidump_upload.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_minidump_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.$(OBJEXT) +src_tools_linux_pid2md_pid2md_DEPENDENCIES = \ + src/client/linux/libbreakpad_client.a src/common/path_helper.o +am_src_tools_linux_symupload_minidump_upload_OBJECTS = \ + src/common/linux/http_upload.$(OBJEXT) \ + src/common/path_helper.$(OBJEXT) \ + src/tools/linux/symupload/minidump_upload.$(OBJEXT) src_tools_linux_symupload_minidump_upload_OBJECTS = \ $(am_src_tools_linux_symupload_minidump_upload_OBJECTS) src_tools_linux_symupload_minidump_upload_DEPENDENCIES = -am__src_tools_linux_symupload_sym_upload_SOURCES_DIST = \ - src/common/linux/http_upload.cc src/common/linux/http_upload.h \ - src/common/linux/libcurl_wrapper.cc \ - src/common/linux/libcurl_wrapper.h \ - src/common/linux/symbol_collector_client.cc \ - src/common/linux/symbol_collector_client.h \ - src/common/linux/symbol_upload.cc \ - src/common/linux/symbol_upload.h src/common/path_helper.cc \ - src/tools/linux/symupload/sym_upload.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_sym_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.$(OBJEXT) +am_src_tools_linux_symupload_sym_upload_OBJECTS = \ + src/common/linux/http_upload.$(OBJEXT) \ + src/common/linux/libcurl_wrapper.$(OBJEXT) \ + src/common/linux/symbol_collector_client.$(OBJEXT) \ + src/common/linux/symbol_upload.$(OBJEXT) \ + src/common/path_helper.$(OBJEXT) \ + src/tools/linux/symupload/sym_upload.$(OBJEXT) src_tools_linux_symupload_sym_upload_OBJECTS = \ $(am_src_tools_linux_symupload_sym_upload_OBJECTS) src_tools_linux_symupload_sym_upload_DEPENDENCIES = -am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST = \ - src/common/dwarf_cfi_to_module.cc \ - src/common/dwarf_cu_to_module.cc \ - src/common/dwarf_line_to_module.cc \ - src/common/dwarf_range_list_handler.cc src/common/language.cc \ - src/common/md5.cc src/common/module.cc \ - src/common/path_helper.cc src/common/stabs_reader.cc \ - src/common/stabs_to_module.cc src/common/dwarf/bytereader.cc \ - src/common/dwarf/dwarf2diehandler.cc \ - src/common/dwarf/dwarf2reader.cc \ - src/common/dwarf/elf_reader.cc \ - src/common/mac/arch_utilities.cc src/common/mac/dump_syms.cc \ - src/common/mac/dump_syms.h src/common/mac/file_id.cc \ - src/common/mac/file_id.h src/common/mac/macho_id.cc \ - src/common/mac/macho_id.h src/common/mac/macho_reader.cc \ - src/common/mac/macho_reader.h \ - src/common/mac/macho_utilities.cc \ - src/common/mac/macho_utilities.h \ - src/common/mac/macho_walker.cc src/common/mac/macho_walker.h \ - src/tools/mac/dump_syms/dump_syms_tool.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-path_helper.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac-dump_syms_tool.$(OBJEXT) +am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-path_helper.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT) \ + src/common/tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT) \ + src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT) \ + src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT) \ + src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT) \ + src/common/dwarf/tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT) \ + src/common/mac/tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT) \ + src/tools/mac/dump_syms/dump_syms_mac-dump_syms_tool.$(OBJEXT) src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = \ $(am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) +src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES = \ + $(am__DEPENDENCIES_1) src_tools_mac_dump_syms_dump_syms_mac_LINK = $(CXXLD) \ $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -2106,64 +1663,64 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES) DIST_SOURCES = \ $(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \ - $(am__src_libbreakpad_a_SOURCES_DIST) \ - $(am__src_testing_libtesting_a_SOURCES_DIST) \ - $(am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST) \ + $(src_libbreakpad_a_SOURCES) \ + $(src_testing_libtesting_a_SOURCES) \ + $(src_third_party_libdisasm_libdisasm_a_SOURCES) \ $(src_client_linux_linux_client_unittest_SOURCES) \ $(am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST) \ - $(am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST) \ - $(am__src_common_dumper_unittest_SOURCES_DIST) \ - $(am__src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES_DIST) \ - $(am__src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES_DIST) \ - $(am__src_common_linux_google_crashdump_uploader_test_SOURCES_DIST) \ - $(am__src_common_mac_macho_reader_unittest_SOURCES_DIST) \ - $(am__src_common_safe_math_unittest_SOURCES_DIST) \ - $(am__src_common_test_assembler_unittest_SOURCES_DIST) \ - $(am__src_processor_address_map_unittest_SOURCES_DIST) \ - $(am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST) \ - $(am__src_processor_cfi_frame_info_unittest_SOURCES_DIST) \ - $(am__src_processor_contained_range_map_unittest_SOURCES_DIST) \ - $(am__src_processor_disassembler_objdump_unittest_SOURCES_DIST) \ - $(am__src_processor_disassembler_x86_unittest_SOURCES_DIST) \ - $(am__src_processor_exploitability_unittest_SOURCES_DIST) \ - $(am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST) \ - $(am__src_processor_map_serializers_unittest_SOURCES_DIST) \ - $(am__src_processor_microdump_processor_unittest_SOURCES_DIST) \ - $(am__src_processor_microdump_stackwalk_SOURCES_DIST) \ - $(am__src_processor_minidump_dump_SOURCES_DIST) \ - $(am__src_processor_minidump_processor_unittest_SOURCES_DIST) \ - $(am__src_processor_minidump_stackwalk_SOURCES_DIST) \ - $(am__src_processor_minidump_unittest_SOURCES_DIST) \ - $(am__src_processor_pathname_stripper_unittest_SOURCES_DIST) \ - $(am__src_processor_postfix_evaluator_unittest_SOURCES_DIST) \ - $(am__src_processor_proc_maps_linux_unittest_SOURCES_DIST) \ - $(am__src_processor_range_map_truncate_lower_unittest_SOURCES_DIST) \ - $(am__src_processor_range_map_truncate_upper_unittest_SOURCES_DIST) \ - $(am__src_processor_range_map_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_arm_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_mips_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_riscv64_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_riscv_unittest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_selftest_SOURCES_DIST) \ - $(am__src_processor_stackwalker_x86_unittest_SOURCES_DIST) \ - $(am__src_processor_static_address_map_unittest_SOURCES_DIST) \ - $(am__src_processor_static_contained_range_map_unittest_SOURCES_DIST) \ - $(am__src_processor_static_map_unittest_SOURCES_DIST) \ - $(am__src_processor_static_range_map_unittest_SOURCES_DIST) \ - $(am__src_processor_synth_minidump_unittest_SOURCES_DIST) \ - $(am__src_tools_linux_core2md_core2md_SOURCES_DIST) \ - $(am__src_tools_linux_core_handler_core_handler_SOURCES_DIST) \ - $(am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST) \ - $(am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST) \ - $(am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST) \ - $(am__src_tools_linux_pid2md_pid2md_SOURCES_DIST) \ - $(am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST) \ - $(am__src_tools_linux_symupload_sym_upload_SOURCES_DIST) \ - $(am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST) + $(src_client_linux_linux_dumper_unittest_helper_SOURCES) \ + $(src_common_dumper_unittest_SOURCES) \ + $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ + $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ + $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_mac_macho_reader_unittest_SOURCES) \ + $(src_common_safe_math_unittest_SOURCES) \ + $(src_common_test_assembler_unittest_SOURCES) \ + $(src_processor_address_map_unittest_SOURCES) \ + $(src_processor_basic_source_line_resolver_unittest_SOURCES) \ + $(src_processor_cfi_frame_info_unittest_SOURCES) \ + $(src_processor_contained_range_map_unittest_SOURCES) \ + $(src_processor_disassembler_objdump_unittest_SOURCES) \ + $(src_processor_disassembler_x86_unittest_SOURCES) \ + $(src_processor_exploitability_unittest_SOURCES) \ + $(src_processor_fast_source_line_resolver_unittest_SOURCES) \ + $(src_processor_map_serializers_unittest_SOURCES) \ + $(src_processor_microdump_processor_unittest_SOURCES) \ + $(src_processor_microdump_stackwalk_SOURCES) \ + $(src_processor_minidump_dump_SOURCES) \ + $(src_processor_minidump_processor_unittest_SOURCES) \ + $(src_processor_minidump_stackwalk_SOURCES) \ + $(src_processor_minidump_unittest_SOURCES) \ + $(src_processor_pathname_stripper_unittest_SOURCES) \ + $(src_processor_postfix_evaluator_unittest_SOURCES) \ + $(src_processor_proc_maps_linux_unittest_SOURCES) \ + $(src_processor_range_map_truncate_lower_unittest_SOURCES) \ + $(src_processor_range_map_truncate_upper_unittest_SOURCES) \ + $(src_processor_range_map_unittest_SOURCES) \ + $(src_processor_stackwalker_address_list_unittest_SOURCES) \ + $(src_processor_stackwalker_amd64_unittest_SOURCES) \ + $(src_processor_stackwalker_arm64_unittest_SOURCES) \ + $(src_processor_stackwalker_arm_unittest_SOURCES) \ + $(src_processor_stackwalker_mips64_unittest_SOURCES) \ + $(src_processor_stackwalker_mips_unittest_SOURCES) \ + $(src_processor_stackwalker_riscv64_unittest_SOURCES) \ + $(src_processor_stackwalker_riscv_unittest_SOURCES) \ + $(src_processor_stackwalker_selftest_SOURCES) \ + $(src_processor_stackwalker_x86_unittest_SOURCES) \ + $(src_processor_static_address_map_unittest_SOURCES) \ + $(src_processor_static_contained_range_map_unittest_SOURCES) \ + $(src_processor_static_map_unittest_SOURCES) \ + $(src_processor_static_range_map_unittest_SOURCES) \ + $(src_processor_synth_minidump_unittest_SOURCES) \ + $(src_tools_linux_core2md_core2md_SOURCES) \ + $(src_tools_linux_core_handler_core_handler_SOURCES) \ + $(src_tools_linux_dump_syms_dump_syms_SOURCES) \ + $(src_tools_linux_md2core_minidump_2_core_SOURCES) \ + $(src_tools_linux_md2core_minidump_2_core_unittest_SOURCES) \ + $(src_tools_linux_pid2md_pid2md_SOURCES) \ + $(src_tools_linux_symupload_minidump_upload_SOURCES) \ + $(src_tools_linux_symupload_sym_upload_SOURCES) \ + $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -2534,1275 +2091,1279 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -# This allows #includes to be relative to src/ -AM_CPPFLAGS = -I$(top_srcdir)/src -AM_CFLAGS = $(am__append_2) -AM_CXXFLAGS = $(am__append_1) $(WARN_CXXFLAGS) $(am__append_3) +# This allows #includes to be relative to src/ +AM_CPPFLAGS = -I$(top_srcdir)/src +AM_CFLAGS = $(am__append_2) +AM_CXXFLAGS = $(am__append_1) $(WARN_CXXFLAGS) $(am__append_3) + +# Specify include paths for ac macros +ACLOCAL_AMFLAGS = -I m4 + +# License file is called LICENSE not COPYING +AUTOMAKE_OPTIONS = foreign +dist_doc_DATA = \ + AUTHORS \ + ChangeLog \ + INSTALL \ + LICENSE \ + NEWS \ + README.md + +@LINUX_HOST_TRUE@includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler +@LINUX_HOST_TRUE@includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h +@LINUX_HOST_TRUE@includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common +@LINUX_HOST_TRUE@includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h +@LINUX_HOST_TRUE@includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer +@LINUX_HOST_TRUE@includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h +@LINUX_HOST_TRUE@includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation +@LINUX_HOST_TRUE@includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h +@LINUX_HOST_TRUE@includelssdir = $(includedir)/$(PACKAGE)/third_party/lss +@LINUX_HOST_TRUE@includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h +@LINUX_HOST_TRUE@includecldir = $(includedir)/$(PACKAGE)/common/linux +@LINUX_HOST_TRUE@includecl_HEADERS = $(top_srcdir)/src/common/linux/*.h +includegbcdir = $(includedir)/$(PACKAGE)/google_breakpad/common +includegbc_HEADERS = $(top_srcdir)/src/google_breakpad/common/*.h +includecdir = $(includedir)/$(PACKAGE)/common +includec_HEADERS = $(top_srcdir)/src/common/*.h +includepdir = $(includedir)/$(PACKAGE)/processor +includep_HEADERS = $(top_srcdir)/src/processor/*.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = $(am__append_6) $(am__append_12) +@SYSTEM_TEST_LIBS_FALSE@TEST_CFLAGS = \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/include \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest/include \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock/include \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock \ +@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing + +@SYSTEM_TEST_LIBS_TRUE@TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) +@SYSTEM_TEST_LIBS_FALSE@TEST_LIBS = src/testing/libtesting.a +@SYSTEM_TEST_LIBS_TRUE@TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS) +@SYSTEM_TEST_LIBS_FALSE@TEST_DEPS = $(TEST_LIBS) +@SYSTEM_TEST_LIBS_TRUE@TEST_DEPS = +@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_FALSE@LOG_DRIVER = $(top_srcdir)/autotools/test-driver +@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_TRUE@LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver + +# Since Autotools 1.2, tests are run through a special "test driver" script. +# Unfortunately, it's not possible anymore to specify an alternative shell to +# run them on connected devices, so use a slightly modified version of the +# driver for Android. +@ANDROID_HOST_TRUE@LOG_DRIVER = $(top_srcdir)/android/test-driver +check_LIBRARIES = $(am__append_4) +noinst_LIBRARIES = $(am__append_7) +lib_LIBRARIES = $(am__append_5) $(am__append_11) +noinst_SCRIPTS = $(check_SCRIPTS) +CLEANFILES = $(am__append_15) +src_testing_libtesting_a_SOURCES = \ + src/breakpad_googletest_includes.h \ + src/testing/googletest/src/gtest-all.cc \ + src/testing/googletest/src/gtest_main.cc \ + src/testing/googlemock/src/gmock-all.cc + +src_testing_libtesting_a_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +@DISABLE_PROCESSOR_FALSE@check_SCRIPTS = \ +@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_test \ +@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_machine_readable_test \ +@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump_test \ +@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_test \ +@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_machine_readable_test + +TESTS = $(check_PROGRAMS) $(check_SCRIPTS) + +# All targets that were defined above should now be +# declared below. This should be done unconditionally +# so DO NOT wrap them in conditions! +# Execept for conditionally adding a specific file or +# flag that should only be added for a specific arch, +# system, etc. +src_common_safe_math_unittest_SOURCES = \ + src/common/safe_math.h \ + src/common/safe_math_unittest.cc + +src_common_safe_math_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_safe_math_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + + +# Breakpad processor library +src_libbreakpad_a_SOURCES = \ + src/google_breakpad/common/breakpad_types.h \ + src/google_breakpad/common/minidump_format.h \ + src/google_breakpad/common/minidump_size.h \ + src/google_breakpad/processor/basic_source_line_resolver.h \ + src/google_breakpad/processor/call_stack.h \ + src/google_breakpad/processor/code_module.h \ + src/google_breakpad/processor/code_modules.h \ + src/google_breakpad/processor/dump_context.h \ + src/google_breakpad/processor/dump_object.h \ + src/google_breakpad/processor/exploitability.h \ + src/google_breakpad/processor/fast_source_line_resolver.h \ + src/google_breakpad/processor/memory_region.h \ + src/google_breakpad/processor/microdump.h \ + src/google_breakpad/processor/microdump_processor.h \ + src/google_breakpad/processor/minidump.h \ + src/google_breakpad/processor/minidump_processor.h \ + src/google_breakpad/processor/process_result.h \ + src/google_breakpad/processor/process_state.h \ + src/google_breakpad/processor/proc_maps_linux.h \ + src/google_breakpad/processor/source_line_resolver_base.h \ + src/google_breakpad/processor/source_line_resolver_interface.h \ + src/google_breakpad/processor/stack_frame.h \ + src/google_breakpad/processor/stack_frame_cpu.h \ + src/google_breakpad/processor/stack_frame_symbolizer.h \ + src/google_breakpad/processor/stackwalker.h \ + src/google_breakpad/processor/symbol_supplier.h \ + src/google_breakpad/processor/system_info.h \ + src/processor/address_map-inl.h \ + src/processor/address_map.h \ + src/processor/basic_code_module.h \ + src/processor/basic_code_modules.cc \ + src/processor/basic_code_modules.h \ + src/processor/basic_source_line_resolver_types.h \ + src/processor/basic_source_line_resolver.cc \ + src/processor/call_stack.cc \ + src/processor/cfi_frame_info.cc \ + src/processor/cfi_frame_info.h \ + src/processor/contained_range_map-inl.h \ + src/processor/contained_range_map.h \ + src/processor/convert_old_arm64_context.cc \ + src/processor/convert_old_arm64_context.h \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc \ + src/processor/disassembler_x86.h \ + src/processor/disassembler_x86.cc \ + src/processor/dump_context.cc \ + src/processor/dump_object.cc \ + src/processor/exploitability.cc \ + src/processor/exploitability_linux.h \ + src/processor/exploitability_linux.cc \ + src/processor/exploitability_win.h \ + src/processor/exploitability_win.cc \ + src/processor/fast_source_line_resolver_types.h \ + src/processor/fast_source_line_resolver.cc \ + src/processor/linked_ptr.h \ + src/processor/logging.h \ + src/processor/logging.cc \ + src/processor/map_serializers-inl.h \ + src/processor/map_serializers.h \ + src/processor/microdump.cc \ + src/processor/microdump_processor.cc \ + src/processor/minidump.cc \ + src/processor/minidump_processor.cc \ + src/processor/module_comparer.cc \ + src/processor/module_comparer.h \ + src/processor/module_factory.h \ + src/processor/module_serializer.cc \ + src/processor/module_serializer.h \ + src/processor/pathname_stripper.cc \ + src/processor/pathname_stripper.h \ + src/processor/postfix_evaluator-inl.h \ + src/processor/postfix_evaluator.h \ + src/processor/process_state.cc \ + src/processor/proc_maps_linux.cc \ + src/processor/range_map-inl.h \ + src/processor/range_map.h \ + src/processor/simple_serializer-inl.h \ + src/processor/simple_serializer.h \ + src/processor/simple_symbol_supplier.cc \ + src/processor/simple_symbol_supplier.h \ + src/processor/windows_frame_info.h \ + src/processor/source_line_resolver_base_types.h \ + src/processor/source_line_resolver_base.cc \ + src/processor/stack_frame_cpu.cc \ + src/processor/stack_frame_symbolizer.cc \ + src/processor/stackwalk_common.cc \ + src/processor/stackwalk_common.h \ + src/processor/stackwalker.cc \ + src/processor/stackwalker_amd64.cc \ + src/processor/stackwalker_amd64.h \ + src/processor/stackwalker_arm.cc \ + src/processor/stackwalker_arm.h \ + src/processor/stackwalker_arm64.cc \ + src/processor/stackwalker_arm64.h \ + src/processor/stackwalker_address_list.cc \ + src/processor/stackwalker_address_list.h \ + src/processor/stackwalker_mips.cc \ + src/processor/stackwalker_mips.h \ + src/processor/stackwalker_ppc.cc \ + src/processor/stackwalker_ppc.h \ + src/processor/stackwalker_ppc64.cc \ + src/processor/stackwalker_ppc64.h \ + src/processor/stackwalker_riscv.cc \ + src/processor/stackwalker_riscv.h \ + src/processor/stackwalker_riscv64.cc \ + src/processor/stackwalker_riscv64.h \ + src/processor/stackwalker_sparc.cc \ + src/processor/stackwalker_sparc.h \ + src/processor/stackwalker_x86.cc \ + src/processor/stackwalker_x86.h \ + src/processor/static_address_map-inl.h \ + src/processor/static_address_map.h \ + src/processor/static_contained_range_map-inl.h \ + src/processor/static_contained_range_map.h \ + src/processor/static_map_iterator-inl.h \ + src/processor/static_map_iterator.h \ + src/processor/static_map-inl.h \ + src/processor/static_map.h \ + src/processor/static_range_map-inl.h \ + src/processor/static_range_map.h \ + src/processor/symbolic_constants_win.cc \ + src/processor/symbolic_constants_win.h \ + src/processor/tokenize.cc \ + src/processor/tokenize.h + + +# libdisasm 3rd party library +src_third_party_libdisasm_libdisasm_a_SOURCES = \ + src/third_party/libdisasm/ia32_implicit.c \ + src/third_party/libdisasm/ia32_implicit.h \ + src/third_party/libdisasm/ia32_insn.c \ + src/third_party/libdisasm/ia32_insn.h \ + src/third_party/libdisasm/ia32_invariant.c \ + src/third_party/libdisasm/ia32_invariant.h \ + src/third_party/libdisasm/ia32_modrm.c \ + src/third_party/libdisasm/ia32_modrm.h \ + src/third_party/libdisasm/ia32_opcode_tables.c \ + src/third_party/libdisasm/ia32_opcode_tables.h \ + src/third_party/libdisasm/ia32_operand.c \ + src/third_party/libdisasm/ia32_operand.h \ + src/third_party/libdisasm/ia32_reg.c \ + src/third_party/libdisasm/ia32_reg.h \ + src/third_party/libdisasm/ia32_settings.c \ + src/third_party/libdisasm/ia32_settings.h \ + src/third_party/libdisasm/libdis.h \ + src/third_party/libdisasm/qword.h \ + src/third_party/libdisasm/x86_disasm.c \ + src/third_party/libdisasm/x86_format.c \ + src/third_party/libdisasm/x86_imm.c \ + src/third_party/libdisasm/x86_imm.h \ + src/third_party/libdisasm/x86_insn.c \ + src/third_party/libdisasm/x86_misc.c \ + src/third_party/libdisasm/x86_operand_list.c \ + src/third_party/libdisasm/x86_operand_list.h + + +# Breakpad client +src_client_linux_libbreakpad_client_a_SOURCES = \ + src/client/linux/crash_generation/crash_generation_client.cc \ + src/client/linux/crash_generation/crash_generation_server.cc \ + src/client/linux/dump_writer_common/thread_info.cc \ + src/client/linux/dump_writer_common/ucontext_reader.cc \ + src/client/linux/handler/exception_handler.cc \ + src/client/linux/handler/exception_handler.h \ + src/client/linux/handler/minidump_descriptor.cc \ + src/client/linux/handler/minidump_descriptor.h \ + src/client/linux/log/log.cc src/client/linux/log/log.h \ + src/client/linux/microdump_writer/microdump_writer.cc \ + src/client/linux/microdump_writer/microdump_writer.h \ + src/client/linux/minidump_writer/linux_core_dumper.cc \ + src/client/linux/minidump_writer/linux_dumper.cc \ + src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ + src/client/linux/minidump_writer/minidump_writer.cc \ + src/client/linux/minidump_writer/pe_file.cc \ + src/client/minidump_file_writer-inl.h \ + src/client/minidump_file_writer.cc \ + src/client/minidump_file_writer.h src/common/convert_UTF.cc \ + src/common/convert_UTF.h src/common/md5.cc src/common/md5.h \ + src/common/string_conversion.cc src/common/string_conversion.h \ + src/common/linux/elf_core_dump.cc src/common/linux/elfutils.cc \ + src/common/linux/elfutils.h src/common/linux/file_id.cc \ + src/common/linux/file_id.h src/common/linux/guid_creator.cc \ + src/common/linux/guid_creator.h \ + src/common/linux/linux_libc_support.cc \ + src/common/linux/memory_mapped_file.cc \ + src/common/linux/safe_readlink.cc $(am__append_21) + +# Client tests +src_client_linux_linux_dumper_unittest_helper_SOURCES = \ + src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc + +src_client_linux_linux_dumper_unittest_helper_LDFLAGS = $(PTHREAD_CFLAGS) +src_client_linux_linux_dumper_unittest_helper_CC = $(PTHREAD_CC) +@ANDROID_HOST_FALSE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(PTHREAD_CFLAGS) +# On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include +# to the include path is necessary to build this program. +@ANDROID_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(AM_CXXFLAGS) +src_client_linux_linux_client_unittest_shlib_SOURCES = \ + $(src_testing_libtesting_a_SOURCES) \ + src/client/linux/handler/exception_handler_unittest.cc \ + src/client/linux/microdump_writer/microdump_writer_unittest.cc \ + src/client/linux/minidump_writer/directory_reader_unittest.cc \ + src/client/linux/minidump_writer/cpu_set_unittest.cc \ + src/client/linux/minidump_writer/line_reader_unittest.cc \ + src/client/linux/minidump_writer/linux_core_dumper.cc \ + src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \ + src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ + src/client/linux/minidump_writer/minidump_writer_unittest.cc \ + src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ + src/client/linux/minidump_writer/pe_file.cc \ + src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ + src/common/linux/elf_core_dump.cc \ + src/common/linux/linux_libc_support_unittest.cc \ + src/common/linux/tests/auto_testfile.h \ + src/common/linux/tests/crash_generator.cc \ + src/common/memory_allocator_unittest.cc \ + src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \ + src/common/tests/file_utils.h \ + src/processor/basic_code_modules.cc \ + src/processor/convert_old_arm64_context.cc \ + src/processor/dump_context.cc src/processor/dump_object.cc \ + src/processor/logging.cc src/processor/minidump.cc \ + src/processor/pathname_stripper.cc \ + src/processor/proc_maps_linux.cc $(am__append_22) +src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_client_linux_linux_client_unittest_shlib_LDFLAGS = -shared \ + -Wl,-h,linux_client_unittest_shlib $(am__append_23) +src_client_linux_linux_client_unittest_shlib_LDADD = \ + src/client/linux/crash_generation/crash_generation_client.o \ + src/client/linux/dump_writer_common/thread_info.o \ + src/client/linux/dump_writer_common/ucontext_reader.o \ + src/client/linux/handler/exception_handler.o \ + src/client/linux/handler/minidump_descriptor.o \ + src/client/linux/log/log.o \ + src/client/linux/microdump_writer/microdump_writer.o \ + src/client/linux/minidump_writer/linux_dumper.o \ + src/client/linux/minidump_writer/linux_ptrace_dumper.o \ + src/client/linux/minidump_writer/minidump_writer.o \ + src/client/minidump_file_writer.o \ + src/common/convert_UTF.o \ + src/common/md5.o \ + src/common/linux/elfutils.o \ + src/common/linux/file_id.o \ + src/common/linux/guid_creator.o \ + src/common/linux/linux_libc_support.o \ + src/common/linux/memory_mapped_file.o \ + src/common/linux/safe_readlink.o \ + src/common/string_conversion.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \ + src/client/linux/linux_dumper_unittest_helper \ + src/client/linux/libbreakpad_client.a \ + $(TEST_DEPS) \ + src/libbreakpad.a + +src_client_linux_linux_client_unittest_SOURCES = +# The extra-long build id is for a test in minidump_writer_unittest.cc. +src_client_linux_linux_client_unittest_LDFLAGS = \ + -Wl,-rpath,'$$ORIGIN' \ + -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \ + $(am__append_24) +src_client_linux_linux_client_unittest_LDADD = \ + src/client/linux/linux_client_unittest_shlib \ + $(TEST_LIBS) + +src_client_linux_linux_client_unittest_DEPENDENCIES = \ + src/client/linux/linux_client_unittest_shlib + + +# Tools +src_tools_linux_core2md_core2md_SOURCES = \ + src/tools/linux/core2md/core2md.cc + +src_tools_linux_core2md_core2md_LDADD = \ + src/client/linux/libbreakpad_client.a \ + src/common/path_helper.o + +src_tools_linux_core_handler_core_handler_SOURCES = \ + src/tools/linux/core_handler/core_handler.cc + +src_tools_linux_core_handler_core_handler_LDADD = \ + src/client/linux/libbreakpad_client.a \ + src/common/path_helper.o + +src_tools_linux_pid2md_pid2md_SOURCES = \ + src/tools/linux/pid2md/pid2md.cc + +src_tools_linux_pid2md_pid2md_LDADD = \ + src/client/linux/libbreakpad_client.a \ + src/common/path_helper.o + +src_tools_linux_dump_syms_dump_syms_SOURCES = \ + src/common/dwarf_cfi_to_module.cc \ + src/common/dwarf_cu_to_module.cc \ + src/common/dwarf_line_to_module.cc \ + src/common/dwarf_range_list_handler.cc \ + src/common/language.cc \ + src/common/module.cc \ + src/common/path_helper.cc \ + src/common/stabs_reader.cc \ + src/common/stabs_to_module.cc \ + src/common/dwarf/bytereader.cc \ + src/common/dwarf/dwarf2diehandler.cc \ + src/common/dwarf/dwarf2reader.cc \ + src/common/dwarf/elf_reader.cc \ + src/common/linux/crc32.cc \ + src/common/linux/dump_symbols.cc \ + src/common/linux/dump_symbols.h \ + src/common/linux/elf_symbols_to_module.cc \ + src/common/linux/elf_symbols_to_module.h \ + src/common/linux/elfutils.cc \ + src/common/linux/file_id.cc \ + src/common/linux/linux_libc_support.cc \ + src/common/linux/memory_mapped_file.cc \ + src/common/linux/safe_readlink.cc \ + src/tools/linux/dump_syms/dump_syms.cc + +src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \ + $(RUSTC_DEMANGLE_CFLAGS) + +src_tools_linux_dump_syms_dump_syms_LDADD = \ + $(RUSTC_DEMANGLE_LIBS) \ + -lz + +src_tools_linux_md2core_minidump_2_core_SOURCES = \ + src/common/linux/memory_mapped_file.cc \ + src/common/path_helper.cc \ + src/tools/linux/md2core/minidump-2-core.cc \ + src/tools/linux/md2core/minidump_memory_range.h + +src_tools_linux_symupload_minidump_upload_SOURCES = \ + src/common/linux/http_upload.cc \ + src/common/path_helper.cc \ + src/tools/linux/symupload/minidump_upload.cc + +src_tools_linux_symupload_minidump_upload_LDADD = -ldl +src_tools_linux_symupload_sym_upload_SOURCES = \ + src/common/linux/http_upload.cc \ + src/common/linux/http_upload.h \ + src/common/linux/libcurl_wrapper.cc \ + src/common/linux/libcurl_wrapper.h \ + src/common/linux/symbol_collector_client.cc \ + src/common/linux/symbol_collector_client.h \ + src/common/linux/symbol_upload.cc \ + src/common/linux/symbol_upload.h \ + src/common/path_helper.cc \ + src/tools/linux/symupload/sym_upload.cc + +src_tools_linux_symupload_sym_upload_LDADD = -ldl +src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \ + src/common/dwarf_cfi_to_module.cc \ + src/common/dwarf_cu_to_module.cc \ + src/common/dwarf_line_to_module.cc \ + src/common/dwarf_range_list_handler.cc \ + src/common/language.cc \ + src/common/md5.cc \ + src/common/module.cc \ + src/common/path_helper.cc \ + src/common/stabs_reader.cc \ + src/common/stabs_to_module.cc \ + src/common/dwarf/bytereader.cc \ + src/common/dwarf/dwarf2diehandler.cc \ + src/common/dwarf/dwarf2reader.cc \ + src/common/dwarf/elf_reader.cc \ + src/common/mac/arch_utilities.cc \ + src/common/mac/dump_syms.cc \ + src/common/mac/dump_syms.h \ + src/common/mac/file_id.cc \ + src/common/mac/file_id.h \ + src/common/mac/macho_id.cc \ + src/common/mac/macho_id.h \ + src/common/mac/macho_reader.cc \ + src/common/mac/macho_reader.h \ + src/common/mac/macho_utilities.cc \ + src/common/mac/macho_utilities.h \ + src/common/mac/macho_walker.cc \ + src/common/mac/macho_walker.h \ + src/tools/mac/dump_syms/dump_syms_tool.cc + +src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS = \ + -I$(top_srcdir)/src/third_party/mac_headers \ + $(RUSTC_DEMANGLE_CFLAGS) \ + -DHAVE_MACH_O_NLIST_H + +src_tools_mac_dump_syms_dump_syms_mac_LDADD = \ + $(RUSTC_DEMANGLE_LIBS) + +src_common_dumper_unittest_SOURCES = \ + src/common/byte_cursor_unittest.cc \ + src/common/convert_UTF.cc \ + src/common/dwarf_cfi_to_module.cc \ + src/common/dwarf_cfi_to_module_unittest.cc \ + src/common/dwarf_cu_to_module.cc \ + src/common/dwarf_cu_to_module_unittest.cc \ + src/common/dwarf_line_to_module.cc \ + src/common/dwarf_line_to_module_unittest.cc \ + src/common/dwarf_range_list_handler.cc \ + src/common/language.cc \ + src/common/memory_range_unittest.cc \ + src/common/module.cc \ + src/common/module_unittest.cc \ + src/common/path_helper.cc \ + src/common/stabs_reader.cc \ + src/common/stabs_reader_unittest.cc \ + src/common/stabs_to_module.cc \ + src/common/stabs_to_module_unittest.cc \ + src/common/string_conversion.cc \ + src/common/string_conversion_unittest.cc \ + src/common/test_assembler.cc \ + src/common/dwarf/bytereader.cc \ + src/common/dwarf/bytereader.h \ + src/common/dwarf/bytereader-inl.h \ + src/common/dwarf/bytereader_unittest.cc \ + src/common/dwarf/cfi_assembler.cc \ + src/common/dwarf/cfi_assembler.h \ + src/common/dwarf/dwarf2diehandler.cc \ + src/common/dwarf/dwarf2diehandler_unittest.cc \ + src/common/dwarf/dwarf2reader.cc \ + src/common/dwarf/dwarf2reader.h \ + src/common/dwarf/elf_reader.cc \ + src/common/dwarf/elf_reader.h \ + src/common/dwarf/dwarf2reader_cfi_unittest.cc \ + src/common/dwarf/dwarf2reader_die_unittest.cc \ + src/common/dwarf/dwarf2reader_test_common.h \ + src/common/linux/crc32.cc \ + src/common/linux/dump_symbols.cc \ + src/common/linux/dump_symbols_unittest.cc \ + src/common/linux/elf_core_dump.cc \ + src/common/linux/elf_core_dump_unittest.cc \ + src/common/linux/elf_symbols_to_module.cc \ + src/common/linux/elf_symbols_to_module_unittest.cc \ + src/common/linux/elfutils.cc \ + src/common/linux/file_id.cc \ + src/common/linux/file_id_unittest.cc \ + src/common/linux/linux_libc_support.cc \ + src/common/linux/memory_mapped_file.cc \ + src/common/linux/memory_mapped_file_unittest.cc \ + src/common/linux/safe_readlink.cc \ + src/common/linux/safe_readlink_unittest.cc \ + src/common/linux/synth_elf.cc \ + src/common/linux/synth_elf_unittest.cc \ + src/common/linux/tests/crash_generator.cc \ + src/common/linux/tests/crash_generator.h \ + src/common/testdata/func-line-pairing.h \ + src/common/tests/file_utils.cc + +src_common_dumper_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) \ + $(RUSTC_DEMANGLE_CFLAGS) \ + $(PTHREAD_CFLAGS) -# Specify include paths for ac macros -ACLOCAL_AMFLAGS = -I m4 +src_common_dumper_unittest_LDADD = \ + $(TEST_LIBS) \ + $(RUSTC_DEMANGLE_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + -lz -# License file is called LICENSE not COPYING -AUTOMAKE_OPTIONS = foreign -dist_doc_DATA = \ - AUTHORS \ - ChangeLog \ - INSTALL \ - LICENSE \ - NEWS \ - README.md +src_common_mac_macho_reader_unittest_SOURCES = \ + src/common/dwarf_cfi_to_module.cc \ + src/common/dwarf_cu_to_module.cc \ + src/common/dwarf_line_to_module.cc \ + src/common/language.cc \ + src/common/md5.cc \ + src/common/module.cc \ + src/common/path_helper.cc \ + src/common/stabs_reader.cc \ + src/common/stabs_to_module.cc \ + src/common/test_assembler.cc \ + src/common/dwarf/bytereader.cc \ + src/common/dwarf/cfi_assembler.cc \ + src/common/dwarf/dwarf2diehandler.cc \ + src/common/dwarf/dwarf2reader.cc \ + src/common/dwarf/elf_reader.cc \ + src/common/mac/arch_utilities.cc \ + src/common/mac/file_id.cc \ + src/common/mac/macho_id.cc \ + src/common/mac/macho_reader.cc \ + src/common/mac/macho_reader_unittest.cc \ + src/common/mac/macho_utilities.cc \ + src/common/mac/macho_walker.cc \ + src/common/tests/file_utils.cc -@LINUX_HOST_TRUE@includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler -@LINUX_HOST_TRUE@includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h -@LINUX_HOST_TRUE@includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common -@LINUX_HOST_TRUE@includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h -@LINUX_HOST_TRUE@includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer -@LINUX_HOST_TRUE@includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h -@LINUX_HOST_TRUE@includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation -@LINUX_HOST_TRUE@includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h -@LINUX_HOST_TRUE@includelssdir = $(includedir)/$(PACKAGE)/third_party/lss -@LINUX_HOST_TRUE@includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h -@LINUX_HOST_TRUE@includecldir = $(includedir)/$(PACKAGE)/common/linux -@LINUX_HOST_TRUE@includecl_HEADERS = $(top_srcdir)/src/common/linux/*.h -includegbcdir = $(includedir)/$(PACKAGE)/google_breakpad/common -includegbc_HEADERS = $(top_srcdir)/src/google_breakpad/common/*.h -includecdir = $(includedir)/$(PACKAGE)/common -includec_HEADERS = $(top_srcdir)/src/common/*.h -includepdir = $(includedir)/$(PACKAGE)/processor -includep_HEADERS = $(top_srcdir)/src/processor/*.h -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = $(am__append_5) $(am__append_8) -@SYSTEM_TEST_LIBS_FALSE@TEST_CFLAGS = \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/include \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest/include \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock/include \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock \ -@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing +src_common_mac_macho_reader_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) \ + -I$(top_srcdir)/src/third_party/mac_headers \ + -DHAVE_MACH_O_NLIST_H \ + $(PTHREAD_CFLAGS) -@SYSTEM_TEST_LIBS_TRUE@TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) -@SYSTEM_TEST_LIBS_FALSE@TEST_LIBS = src/testing/libtesting.a -@SYSTEM_TEST_LIBS_TRUE@TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS) -@SYSTEM_TEST_LIBS_FALSE@TEST_DEPS = $(TEST_LIBS) -@SYSTEM_TEST_LIBS_TRUE@TEST_DEPS = -check_LIBRARIES = src/testing/libtesting.a -noinst_LIBRARIES = $(am__append_6) -lib_LIBRARIES = $(am__append_4) $(am__append_7) -CLEANFILES = $(am__append_12) -@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \ -@SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest-all.cc \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest_main.cc \ -@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/gmock-all.cc - -@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_CPPFLAGS = \ -@SYSTEM_TEST_LIBS_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@LINUX_HOST_TRUE@src_client_linux_libbreakpad_client_a_SOURCES = src/client/linux/crash_generation/crash_generation_client.cc \ -@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.cc \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.cc \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.cc \ -@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.cc \ -@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.h \ -@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.cc \ -@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.h \ -@LINUX_HOST_TRUE@ src/client/linux/log/log.cc \ -@LINUX_HOST_TRUE@ src/client/linux/log/log.h \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.cc \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.h \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ -@LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \ -@LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \ -@LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \ -@LINUX_HOST_TRUE@ src/common/convert_UTF.cc \ -@LINUX_HOST_TRUE@ src/common/convert_UTF.h src/common/md5.cc \ -@LINUX_HOST_TRUE@ src/common/md5.h \ -@LINUX_HOST_TRUE@ src/common/string_conversion.cc \ -@LINUX_HOST_TRUE@ src/common/string_conversion.h \ -@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ -@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \ -@LINUX_HOST_TRUE@ src/common/linux/elfutils.h \ -@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \ -@LINUX_HOST_TRUE@ src/common/linux/file_id.h \ -@LINUX_HOST_TRUE@ src/common/linux/guid_creator.cc \ -@LINUX_HOST_TRUE@ src/common/linux/guid_creator.h \ -@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \ -@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ -@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \ -@LINUX_HOST_TRUE@ $(am__append_9) -@DISABLE_PROCESSOR_FALSE@src_libbreakpad_a_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/breakpad_types.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/minidump_format.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/minidump_size.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/basic_source_line_resolver.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/call_stack.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/code_module.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/code_modules.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/dump_context.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/dump_object.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/exploitability.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/fast_source_line_resolver.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/memory_region.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/microdump.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/microdump_processor.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/minidump.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/minidump_processor.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_result.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_state.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/proc_maps_linux.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_base.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_interface.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame_cpu.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame_symbolizer.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stackwalker.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/symbol_supplier.h \ -@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/system_info.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/address_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/address_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_module.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_types.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_types.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/linked_ptr.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_factory.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/range_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/range_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_serializer-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_serializer.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/windows_frame_info.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base_types.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_iterator-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_iterator.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map-inl.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.h - -@DISABLE_PROCESSOR_FALSE@src_third_party_libdisasm_libdisasm_a_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdis.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/qword.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_disasm.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_format.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.h \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_insn.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_misc.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.c \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.h +src_common_mac_macho_reader_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -@DISABLE_PROCESSOR_FALSE@check_SCRIPTS = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_test \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_machine_readable_test \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump_test \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_test \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_machine_readable_test +src_common_linux_google_crashdump_uploader_test_SOURCES = \ + src/common/linux/google_crashdump_uploader.cc \ + src/common/linux/google_crashdump_uploader_test.cc \ + src/common/linux/libcurl_wrapper.cc -TESTS = $(check_PROGRAMS) $(check_SCRIPTS) -@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_FALSE@LOG_DRIVER = $(top_srcdir)/autotools/test-driver -# The default Autotools test driver script. -@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_TRUE@LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver +src_common_linux_google_crashdump_uploader_test_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) -# Since Autotools 1.2, tests are run through a special "test driver" script. -# Unfortunately, it's not possible anymore to specify an alternative shell to -# run them on connected devices, so use a slightly modified version of the -# driver for Android. -@ANDROID_HOST_TRUE@LOG_DRIVER = $(top_srcdir)/android/test-driver -@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_SOURCES = \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +src_common_linux_google_crashdump_uploader_test_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + -ldl -@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_LDFLAGS = $(PTHREAD_CFLAGS) -@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CC = $(PTHREAD_CC) -@ANDROID_HOST_FALSE@@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(PTHREAD_CFLAGS) -# On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include -# to the include path is necessary to build this program. -@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(AM_CXXFLAGS) -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_SOURCES = \ -@LINUX_HOST_TRUE@ $(src_testing_libtesting_a_SOURCES) \ -@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/directory_reader_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/cpu_set_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/line_reader_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/pe_file.cc \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ -@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ -@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \ -@LINUX_HOST_TRUE@ src/common/linux/tests/auto_testfile.h \ -@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \ -@LINUX_HOST_TRUE@ src/common/memory_allocator_unittest.cc \ -@LINUX_HOST_TRUE@ src/common/tests/auto_tempdir.h \ -@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc \ -@LINUX_HOST_TRUE@ src/common/tests/file_utils.h \ -@LINUX_HOST_TRUE@ src/processor/basic_code_modules.cc \ -@LINUX_HOST_TRUE@ src/processor/convert_old_arm64_context.cc \ -@LINUX_HOST_TRUE@ src/processor/dump_context.cc \ -@LINUX_HOST_TRUE@ src/processor/dump_object.cc \ -@LINUX_HOST_TRUE@ src/processor/logging.cc \ -@LINUX_HOST_TRUE@ src/processor/minidump.cc \ -@LINUX_HOST_TRUE@ src/processor/pathname_stripper.cc \ -@LINUX_HOST_TRUE@ src/processor/proc_maps_linux.cc \ -@LINUX_HOST_TRUE@ $(am__append_21) -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \ -@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDFLAGS = \ -@LINUX_HOST_TRUE@ -shared -Wl,-h,linux_client_unittest_shlib \ -@LINUX_HOST_TRUE@ $(am__append_22) -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDADD = \ -@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_client.o \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.o \ -@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.o \ -@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.o \ -@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.o \ -@LINUX_HOST_TRUE@ src/client/linux/log/log.o \ -@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.o \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.o \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.o \ -@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.o \ -@LINUX_HOST_TRUE@ src/client/minidump_file_writer.o \ -@LINUX_HOST_TRUE@ src/common/convert_UTF.o \ -@LINUX_HOST_TRUE@ src/common/md5.o \ -@LINUX_HOST_TRUE@ src/common/linux/elfutils.o \ -@LINUX_HOST_TRUE@ src/common/linux/file_id.o \ -@LINUX_HOST_TRUE@ src/common/linux/guid_creator.o \ -@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.o \ -@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.o \ -@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.o \ -@LINUX_HOST_TRUE@ src/common/string_conversion.o \ -@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \ -@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ -@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \ -@LINUX_HOST_TRUE@ $(TEST_DEPS) \ -@LINUX_HOST_TRUE@ src/libbreakpad.a +src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \ + src/tools/linux/md2core/minidump_memory_range_unittest.cc -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES = -# The extra-long build id is for a test in minidump_writer_unittest.cc. -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \ -@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' \ -@LINUX_HOST_TRUE@ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \ -@LINUX_HOST_TRUE@ $(am__append_23) -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDADD = \ -@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib \ -@LINUX_HOST_TRUE@ $(TEST_LIBS) - -@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_DEPENDENCIES = \ -@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib +src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_address_map_unittest_SOURCES = \ + src/processor/address_map_unittest.cc + +src_processor_address_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o + +src_processor_basic_source_line_resolver_unittest_SOURCES = \ + src/processor/basic_source_line_resolver_unittest.cc + +src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_basic_source_line_resolver_unittest_LDADD = \ + src/processor/basic_source_line_resolver.o \ + src/processor/cfi_frame_info.o \ + src/processor/pathname_stripper.o \ + src/processor/logging.o \ + src/processor/source_line_resolver_base.o \ + src/processor/tokenize.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_cfi_frame_info_unittest_SOURCES = \ + src/processor/cfi_frame_info_unittest.cc + +src_processor_cfi_frame_info_unittest_LDADD = \ + src/processor/cfi_frame_info.o \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_cfi_frame_info_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_contained_range_map_unittest_SOURCES = \ + src/processor/contained_range_map_unittest.cc + +src_processor_contained_range_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o + +src_processor_exploitability_unittest_SOURCES = \ + src/processor/exploitability_unittest.cc + +src_processor_exploitability_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_exploitability_unittest_LDADD = \ + src/processor/convert_old_arm64_context.o \ + src/processor/minidump_processor.o \ + src/processor/process_state.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/cfi_frame_info.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_disassembler_objdump_unittest_SOURCES = \ + src/processor/disassembler_objdump_unittest.cc + +src_processor_disassembler_objdump_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_disassembler_objdump_unittest_LDADD = \ + src/processor/disassembler_objdump.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_disassembler_x86_unittest_SOURCES = \ + src/processor/disassembler_x86_unittest.cc + +src_processor_disassembler_x86_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_disassembler_x86_unittest_LDADD = \ + src/processor/disassembler_x86.o \ + src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_fast_source_line_resolver_unittest_SOURCES = \ + src/processor/fast_source_line_resolver_unittest.cc + +src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_fast_source_line_resolver_unittest_LDADD = \ + src/processor/fast_source_line_resolver.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/cfi_frame_info.o \ + src/processor/module_comparer.o \ + src/processor/module_serializer.o \ + src/processor/pathname_stripper.o \ + src/processor/logging.o \ + src/processor/source_line_resolver_base.o \ + src/processor/tokenize.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_map_serializers_unittest_SOURCES = \ + src/processor/map_serializers_unittest.cc + +src_processor_map_serializers_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_map_serializers_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_microdump_processor_unittest_SOURCES = \ + src/processor/microdump_processor_unittest.cc + +src_processor_microdump_processor_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_microdump_processor_unittest_LDADD = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/cfi_frame_info.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/microdump.o \ + src/processor/microdump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/tokenize.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_minidump_processor_unittest_SOURCES = \ + src/processor/minidump_processor_unittest.cc + +src_processor_minidump_processor_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_minidump_processor_unittest_LDADD = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/cfi_frame_info.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o \ + src/processor/logging.o \ + src/processor/minidump_processor.o \ + src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/proc_maps_linux.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_minidump_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/minidump_unittest.cc \ + src/processor/synth_minidump.cc + +src_processor_minidump_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_minidump_unittest_LDADD = \ + src/processor/basic_code_modules.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_proc_maps_linux_unittest_SOURCES = \ + src/processor/proc_maps_linux.cc \ + src/processor/proc_maps_linux_unittest.cc + +src_processor_proc_maps_linux_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_proc_maps_linux_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_static_address_map_unittest_SOURCES = \ + src/processor/static_address_map_unittest.cc + +src_processor_static_address_map_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_static_address_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_static_contained_range_map_unittest_SOURCES = \ + src/processor/static_contained_range_map_unittest.cc + +src_processor_static_contained_range_map_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_static_contained_range_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_static_map_unittest_SOURCES = \ + src/processor/static_map_unittest.cc + +src_processor_static_map_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_static_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_static_range_map_unittest_SOURCES = \ + src/processor/static_range_map_unittest.cc + +src_processor_static_range_map_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_static_range_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_pathname_stripper_unittest_SOURCES = \ + src/processor/pathname_stripper_unittest.cc + +src_processor_pathname_stripper_unittest_LDADD = \ + src/processor/pathname_stripper.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_postfix_evaluator_unittest_SOURCES = \ + src/processor/postfix_evaluator_unittest.cc + +src_processor_postfix_evaluator_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_range_map_truncate_lower_unittest_SOURCES = \ + src/processor/range_map_truncate_lower_unittest.cc + +src_processor_range_map_truncate_lower_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_range_map_truncate_lower_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_range_map_truncate_upper_unittest_SOURCES = \ + src/processor/range_map_truncate_upper_unittest.cc + +src_processor_range_map_truncate_upper_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_range_map_truncate_upper_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_range_map_unittest_SOURCES = \ + src/processor/range_map_unittest.cc + +src_processor_range_map_unittest_LDADD = \ + src/processor/logging.o \ + src/processor/pathname_stripper.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_selftest_SOURCES = \ + src/processor/stackwalker_selftest.cc + +src_processor_stackwalker_selftest_LDADD = \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o \ + src/processor/logging.o \ + src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/tokenize.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_amd64_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_amd64_unittest.cc + +src_processor_stackwalker_amd64_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_amd64_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_arm_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_arm_unittest.cc + +src_processor_stackwalker_arm_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_arm_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_arm64_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_arm64_unittest.cc + +src_processor_stackwalker_arm64_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_arm64_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_address_list_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_address_list_unittest.cc + +src_processor_stackwalker_address_list_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_address_list_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_mips_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_mips_unittest.cc + +src_processor_stackwalker_mips_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_mips_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_mips64_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_mips64_unittest.cc + +src_processor_stackwalker_mips64_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_mips64_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_riscv_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv_unittest.cc + +src_processor_stackwalker_riscv_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_riscv_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_riscv64_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_riscv64_unittest.cc + +src_processor_stackwalker_riscv64_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_riscv64_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_stackwalker_x86_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/processor/stackwalker_x86_unittest.cc + +src_processor_stackwalker_x86_unittest_LDADD = \ + src/libbreakpad.a \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_stackwalker_x86_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_synth_minidump_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/common/test_assembler.h \ + src/processor/synth_minidump_unittest.cc \ + src/processor/synth_minidump.cc \ + src/processor/synth_minidump.h + +src_processor_synth_minidump_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_processor_synth_minidump_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_common_test_assembler_unittest_SOURCES = \ + src/common/test_assembler.cc \ + src/common/test_assembler.h \ + src/common/test_assembler_unittest.cc -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o - -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_SOURCES = \ -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler.cc - -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_LDADD = \ -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/common/path_helper.o - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -lz - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range.h - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_LDADD = -ldl -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_LDADD = -ldl -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_tool.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/safe_math.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/safe_math_unittest.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_CPPFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_safe_math_unittest_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/byte_cursor_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/convert_UTF.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/memory_range_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/string_conversion.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/string_conversion_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader-inl.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_cfi_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_die_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_test_common.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/testdata/func-line-pairing.h \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_CPPFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_CFLAGS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUSTC_DEMANGLE_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -lz - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_SOURCES = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_CPPFLAGS = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) - -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_LDADD = \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_SOURCES = \ -@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader.cc \ -@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test.cc \ -@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.cc - -@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_CPPFLAGS = \ -@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_LDADD = \ -@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ -@LINUX_HOST_TRUE@ -ldl - -@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \ -@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range_unittest.cc - -@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \ -@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \ -@LINUX_HOST_TRUE@ $(TEST_LIBS) \ -@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o - -@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o - -@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_objdump_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_lower_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_upper_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_selftest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_riscv64_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc \ -@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.h - -@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \ -@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.h \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader_lineinfo_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_lineinfo_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_lineinfo_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/bytereader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/elf_reader.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.h \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_splitfunctions_unittest_CPPFLAGS = \ -@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) - -@DISABLE_PROCESSOR_FALSE@src_common_dwarf_dwarf2reader_splitfunctions_unittest_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/bytereader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/dwarf2reader.o \ -@DISABLE_PROCESSOR_FALSE@ src/common/dwarf/elf_reader.o \ -@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \ -@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - -@DISABLE_PROCESSOR_FALSE@noinst_SCRIPTS = $(check_SCRIPTS) -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o - -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_SOURCES = \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk.cc - -@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_LDADD = \ -@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \ -@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \ -@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a +src_common_test_assembler_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_test_assembler_unittest_LDADD = \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES = \ + src/common/dwarf/dwarf2reader.h \ + src/common/dwarf/dwarf2reader_lineinfo_unittest.cc + +src_common_dwarf_dwarf2reader_lineinfo_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_dwarf_dwarf2reader_lineinfo_unittest_LDADD = \ + src/common/dwarf/bytereader.o \ + src/common/dwarf/dwarf2reader.o \ + src/common/dwarf/elf_reader.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES = \ + src/common/dwarf/dwarf2reader.h \ + src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc + +src_common_dwarf_dwarf2reader_splitfunctions_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_dwarf_dwarf2reader_splitfunctions_unittest_LDADD = \ + src/common/dwarf/bytereader.o \ + src/common/dwarf/dwarf2reader.o \ + src/common/dwarf/elf_reader.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_processor_minidump_dump_SOURCES = \ + src/processor/minidump_dump.cc + +src_processor_minidump_dump_LDADD = \ + src/common/path_helper.o \ + src/processor/basic_code_modules.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/minidump.o \ + src/processor/pathname_stripper.o \ + src/processor/proc_maps_linux.o + +src_processor_microdump_stackwalk_SOURCES = \ + src/processor/microdump_stackwalk.cc + +src_processor_microdump_stackwalk_LDADD = \ + src/common/path_helper.o \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/cfi_frame_info.o \ + src/processor/disassembler_x86.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/logging.o \ + src/processor/microdump.o \ + src/processor/microdump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalk_common.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a + +src_processor_minidump_stackwalk_SOURCES = \ + src/processor/minidump_stackwalk.cc + +src_processor_minidump_stackwalk_LDADD = \ + src/common/path_helper.o \ + src/processor/basic_code_modules.o \ + src/processor/basic_source_line_resolver.o \ + src/processor/call_stack.o \ + src/processor/cfi_frame_info.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/disassembler_objdump.o \ + src/processor/disassembler_x86.o \ + src/processor/dump_context.o \ + src/processor/dump_object.o \ + src/processor/exploitability.o \ + src/processor/exploitability_linux.o \ + src/processor/exploitability_win.o \ + src/processor/logging.o \ + src/processor/minidump.o \ + src/processor/minidump_processor.o \ + src/processor/pathname_stripper.o \ + src/processor/process_state.o \ + src/processor/proc_maps_linux.o \ + src/processor/simple_symbol_supplier.o \ + src/processor/source_line_resolver_base.o \ + src/processor/stack_frame_cpu.o \ + src/processor/stack_frame_symbolizer.o \ + src/processor/stackwalk_common.o \ + src/processor/stackwalker.o \ + src/processor/stackwalker_address_list.o \ + src/processor/stackwalker_amd64.o \ + src/processor/stackwalker_arm.o \ + src/processor/stackwalker_arm64.o \ + src/processor/stackwalker_mips.o \ + src/processor/stackwalker_ppc.o \ + src/processor/stackwalker_ppc64.o \ + src/processor/stackwalker_riscv.o \ + src/processor/stackwalker_riscv64.o \ + src/processor/stackwalker_sparc.o \ + src/processor/stackwalker_x86.o \ + src/processor/symbolic_constants_win.o \ + src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a EXTRA_DIST = \ $(SCRIPTS) \ @@ -9403,6 +8964,13 @@ src/processor/synth_minidump_unittest.log: src/processor/synth_minidump_unittest --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT) + @p='src/processor/stackwalker_selftest$(EXEEXT)'; \ + b='src/processor/stackwalker_selftest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/client/linux/linux_client_unittest.log: src/client/linux/linux_client_unittest$(EXEEXT) @p='src/client/linux/linux_client_unittest$(EXEEXT)'; \ b='src/client/linux/linux_client_unittest'; \ @@ -9438,13 +9006,6 @@ src/common/mac/macho_reader_unittest.log: src/common/mac/macho_reader_unittest$( --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT) - @p='src/processor/stackwalker_selftest$(EXEEXT)'; \ - b='src/processor/stackwalker_selftest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/microdump_stackwalk_test.log: src/processor/microdump_stackwalk_test @p='src/processor/microdump_stackwalk_test'; \ b='src/processor/microdump_stackwalk_test'; \ From 87b60390f05bc91a13d0c636f7ce75fa2f7533ca Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 1 Dec 2022 15:20:03 -0500 Subject: [PATCH 137/195] Mac: add option to dump_syms to mark folded symbols Bug: google-breakpad:751 Change-Id: I12afcc8399fa9808aace9f465622bd074eab13f4 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4034827 Reviewed-by: Mark Mentovai --- src/common/mac/dump_syms.cc | 6 ++---- src/common/mac/dump_syms.h | 16 ++++++++++++---- src/tools/mac/dump_syms/dump_syms_tool.cc | 22 ++++++++++++++++++---- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index c7afb2152..1f8303128 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -441,10 +441,8 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { return false; // Create a module to hold the debugging information. - module.reset(new Module(module_name, - "mac", - selected_arch_name, - identifier)); + module.reset(new Module(module_name, "mac", selected_arch_name, identifier, + "", enable_multiple_)); return true; } diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index d097cfa55..97632ce02 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -53,7 +53,9 @@ namespace google_breakpad { class DumpSymbols { public: - DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs) + DumpSymbols(SymbolData symbol_data, + bool handle_inter_cu_refs, + bool enable_multiple = false) : symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs), object_filename_(), @@ -62,9 +64,9 @@ class DumpSymbols { from_disk_(false), object_files_(), selected_object_file_(), - selected_object_name_() {} - ~DumpSymbols() { - } + selected_object_name_(), + enable_multiple_(enable_multiple) {} + ~DumpSymbols() = default; // Prepare to read debugging information from |filename|. |filename| may be // the name of a fat file, a Mach-O file, or a dSYM bundle containing either @@ -201,6 +203,12 @@ class DumpSymbols { // fat binary, it includes an indication of the particular architecture // within that binary. string selected_object_name_; + + // Whether symbols sharing an address should be collapsed into a single entry + // and marked with an `m` in the output. + // See: https://crbug.com/google-breakpad/751 and docs at + // docs/symbol_files.md#records-3 + bool enable_multiple_; }; } // namespace google_breakpad diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 2ac9e2ccd..d0f29ba7d 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -50,8 +50,14 @@ using std::vector; struct Options { Options() - : srcPath(), dsymPath(), arch(), header_only(false), - cfi(true), handle_inter_cu_refs(true), handle_inlines(false) {} + : srcPath(), + dsymPath(), + arch(), + header_only(false), + cfi(true), + handle_inter_cu_refs(true), + handle_inlines(false), + enable_multiple(false) {} string srcPath; string dsymPath; @@ -60,6 +66,7 @@ struct Options { bool cfi; bool handle_inter_cu_refs; bool handle_inlines; + bool enable_multiple; }; static bool StackFrameEntryComparator(const Module::StackFrameEntry* a, @@ -139,7 +146,8 @@ static bool Start(const Options& options) { SymbolData symbol_data = (options.handle_inlines ? INLINES : NO_DATA) | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; - DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs); + DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs, + options.enable_multiple); // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the // Mach-O file, which is not copied into the dSYM. Whereas in i386, the CFI @@ -215,6 +223,9 @@ static void Usage(int argc, const char *argv[]) { fprintf(stderr, "\t-c: Do not generate CFI section\n"); fprintf(stderr, "\t-r: Do not handle inter-compilation unit references\n"); fprintf(stderr, "\t-d: Generate INLINE and INLINE_ORIGIN records\n"); + fprintf(stderr, + "\t-m: Enable writing the optional 'm' field on FUNC " + "and PUBLIC, denoting multiple symbols for the address.\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -224,7 +235,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; signed char ch; - while ((ch = getopt(argc, (char * const*)argv, "ia:g:crd?h")) != -1) { + while ((ch = getopt(argc, (char* const*)argv, "ia:g:crdm?h")) != -1) { switch (ch) { case 'i': options->header_only = true; @@ -252,6 +263,9 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { case 'd': options->handle_inlines = true; break; + case 'm': + options->enable_multiple = true; + break; case '?': case 'h': Usage(argc, argv); From d31ce76161ba9ce0f7fd54e67ad582f777337e08 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 24 Nov 2022 17:20:21 +0900 Subject: [PATCH 138/195] gyp: drop unused build system Chromium moved to GN a long time ago, and CrOS has never used this. Let's remove one of the build systems to make it easier on people. Especially since the GYP tool is completely unmaintained now. Change-Id: I0371ca1427811f307dc30f88ed6d1bf61d7fab89 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4054941 Reviewed-by: Mark Mentovai --- .gitignore | 5 +- DEPS | 26 - Makefile.am | 8 +- Makefile.in | 8 +- default.xml | 5 - src/build/all.gyp | 41 - src/build/common.gypi | 1045 ----------------- src/build/filename_rules.gypi | 57 - src/build/gyp_breakpad | 67 -- src/build/testing.gyp | 90 -- src/client/windows/breakpad_client.gyp | 66 -- .../crash_generation/crash_generation.gyp | 63 - .../windows/handler/exception_handler.gyp | 47 - .../windows/sender/crash_report_sender.gyp | 46 - .../crash_generation_app.gyp | 63 - src/client/windows/unittests/client_tests.gyp | 81 -- src/client/windows/unittests/testing.gyp | 90 -- src/common/common.gyp | 262 ----- src/common/windows/common_windows.gyp | 112 -- src/processor/processor.gyp | 192 --- src/processor/processor_tools.gypi | 57 - src/third_party/libdisasm/libdisasm.gyp | 67 -- src/tools/linux/tools_linux.gypi | 83 -- src/tools/mac/tools_mac.gypi | 116 -- src/tools/tools.gyp | 38 - .../converter/ms_symbol_server_converter.gyp | 46 - src/tools/windows/converter_exe/converter.gyp | 57 - src/tools/windows/dump_syms/dump_syms.gyp | 64 - src/tools/windows/symupload/symupload.gyp | 50 - src/tools/windows/tools_windows.gyp | 46 - 30 files changed, 4 insertions(+), 2994 deletions(-) delete mode 100644 src/build/all.gyp delete mode 100644 src/build/common.gypi delete mode 100644 src/build/filename_rules.gypi delete mode 100755 src/build/gyp_breakpad delete mode 100644 src/build/testing.gyp delete mode 100644 src/client/windows/breakpad_client.gyp delete mode 100644 src/client/windows/crash_generation/crash_generation.gyp delete mode 100644 src/client/windows/handler/exception_handler.gyp delete mode 100644 src/client/windows/sender/crash_report_sender.gyp delete mode 100644 src/client/windows/tests/crash_generation_app/crash_generation_app.gyp delete mode 100644 src/client/windows/unittests/client_tests.gyp delete mode 100644 src/client/windows/unittests/testing.gyp delete mode 100644 src/common/common.gyp delete mode 100644 src/common/windows/common_windows.gyp delete mode 100644 src/processor/processor.gyp delete mode 100644 src/processor/processor_tools.gypi delete mode 100644 src/third_party/libdisasm/libdisasm.gyp delete mode 100644 src/tools/linux/tools_linux.gypi delete mode 100644 src/tools/mac/tools_mac.gypi delete mode 100644 src/tools/tools.gyp delete mode 100644 src/tools/windows/converter/ms_symbol_server_converter.gyp delete mode 100644 src/tools/windows/converter_exe/converter.gyp delete mode 100644 src/tools/windows/dump_syms/dump_syms.gyp delete mode 100644 src/tools/windows/symupload/symupload.gyp delete mode 100644 src/tools/windows/tools_windows.gyp diff --git a/.gitignore b/.gitignore index efa0851af..737bda54b 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,7 @@ config.h /Makefile stamp-h1 -# Ignore GYP generated Visual Studio artifacts. +# Ignore generated Visual Studio artifacts. *.filters *.sdf *.sln @@ -77,7 +77,7 @@ stamp-h1 *.vcproj *.vcxproj -# Ignore GYP generated Makefiles +# Ignore generated Makefiles src/Makefile *.Makefile *.target.mk @@ -89,4 +89,3 @@ src/Makefile src/testing src/third_party/lss src/third_party/protobuf -src/tools/gyp diff --git a/DEPS b/DEPS index 3244e5434..e08dbd4ca 100644 --- a/DEPS +++ b/DEPS @@ -43,11 +43,6 @@ deps = { "https://github.com/google/protobuf.git" + "@cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac", - # GYP project generator. - "src/src/tools/gyp": - "https://chromium.googlesource.com/external/gyp/" + - "@324dd166b7c0b39d513026fa52d6280ac6d56770", - # Linux syscall support. "src/src/third_party/lss": "https://chromium.googlesource.com/linux-syscall-support/" + @@ -61,24 +56,3 @@ hooks = [ "src/DEPS", "src/default.xml"], }, ] - -hooks_os = { - 'win': [ - { - # TODO(chrisha): Fix the GYP files so that they work without - # --no-circular-check. - "pattern": ".", - "action": ["python", - "src/src/tools/gyp/gyp_main.py", - "--no-circular-check", - "src/src/client/windows/breakpad_client.gyp"], - }, - { - # XXX: this and above should all be wired into build/all.gyp ? - "action": ["python", - "src/src/tools/gyp/gyp_main.py", - "--no-circular-check", - "src/src/tools/windows/tools_windows.gyp"], - }, - ], -} diff --git a/Makefile.am b/Makefile.am index b2953e5ba..9e66a6852 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1493,13 +1493,10 @@ EXTRA_DIST = \ src/client/solaris/handler/minidump_test.cc \ src/client/solaris/handler/solaris_lwp.cc \ src/client/solaris/handler/solaris_lwp.h \ - src/client/windows/breakpad_client.gyp \ src/client/windows/handler/exception_handler.cc \ src/client/windows/handler/exception_handler.h \ - src/client/windows/handler/exception_handler.gyp \ src/client/windows/sender/crash_report_sender.cc \ src/client/windows/sender/crash_report_sender.h \ - src/client/windows/sender/crash_report_sender.gyp \ src/common/dwarf/dwarf2diehandler.h \ src/common/dwarf/dwarf2enums.h \ src/common/dwarf/line_state_machine.h \ @@ -1709,9 +1706,7 @@ EXTRA_DIST = \ src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \ src/tools/windows/converter/ms_symbol_server_converter.cc \ src/tools/windows/converter/ms_symbol_server_converter.h \ - src/tools/windows/converter/ms_symbol_server_converter.gyp \ src/tools/windows/dump_syms/dump_syms.cc \ - src/tools/windows/dump_syms/dump_syms.gyp \ src/tools/windows/dump_syms/run_regtest.sh \ src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \ src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \ @@ -1721,8 +1716,7 @@ EXTRA_DIST = \ src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \ src/tools/windows/dump_syms/testdata/omap_stretched.sym \ src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \ - src/tools/windows/symupload/symupload.cc \ - src/tools/windows/symupload/symupload.gyp + src/tools/windows/symupload/symupload.cc mostlyclean-local: -find src -name '*.dwo' -exec rm -f {} + diff --git a/Makefile.in b/Makefile.in index 2461bd4ef..17a453517 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3403,13 +3403,10 @@ EXTRA_DIST = \ src/client/solaris/handler/minidump_test.cc \ src/client/solaris/handler/solaris_lwp.cc \ src/client/solaris/handler/solaris_lwp.h \ - src/client/windows/breakpad_client.gyp \ src/client/windows/handler/exception_handler.cc \ src/client/windows/handler/exception_handler.h \ - src/client/windows/handler/exception_handler.gyp \ src/client/windows/sender/crash_report_sender.cc \ src/client/windows/sender/crash_report_sender.h \ - src/client/windows/sender/crash_report_sender.gyp \ src/common/dwarf/dwarf2diehandler.h \ src/common/dwarf/dwarf2enums.h \ src/common/dwarf/line_state_machine.h \ @@ -3619,9 +3616,7 @@ EXTRA_DIST = \ src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \ src/tools/windows/converter/ms_symbol_server_converter.cc \ src/tools/windows/converter/ms_symbol_server_converter.h \ - src/tools/windows/converter/ms_symbol_server_converter.gyp \ src/tools/windows/dump_syms/dump_syms.cc \ - src/tools/windows/dump_syms/dump_syms.gyp \ src/tools/windows/dump_syms/run_regtest.sh \ src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \ src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \ @@ -3631,8 +3626,7 @@ EXTRA_DIST = \ src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \ src/tools/windows/dump_syms/testdata/omap_stretched.sym \ src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \ - src/tools/windows/symupload/symupload.cc \ - src/tools/windows/symupload/symupload.gyp + src/tools/windows/symupload/symupload.cc all: all-am diff --git a/default.xml b/default.xml index 154b3901f..916b41fe7 100644 --- a/default.xml +++ b/default.xml @@ -20,11 +20,6 @@ revision='refs/heads/main' remote='chromium' /> - - . - # Additional documentation on these macros is available at - # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 - # Chrome normally builds with the Mac OS X 10.5 SDK and sets the - # deployment target to 10.5. Other projects, such as O3D, may override - # these defaults. - 'mac_sdk%': '10.5', - 'mac_deployment_target%': '10.5', - - # Set to 1 to enable code coverage. In addition to build changes - # (e.g. extra CFLAGS), also creates a new target in the src/chrome - # project file called "coverage". - # Currently ignored on Windows. - 'coverage%': 0, - - # Although base/allocator lets you select a heap library via an - # environment variable, the libcmt shim it uses sometimes gets in - # the way. To disable it entirely, and switch to normal msvcrt, do e.g. - # 'win_use_allocator_shim': 0, - # 'win_release_RuntimeLibrary': 2 - # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. - 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt - - # Whether usage of OpenMAX is enabled. - 'enable_openmax%': 0, - - # TODO(bradnelson): eliminate this when possible. - # To allow local gyp files to prevent release.vsprops from being included. - # Yes(1) means include release.vsprops. - # Once all vsprops settings are migrated into gyp, this can go away. - 'msvs_use_common_release%': 1, - - # TODO(bradnelson): eliminate this when possible. - # To allow local gyp files to override additional linker options for msvs. - # Yes(1) means set use the common linker options. - 'msvs_use_common_linker_extras%': 1, - - # TODO(sgk): eliminate this if possible. - # It would be nicer to support this via a setting in 'target_defaults' - # in chrome/app/locales/locales.gypi overriding the setting in the - # 'Debug' configuration in the 'target_defaults' dict below, - # but that doesn't work as we'd like. - 'msvs_debug_link_incremental%': '2', - - # This is the location of the sandbox binary. Chrome looks for this before - # running the zygote process. If found, and SUID, it will be used to - # sandbox the zygote process and, thus, all renderer processes. - 'linux_sandbox_path%': '', - - # Set this to true to enable SELinux support. - 'selinux%': 0, - - # Strip the binary after dumping symbols. - 'linux_strip_binary%': 0, - - # Enable TCMalloc. - 'linux_use_tcmalloc%': 1, - - # Disable TCMalloc's debugallocation. - 'linux_use_debugallocation%': 0, - - # Disable TCMalloc's heapchecker. - 'linux_use_heapchecker%': 0, - - # Set to 1 to turn on seccomp sandbox by default. - # (Note: this is ignored for official builds.) - 'linux_use_seccomp_sandbox%': 0, - - # Set to select the Title Case versions of strings in GRD files. - 'use_titlecase_in_grd%': 0, - - # Used to disable Native Client at compile time, for platforms where it - # isn't supported - 'disable_nacl%': 0, - - # Set Thumb compilation flags. - 'arm_thumb%': 0, - - # Set ARM fpu compilation flags (only meaningful if arm_version==7 and - # arm_neon==0). - 'arm_fpu%': 'vfpv3', - - # Enable new NPDevice API. - 'enable_new_npdevice_api%': 0, - - 'conditions': [ - # Whether to use multiple cores to compile with visual studio. This is - # optional because it sometimes causes corruption on VS 2005. - # It is on by default on VS 2008 and off on VS 2005. - ['OS=="win"', { - 'conditions': [ - ['MSVS_VERSION=="2005"', { - 'msvs_multi_core_compile%': 0, - },{ - 'msvs_multi_core_compile%': 1, - }], - # Don't do incremental linking for large modules on 32-bit. - ['MSVS_OS_BITS==32', { - 'msvs_large_module_debug_link_mode%': '1', # No - },{ - 'msvs_large_module_debug_link_mode%': '2', # Yes - }], - ], - 'nacl_win64_defines': [ - # This flag is used to minimize dependencies when building - # Native Client loader for 64-bit Windows. - 'NACL_WIN64', - ], - }], - ], - - # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' - # so Cocoa is happy (http://crbug.com/20441). - 'locales': [ - 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', - 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he', - 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', - 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', - 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', - 'vi', 'zh-CN', 'zh-TW', - ], - }, - 'target_defaults': { - 'includes': [ - 'filename_rules.gypi', - ], - 'variables': { - # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html - 'mac_release_optimization%': '3', # Use -O3 unless overridden - 'mac_debug_optimization%': '0', # Use -O0 unless overridden - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx - 'win_release_Optimization%': '2', # 2 = /Os - 'win_debug_Optimization%': '0', # 0 = /Od - # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx - 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) - 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) - - 'release_extra_cflags%': '', - 'debug_extra_cflags%': '', - 'release_valgrind_build%': 0, - }, - 'conditions': [ - ['selinux==1', { - 'defines': ['CHROMIUM_SELINUX=1'], - }], - ['win_use_allocator_shim==0', { - 'conditions': [ - ['OS=="win"', { - 'defines': ['NO_TCMALLOC'], - }], - ], - }], - ['coverage!=0', { - 'conditions': [ - ['OS=="mac"', { - 'xcode_settings': { - 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs - 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage - }, - # Add -lgcov for types executable, shared_library, and - # loadable_module; not for static_library. - # This is a delayed conditional. - 'target_conditions': [ - ['_type!="static_library"', { - 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, - }], - ], - }], - # Linux gyp (into scons) doesn't like target_conditions? - # TODO(???): track down why 'target_conditions' doesn't work - # on Linux gyp into scons like it does on Mac gyp into xcodeproj. - ['OS=="linux"', { - 'cflags': [ '-ftest-coverage', - '-fprofile-arcs' ], - 'link_settings': { 'libraries': [ '-lgcov' ] }, - }], - # Finally, for Windows, we simply turn on profiling. - ['OS=="win"', { - 'msvs_settings': { - 'VCLinkerTool': { - 'Profile': 'true', - }, - 'VCCLCompilerTool': { - # /Z7, not /Zi, so coverage is happyb - 'DebugInformationFormat': '1', - 'AdditionalOptions': ['/Yd'], - } - } - }], # OS==win - ], # conditions for coverage - }], # coverage!=0 - ], # conditions for 'target_defaults' - 'target_conditions': [ - [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { - 'cflags!': [ - '-Wall', - '-Wextra', - '-Werror', - ], - }], - [ 'OS=="win"', { - 'defines': [ - '_CRT_SECURE_NO_DEPRECATE', - '_CRT_NONSTDC_NO_WARNINGS', - '_CRT_NONSTDC_NO_DEPRECATE', - # This is required for ATL to use XP-safe versions of its functions. - '_USING_V110_SDK71_', - ], - 'msvs_disabled_warnings': [4800], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WarnAsError': 'true', - 'Detect64BitPortabilityProblems': 'false', - }, - }, - }], - [ 'OS=="mac"', { - 'xcode_settings': { - 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', - 'WARNING_CFLAGS!': ['-Wall'], - }, - }], - ], # target_conditions for 'target_defaults' - 'default_configuration': 'Debug', - 'configurations': { - # VCLinkerTool LinkIncremental values below: - # 0 == default - # 1 == /INCREMENTAL:NO - # 2 == /INCREMENTAL - # Debug links incremental, Release does not. - # - # Abstract base configurations to cover common - # attributes. - # - 'Common_Base': { - 'abstract': 1, - 'msvs_configuration_attributes': { - 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', - 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', - 'CharacterSet': '1', - }, - }, - 'x86_Base': { - 'abstract': 1, - 'msvs_settings': { - 'VCLinkerTool': { - 'MinimumRequiredVersion': '5.01', # XP. - 'TargetMachine': '1', - }, - }, - 'msvs_configuration_platform': 'Win32', - }, - 'x64_Base': { - 'abstract': 1, - 'msvs_configuration_platform': 'x64', - 'msvs_settings': { - 'VCLinkerTool': { - 'TargetMachine': '17', # x86 - 64 - 'AdditionalLibraryDirectories!': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], - 'AdditionalLibraryDirectories': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], - }, - 'VCLibrarianTool': { - 'AdditionalLibraryDirectories!': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], - 'AdditionalLibraryDirectories': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], - }, - }, - 'defines': [ - # Not sure if tcmalloc works on 64-bit Windows. - 'NO_TCMALLOC', - ], - }, - 'Debug_Base': { - 'abstract': 1, - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'NO', - 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', - 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ], - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '<(win_debug_Optimization)', - 'PreprocessorDefinitions': ['_DEBUG'], - 'BasicRuntimeChecks': '3', - 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', - }, - 'VCLinkerTool': { - 'LinkIncremental': '<(msvs_debug_link_incremental)', - }, - 'VCResourceCompilerTool': { - 'PreprocessorDefinitions': ['_DEBUG'], - }, - }, - 'conditions': [ - ['OS=="linux"', { - 'cflags': [ - '<@(debug_extra_cflags)', - ], - }], - ], - }, - 'Release_Base': { - 'abstract': 1, - 'defines': [ - 'NDEBUG', - ], - 'xcode_settings': { - 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip - 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', - 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '<(win_release_Optimization)', - 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', - }, - 'VCLinkerTool': { - 'LinkIncremental': '1', - }, - }, - 'conditions': [ - ['release_valgrind_build==0', { - 'defines': ['NVALGRIND'], - }], - ['win_use_allocator_shim==0', { - 'defines': ['NO_TCMALLOC'], - }], - ['win_release_RuntimeLibrary==2', { - # Visual C++ 2008 barfs when building anything with /MD (msvcrt): - # VC\include\typeinfo(139) : warning C4275: non dll-interface - # class 'stdext::exception' used as base for dll-interface - # class 'std::bad_cast' - 'msvs_disabled_warnings': [4275], - }], - ['OS=="linux"', { - 'cflags': [ - '<@(release_extra_cflags)', - ], - }], - ], - }, - 'Purify_Base': { - 'abstract': 1, - 'defines': [ - 'PURIFY', - 'NO_TCMALLOC', - ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '0', - 'RuntimeLibrary': '0', - 'BufferSecurityCheck': 'false', - }, - 'VCLinkerTool': { - 'EnableCOMDATFolding': '1', - 'LinkIncremental': '1', - }, - }, - }, - # - # Concrete configurations - # - 'Debug': { - 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'], - }, - 'Release': { - 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], - 'conditions': [ - ['msvs_use_common_release', { - 'defines': ['OFFICIAL_BUILD'], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '3', - 'StringPooling': 'true', - 'OmitFramePointers': 'true', - 'InlineFunctionExpansion': '2', - 'EnableIntrinsicFunctions': 'true', - 'FavorSizeOrSpeed': '2', - 'OmitFramePointers': 'true', - 'EnableFiberSafeOptimizations': 'true', - 'WholeProgramOptimization': 'true', - }, - 'VCLibrarianTool': { - 'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'], - }, - 'VCLinkerTool': { - 'LinkIncremental': '1', - 'OptimizeReferences': '2', - 'EnableCOMDATFolding': '2', - 'OptimizeForWindows98': '1', - 'LinkTimeCodeGeneration': '1', - }, - }, - }], - ] - }, - 'conditions': [ - [ 'OS=="win"', { - # TODO(bradnelson): add a gyp mechanism to make this more graceful. - 'Purify': { - 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'], - }, - 'Debug_x64': { - 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], - }, - 'Release_x64': { - 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], - }, - 'Purify_x64': { - 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'], - }, - }], - ], - }, - }, - 'conditions': [ - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { - 'target_defaults': { - # Enable -Werror by default, but put it in a variable so it can - # be disabled in ~/.gyp/include.gypi on the valgrind builders. - 'variables': { - # Use -fno-strict-aliasing by default since gcc 4.4 has periodic - # issues that slip through the cracks. We could do this just for - # gcc 4.4 but it makes more sense to be consistent on all - # compilers in use. TODO(Craig): turn this off again when - # there is some 4.4 test infrastructure in place and existing - # aliasing issues have been fixed. - 'no_strict_aliasing%': 1, - 'conditions': [['OS=="linux"', {'werror%': '-Werror',}], - ['OS=="freebsd"', {'werror%': '',}], - ['OS=="openbsd"', {'werror%': '',}], - ], - }, - 'cflags': [ - '<(werror)', # See note above about the werror variable. - '-pthread', - '-fno-exceptions', - '-Wall', - # TODO(evan): turn this back on once all the builds work. - # '-Wextra', - # Don't warn about unused function params. We use those everywhere. - '-Wno-unused-parameter', - # Don't warn about the "struct foo f = {0};" initialization pattern. - '-Wno-missing-field-initializers', - '-D_FILE_OFFSET_BITS=64', - # Don't export any symbols (for example, to plugins we dlopen()). - # Note: this is *required* to make some plugins work. - '-fvisibility=hidden', - ], - 'cflags_cc': [ - '-frtti', - '-fno-threadsafe-statics', - # Make inline functions have hidden visiblity by default. - # Surprisingly, not covered by -fvisibility=hidden. - '-fvisibility-inlines-hidden', - ], - 'ldflags': [ - '-pthread', '-Wl,-z,noexecstack', - ], - 'scons_variable_settings': { - 'LIBPATH': ['$LIB_DIR'], - # Linking of large files uses lots of RAM, so serialize links - # using the handy flock command from util-linux. - 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], - 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], - 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], - - # We have several cases where archives depend on each other in - # a cyclic fashion. Since the GNU linker does only a single - # pass over the archives we surround the libraries with - # --start-group and --end-group (aka -( and -) ). That causes - # ld to loop over the group until no more undefined symbols - # are found. In an ideal world we would only make groups from - # those libraries which we knew to be in cycles. However, - # that's tough with SCons, so we bodge it by making all the - # archives a group by redefining the linking command here. - # - # TODO: investigate whether we still have cycles that - # require --{start,end}-group. There has been a lot of - # refactoring since this was first coded, which might have - # eliminated the circular dependencies. - # - # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS - # so that we prefer our own built libraries (e.g. -lpng) to - # system versions of libraries that pkg-config might turn up. - # TODO(sgk): investigate handling this not by re-ordering the - # flags this way, but by adding a hook to use the SCons - # ParseFlags() option on the output from pkg-config. - 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', - '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', - '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], - 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', - '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', - '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], - 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', - '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', - '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], - 'IMPLICIT_COMMAND_DEPENDENCIES': 0, - }, - 'scons_import_variables': [ - 'AS', - 'CC', - 'CXX', - 'LINK', - ], - 'scons_propagate_variables': [ - 'AS', - 'CC', - 'CCACHE_DIR', - 'CXX', - 'DISTCC_DIR', - 'DISTCC_HOSTS', - 'HOME', - 'INCLUDE_SERVER_ARGS', - 'INCLUDE_SERVER_PORT', - 'LINK', - 'CHROME_BUILD_TYPE', - 'CHROMIUM_BUILD', - 'OFFICIAL_BUILD', - ], - 'configurations': { - 'Debug_Base': { - 'variables': { - 'debug_optimize%': '0', - }, - 'defines': [ - '_DEBUG', - ], - 'cflags': [ - '-O>(debug_optimize)', - '-g', - # One can use '-gstabs' to enable building the debugging - # information in STABS format for breakpad's dumpsyms. - ], - 'ldflags': [ - '-rdynamic', # Allows backtrace to resolve symbols. - ], - }, - 'Release_Base': { - 'variables': { - 'release_optimize%': '2', - }, - 'cflags': [ - '-O>(release_optimize)', - # Don't emit the GCC version ident directives, they just end up - # in the .comment section taking up binary size. - '-fno-ident', - # Put data and code in their own sections, so that unused symbols - # can be removed at link time with --gc-sections. - '-fdata-sections', - '-ffunction-sections', - ], - 'ldflags': [ - '-Wl,--gc-sections', - ], - }, - }, - 'variants': { - 'coverage': { - 'cflags': ['-fprofile-arcs', '-ftest-coverage'], - 'ldflags': ['-fprofile-arcs'], - }, - 'profile': { - 'cflags': ['-pg', '-g'], - 'ldflags': ['-pg'], - }, - 'symbols': { - 'cflags': ['-g'], - }, - }, - 'conditions': [ - [ 'target_arch=="ia32"', { - 'asflags': [ - # Needed so that libs with .s files (e.g. libicudata.a) - # are compatible with the general 32-bit-ness. - '-32', - ], - # All floating-point computations on x87 happens in 80-bit - # precision. Because the C and C++ language standards allow - # the compiler to keep the floating-point values in higher - # precision than what's specified in the source and doing so - # is more efficient than constantly rounding up to 64-bit or - # 32-bit precision as specified in the source, the compiler, - # especially in the optimized mode, tries very hard to keep - # values in x87 floating-point stack (in 80-bit precision) - # as long as possible. This has important side effects, that - # the real value used in computation may change depending on - # how the compiler did the optimization - that is, the value - # kept in 80-bit is different than the value rounded down to - # 64-bit or 32-bit. There are possible compiler options to make - # this behavior consistent (e.g. -ffloat-store would keep all - # floating-values in the memory, thus force them to be rounded - # to its original precision) but they have significant runtime - # performance penalty. - # - # -mfpmath=sse -msse2 makes the compiler use SSE instructions - # which keep floating-point values in SSE registers in its - # native precision (32-bit for single precision, and 64-bit for - # double precision values). This means the floating-point value - # used during computation does not change depending on how the - # compiler optimized the code, since the value is always kept - # in its specified precision. - 'conditions': [ - ['disable_sse2==0', { - 'cflags': [ - '-march=pentium4', - '-msse2', - '-mfpmath=sse', - ], - }], - ], - # -mmmx allows mmintrin.h to be used for mmx intrinsics. - # video playback is mmx and sse2 optimized. - 'cflags': [ - '-m32', - '-mmmx', - ], - 'ldflags': [ - '-m32', - ], - }], - ['target_arch=="arm"', { - 'target_conditions': [ - ['_toolset=="target"', { - 'cflags_cc': [ - # The codesourcery arm-2009q3 toolchain warns at that the ABI - # has changed whenever it encounters a varargs function. This - # silences those warnings, as they are not helpful and - # clutter legitimate warnings. - '-Wno-abi', - ], - 'conditions': [ - ['arm_thumb == 1', { - 'cflags': [ - '-mthumb', - # TODO(piman): -Wa,-mimplicit-it=thumb is needed for - # inline assembly that uses condition codes but it's - # suboptimal. Better would be to #ifdef __thumb__ at the - # right place and have a separate thumb path. - '-Wa,-mimplicit-it=thumb', - ] - }], - ['arm_version==7', { - 'cflags': [ - '-march=armv7-a', - '-mtune=cortex-a8', - '-mfloat-abi=softfp', - ], - 'conditions': [ - ['arm_neon==1', { - 'cflags': [ '-mfpu=neon', ], - }, { - 'cflags': [ '-mfpu=<(arm_fpu)', ], - }] - ], - }], - ], - }], - ], - }], - ['linux_fpic==1', { - 'cflags': [ - '-fPIC', - ], - }], - ['sysroot!=""', { - 'target_conditions': [ - ['_toolset=="target"', { - 'cflags': [ - '--sysroot=<(sysroot)', - ], - 'ldflags': [ - '--sysroot=<(sysroot)', - ], - }]] - }], - ['no_strict_aliasing==1', { - 'cflags': [ - '-fno-strict-aliasing', - ], - }], - ['linux_use_heapchecker==1', { - 'variables': {'linux_use_tcmalloc%': 1}, - }], - ['linux_use_tcmalloc==0', { - 'defines': ['NO_TCMALLOC'], - }], - ['linux_use_heapchecker==0', { - 'defines': ['NO_HEAPCHECKER'], - }], - ], - }, - }], - # FreeBSD-specific options; note that most FreeBSD options are set above, - # with Linux. - ['OS=="freebsd"', { - 'target_defaults': { - 'ldflags': [ - '-Wl,--no-keep-memory', - ], - }, - }], - ['OS=="solaris"', { - 'cflags!': ['-fvisibility=hidden'], - 'cflags_cc!': ['-fvisibility-inlines-hidden'], - }], - ['OS=="mac"', { - 'target_defaults': { - 'variables': { - # This should be 'mac_real_dsym%', but there seems to be a bug - # with % in variables that are intended to be set to different - # values in different targets, like this one. - 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. - }, - 'mac_bundle': 0, - 'xcode_settings': { - 'ALWAYS_SEARCH_USER_PATHS': 'NO', - 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 - 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks - 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic - # (Equivalent to -fPIC) - 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions - 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti - 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings - # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden - 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', - 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden - 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics - 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror - 'GCC_VERSION': '4.2', - 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof - # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min - 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', - 'PREBINDING': 'NO', # No -Wl,-prebind - 'USE_HEADERMAP': 'NO', - 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'], - 'conditions': [ - ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, - {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} - ], - ], - }, - 'target_conditions': [ - ['_type!="static_library"', { - 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, - }], - ['_mac_bundle', { - 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, - }], - ], # target_conditions - }, # target_defaults - }], # OS=="mac" - ['OS=="win"', { - 'target_defaults': { - 'defines': [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - 'WIN32', - '_WINDOWS', - '_HAS_EXCEPTIONS=0', - 'NOMINMAX', - '_CRT_RAND_S', - 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', - 'WIN32_LEAN_AND_MEAN', - '_SECURE_ATL', - '_HAS_TR1=0', - ], - 'msvs_system_include_dirs': [ - '<(DEPTH)/third_party/platformsdk_win7/files/Include', - '$(VSInstallDir)/VC/atlmfc/include', - ], - 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], - 'msvs_disabled_warnings': [ - 4091, 4100, 4127, 4366, 4396, 4503, 4512, 4819, 4995, 4702 - ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'MinimalRebuild': 'false', - 'ExceptionHandling': '0', - 'BufferSecurityCheck': 'true', - 'EnableFunctionLevelLinking': 'true', - 'RuntimeTypeInfo': 'false', - 'WarningLevel': '4', - 'WarnAsError': 'true', - 'DebugInformationFormat': '3', - 'conditions': [ - [ 'msvs_multi_core_compile', { - 'AdditionalOptions': ['/MP'], - }], - ], - }, - 'VCLibrarianTool': { - 'AdditionalOptions': ['/ignore:4221'], - 'AdditionalLibraryDirectories': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], - }, - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'wininet.lib', - 'version.lib', - 'msimg32.lib', - 'ws2_32.lib', - 'usp10.lib', - 'psapi.lib', - 'dbghelp.lib', - ], - 'AdditionalLibraryDirectories': - ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], - 'GenerateDebugInformation': 'true', - 'MapFileName': '$(OutDir)\\$(TargetName).map', - 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', - 'FixedBaseAddress': '1', - # SubSystem values: - # 0 == not set - # 1 == /SUBSYSTEM:CONSOLE - # 2 == /SUBSYSTEM:WINDOWS - # Most of the executables we'll ever create are tests - # and utilities with console output. - 'SubSystem': '1', - }, - 'VCMIDLTool': { - 'GenerateStublessProxies': 'true', - 'TypeLibraryName': '$(InputName).tlb', - 'OutputDirectory': '$(IntDir)', - 'HeaderFileName': '$(InputName).h', - 'DLLDataFileName': 'dlldata.c', - 'InterfaceIdentifierFileName': '$(InputName)_i.c', - 'ProxyFileName': '$(InputName)_p.c', - }, - 'VCResourceCompilerTool': { - 'Culture' : '1033', - 'AdditionalIncludeDirectories': ['<(DEPTH)'], - }, - }, - }, - }], - ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { - 'target_defaults': { - 'defines': [ - 'DISABLE_NACL', - ], - }, - }], - ['OS=="win" and msvs_use_common_linker_extras', { - 'target_defaults': { - 'msvs_settings': { - 'VCLinkerTool': { - 'DelayLoadDLLs': [ - 'dbghelp.dll', - 'dwmapi.dll', - 'uxtheme.dll', - ], - }, - }, - 'configurations': { - 'x86_Base': { - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalOptions': [ - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/ignore:4221', - '/nxcompat', - ], - }, - }, - }, - 'x64_Base': { - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalOptions': [ - # safeseh is not compatible with x64 - '/dynamicbase', - '/ignore:4199', - '/ignore:4221', - '/nxcompat', - ], - }, - }, - }, - }, - }, - }], - ['enable_new_npdevice_api==1', { - 'target_defaults': { - 'defines': [ - 'ENABLE_NEW_NPDEVICE_API', - ], - }, - }], - ], - 'scons_settings': { - 'sconsbuild_dir': '<(DEPTH)/sconsbuild', - 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], - }, - 'xcode_settings': { - # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! - # This block adds *project-wide* configuration settings to each project - # file. It's almost always wrong to put things here. Specify your - # custom xcode_settings in target_defaults to add them to targets instead. - - # In an Xcode Project Info window, the "Base SDK for All Configurations" - # setting sets the SDK on a project-wide basis. In order to get the - # configured SDK to show properly in the Xcode UI, SDKROOT must be set - # here at the project level. - 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot - - # The Xcode generator will look for an xcode_settings section at the root - # of each dict and use it to apply settings on a file-wide basis. Most - # settings should not be here, they should be in target-specific - # xcode_settings sections, or better yet, should use non-Xcode-specific - # settings in target dicts. SYMROOT is a special case, because many other - # Xcode variables depend on it, including variables such as - # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something - # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the - # files to appear (when present) in the UI as actual files and not red - # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, - # and therefore SYMROOT, needs to be set at the project level. - 'SYMROOT': '<(DEPTH)/xcodebuild', - }, -} diff --git a/src/build/filename_rules.gypi b/src/build/filename_rules.gypi deleted file mode 100644 index b34f19bda..000000000 --- a/src/build/filename_rules.gypi +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'target_conditions': [ - ['OS!="win"', { - 'sources/': [ - ['exclude', '(^|/)windows/'], - ], - }], - ['OS!="linux"', { - 'sources/': [ - ['exclude', '(^|/)linux/'], - ], - }], - ['OS!="mac"', { - 'sources/': [ - ['exclude', '(^|/)mac/'], - ], - }], - ['OS!="android"', { - 'sources/': [ - ['exclude', '(^|/)android/'], - ], - }], - ['OS!="solaris"', { - 'sources/': [ - ['exclude', '(^|/)solaris/'], - ], - }], - ], -} diff --git a/src/build/gyp_breakpad b/src/build/gyp_breakpad deleted file mode 100755 index 219d47328..000000000 --- a/src/build/gyp_breakpad +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import os -import platform -import sys - -script_dir = os.path.dirname(os.path.realpath(__file__)) -breakpad_root = os.path.abspath(os.path.join(script_dir, os.pardir)) - -sys.path.insert(0, os.path.join(breakpad_root, 'tools', 'gyp', 'pylib')) -import gyp - -def run_gyp(args): - rc = gyp.main(args) - if rc != 0: - print 'Error running GYP' - sys.exit(rc) - - -def main(): - args = sys.argv[1:] - args.append(os.path.join(script_dir, 'all.gyp')) - - args.append('-I') - args.append(os.path.join(breakpad_root, 'build', 'common.gypi')) - - args.extend(['-D', 'gyp_output_dir=out']) - - # Set the GYP DEPTH variable to the root of the project. - args.append('--depth=' + os.path.relpath(breakpad_root)) - - print 'Updating projects from gyp files...' - sys.stdout.flush() - - run_gyp(args) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/src/build/testing.gyp b/src/build/testing.gyp deleted file mode 100644 index d03246657..000000000 --- a/src/build/testing.gyp +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'targets': [ - { - 'target_name': 'gtest', - 'type': 'static_library', - 'sources': [ - '../testing/googletest/src/gtest-all.cc', - ], - 'include_dirs': [ - '../testing/googletest', - '../testing/googletest/include', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../testing/googletest/include', - ], - }, - }, - { - 'target_name': 'gtest_main', - 'type': 'static_library', - 'dependencies': [ - 'gtest', - ], - 'sources': [ - '../testing/googletest/src/gtest_main.cc', - ], - }, - { - 'target_name': 'gmock', - 'type': 'static_library', - 'dependencies': [ - 'gtest', - ], - 'sources': [ - '../testing/googlemock/src/gmock-all.cc', - ], - 'include_dirs': [ - '../testing/googlemock', - '../testing/googlemock/include', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../testing/googlemock/include', - ], - }, - 'export_dependent_settings': [ - 'gtest', - ], - }, - { - 'target_name': 'gmock_main', - 'type': 'static_library', - 'dependencies': [ - 'gmock', - ], - 'sources': [ - '../testing/googlemock/src/gmock_main.cc', - ], - }, - ], -} diff --git a/src/client/windows/breakpad_client.gyp b/src/client/windows/breakpad_client.gyp deleted file mode 100644 index 05e2da3a0..000000000 --- a/src/client/windows/breakpad_client.gyp +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'build_all', - 'type': 'none', - 'dependencies': [ - './crash_generation/crash_generation.gyp:*', - './handler/exception_handler.gyp:*', - './sender/crash_report_sender.gyp:*', - './unittests/client_tests.gyp:*', - './unittests/testing.gyp:*', - './tests/crash_generation_app/crash_generation_app.gyp:*', - ] - }, - { - 'target_name': 'common', - 'type': 'static_library', - 'include_dirs': [ - '<(DEPTH)', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(DEPTH)', - ] - }, - 'sources': [ - '<(DEPTH)/common/windows/guid_string.cc', - '<(DEPTH)/common/windows/guid_string.h', - '<(DEPTH)/common/windows/http_upload.cc', - '<(DEPTH)/common/windows/http_upload.h', - '<(DEPTH)/common/windows/string_utils.cc', - ] - } - ] -} diff --git a/src/client/windows/crash_generation/crash_generation.gyp b/src/client/windows/crash_generation/crash_generation.gyp deleted file mode 100644 index 9b4c6eaaf..000000000 --- a/src/client/windows/crash_generation/crash_generation.gyp +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'crash_generation_server', - 'type': 'static_library', - 'sources': [ - 'client_info.cc', - 'crash_generation_server.cc', - 'minidump_generator.cc', - 'client_info.h', - 'crash_generation_client.h', - 'crash_generation_server.h', - 'minidump_generator.h', - ], - 'dependencies': [ - '../breakpad_client.gyp:common' - ], - }, - { - 'target_name': 'crash_generation_client', - 'type': 'static_library', - 'include_dirs': [ - '<(DEPTH)', - ], - 'sources': [ - 'crash_generation_client.h', - 'crash_generation_client.cc', - 'crash_generation_server.h', - ], - }, - ], -} diff --git a/src/client/windows/handler/exception_handler.gyp b/src/client/windows/handler/exception_handler.gyp deleted file mode 100644 index b53a6cd45..000000000 --- a/src/client/windows/handler/exception_handler.gyp +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'exception_handler', - 'type': 'static_library', - 'sources': [ - "exception_handler.cc", - "exception_handler.h", - ], - 'dependencies': [ - '../breakpad_client.gyp:common', - '../crash_generation/crash_generation.gyp:crash_generation_server', - ] - }, - ], -} diff --git a/src/client/windows/sender/crash_report_sender.gyp b/src/client/windows/sender/crash_report_sender.gyp deleted file mode 100644 index 82f81a4cc..000000000 --- a/src/client/windows/sender/crash_report_sender.gyp +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'crash_report_sender', - 'type': 'static_library', - 'sources': [ - 'crash_report_sender.cc', - 'crash_report_sender.h', - ], - 'dependencies': [ - '../breakpad_client.gyp:common' - ], - }, - ], -} diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp b/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp deleted file mode 100644 index 3c27273f1..000000000 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'crash_generation_app', - 'type': 'executable', - 'sources': [ - 'abstract_class.cc', - 'abstract_class.h', - 'crash_generation_app.cc', - 'crash_generation_app.h', - 'crash_generation_app.ico', - 'crash_generation_app.rc', - 'resource.h', - 'small.ico', - ], - 'libraries': [ - 'user32.lib', - ], - 'dependencies': [ - '../../breakpad_client.gyp:common', - '../../crash_generation/crash_generation.gyp:crash_generation_server', - '../../crash_generation/crash_generation.gyp:crash_generation_client', - '../../handler/exception_handler.gyp:exception_handler', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'SubSystem': '2', # Windows Subsystem as opposed to a console app - }, - }, - } - ] -} diff --git a/src/client/windows/unittests/client_tests.gyp b/src/client/windows/unittests/client_tests.gyp deleted file mode 100644 index 1e594515a..000000000 --- a/src/client/windows/unittests/client_tests.gyp +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'client_tests', - 'type': 'executable', - 'sources': [ - 'exception_handler_test.h', - 'exception_handler_test.cc', - 'exception_handler_death_test.cc', - 'exception_handler_nesting_test.cc', - 'minidump_test.cc', - 'dump_analysis.cc', - 'dump_analysis.h', - 'crash_generation_server_test.cc' - ], - 'dependencies': [ - 'testing.gyp:gtest', - 'testing.gyp:gmock', - '../breakpad_client.gyp:common', - '../crash_generation/crash_generation.gyp:crash_generation_server', - '../crash_generation/crash_generation.gyp:crash_generation_client', - '../handler/exception_handler.gyp:exception_handler', - 'processor_bits', - ] - }, - { - 'target_name': 'processor_bits', - 'type': 'static_library', - 'include_dirs': [ - '<(DEPTH)', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(DEPTH)', - ] - }, - 'sources': [ - '<(DEPTH)/common/string_conversion.cc', - '<(DEPTH)/processor/basic_code_modules.cc', - '<(DEPTH)/processor/convert_old_arm64_context.cc', - '<(DEPTH)/processor/dump_context.cc', - '<(DEPTH)/processor/dump_object.cc', - '<(DEPTH)/processor/logging.cc', - '<(DEPTH)/processor/minidump.cc', - '<(DEPTH)/processor/pathname_stripper.cc', - '<(DEPTH)/processor/proc_maps_linux.cc', - ] - } - ], -} diff --git a/src/client/windows/unittests/testing.gyp b/src/client/windows/unittests/testing.gyp deleted file mode 100644 index 2d8d31a97..000000000 --- a/src/client/windows/unittests/testing.gyp +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2010 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'target_defaults': { - }, - 'targets': [ - { - 'target_name': 'gtest', - 'type': 'static_library', - 'include_dirs': [ - '<(DEPTH)/testing/include', - '<(DEPTH)/testing/googletest/include', - '<(DEPTH)/testing/googletest', - '<(DEPTH)/testing', - ], - 'sources': [ - '<(DEPTH)/testing/googletest/src/gtest-all.cc', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(DEPTH)/testing/include', - '<(DEPTH)/testing/gtest/include', - ], - # Visual C++ implements variadic templates strangely, and - # VC++2012 broke Google Test by lowering this value. See - # http://stackoverflow.com/questions/12558327/google-test-in-visual-studio-2012 - 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'], - }, - 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'], - }, - { - 'target_name': 'gmock', - 'type': 'static_library', - 'include_dirs': [ - '<(DEPTH)/testing/include', - '<(DEPTH)/testing/googletest/include', - '<(DEPTH)/testing/googletest', - '<(DEPTH)/testing/googlemock/include', - '<(DEPTH)/testing/googlemock', - '<(DEPTH)/testing', - ], - 'sources': [ - '<(DEPTH)/testing/googlemock/src/gmock-all.cc', - '<(DEPTH)/testing/googletest/src/gtest_main.cc', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(DEPTH)/testing/include', - '<(DEPTH)/testing/googletest/include', - '<(DEPTH)/testing/googletest', - '<(DEPTH)/testing/googlemock/include', - '<(DEPTH)/testing/googlemock', - '<(DEPTH)/testing', - ], - 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'], - }, - 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'], - }, - - ], -} diff --git a/src/common/common.gyp b/src/common/common.gyp deleted file mode 100644 index f5833b03f..000000000 --- a/src/common/common.gyp +++ /dev/null @@ -1,262 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'target_defaults': { - 'target_conditions': [ - ['OS=="mac"', { - 'defines': ['HAVE_MACH_O_NLIST_H'], - }], - ['OS=="linux"', { - # Assume glibc. - 'defines': ['HAVE_A_OUT_H', 'HAVE_GETCONTEXT'], - 'sources!': [ - 'linux/breakpad_getcontext.S', - 'linux/breakpad_getcontext.h', - 'linux/breakpad_getcontext_unittest.cc', - ], - }], - ['OS!="android"', {'sources/': [['exclude', '(^|/)android/']]}], - ['OS!="linux"', {'sources/': [['exclude', '(^|/)linux/']]}], - ['OS!="mac"', {'sources/': [['exclude', '(^|/)mac/']]}], - ['OS!="solaris"', {'sources/': [['exclude', '(^|/)solaris/']]}], - ['OS!="win"', {'sources/': [['exclude', '(^|/)windows/']]}], - ], - }, - 'targets': [ - { - 'target_name': 'common', - 'type': 'static_library', - 'sources': [ - 'android/include/elf.h', - 'android/include/link.h', - 'android/include/stab.h', - 'android/include/sys/procfs.h', - 'android/include/sys/user.h', - 'android/testing/include/wchar.h', - 'android/testing/mkdtemp.h', - 'android/testing/pthread_fixes.h', - 'android/ucontext_constants.h', - 'basictypes.h', - 'byte_cursor.h', - 'convert_UTF.cc', - 'convert_UTF.h', - 'dwarf/bytereader-inl.h', - 'dwarf/bytereader.cc', - 'dwarf/bytereader.h', - 'dwarf/cfi_assembler.cc', - 'dwarf/cfi_assembler.h', - 'dwarf/dwarf2diehandler.cc', - 'dwarf/dwarf2diehandler.h', - 'dwarf/dwarf2enums.h', - 'dwarf/dwarf2reader.cc', - 'dwarf/dwarf2reader.h', - 'dwarf/dwarf2reader_test_common.h', - 'dwarf/elf_reader.cc', - 'dwarf/elf_reader.h', - 'dwarf/functioninfo.cc', - 'dwarf/functioninfo.h', - 'dwarf/line_state_machine.h', - 'dwarf/types.h', - 'dwarf_cfi_to_module.cc', - 'dwarf_cfi_to_module.h', - 'dwarf_cu_to_module.cc', - 'dwarf_cu_to_module.h', - 'dwarf_line_to_module.cc', - 'dwarf_line_to_module.h', - 'language.cc', - 'language.h', - 'linux/breakpad_getcontext.S', - 'linux/breakpad_getcontext.h', - 'linux/crc32.cc', - 'linux/crc32.h', - 'linux/dump_symbols.cc', - 'linux/dump_symbols.h', - 'linux/eintr_wrapper.h', - 'linux/elf_core_dump.cc', - 'linux/elf_core_dump.h', - 'linux/elf_gnu_compat.h', - 'linux/elf_symbols_to_module.cc', - 'linux/elf_symbols_to_module.h', - 'linux/elfutils-inl.h', - 'linux/elfutils.cc', - 'linux/elfutils.h', - 'linux/file_id.cc', - 'linux/file_id.h', - 'linux/google_crashdump_uploader.cc', - 'linux/google_crashdump_uploader.h', - 'linux/guid_creator.cc', - 'linux/guid_creator.h', - 'linux/http_upload.cc', - 'linux/http_upload.h', - 'linux/ignore_ret.h', - 'linux/libcurl_wrapper.cc', - 'linux/libcurl_wrapper.h', - 'linux/linux_libc_support.cc', - 'linux/linux_libc_support.h', - 'linux/memory_mapped_file.cc', - 'linux/memory_mapped_file.h', - 'linux/safe_readlink.cc', - 'linux/safe_readlink.h', - 'linux/symbol_collector_client.cc', - 'linux/symbol_collector_client.h', - 'linux/synth_elf.cc', - 'linux/synth_elf.h', - 'long_string_dictionary.cc', - 'long_string_dictionary.h', - 'mac/arch_utilities.cc', - 'mac/arch_utilities.h', - 'mac/bootstrap_compat.cc', - 'mac/bootstrap_compat.h', - 'mac/byteswap.h', - 'mac/dump_syms.h', - 'mac/dump_syms.cc', - 'mac/file_id.cc', - 'mac/file_id.h', - 'mac/GTMDefines.h', - 'mac/GTMLogger.h', - 'mac/GTMLogger.m', - 'mac/HTTPMultipartUpload.h', - 'mac/HTTPMultipartUpload.m', - 'mac/MachIPC.h', - 'mac/MachIPC.mm', - 'mac/macho_id.cc', - 'mac/macho_id.h', - 'mac/macho_reader.cc', - 'mac/macho_reader.h', - 'mac/macho_utilities.cc', - 'mac/macho_utilities.h', - 'mac/macho_walker.cc', - 'mac/macho_walker.h', - 'mac/scoped_task_suspend-inl.h', - 'mac/string_utilities.cc', - 'mac/string_utilities.h', - 'mac/super_fat_arch.h', - 'md5.cc', - 'md5.h', - 'memory_allocator.h', - 'memory_range.h', - 'module.cc', - 'module.h', - 'safe_math.h', - 'scoped_ptr.h', - 'simple_string_dictionary.cc', - 'simple_string_dictionary.h', - 'solaris/dump_symbols.cc', - 'solaris/dump_symbols.h', - 'solaris/file_id.cc', - 'solaris/file_id.h', - 'solaris/guid_creator.cc', - 'solaris/guid_creator.h', - 'solaris/message_output.h', - 'stabs_reader.cc', - 'stabs_reader.h', - 'stabs_to_module.cc', - 'stabs_to_module.h', - 'string_conversion.cc', - 'string_conversion.h', - 'symbol_data.h', - 'test_assembler.cc', - 'test_assembler.h', - 'unordered.h', - 'using_std_string.h', - 'windows/common_windows.gyp', - 'windows/dia_util.cc', - 'windows/dia_util.h', - 'windows/guid_string.cc', - 'windows/guid_string.h', - 'windows/http_upload.cc', - 'windows/http_upload.h', - 'windows/omap.cc', - 'windows/omap.h', - 'windows/omap_internal.h', - 'windows/pdb_source_line_writer.cc', - 'windows/pdb_source_line_writer.h', - 'windows/string_utils-inl.h', - 'windows/string_utils.cc', - ], - 'include_dirs': [ - '..', - ], - }, - { - 'target_name': 'common_unittests', - 'type': 'executable', - 'sources': [ - 'byte_cursor_unittest.cc', - 'dwarf/bytereader_unittest.cc', - 'dwarf/dwarf2diehandler_unittest.cc', - 'dwarf/dwarf2reader_cfi_unittest.cc', - 'dwarf/dwarf2reader_die_unittest.cc', - 'dwarf_cfi_to_module_unittest.cc', - 'dwarf_cu_to_module_unittest.cc', - 'dwarf_line_to_module_unittest.cc', - 'linux/breakpad_getcontext_unittest.cc', - 'linux/dump_symbols_unittest.cc', - 'linux/elf_core_dump_unittest.cc', - 'linux/elf_symbols_to_module_unittest.cc', - 'linux/file_id_unittest.cc', - 'linux/google_crashdump_uploader_test.cc', - 'linux/linux_libc_support_unittest.cc', - 'linux/memory_mapped_file_unittest.cc', - 'linux/safe_readlink_unittest.cc', - 'linux/synth_elf_unittest.cc', - 'linux/tests/auto_testfile.h', - 'linux/tests/crash_generator.cc', - 'linux/tests/crash_generator.h', - 'long_string_dictionary_unittest.cc', - 'mac/macho_reader_unittest.cc', - 'memory_allocator_unittest.cc', - 'memory_range_unittest.cc', - 'module_unittest.cc', - 'safe_math_unittest.cc', - 'simple_string_dictionary_unittest.cc', - 'stabs_reader_unittest.cc', - 'stabs_to_module_unittest.cc', - 'string_conversion_unittest.cc', - 'test_assembler_unittest.cc', - 'tests/auto_tempdir.h', - 'tests/file_utils.cc', - 'tests/file_utils.h', - 'windows/omap_unittest.cc', - ], - 'include_dirs': [ - '..', - ], - 'dependencies': [ - 'common', - '../build/testing.gyp:gmock_main', - '../build/testing.gyp:gmock', - '../build/testing.gyp:gtest', - ], - 'libraries': [ - '-ldl', - ], - }, - ], -} diff --git a/src/common/windows/common_windows.gyp b/src/common/windows/common_windows.gyp deleted file mode 100644 index e2f07a5f7..000000000 --- a/src/common/windows/common_windows.gyp +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2013 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'dia_sdk', - 'type': 'none', - 'all_dependent_settings': { - 'include_dirs': [ - '<(DEPTH)', - '$(VSInstallDir)/DIA SDK/include', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'diaguids.lib', - 'imagehlp.lib', - ], - }, - }, - 'configurations': { - 'x86_Base': { - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalLibraryDirectories': - ['$(VSInstallDir)/DIA SDK/lib'], - }, - }, - }, - 'x64_Base': { - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalLibraryDirectories': - ['$(VSInstallDir)/DIA SDK/lib/amd64'], - }, - }, - }, - }, - }, - }, - { - 'target_name': 'common_windows_lib', - 'type': 'static_library', - 'sources': [ - 'dia_util.cc', - 'dia_util.h', - 'guid_string.cc', - 'guid_string.h', - 'http_upload.cc', - 'http_upload.h', - 'module_info.h', - 'omap.cc', - 'omap.h', - 'omap_internal.h', - 'pdb_source_line_writer.cc', - 'pdb_source_line_writer.h', - 'pe_source_line_writer.cc', - 'pe_source_line_writer.h', - 'pe_util.h', - 'pe_util.cc', - 'string_utils.cc', - 'string_utils-inl.h', - 'symbol_collector_client.cc', - 'symbol_collector_client.h', - ], - 'dependencies': [ - 'dia_sdk', - ], - }, - { - 'target_name': 'common_windows_unittests', - 'type': 'executable', - 'sources': [ - 'omap_unittest.cc', - ], - 'dependencies': [ - '<(DEPTH)/client/windows/unittests/testing.gyp:gmock', - '<(DEPTH)/client/windows/unittests/testing.gyp:gtest', - 'common_windows_lib', - ], - }, - ], -} diff --git a/src/processor/processor.gyp b/src/processor/processor.gyp deleted file mode 100644 index 146220f21..000000000 --- a/src/processor/processor.gyp +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../build/common.gypi', - 'processor_tools.gypi', - ], - 'targets': [ - { - 'target_name': 'processor', - 'type': 'static_library', - 'sources': [ - 'address_map-inl.h', - 'address_map.h', - 'basic_code_module.h', - 'basic_code_modules.cc', - 'basic_code_modules.h', - 'basic_source_line_resolver.cc', - 'basic_source_line_resolver_types.h', - 'call_stack.cc', - 'cfi_frame_info-inl.h', - 'cfi_frame_info.cc', - 'cfi_frame_info.h', - 'contained_range_map-inl.h', - 'contained_range_map.h', - 'convert_old_arm64_context.cc', - 'convert_old_arm64_context.h', - 'disassembler_objdump.cc', - 'disassembler_objdump.h', - 'disassembler_x86.cc', - 'disassembler_x86.h', - 'dump_context.cc', - 'dump_object.cc', - 'exploitability.cc', - 'exploitability_linux.cc', - 'exploitability_linux.h', - 'exploitability_win.cc', - 'exploitability_win.h', - 'fast_source_line_resolver.cc', - 'fast_source_line_resolver_types.h', - 'linked_ptr.h', - 'logging.cc', - 'logging.h', - 'map_serializers-inl.h', - 'map_serializers.h', - 'microdump_processor.cc', - 'minidump.cc', - 'minidump_processor.cc', - 'module_comparer.cc', - 'module_comparer.h', - 'module_factory.h', - 'module_serializer.cc', - 'module_serializer.h', - 'pathname_stripper.cc', - 'pathname_stripper.h', - 'postfix_evaluator-inl.h', - 'postfix_evaluator.h', - 'proc_maps_linux.cc', - 'process_state.cc', - 'range_map-inl.h', - 'range_map.h', - 'simple_serializer-inl.h', - 'simple_serializer.h', - 'simple_symbol_supplier.cc', - 'simple_symbol_supplier.h', - 'source_line_resolver_base.cc', - 'source_line_resolver_base_types.h', - 'stack_frame_cpu.cc', - 'stack_frame_symbolizer.cc', - 'stackwalk_common.cc', - 'stackwalk_common.h', - 'stackwalker.cc', - 'stackwalker_address_list.cc', - 'stackwalker_address_list.h', - 'stackwalker_amd64.cc', - 'stackwalker_amd64.h', - 'stackwalker_arm.cc', - 'stackwalker_arm.h', - 'stackwalker_arm64.cc', - 'stackwalker_arm64.h', - 'stackwalker_mips.cc', - 'stackwalker_mips.h', - 'stackwalker_ppc.cc', - 'stackwalker_ppc.h', - 'stackwalker_ppc64.cc', - 'stackwalker_ppc64.h', - 'stackwalker_selftest.cc', - 'stackwalker_sparc.cc', - 'stackwalker_sparc.h', - 'stackwalker_x86.cc', - 'stackwalker_x86.h', - 'static_address_map-inl.h', - 'static_address_map.h', - 'static_contained_range_map-inl.h', - 'static_contained_range_map.h', - 'static_map-inl.h', - 'static_map.h', - 'static_map_iterator-inl.h', - 'static_map_iterator.h', - 'static_range_map-inl.h', - 'static_range_map.h', - 'symbolic_constants_win.cc', - 'symbolic_constants_win.h', - 'synth_minidump.cc', - 'synth_minidump.h', - 'tokenize.cc', - 'tokenize.h', - 'windows_frame_info.h', - ], - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../common/common.gyp:common', - '../third_party/libdisasm/libdisasm.gyp:libdisasm', - ], - }, - { - 'target_name': 'processor_unittests', - 'type': 'executable', - 'sources': [ - 'address_map_unittest.cc', - 'basic_source_line_resolver_unittest.cc', - 'cfi_frame_info_unittest.cc', - 'contained_range_map_unittest.cc', - 'disassembler_objdump_unittest.cc', - 'disassembler_x86_unittest.cc', - 'exploitability_unittest.cc', - 'fast_source_line_resolver_unittest.cc', - 'map_serializers_unittest.cc', - 'microdump_processor_unittest.cc', - 'minidump_processor_unittest.cc', - 'minidump_unittest.cc', - 'pathname_stripper_unittest.cc', - 'postfix_evaluator_unittest.cc', - 'range_map_truncate_lower_unittest.cc', - 'range_map_truncate_upper_unittest.cc', - 'range_map_unittest.cc', - 'stackwalker_address_list_unittest.cc', - 'stackwalker_amd64_unittest.cc', - 'stackwalker_arm64_unittest.cc', - 'stackwalker_arm_unittest.cc', - 'stackwalker_mips_unittest.cc', - 'stackwalker_mips64_unittest.cc', - 'stackwalker_riscv_unittest.cc', - 'stackwalker_riscv64_unittest.cc', - 'stackwalker_unittest_utils.h', - 'stackwalker_x86_unittest.cc', - 'static_address_map_unittest.cc', - 'static_contained_range_map_unittest.cc', - 'static_map_unittest.cc', - 'static_range_map_unittest.cc', - 'synth_minidump_unittest.cc', - 'synth_minidump_unittest_data.h', - ], - 'include_dirs': [ - '..', - ], - 'dependencies': [ - 'processor', - '../build/testing.gyp:gmock', - '../build/testing.gyp:gtest', - ], - }, - ], -} diff --git a/src/processor/processor_tools.gypi b/src/processor/processor_tools.gypi deleted file mode 100644 index e64645db7..000000000 --- a/src/processor/processor_tools.gypi +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'target_defaults': { - 'include_dirs': [ - '..', - ], - }, - 'targets': [ - { - 'target_name': 'minidump_dump', - 'type': 'executable', - 'sources': [ - 'minidump_dump.cc', - ], - 'dependencies': [ - 'processor', - ], - }, - { - 'target_name': 'minidump_stackwalk', - 'type': 'executable', - 'sources': [ - 'minidump_stackwalk.cc', - ], - 'dependencies': [ - 'processor', - ], - }, - ], -} diff --git a/src/third_party/libdisasm/libdisasm.gyp b/src/third_party/libdisasm/libdisasm.gyp deleted file mode 100644 index 4847dd428..000000000 --- a/src/third_party/libdisasm/libdisasm.gyp +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'libdisasm', - 'type': 'static_library', - 'sources': [ - 'ia32_implicit.c', - 'ia32_implicit.h', - 'ia32_insn.c', - 'ia32_insn.h', - 'ia32_invariant.c', - 'ia32_invariant.h', - 'ia32_modrm.c', - 'ia32_modrm.h', - 'ia32_opcode_tables.c', - 'ia32_opcode_tables.h', - 'ia32_operand.c', - 'ia32_operand.h', - 'ia32_reg.c', - 'ia32_reg.h', - 'ia32_settings.c', - 'ia32_settings.h', - 'libdis.h', - 'qword.h', - 'x86_disasm.c', - 'x86_format.c', - 'x86_imm.c', - 'x86_imm.h', - 'x86_insn.c', - 'x86_misc.c', - 'x86_operand_list.c', - 'x86_operand_list.h', - ], - }, - ], -} diff --git a/src/tools/linux/tools_linux.gypi b/src/tools/linux/tools_linux.gypi deleted file mode 100644 index 48a43a8ce..000000000 --- a/src/tools/linux/tools_linux.gypi +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'target_defaults': { - 'include_dirs': [ - '../..', - ], - }, - 'targets': [ - { - 'target_name': 'dump_syms', - 'type': 'executable', - 'sources': [ - 'dump_syms/dump_syms.cc', - ], - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'md2core', - 'type': 'executable', - 'sources': [ - 'md2core/minidump-2-core.cc', - 'md2core/minidump_memory_range.h', - ], - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'minidump_upload', - 'type': 'executable', - 'sources': [ - 'symupload/minidump_upload.cc', - ], - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'symupload', - 'type': 'executable', - 'sources': [ - 'symupload/sym_upload.cc', - ], - 'link_settings': { - 'libraries': [ - '-ldl', - ], - }, - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - ], -} diff --git a/src/tools/mac/tools_mac.gypi b/src/tools/mac/tools_mac.gypi deleted file mode 100644 index 6ee9c6fdd..000000000 --- a/src/tools/mac/tools_mac.gypi +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'target_defaults': { - 'include_dirs': [ - '../..', - ], - }, - 'targets': [ - { - 'target_name': 'crash_report', - 'type': 'executable', - 'sources': [ - 'crash_report/crash_report.mm', - 'crash_report/on_demand_symbol_supplier.h', - 'crash_report/on_demand_symbol_supplier.mm', - ], - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', - ], - }, - 'dependencies': [ - '../common/common.gyp:common', - '../processor/processor.gyp:processor', - ], - }, - { - 'target_name': 'dump_syms', - 'type': 'executable', - 'sources': [ - 'dump_syms/dump_syms_tool.cc', - ], - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', - ], - }, - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'macho_dump', - 'type': 'executable', - 'sources': [ - 'dump_syms/macho_dump.cc', - ], - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'minidump_upload', - 'type': 'executable', - 'sources': [ - 'symupload/minidump_upload.m', - ], - 'include_dirs': [ - '../../common/mac', - ], - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', - ], - }, - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - { - 'target_name': 'symupload', - 'type': 'executable', - 'sources': [ - 'symupload/symupload.m', - ], - 'include_dirs': [ - '../../common/mac', - ], - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', - ], - }, - 'dependencies': [ - '../common/common.gyp:common', - ], - }, - ], -} diff --git a/src/tools/tools.gyp b/src/tools/tools.gyp deleted file mode 100644 index 66b749136..000000000 --- a/src/tools/tools.gyp +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'conditions': [ - ['OS=="mac"', { - 'includes': ['mac/tools_mac.gypi'], - }], - ['OS=="linux"', { - 'includes': ['linux/tools_linux.gypi'], - }], - ], -} diff --git a/src/tools/windows/converter/ms_symbol_server_converter.gyp b/src/tools/windows/converter/ms_symbol_server_converter.gyp deleted file mode 100644 index a6e500d6a..000000000 --- a/src/tools/windows/converter/ms_symbol_server_converter.gyp +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2013 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'ms_symbol_server_converter', - 'type': 'static_library', - 'msvs_guid': '1463C4CD-23FC-4DE9-BFDE-283338200157', - 'sources': [ - 'ms_symbol_server_converter.cc', - ], - 'dependencies': [ - '../../../common/windows/common_windows.gyp:common_windows_lib', - ], - }, - ], -} diff --git a/src/tools/windows/converter_exe/converter.gyp b/src/tools/windows/converter_exe/converter.gyp deleted file mode 100644 index b930e8812..000000000 --- a/src/tools/windows/converter_exe/converter.gyp +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2013 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'converter_exe', - 'type': 'executable', - 'sources': [ - 'converter.cc', - 'escaping.cc', - 'escaping.h', - 'http_client.h', - 'http_download.cc', - 'http_download.h', - 'tokenizer.cc', - 'tokenizer.h', - 'winhttp_client.cc', - 'winhttp_client.h', - 'wininet_client.cc', - 'wininet_client.h', - ], - 'dependencies': [ - '../../../common/windows/common_windows.gyp:common_windows_lib', - '../converter/ms_symbol_server_converter.gyp:ms_symbol_server_converter', - ], - }, - ], -} diff --git a/src/tools/windows/dump_syms/dump_syms.gyp b/src/tools/windows/dump_syms/dump_syms.gyp deleted file mode 100644 index efb013e41..000000000 --- a/src/tools/windows/dump_syms/dump_syms.gyp +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2013 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'dump_syms', - 'type': 'executable', - 'sources': [ - 'dump_syms.cc', - ], - 'dependencies': [ - '../../../common/windows/common_windows.gyp:common_windows_lib', - ], - }, - { - 'target_name': 'dump_syms_unittest', - 'type': 'executable', - 'sources': [ - 'dump_syms_unittest.cc', - ], - 'dependencies': [ - '<(DEPTH)/client/windows/unittests/testing.gyp:gmock', - '<(DEPTH)/client/windows/unittests/testing.gyp:gtest', - 'dump_syms', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'shell32.lib', - ], - }, - }, - }, - ], -} diff --git a/src/tools/windows/symupload/symupload.gyp b/src/tools/windows/symupload/symupload.gyp deleted file mode 100644 index 5e6295918..000000000 --- a/src/tools/windows/symupload/symupload.gyp +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2013 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -{ - 'includes': [ - '../../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'symupload', - 'type': 'executable', - 'sources': [ - 'symupload.cc', - ], - 'dependencies': [ - '../../../common/windows/common_windows.gyp:common_windows_lib', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'LargeAddressAware': '2', - }, - }, - }, - ], -} diff --git a/src/tools/windows/tools_windows.gyp b/src/tools/windows/tools_windows.gyp deleted file mode 100644 index a616b2371..000000000 --- a/src/tools/windows/tools_windows.gyp +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2017 Google LLC -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google LLC nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -{ - 'includes': [ - '../../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'build_all', - 'type': 'none', - 'dependencies': [ - './converter/ms_symbol_server_converter.gyp:*', - './converter_exe/converter.gyp:*', - './dump_syms/dump_syms.gyp:*', - './symupload/symupload.gyp:*', - ], - }, - ], -} From cc7abac08b0c52e6581b9c9c4226816b17a4c26d Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 8 Dec 2022 18:27:40 +0000 Subject: [PATCH 139/195] Add option to enable multiple symbol field in Linux tool Bug: google-breakpad:751 Change-Id: I63a4d652413ef7311da7494fbd8fb816445eb353 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4089183 Reviewed-by: Mark Mentovai --- src/common/linux/dump_symbols.cc | 14 ++++++++------ src/common/linux/dump_symbols.h | 9 ++++++--- src/tools/linux/dump_syms/dump_syms.cc | 9 ++++++++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 7e639b0a8..4915e6ffc 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -1024,7 +1024,8 @@ template bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header, const string& obj_filename, const string& obj_os, - scoped_ptr& module) { + scoped_ptr& module, + bool enable_multiple_field) { PageAllocator allocator; wasteful_vector identifier(&allocator, kDefaultBuildIdSize); if (!FileID::ElfFileIdentifierFromMappedFile(elf_header, identifier)) { @@ -1053,7 +1054,8 @@ bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header, // This is just the raw Build ID in hex. string code_id = FileID::ConvertIdentifierToString(identifier); - module.reset(new Module(name, obj_os, architecture, id, code_id)); + module.reset(new Module(name, obj_os, architecture, id, code_id, + enable_multiple_field)); return true; } @@ -1070,8 +1072,8 @@ bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header, *out_module = NULL; scoped_ptr module; - if (!InitModuleForElfClass(elf_header, obj_filename, obj_os, - module)) { + if (!InitModuleForElfClass(elf_header, obj_filename, obj_os, module, + options.enable_multiple_field)) { return false; } @@ -1183,14 +1185,14 @@ bool WriteSymbolFileHeader(const string& load_path, if (elfclass == ELFCLASS32) { if (!InitModuleForElfClass( reinterpret_cast(elf_header), obj_file, obj_os, - module)) { + module, /*enable_multiple_field=*/false)) { fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); return false; } } else if (elfclass == ELFCLASS64) { if (!InitModuleForElfClass( reinterpret_cast(elf_header), obj_file, obj_os, - module)) { + module, /*enable_multiple_field=*/false)) { fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); return false; } diff --git a/src/common/linux/dump_symbols.h b/src/common/linux/dump_symbols.h index 8ac169c9f..f1802ecc3 100644 --- a/src/common/linux/dump_symbols.h +++ b/src/common/linux/dump_symbols.h @@ -46,13 +46,16 @@ namespace google_breakpad { class Module; struct DumpOptions { - DumpOptions(SymbolData symbol_data, bool handle_inter_cu_refs) + DumpOptions(SymbolData symbol_data, + bool handle_inter_cu_refs, + bool enable_multiple_field) : symbol_data(symbol_data), - handle_inter_cu_refs(handle_inter_cu_refs) { - } + handle_inter_cu_refs(handle_inter_cu_refs), + enable_multiple_field(enable_multiple_field) {} SymbolData symbol_data; bool handle_inter_cu_refs; + bool enable_multiple_field; }; // Find all the debugging information in OBJ_FILE, an ELF executable diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index 6e6a64249..8998b3b35 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -56,6 +56,9 @@ int usage(const char* self) { fprintf(stderr, " -n Use specified name for name of the object\n"); fprintf(stderr, " -o Use specified name for the " "operating system\n"); + fprintf(stderr, " -m Enable writing the optional 'm' field on FUNC" + "and PUBLIC, denoting multiple symbols for " + "the address.\n"); return 1; } @@ -67,6 +70,7 @@ int main(int argc, char** argv) { bool handle_inlines = false; bool handle_inter_cu_refs = true; bool log_to_stderr = false; + bool enable_multiple_field = false; std::string obj_name; const char* obj_os = "Linux"; int arg_index = 1; @@ -96,6 +100,8 @@ int main(int argc, char** argv) { } obj_os = argv[arg_index + 1]; ++arg_index; + } else if (strcmp("-m", argv[arg_index]) == 0) { + enable_multiple_field = true; } else { printf("2.4 %s\n", argv[arg_index]); return usage(argv[0]); @@ -132,7 +138,8 @@ int main(int argc, char** argv) { } else { SymbolData symbol_data = (handle_inlines ? INLINES : NO_DATA) | (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; - google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs); + google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs, + enable_multiple_field); if (!WriteSymbolFile(binary, obj_name, obj_os, debug_dirs, options, std::cout)) { fprintf(saved_stderr, "Failed to write symbol file.\n"); From 9acaa082c824c65cc220e8fa1740d5b748000c60 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 12 Dec 2022 17:22:04 +0800 Subject: [PATCH 140/195] Fix build failures. - Fix a test build failure introduced by https://chromium.googlesource.com/breakpad/breakpad/+/cc7abac08b0c52e6581b9c9c4226816b17a4c26d. - Use strcmp from instead of std::strcmp from . Bug: google-breakpad:867 Change-Id: I8dcbc7d5ac8ea799b4d5287ddbbf5d6626992123 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4095054 Reviewed-by: Mike Frysinger --- src/common/dwarf/elf_reader.cc | 8 ++++---- src/common/linux/dump_symbols_unittest.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 4f8b6030c..5fd1cfb96 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -183,7 +183,7 @@ class Elf64 { template class ElfSectionReader { public: - ElfSectionReader(const char* name, const string& path, int fd, + ElfSectionReader(const char* cname, const string& path, int fd, const typename ElfArch::Shdr& section_header) : contents_aligned_(NULL), contents_(NULL), @@ -198,8 +198,8 @@ class ElfSectionReader { if (header_.sh_type == SHT_NOBITS || header_.sh_size == 0) return; // extra sh_type check for string table. - if ((std::strcmp(name, ".strtab") == 0 || - std::strcmp(name, ".shstrtab") == 0) && + std::string_view name{cname}; + if ((name == ".strtab" || name == ".shstrtab") && header_.sh_type != SHT_STRTAB) { fprintf(stderr, "Invalid sh_type for string table section: expected " @@ -215,7 +215,7 @@ class ElfSectionReader { (header_.sh_offset - offset_aligned); // Check for and handle any compressed contents. - //if (strncmp(name, ".zdebug_", strlen(".zdebug_")) == 0) + //if (name == ".zdebug_") // DecompressZlibContents(); // TODO(saugustine): Add support for proposed elf-section flag // "SHF_COMPRESS". diff --git a/src/common/linux/dump_symbols_unittest.cc b/src/common/linux/dump_symbols_unittest.cc index 4167ccc59..97d5827e2 100644 --- a/src/common/linux/dump_symbols_unittest.cc +++ b/src/common/linux/dump_symbols_unittest.cc @@ -91,7 +91,7 @@ TYPED_TEST(DumpSymbols, Invalid) { Elf32_Ehdr header; memset(&header, 0, sizeof(header)); Module* module; - DumpOptions options(ALL_SYMBOL_DATA, true); + DumpOptions options(ALL_SYMBOL_DATA, true, false); EXPECT_FALSE(ReadSymbolDataInternal(reinterpret_cast(&header), "foo", "Linux", @@ -128,7 +128,7 @@ TYPED_TEST(DumpSymbols, SimplePublic) { this->GetElfContents(elf); Module* module; - DumpOptions options(ALL_SYMBOL_DATA, true); + DumpOptions options(ALL_SYMBOL_DATA, true, false); EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata, "foo", "Linux", @@ -185,7 +185,7 @@ TYPED_TEST(DumpSymbols, SimpleBuildID) { this->GetElfContents(elf); Module* module; - DumpOptions options(ALL_SYMBOL_DATA, true); + DumpOptions options(ALL_SYMBOL_DATA, true, false); EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata, "foo", "Linux", From 33b84389868f03ac0e3ebd8b95d1ba5cec555adc Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 14 Dec 2022 13:04:49 -0500 Subject: [PATCH 141/195] Remove tools/mac/crash_report This is pretty rotted and unmaintained, and nobody seems to be using it. Bug: None Change-Id: I965393dd75d995d5c7d55bea6d9b256e89a7421b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4107469 Reviewed-by: Mark Mentovai --- src/tools/mac/crash_report/crash_report.mm | 417 ------------ .../crash_report.xcodeproj/project.pbxproj | 618 ------------------ .../crash_report/on_demand_symbol_supplier.h | 110 ---- .../crash_report/on_demand_symbol_supplier.mm | 313 --------- 4 files changed, 1458 deletions(-) delete mode 100644 src/tools/mac/crash_report/crash_report.mm delete mode 100644 src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj delete mode 100644 src/tools/mac/crash_report/on_demand_symbol_supplier.h delete mode 100644 src/tools/mac/crash_report/on_demand_symbol_supplier.mm diff --git a/src/tools/mac/crash_report/crash_report.mm b/src/tools/mac/crash_report/crash_report.mm deleted file mode 100644 index 36322ec8f..000000000 --- a/src/tools/mac/crash_report/crash_report.mm +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright 2010 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// crash_report.mm: Convert the contents of a minidump into a format that -// looks more like Apple's CrashReporter format - -#include - -#include -#include - -#include - -#include - -#include "common/scoped_ptr.h" -#include "google_breakpad/processor/basic_source_line_resolver.h" -#include "google_breakpad/processor/call_stack.h" -#include "google_breakpad/processor/code_module.h" -#include "google_breakpad/processor/minidump.h" -#include "google_breakpad/processor/minidump_processor.h" -#include "google_breakpad/processor/process_state.h" -#include "google_breakpad/processor/stack_frame_cpu.h" -#include "google_breakpad/processor/system_info.h" -#include "processor/pathname_stripper.h" -#include "processor/simple_symbol_supplier.h" - -#include "on_demand_symbol_supplier.h" - -using std::string; - -using google_breakpad::BasicSourceLineResolver; -using google_breakpad::CallStack; -using google_breakpad::CodeModule; -using google_breakpad::CodeModules; -using google_breakpad::Minidump; -using google_breakpad::MinidumpProcessor; -using google_breakpad::OnDemandSymbolSupplier; -using google_breakpad::PathnameStripper; -using google_breakpad::ProcessState; -using google_breakpad::scoped_ptr; -using google_breakpad::StackFrame; -using google_breakpad::StackFramePPC; -using google_breakpad::StackFrameX86; -using google_breakpad::SystemInfo; - -typedef struct { - NSString *minidumpPath; - NSString *searchDir; - NSString *symbolSearchDir; - BOOL printThreadMemory; -} Options; - -//============================================================================= -static int PrintRegister(const char *name, u_int32_t value, int sequence) { - if (sequence % 4 == 0) { - printf("\n"); - } - printf("%6s = 0x%08x ", name, value); - return ++sequence; -} - -//============================================================================= -static void PrintStack(const CallStack *stack, const string &cpu) { - size_t frame_count = stack->frames()->size(); - char buffer[1024]; - for (size_t frame_index = 0; frame_index < frame_count; ++frame_index) { - const StackFrame *frame = stack->frames()->at(frame_index); - const CodeModule *module = frame->module; - printf("%2zu ", frame_index); - - if (module) { - // Module name (20 chars max) - strcpy(buffer, PathnameStripper::File(module->code_file()).c_str()); - int maxStr = 20; - buffer[maxStr] = 0; - printf("%-*s", maxStr, buffer); - - strcpy(buffer, module->version().c_str()); - buffer[maxStr] = 0; - - printf("%-*s",maxStr, buffer); - - u_int64_t instruction = frame->instruction; - - // PPC only: Adjust the instruction to match that of Crash reporter. The - // instruction listed is actually the return address. See the detailed - // comments in stackwalker_ppc.cc for more information. - if (cpu == "ppc" && frame_index) - instruction += 4; - - printf(" 0x%08llx ", instruction); - - // Function name - if (!frame->function_name.empty()) { - printf("%s", frame->function_name.c_str()); - if (!frame->source_file_name.empty()) { - string source_file = PathnameStripper::File(frame->source_file_name); - printf(" + 0x%llx (%s:%d)", - instruction - frame->source_line_base, - source_file.c_str(), frame->source_line); - } else { - printf(" + 0x%llx", instruction - frame->function_base); - } - } - } - printf("\n"); - } -} - -//============================================================================= -static void PrintRegisters(const CallStack *stack, const string &cpu) { - int sequence = 0; - const StackFrame *frame = stack->frames()->at(0); - if (cpu == "x86") { - const StackFrameX86 *frame_x86 = - reinterpret_cast(frame); - - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EIP) - sequence = PrintRegister("eip", frame_x86->context.eip, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP) - sequence = PrintRegister("esp", frame_x86->context.esp, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBP) - sequence = PrintRegister("ebp", frame_x86->context.ebp, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBX) - sequence = PrintRegister("ebx", frame_x86->context.ebx, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESI) - sequence = PrintRegister("esi", frame_x86->context.esi, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EDI) - sequence = PrintRegister("edi", frame_x86->context.edi, sequence); - if (frame_x86->context_validity == StackFrameX86::CONTEXT_VALID_ALL) { - sequence = PrintRegister("eax", frame_x86->context.eax, sequence); - sequence = PrintRegister("ecx", frame_x86->context.ecx, sequence); - sequence = PrintRegister("edx", frame_x86->context.edx, sequence); - sequence = PrintRegister("efl", frame_x86->context.eflags, sequence); - } - } else if (cpu == "ppc") { - const StackFramePPC *frame_ppc = - reinterpret_cast(frame); - - if ((frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_ALL) == - StackFramePPC::CONTEXT_VALID_ALL) { - sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence); - sequence = PrintRegister("srr1", frame_ppc->context.srr1, sequence); - sequence = PrintRegister("cr", frame_ppc->context.cr, sequence); - sequence = PrintRegister("xer", frame_ppc->context.xer, sequence); - sequence = PrintRegister("lr", frame_ppc->context.lr, sequence); - sequence = PrintRegister("ctr", frame_ppc->context.ctr, sequence); - sequence = PrintRegister("mq", frame_ppc->context.mq, sequence); - sequence = PrintRegister("vrsave", frame_ppc->context.vrsave, sequence); - - sequence = 0; - char buffer[5]; - for (int i = 0; i < MD_CONTEXT_PPC_GPR_COUNT; ++i) { - sprintf(buffer, "r%d", i); - sequence = PrintRegister(buffer, frame_ppc->context.gpr[i], sequence); - } - } else { - if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_SRR0) - sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence); - if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_GPR1) - sequence = PrintRegister("r1", frame_ppc->context.gpr[1], sequence); - } - } - - printf("\n"); -} - -static void PrintModules(const CodeModules *modules) { - if (!modules) - return; - - printf("\n"); - printf("Loaded modules:\n"); - - u_int64_t main_address = 0; - const CodeModule *main_module = modules->GetMainModule(); - if (main_module) { - main_address = main_module->base_address(); - } - - unsigned int module_count = modules->module_count(); - for (unsigned int module_sequence = 0; - module_sequence < module_count; - ++module_sequence) { - const CodeModule *module = modules->GetModuleAtSequence(module_sequence); - assert(module); - u_int64_t base_address = module->base_address(); - printf("0x%08llx - 0x%08llx %s %s%s %s\n", - base_address, base_address + module->size() - 1, - PathnameStripper::File(module->code_file()).c_str(), - module->version().empty() ? "???" : module->version().c_str(), - main_module != NULL && base_address == main_address ? - " (main)" : "", - module->code_file().c_str()); - } -} - -static void ProcessSingleReport(Options *options, NSString *file_path) { - string minidump_file([file_path fileSystemRepresentation]); - BasicSourceLineResolver resolver; - string search_dir = options->searchDir ? - [options->searchDir fileSystemRepresentation] : ""; - string symbol_search_dir = options->symbolSearchDir ? - [options->symbolSearchDir fileSystemRepresentation] : ""; - scoped_ptr symbol_supplier( - new OnDemandSymbolSupplier(search_dir, symbol_search_dir)); - scoped_ptr - minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver)); - ProcessState process_state; - scoped_ptr dump(new google_breakpad::Minidump(minidump_file)); - - if (!dump->Read()) { - fprintf(stderr, "Minidump %s could not be read\n", dump->path().c_str()); - return; - } - if (minidump_processor->Process(dump.get(), &process_state) != - google_breakpad::PROCESS_OK) { - fprintf(stderr, "MinidumpProcessor::Process failed\n"); - return; - } - - const SystemInfo *system_info = process_state.system_info(); - string cpu = system_info->cpu; - - // Convert the time to a string - u_int32_t time_date_stamp = process_state.time_date_stamp(); - struct tm timestruct; - gmtime_r(reinterpret_cast(&time_date_stamp), ×truct); - char timestr[20]; - strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", ×truct); - printf("Date: %s GMT\n", timestr); - - printf("Operating system: %s (%s)\n", system_info->os.c_str(), - system_info->os_version.c_str()); - printf("Architecture: %s\n", cpu.c_str()); - - if (process_state.crashed()) { - printf("Crash reason: %s\n", process_state.crash_reason().c_str()); - printf("Crash address: 0x%llx\n", process_state.crash_address()); - } else { - printf("No crash\n"); - } - - int requesting_thread = process_state.requesting_thread(); - if (requesting_thread != -1) { - printf("\n"); - printf("Thread %d (%s)", - requesting_thread, - process_state.crashed() ? "crashed" : - "requested dump, did not crash"); - string requesting_thread_name = process_state.thread_names()->at(requesting_thread); - if (!requesting_thread_name.empty()) { - printf(" (name: %s)", requesting_thread_name.c_str()); - } - printf("\n"); - PrintStack(process_state.threads()->at(requesting_thread), cpu); - } - - // Print all of the threads in the dump. - int thread_count = static_cast(process_state.threads()->size()); - const std::vector - *thread_memory_regions = process_state.thread_memory_regions(); - - for (int thread_index = 0; thread_index < thread_count; ++thread_index) { - if (thread_index != requesting_thread) { - // Don't print the crash thread again, it was already printed. - printf("\n"); - printf("Thread %d", thread_index); - string thread_name = process_state.thread_names()->at(thread_index); - if (!thread_name.empty()) { - printf(" (name: %s)", thread_name.c_str()); - } - printf("\n"); - PrintStack(process_state.threads()->at(thread_index), cpu); - google_breakpad::MemoryRegion *thread_stack_bytes = - thread_memory_regions->at(thread_index); - if (options->printThreadMemory) { - thread_stack_bytes->Print(); - } - } - } - - // Print the crashed registers - if (requesting_thread != -1) { - printf("\nThread %d:", requesting_thread); - PrintRegisters(process_state.threads()->at(requesting_thread), cpu); - } - - // Print information about modules - PrintModules(process_state.modules()); -} - -//============================================================================= -static void Start(Options *options) { - NSFileManager *manager = [NSFileManager defaultManager]; - NSString *minidump_path = options->minidumpPath; - BOOL is_dir = NO; - BOOL file_exists = [manager fileExistsAtPath:minidump_path - isDirectory:&is_dir]; - if (file_exists && is_dir) { - NSDirectoryEnumerator *enumerator = - [manager enumeratorAtPath:minidump_path]; - NSString *current_file = nil; - while ((current_file = [enumerator nextObject])) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - if ([[current_file pathExtension] isEqualTo:@"dmp"]) { - printf("Attempting to process report: %s\n", - [current_file cStringUsingEncoding:NSASCIIStringEncoding]); - NSString *full_path = - [minidump_path stringByAppendingPathComponent:current_file]; - ProcessSingleReport(options, full_path); - } - [pool release]; - } - } else if (file_exists) { - ProcessSingleReport(options, minidump_path); - } -} - -//============================================================================= -static void Usage(int argc, const char *argv[]) { - fprintf(stderr, "Convert a minidump to a crash report. Breakpad symbol " - "files will be used (or created if missing) in /tmp.\n" - "If a symbol-file-search-dir is specified, any symbol " - "files in it will be used instead of being loaded from " - "modules on disk.\n" - "If modules cannot be found at the paths stored in the " - "minidump file, they will be searched for at " - "/.\n"); - fprintf(stderr, "Usage: %s [-s module-search-dir] [-S symbol-file-search-dir] " - "minidump-file\n", argv[0]); - fprintf(stderr, "\t-s: Specify a search directory to use for missing modules\n" - "\t-S: Specify a search directory to use for symbol files\n" - "\t-t: Print thread stack memory in hex\n" - "\t-h: Usage\n" - "\t-?: Usage\n"); -} - -//============================================================================= -static void SetupOptions(int argc, const char *argv[], Options *options) { - extern int optind; - char ch; - - while ((ch = getopt(argc, (char * const *)argv, "S:s:ht?")) != -1) { - switch (ch) { - case 's': - options->searchDir = [[NSFileManager defaultManager] - stringWithFileSystemRepresentation:optarg - length:strlen(optarg)]; - break; - - case 'S': - options->symbolSearchDir = [[NSFileManager defaultManager] - stringWithFileSystemRepresentation:optarg - length:strlen(optarg)]; - break; - - case 't': - options->printThreadMemory = YES; - break; - case 'h': - case '?': - Usage(argc, argv); - exit(1); - break; - } - } - - if ((argc - optind) != 1) { - fprintf(stderr, "%s: Missing minidump file\n", argv[0]); - Usage(argc, argv); - exit(1); - } - - options->minidumpPath = [[NSFileManager defaultManager] - stringWithFileSystemRepresentation:argv[optind] - length:strlen(argv[optind])]; -} - -//============================================================================= -int main (int argc, const char * argv[]) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - Options options; - - bzero(&options, sizeof(Options)); - SetupOptions(argc, argv, &options); - Start(&options); - [pool release]; - - return 0; -} diff --git a/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj b/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj deleted file mode 100644 index 33204f7e2..000000000 --- a/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj +++ /dev/null @@ -1,618 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */; }; - 4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */; }; - 4247E6402110D5A500482558 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4247E63F2110D5A500482558 /* path_helper.cc */; }; - 4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */; }; - 4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721E126F9ADE00B43EAF /* exploitability.cc */; }; - 4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */; }; - 4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */; }; - 4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */; }; - 4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722C126F9B6E00B43EAF /* x86_misc.c */; }; - 4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */; }; - 4D2C7233126F9BB000B43EAF /* ia32_invariant.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; }; - 4D2C7235126F9BC200B43EAF /* ia32_settings.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7234126F9BC200B43EAF /* ia32_settings.c */; }; - 4D2C7246126F9C0B00B43EAF /* ia32_insn.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */; }; - 4D2C724A126F9C2300B43EAF /* ia32_opcode_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; }; - 4D2C724C126F9C3800B43EAF /* ia32_implicit.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; }; - 4D2C724E126F9C4D00B43EAF /* ia32_reg.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; }; - 4D2C725B126F9C8000B43EAF /* ia32_operand.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C725A126F9C8000B43EAF /* ia32_operand.c */; }; - 4D2C725D126F9C9200B43EAF /* x86_insn.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C725C126F9C9200B43EAF /* x86_insn.c */; }; - 4D2C7264126F9CBB00B43EAF /* ia32_modrm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */; }; - 4D2C726D126F9CDC00B43EAF /* x86_imm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7263126F9CBB00B43EAF /* x86_imm.c */; }; - 4D72CA5713DFBA84006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA5613DFBA84006CABE3 /* md5.cc */; }; - 557800400BE1F28500EC23E0 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */; }; - 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */; }; - 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */; }; - 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */; }; - 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */; }; - 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */; }; - 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */; }; - 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8411F0C6FB00FCF3E4 /* language.cc */; }; - 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8611F0C6FB00FCF3E4 /* module.cc */; }; - 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */; }; - 8B40BDC00C0638E4009535AF /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B40BDBF0C0638E4009535AF /* logging.cc */; }; - 8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* crash_report.mm */; settings = {ATTRIBUTES = (); }; }; - 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; - 9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */; }; - 9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */; }; - 9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172A0B1B8B2400F8391B /* call_stack.cc */; }; - 9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */; }; - 9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF173F0B1B8B9A00F8391B /* minidump.cc */; }; - 9BDF17540B1B8BF900F8391B /* stackwalker_ppc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */; }; - 9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */; }; - 9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17530B1B8BF900F8391B /* stackwalker.cc */; }; - 9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF175B0B1B8C1B00F8391B /* process_state.cc */; }; - 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */; }; - 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */; }; - 9BDF21A70B1E825400F8391B /* dump_syms.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */; }; - 9BE650B20B52FE3000611104 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AC0B52FE3000611104 /* file_id.cc */; }; - 9BE650B40B52FE3000611104 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AE0B52FE3000611104 /* macho_id.cc */; }; - 9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650B00B52FE3000611104 /* macho_walker.cc */; }; - D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */; }; - D2A5DD631188658B00081F03 /* tokenize.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD621188658B00081F03 /* tokenize.cc */; }; - F407DC48185773C10064622B /* exploitability_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC40185773C10064622B /* exploitability_linux.cc */; }; - F407DC49185773C10064622B /* stack_frame_symbolizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC41185773C10064622B /* stack_frame_symbolizer.cc */; }; - F407DC4A185773C10064622B /* stackwalker_arm64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC42185773C10064622B /* stackwalker_arm64.cc */; }; - F407DC4B185773C10064622B /* stackwalker_mips.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC44185773C10064622B /* stackwalker_mips.cc */; }; - F407DC4C185773C10064622B /* stackwalker_ppc64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC46185773C10064622B /* stackwalker_ppc64.cc */; }; - F44DDD8719C85CD50047280E /* dump_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8419C85CD50047280E /* dump_context.cc */; }; - F44DDD8819C85CD50047280E /* dump_object.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8519C85CD50047280E /* dump_object.cc */; }; - F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8619C85CD50047280E /* microdump_processor.cc */; }; - F47180561D745DEF0032F208 /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180541D745DEF0032F208 /* elf_reader.cc */; }; - F47180581D7467630032F208 /* proc_maps_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180571D7467630032F208 /* proc_maps_linux.cc */; }; - F471805A1D7468A40032F208 /* symbolic_constants_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180591D7468A40032F208 /* symbolic_constants_win.cc */; }; - F4D43B2F1A38490700C290B2 /* microdump.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4D43B2E1A38490700C290B2 /* microdump.cc */; }; - F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE20E8ABCA600E953AD /* bytereader.cc */; }; - F9C7ECE60E8ABCA600E953AD /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */; }; - F9C7ECE70E8ABCA600E953AD /* functioninfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */; }; - F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */; }; - FD6625CD0CF4D45C004AC844 /* stackwalker_amd64.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */; }; - FD8EDEAE0CADDAD400A5EDF1 /* stackwalker_sparc.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 08FB7796FE84155DC02AAC07 /* crash_report.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = crash_report.mm; sourceTree = ""; }; - 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = ""; }; - 162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = ""; }; - 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_old_arm64_context.cc; path = ../../../processor/convert_old_arm64_context.cc; sourceTree = ""; }; - 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_old_arm64_context.h; path = ../../../processor/convert_old_arm64_context.h; sourceTree = ""; }; - 4247E63E2110D5A500482558 /* path_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path_helper.h; path = ../../../common/path_helper.h; sourceTree = ""; }; - 4247E63F2110D5A500482558 /* path_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path_helper.cc; path = ../../../common/path_helper.cc; sourceTree = ""; }; - 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = source_line_resolver_base.cc; path = ../../../processor/source_line_resolver_base.cc; sourceTree = SOURCE_ROOT; }; - 4D2C721E126F9ADE00B43EAF /* exploitability.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability.cc; path = ../../../processor/exploitability.cc; sourceTree = SOURCE_ROOT; }; - 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_win.cc; path = ../../../processor/exploitability_win.cc; sourceTree = SOURCE_ROOT; }; - 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = disassembler_x86.cc; path = ../../../processor/disassembler_x86.cc; sourceTree = SOURCE_ROOT; }; - 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_disasm.c; path = ../../../third_party/libdisasm/x86_disasm.c; sourceTree = SOURCE_ROOT; }; - 4D2C722C126F9B6E00B43EAF /* x86_misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_misc.c; path = ../../../third_party/libdisasm/x86_misc.c; sourceTree = SOURCE_ROOT; }; - 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_operand_list.c; path = ../../../third_party/libdisasm/x86_operand_list.c; sourceTree = SOURCE_ROOT; }; - 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_invariant.c; path = ../../../third_party/libdisasm/ia32_invariant.c; sourceTree = SOURCE_ROOT; }; - 4D2C7234126F9BC200B43EAF /* ia32_settings.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_settings.c; path = ../../../third_party/libdisasm/ia32_settings.c; sourceTree = SOURCE_ROOT; }; - 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_insn.c; path = ../../../third_party/libdisasm/ia32_insn.c; sourceTree = SOURCE_ROOT; }; - 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_opcode_tables.c; path = ../../../third_party/libdisasm/ia32_opcode_tables.c; sourceTree = SOURCE_ROOT; }; - 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_implicit.c; path = ../../../third_party/libdisasm/ia32_implicit.c; sourceTree = SOURCE_ROOT; }; - 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_reg.c; path = ../../../third_party/libdisasm/ia32_reg.c; sourceTree = SOURCE_ROOT; }; - 4D2C725A126F9C8000B43EAF /* ia32_operand.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_operand.c; path = ../../../third_party/libdisasm/ia32_operand.c; sourceTree = SOURCE_ROOT; }; - 4D2C725C126F9C9200B43EAF /* x86_insn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_insn.c; path = ../../../third_party/libdisasm/x86_insn.c; sourceTree = SOURCE_ROOT; }; - 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_modrm.c; path = ../../../third_party/libdisasm/ia32_modrm.c; sourceTree = SOURCE_ROOT; }; - 4D2C7263126F9CBB00B43EAF /* x86_imm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_imm.c; path = ../../../third_party/libdisasm/x86_imm.c; sourceTree = SOURCE_ROOT; }; - 4D72CA5613DFBA84006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; }; - 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; }; - 5578003F0BE1F28500EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; }; - 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; }; - 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; }; - 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; }; - 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cfi_to_module.cc; path = ../../../common/dwarf_cfi_to_module.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cfi_to_module.h; path = ../../../common/dwarf_cfi_to_module.h; sourceTree = SOURCE_ROOT; }; - 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cu_to_module.cc; path = ../../../common/dwarf_cu_to_module.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cu_to_module.h; path = ../../../common/dwarf_cu_to_module.h; sourceTree = SOURCE_ROOT; }; - 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_line_to_module.cc; path = ../../../common/dwarf_line_to_module.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_line_to_module.h; path = ../../../common/dwarf_line_to_module.h; sourceTree = SOURCE_ROOT; }; - 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_reader.cc; path = ../../../common/stabs_reader.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_reader.h; path = ../../../common/stabs_reader.h; sourceTree = SOURCE_ROOT; }; - 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_to_module.cc; path = ../../../common/stabs_to_module.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_to_module.h; path = ../../../common/stabs_to_module.h; sourceTree = SOURCE_ROOT; }; - 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader.cc; path = ../../../common/mac/macho_reader.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_reader.h; path = ../../../common/mac/macho_reader.h; sourceTree = SOURCE_ROOT; }; - 8B31FF8411F0C6FB00FCF3E4 /* language.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = language.cc; path = ../../../common/language.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF8511F0C6FB00FCF3E4 /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = language.h; path = ../../../common/language.h; sourceTree = SOURCE_ROOT; }; - 8B31FF8611F0C6FB00FCF3E4 /* module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cc; path = ../../../common/module.cc; sourceTree = SOURCE_ROOT; }; - 8B31FF8711F0C6FB00FCF3E4 /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../../common/module.h; sourceTree = SOURCE_ROOT; }; - 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2diehandler.cc; path = ../../../common/dwarf/dwarf2diehandler.cc; sourceTree = SOURCE_ROOT; }; - 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2diehandler.h; path = ../../../common/dwarf/dwarf2diehandler.h; sourceTree = SOURCE_ROOT; }; - 8B40BDBF0C0638E4009535AF /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = ../../../processor/logging.cc; sourceTree = SOURCE_ROOT; }; - 8DD76FA10486AA7600D96B5E /* crash_report */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = crash_report; sourceTree = BUILT_PRODUCTS_DIR; }; - 9B35FEE20B2675F9008DE8C7 /* code_module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_module.h; path = ../../../google_breakpad/processor/code_module.h; sourceTree = SOURCE_ROOT; }; - 9B35FEE30B2675F9008DE8C7 /* code_modules.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_modules.h; path = ../../../google_breakpad/processor/code_modules.h; sourceTree = SOURCE_ROOT; }; - 9B35FEE60B26761C008DE8C7 /* basic_code_module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = basic_code_module.h; path = ../../../processor/basic_code_module.h; sourceTree = SOURCE_ROOT; }; - 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = basic_code_modules.cc; path = ../../../processor/basic_code_modules.cc; sourceTree = SOURCE_ROOT; }; - 9B35FEE80B26761C008DE8C7 /* basic_code_modules.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = basic_code_modules.h; path = ../../../processor/basic_code_modules.h; sourceTree = SOURCE_ROOT; }; - 9B3904940B2E52D90059FABE /* basic_source_line_resolver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = basic_source_line_resolver.h; sourceTree = ""; }; - 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = source_line_resolver_interface.h; sourceTree = ""; }; - 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = basic_source_line_resolver.cc; path = ../../../processor/basic_source_line_resolver.cc; sourceTree = SOURCE_ROOT; }; - 9B44619D0B66C66B00BBB817 /* system_info.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = system_info.h; sourceTree = ""; }; - 9BDF16F90B1B8ACD00F8391B /* breakpad_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = breakpad_types.h; sourceTree = ""; }; - 9BDF16FA0B1B8ACD00F8391B /* minidump_format.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_format.h; sourceTree = ""; }; - 9BDF16FC0B1B8ACD00F8391B /* call_stack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = call_stack.h; sourceTree = ""; }; - 9BDF16FD0B1B8ACD00F8391B /* memory_region.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = memory_region.h; sourceTree = ""; }; - 9BDF16FE0B1B8ACD00F8391B /* minidump.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump.h; sourceTree = ""; }; - 9BDF16FF0B1B8ACD00F8391B /* minidump_processor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_processor.h; sourceTree = ""; }; - 9BDF17000B1B8ACD00F8391B /* process_state.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = process_state.h; sourceTree = ""; }; - 9BDF17010B1B8ACD00F8391B /* stack_frame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame.h; sourceTree = ""; }; - 9BDF17020B1B8ACD00F8391B /* stack_frame_cpu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame_cpu.h; sourceTree = ""; }; - 9BDF17030B1B8ACD00F8391B /* stackwalker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stackwalker.h; sourceTree = ""; }; - 9BDF17040B1B8ACD00F8391B /* symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = symbol_supplier.h; sourceTree = ""; }; - 9BDF172A0B1B8B2400F8391B /* call_stack.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = call_stack.cc; path = ../../../processor/call_stack.cc; sourceTree = SOURCE_ROOT; }; - 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_processor.cc; path = ../../../processor/minidump_processor.cc; sourceTree = SOURCE_ROOT; }; - 9BDF173F0B1B8B9A00F8391B /* minidump.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = minidump.cc; path = ../../../processor/minidump.cc; sourceTree = SOURCE_ROOT; }; - 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_ppc.cc; path = ../../../processor/stackwalker_ppc.cc; sourceTree = SOURCE_ROOT; }; - 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_x86.cc; path = ../../../processor/stackwalker_x86.cc; sourceTree = SOURCE_ROOT; }; - 9BDF17530B1B8BF900F8391B /* stackwalker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker.cc; path = ../../../processor/stackwalker.cc; sourceTree = SOURCE_ROOT; }; - 9BDF175B0B1B8C1B00F8391B /* process_state.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = process_state.cc; path = ../../../processor/process_state.cc; sourceTree = SOURCE_ROOT; }; - 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = on_demand_symbol_supplier.h; sourceTree = ""; }; - 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = on_demand_symbol_supplier.mm; sourceTree = ""; }; - 9BDF192D0B1BC15D00F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; }; - 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; sourceTree = SOURCE_ROOT; }; - 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pathname_stripper.cc; path = ../../../processor/pathname_stripper.cc; sourceTree = SOURCE_ROOT; }; - 9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "range_map-inl.h"; path = "../../../processor/range_map-inl.h"; sourceTree = SOURCE_ROOT; }; - 9BDF1A7B0B1BE30100F8391B /* range_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = range_map.h; path = ../../../processor/range_map.h; sourceTree = SOURCE_ROOT; }; - 9BDF1AFA0B1BEB6300F8391B /* address_map-inl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "address_map-inl.h"; path = "../../../processor/address_map-inl.h"; sourceTree = SOURCE_ROOT; }; - 9BDF1AFB0B1BEB6300F8391B /* address_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = address_map.h; path = ../../../processor/address_map.h; sourceTree = SOURCE_ROOT; }; - 9BE650AC0B52FE3000611104 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; }; - 9BE650AD0B52FE3000611104 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; }; - 9BE650AE0B52FE3000611104 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; }; - 9BE650AF0B52FE3000611104 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ../../../common/mac/macho_id.h; sourceTree = SOURCE_ROOT; }; - 9BE650B00B52FE3000611104 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ../../../common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; }; - 9BE650B10B52FE3000611104 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ../../../common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; }; - D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cfi_frame_info.cc; path = ../../../processor/cfi_frame_info.cc; sourceTree = SOURCE_ROOT; }; - D2A5DD621188658B00081F03 /* tokenize.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tokenize.cc; path = ../../../processor/tokenize.cc; sourceTree = SOURCE_ROOT; }; - F407DC40185773C10064622B /* exploitability_linux.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_linux.cc; path = ../../../processor/exploitability_linux.cc; sourceTree = ""; }; - F407DC41185773C10064622B /* stack_frame_symbolizer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stack_frame_symbolizer.cc; path = ../../../processor/stack_frame_symbolizer.cc; sourceTree = ""; }; - F407DC42185773C10064622B /* stackwalker_arm64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_arm64.cc; path = ../../../processor/stackwalker_arm64.cc; sourceTree = ""; }; - F407DC43185773C10064622B /* stackwalker_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_arm64.h; path = ../../../processor/stackwalker_arm64.h; sourceTree = ""; }; - F407DC44185773C10064622B /* stackwalker_mips.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_mips.cc; path = ../../../processor/stackwalker_mips.cc; sourceTree = ""; }; - F407DC45185773C10064622B /* stackwalker_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_mips.h; path = ../../../processor/stackwalker_mips.h; sourceTree = ""; }; - F407DC46185773C10064622B /* stackwalker_ppc64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_ppc64.cc; path = ../../../processor/stackwalker_ppc64.cc; sourceTree = ""; }; - F407DC47185773C10064622B /* stackwalker_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_ppc64.h; path = ../../../processor/stackwalker_ppc64.h; sourceTree = ""; }; - F44DDD8419C85CD50047280E /* dump_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_context.cc; path = ../../../processor/dump_context.cc; sourceTree = ""; }; - F44DDD8519C85CD50047280E /* dump_object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_object.cc; path = ../../../processor/dump_object.cc; sourceTree = ""; }; - F44DDD8619C85CD50047280E /* microdump_processor.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump_processor.cc; path = ../../../processor/microdump_processor.cc; sourceTree = ""; }; - F44DDD8A19C85CFB0047280E /* dump_context.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_context.h; path = ../../../google_breakpad/processor/dump_context.h; sourceTree = ""; }; - F44DDD8B19C85CFB0047280E /* dump_object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_object.h; path = ../../../google_breakpad/processor/dump_object.h; sourceTree = ""; }; - F44DDD8C19C85CFC0047280E /* microdump_processor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump_processor.h; path = ../../../google_breakpad/processor/microdump_processor.h; sourceTree = ""; }; - F44DDD8D19C85CFC0047280E /* process_result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = process_result.h; path = ../../../google_breakpad/processor/process_result.h; sourceTree = ""; }; - F47180541D745DEF0032F208 /* elf_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = elf_reader.cc; path = ../../../common/dwarf/elf_reader.cc; sourceTree = ""; }; - F47180551D745DEF0032F208 /* elf_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = elf_reader.h; path = ../../../common/dwarf/elf_reader.h; sourceTree = ""; }; - F47180571D7467630032F208 /* proc_maps_linux.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proc_maps_linux.cc; path = ../../../processor/proc_maps_linux.cc; sourceTree = ""; }; - F47180591D7468A40032F208 /* symbolic_constants_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = symbolic_constants_win.cc; path = ../../../processor/symbolic_constants_win.cc; sourceTree = ""; }; - F4D43B2E1A38490700C290B2 /* microdump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump.cc; path = ../../../processor/microdump.cc; sourceTree = ""; }; - F4D43B301A38492000C290B2 /* microdump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump.h; path = ../../../google_breakpad/processor/microdump.h; sourceTree = ""; }; - F9C7ECE20E8ABCA600E953AD /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; }; - F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; }; - F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = functioninfo.cc; path = ../../../common/dwarf/functioninfo.cc; sourceTree = SOURCE_ROOT; }; - F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_arm.cc; path = ../../../processor/stackwalker_arm.cc; sourceTree = SOURCE_ROOT; }; - F9F0706610FBC02D0037B88B /* stackwalker_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_arm.h; path = ../../../processor/stackwalker_arm.h; sourceTree = SOURCE_ROOT; }; - FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_amd64.cc; path = ../../../processor/stackwalker_amd64.cc; sourceTree = SOURCE_ROOT; }; - FD6625C50CF4D438004AC844 /* stackwalker_amd64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_amd64.h; path = ../../../processor/stackwalker_amd64.h; sourceTree = SOURCE_ROOT; }; - FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_sparc.cc; path = ../../../processor/stackwalker_sparc.cc; sourceTree = SOURCE_ROOT; }; - FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = stackwalker_sparc.h; path = ../../../processor/stackwalker_sparc.h; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76F9B0486AA7600D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* crash_report */ = { - isa = PBXGroup; - children = ( - 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */, - 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */, - 4247E63F2110D5A500482558 /* path_helper.cc */, - 4247E63E2110D5A500482558 /* path_helper.h */, - 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */, - 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */, - 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */, - F9C7ECE10E8ABC7F00E953AD /* DWARF */, - 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */, - 162F64FD161C5ECB00CD68D5 /* arch_utilities.h */, - 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */, - 5578003F0BE1F28500EC23E0 /* macho_utilities.h */, - 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */, - 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */, - 9BDF192D0B1BC15D00F8391B /* dump_syms.h */, - 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */, - 08FB7796FE84155DC02AAC07 /* crash_report.mm */, - F44DDD8D19C85CFC0047280E /* process_result.h */, - 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */, - F44DDD8419C85CD50047280E /* dump_context.cc */, - F44DDD8A19C85CFB0047280E /* dump_context.h */, - F44DDD8519C85CD50047280E /* dump_object.cc */, - F44DDD8B19C85CFB0047280E /* dump_object.h */, - F4D43B2E1A38490700C290B2 /* microdump.cc */, - F4D43B301A38492000C290B2 /* microdump.h */, - F44DDD8619C85CD50047280E /* microdump_processor.cc */, - F44DDD8C19C85CFC0047280E /* microdump_processor.h */, - 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */, - 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */, - 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */, - 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */, - 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */, - 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */, - 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */, - 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */, - 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */, - 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */, - 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */, - 8B31FF8411F0C6FB00FCF3E4 /* language.cc */, - 8B31FF8511F0C6FB00FCF3E4 /* language.h */, - 4D72CA5613DFBA84006CABE3 /* md5.cc */, - 8B31FF8611F0C6FB00FCF3E4 /* module.cc */, - 8B31FF8711F0C6FB00FCF3E4 /* module.h */, - 08FB7795FE84155DC02AAC07 /* breakpad */, - 4D2C726E126F9CE200B43EAF /* libdisasm */, - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = crash_report; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* breakpad */ = { - isa = PBXGroup; - children = ( - 9BE650AB0B52FE1A00611104 /* common */, - 9BDF17280B1B8B0200F8391B /* processor */, - 9BDF16F70B1B8ACD00F8391B /* google_breakpad */, - ); - name = breakpad; - sourceTree = ""; - }; - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 08FB779EFE84155DC02AAC07 /* Foundation.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FA10486AA7600D96B5E /* crash_report */, - ); - name = Products; - sourceTree = ""; - }; - 4D2C726E126F9CE200B43EAF /* libdisasm */ = { - isa = PBXGroup; - children = ( - 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */, - 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */, - 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */, - 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */, - 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */, - 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */, - 4D2C725A126F9C8000B43EAF /* ia32_operand.c */, - 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */, - 4D2C7234126F9BC200B43EAF /* ia32_settings.c */, - 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */, - 4D2C7263126F9CBB00B43EAF /* x86_imm.c */, - 4D2C725C126F9C9200B43EAF /* x86_insn.c */, - 4D2C722C126F9B6E00B43EAF /* x86_misc.c */, - 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */, - ); - name = libdisasm; - sourceTree = ""; - }; - 9BDF16F70B1B8ACD00F8391B /* google_breakpad */ = { - isa = PBXGroup; - children = ( - 9BDF16F80B1B8ACD00F8391B /* common */, - 9BDF16FB0B1B8ACD00F8391B /* processor */, - ); - name = google_breakpad; - path = ../../../google_breakpad; - sourceTree = SOURCE_ROOT; - }; - 9BDF16F80B1B8ACD00F8391B /* common */ = { - isa = PBXGroup; - children = ( - 9BDF16F90B1B8ACD00F8391B /* breakpad_types.h */, - 9BDF16FA0B1B8ACD00F8391B /* minidump_format.h */, - ); - path = common; - sourceTree = ""; - }; - 9BDF16FB0B1B8ACD00F8391B /* processor */ = { - isa = PBXGroup; - children = ( - 9B3904940B2E52D90059FABE /* basic_source_line_resolver.h */, - 9BDF16FC0B1B8ACD00F8391B /* call_stack.h */, - 9B35FEE20B2675F9008DE8C7 /* code_module.h */, - 9B35FEE30B2675F9008DE8C7 /* code_modules.h */, - 9BDF16FD0B1B8ACD00F8391B /* memory_region.h */, - 9BDF16FE0B1B8ACD00F8391B /* minidump.h */, - 9BDF16FF0B1B8ACD00F8391B /* minidump_processor.h */, - 9BDF17000B1B8ACD00F8391B /* process_state.h */, - 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */, - 9BDF17010B1B8ACD00F8391B /* stack_frame.h */, - 9BDF17020B1B8ACD00F8391B /* stack_frame_cpu.h */, - 9BDF17030B1B8ACD00F8391B /* stackwalker.h */, - 9BDF17040B1B8ACD00F8391B /* symbol_supplier.h */, - 9B44619D0B66C66B00BBB817 /* system_info.h */, - ); - path = processor; - sourceTree = ""; - }; - 9BDF17280B1B8B0200F8391B /* processor */ = { - isa = PBXGroup; - children = ( - 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */, - F407DC40185773C10064622B /* exploitability_linux.cc */, - F407DC41185773C10064622B /* stack_frame_symbolizer.cc */, - F407DC42185773C10064622B /* stackwalker_arm64.cc */, - F407DC43185773C10064622B /* stackwalker_arm64.h */, - F407DC44185773C10064622B /* stackwalker_mips.cc */, - F407DC45185773C10064622B /* stackwalker_mips.h */, - F407DC46185773C10064622B /* stackwalker_ppc64.cc */, - F407DC47185773C10064622B /* stackwalker_ppc64.h */, - 4D2C721E126F9ADE00B43EAF /* exploitability.cc */, - 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */, - D2A5DD621188658B00081F03 /* tokenize.cc */, - D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */, - F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */, - F9F0706610FBC02D0037B88B /* stackwalker_arm.h */, - 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */, - 9BDF1AFA0B1BEB6300F8391B /* address_map-inl.h */, - 9BDF1AFB0B1BEB6300F8391B /* address_map.h */, - 9B35FEE60B26761C008DE8C7 /* basic_code_module.h */, - 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */, - 9B35FEE80B26761C008DE8C7 /* basic_code_modules.h */, - 9BDF172A0B1B8B2400F8391B /* call_stack.cc */, - 8B40BDBF0C0638E4009535AF /* logging.cc */, - 9BDF173F0B1B8B9A00F8391B /* minidump.cc */, - 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */, - 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */, - F47180571D7467630032F208 /* proc_maps_linux.cc */, - 9BDF175B0B1B8C1B00F8391B /* process_state.cc */, - 9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */, - 9BDF1A7B0B1BE30100F8391B /* range_map.h */, - 9BDF17530B1B8BF900F8391B /* stackwalker.cc */, - 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */, - 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */, - FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */, - FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */, - FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */, - FD6625C50CF4D438004AC844 /* stackwalker_amd64.h */, - F47180591D7468A40032F208 /* symbolic_constants_win.cc */, - ); - name = processor; - sourceTree = ""; - }; - 9BE650AB0B52FE1A00611104 /* common */ = { - isa = PBXGroup; - children = ( - 9BE650AC0B52FE3000611104 /* file_id.cc */, - 9BE650AD0B52FE3000611104 /* file_id.h */, - 9BE650AE0B52FE3000611104 /* macho_id.cc */, - 9BE650AF0B52FE3000611104 /* macho_id.h */, - 9BE650B00B52FE3000611104 /* macho_walker.cc */, - 9BE650B10B52FE3000611104 /* macho_walker.h */, - ); - name = common; - sourceTree = ""; - }; - F9C7ECE10E8ABC7F00E953AD /* DWARF */ = { - isa = PBXGroup; - children = ( - F9C7ECE20E8ABCA600E953AD /* bytereader.cc */, - F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */, - 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */, - 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */, - F47180541D745DEF0032F208 /* elf_reader.cc */, - F47180551D745DEF0032F208 /* elf_reader.h */, - F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */, - ); - name = DWARF; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76F960486AA7600D96B5E /* crash_report */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "crash_report" */; - buildPhases = ( - 8DD76F990486AA7600D96B5E /* Sources */, - 8DD76F9B0486AA7600D96B5E /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = crash_report; - productInstallPath = "$(HOME)/bin"; - productName = crash_report; - productReference = 8DD76FA10486AA7600D96B5E /* crash_report */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - }; - buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = en; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* crash_report */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76F960486AA7600D96B5E /* crash_report */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76F990486AA7600D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */, - 8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */, - F47180581D7467630032F208 /* proc_maps_linux.cc in Sources */, - 9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */, - 9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */, - 9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */, - F44DDD8719C85CD50047280E /* dump_context.cc in Sources */, - 9BDF17540B1B8BF900F8391B /* stackwalker_ppc.cc in Sources */, - 9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */, - 9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */, - 9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */, - F47180561D745DEF0032F208 /* elf_reader.cc in Sources */, - 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */, - 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */, - 9BDF21A70B1E825400F8391B /* dump_syms.cc in Sources */, - 9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */, - 9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */, - 9BE650B20B52FE3000611104 /* file_id.cc in Sources */, - 9BE650B40B52FE3000611104 /* macho_id.cc in Sources */, - 9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */, - 557800400BE1F28500EC23E0 /* macho_utilities.cc in Sources */, - 8B40BDC00C0638E4009535AF /* logging.cc in Sources */, - FD8EDEAE0CADDAD400A5EDF1 /* stackwalker_sparc.cc in Sources */, - FD6625CD0CF4D45C004AC844 /* stackwalker_amd64.cc in Sources */, - F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */, - F9C7ECE60E8ABCA600E953AD /* dwarf2reader.cc in Sources */, - F9C7ECE70E8ABCA600E953AD /* functioninfo.cc in Sources */, - F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */, - D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */, - D2A5DD631188658B00081F03 /* tokenize.cc in Sources */, - 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */, - F4D43B2F1A38490700C290B2 /* microdump.cc in Sources */, - 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */, - F44DDD8819C85CD50047280E /* dump_object.cc in Sources */, - 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */, - 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */, - 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */, - 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */, - 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */, - 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */, - 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */, - F407DC49185773C10064622B /* stack_frame_symbolizer.cc in Sources */, - F471805A1D7468A40032F208 /* symbolic_constants_win.cc in Sources */, - 4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */, - 4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */, - 4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */, - 4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */, - F407DC48185773C10064622B /* exploitability_linux.cc in Sources */, - 4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */, - 4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */, - 4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */, - 4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */, - F407DC4A185773C10064622B /* stackwalker_arm64.cc in Sources */, - 4D2C7233126F9BB000B43EAF /* ia32_invariant.c in Sources */, - 4D2C7235126F9BC200B43EAF /* ia32_settings.c in Sources */, - 4D2C7246126F9C0B00B43EAF /* ia32_insn.c in Sources */, - 4D2C724A126F9C2300B43EAF /* ia32_opcode_tables.c in Sources */, - 4D2C724C126F9C3800B43EAF /* ia32_implicit.c in Sources */, - 4247E6402110D5A500482558 /* path_helper.cc in Sources */, - F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */, - 4D2C724E126F9C4D00B43EAF /* ia32_reg.c in Sources */, - 4D2C725B126F9C8000B43EAF /* ia32_operand.c in Sources */, - F407DC4C185773C10064622B /* stackwalker_ppc64.cc in Sources */, - 4D2C725D126F9C9200B43EAF /* x86_insn.c in Sources */, - 4D2C7264126F9CBB00B43EAF /* ia32_modrm.c in Sources */, - F407DC4B185773C10064622B /* stackwalker_mips.cc in Sources */, - 4D2C726D126F9CDC00B43EAF /* x86_imm.c in Sources */, - 4D72CA5713DFBA84006CABE3 /* md5.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB927508733DD40010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - HEADER_SEARCH_PATHS = ../../../../src; - PRODUCT_NAME = crash_report; - }; - name = Debug; - }; - 1DEB927608733DD40010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - HEADER_SEARCH_PATHS = ../../../../src; - PRODUCT_NAME = crash_report; - }; - name = Release; - }; - 1DEB927908733DD40010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - GCC_TREAT_WARNINGS_AS_ERRORS = NO; - }; - name = Debug; - }; - 1DEB927A08733DD40010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "crash_report" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB927508733DD40010E9CD /* Debug */, - 1DEB927608733DD40010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB927908733DD40010E9CD /* Debug */, - 1DEB927A08733DD40010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/src/tools/mac/crash_report/on_demand_symbol_supplier.h deleted file mode 100644 index e265a78a9..000000000 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2006 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// on_demand_symbol_supplier.h: Provides a Symbol Supplier that will create -// a breakpad symbol file on demand. - -#ifndef TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__ -#define TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__ - -#include -#include -#include "google_breakpad/processor/symbol_supplier.h" - -namespace google_breakpad { - -using std::map; -using std::string; -class MinidumpModule; - -class OnDemandSymbolSupplier : public SymbolSupplier { - public: - // |search_dir| is the directory to search for alternative symbols with - // the same name as the module in the minidump - OnDemandSymbolSupplier(const string& search_dir, - const string& symbol_search_dir); - virtual ~OnDemandSymbolSupplier() {} - - // Returns the path to the symbol file for the given module. - virtual SymbolResult GetSymbolFile(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file); - - // Returns the path to the symbol file for the given module. - virtual SymbolResult GetSymbolFile(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file, - string* symbol_data); - // Allocates data buffer on heap, and takes the ownership of - // the data buffer. - virtual SymbolResult GetCStringSymbolData(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file, - char** symbol_data, - size_t* symbol_data_size); - - // Delete the data buffer allocated for module in GetCStringSymbolData(). - virtual void FreeSymbolData(const CodeModule* module); - - protected: - // Search directory - string search_dir_; - string symbol_search_dir_; - - // When we create a symbol file for a module, save the name of the module - // and the path to that module's symbol file. - map module_file_map_; - - // Map of allocated data buffers, keyed by module->code_file(). - map memory_buffers_; - - // Return the name for |module| This will be the value used as the key - // to the |module_file_map_|. - string GetNameForModule(const CodeModule* module); - - // Find the module on local system. If the module resides in a different - // location than the full path in the minidump, this will be the location - // used. - string GetLocalModulePath(const CodeModule* module); - - // Return the full path for |module|. - string GetModulePath(const CodeModule* module); - - // Return the path to the symbol file for |module|. If an empty string is - // returned, then |module| doesn't have a symbol file. - string GetModuleSymbolFile(const CodeModule* module); - - // Generate the breakpad symbol file for |module|. Return true if successful. - // File is generated in /tmp. - bool GenerateSymbolFile(const CodeModule* module, - const SystemInfo* system_info); -}; - -} // namespace google_breakpad - -#endif // TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__ diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm deleted file mode 100644 index d4c4b1ab2..000000000 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2006 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#import -#include -#include -#include -#include -#include -#include - -#include "google_breakpad/processor/basic_source_line_resolver.h" -#include "google_breakpad/processor/minidump.h" -#include "google_breakpad/processor/system_info.h" -#include "processor/pathname_stripper.h" - -#include "on_demand_symbol_supplier.h" -#include "common/mac/dump_syms.h" - -using std::map; -using std::string; - -using google_breakpad::OnDemandSymbolSupplier; -using google_breakpad::PathnameStripper; -using google_breakpad::SymbolSupplier; -using google_breakpad::SystemInfo; - -OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string& search_dir, - const string& symbol_search_dir) - : search_dir_(search_dir) { - NSFileManager* mgr = [NSFileManager defaultManager]; - size_t length = symbol_search_dir.length(); - if (length) { - // Load all sym files in symbol_search_dir into our module_file_map - // A symbol file always starts with a line like this: - // MODULE mac x86 BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon - // or - // MODULE mac ppc BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon - const char* symbolSearchStr = symbol_search_dir.c_str(); - NSString* symbolSearchPath = - [mgr stringWithFileSystemRepresentation:symbolSearchStr - length:strlen(symbolSearchStr)]; - NSDirectoryEnumerator* dirEnum = [mgr enumeratorAtPath:symbolSearchPath]; - NSString* fileName; - NSCharacterSet* hexSet = - [NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"]; - NSCharacterSet* newlineSet = - [NSCharacterSet characterSetWithCharactersInString:@"\r\n"]; - while ((fileName = [dirEnum nextObject])) { - // Check to see what type of file we have - NSDictionary* attrib = [dirEnum fileAttributes]; - NSString* fileType = [attrib objectForKey:NSFileType]; - if ([fileType isEqualToString:NSFileTypeDirectory]) { - // Skip subdirectories - [dirEnum skipDescendents]; - } else { - NSString* filePath = [symbolSearchPath stringByAppendingPathComponent:fileName]; - NSString* dataStr = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL]; - if (dataStr) { - // Check file to see if it is of appropriate type, and grab module - // name. - NSScanner* scanner = [NSScanner scannerWithString:dataStr]; - BOOL goodScan = [scanner scanString:@"MODULE mac " intoString:nil]; - if (goodScan) { - goodScan = ([scanner scanString:@"x86 " intoString:nil] || - [scanner scanString:@"x86_64 " intoString:nil] || - [scanner scanString:@"ppc " intoString:nil]); - if (goodScan) { - NSString* moduleID; - goodScan = [scanner scanCharactersFromSet:hexSet - intoString:&moduleID]; - if (goodScan) { - // Module IDs are always 33 chars long - goodScan = [moduleID length] == 33; - if (goodScan) { - NSString* moduleName; - goodScan = [scanner scanUpToCharactersFromSet:newlineSet - intoString:&moduleName]; - if (goodScan) { - goodScan = [moduleName length] > 0; - if (goodScan) { - const char* moduleNameStr = [moduleName UTF8String]; - const char* filePathStr = [filePath fileSystemRepresentation]; - // Map our file - module_file_map_[moduleNameStr] = filePathStr; - } - } - } - } - } - } - } - } - } - } -} - -SymbolSupplier::SymbolResult -OnDemandSymbolSupplier::GetSymbolFile(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file) { - string path(GetModuleSymbolFile(module)); - - if (path.empty()) { - if (!GenerateSymbolFile(module, system_info)) - return NOT_FOUND; - - path = GetModuleSymbolFile(module); - } - - if (path.empty()) - return NOT_FOUND; - - *symbol_file = path; - return FOUND; -} - -SymbolSupplier::SymbolResult -OnDemandSymbolSupplier::GetSymbolFile(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file, - string* symbol_data) { - SymbolSupplier::SymbolResult s = GetSymbolFile(module, - system_info, - symbol_file); - - - if (s == FOUND) { - std::ifstream in(symbol_file->c_str()); - getline(in, *symbol_data, std::string::traits_type::to_char_type( - std::string::traits_type::eof())); - in.close(); - } - - return s; -} - -SymbolSupplier::SymbolResult -OnDemandSymbolSupplier::GetCStringSymbolData(const CodeModule* module, - const SystemInfo* system_info, - string* symbol_file, - char** symbol_data, - size_t* symbol_data_size) { - std::string symbol_data_string; - SymbolSupplier::SymbolResult result = GetSymbolFile(module, - system_info, - symbol_file, - &symbol_data_string); - if (result == FOUND) { - *symbol_data_size = symbol_data_string.size() + 1; - *symbol_data = new char[*symbol_data_size]; - if (*symbol_data == NULL) { - // Should return INTERRUPT on memory allocation failure. - return INTERRUPT; - } - memcpy(*symbol_data, symbol_data_string.c_str(), symbol_data_string.size()); - (*symbol_data)[symbol_data_string.size()] = '\0'; - memory_buffers_.insert(make_pair(module->code_file(), *symbol_data)); - } - return result; -} - -void OnDemandSymbolSupplier::FreeSymbolData(const CodeModule* module) { - map::iterator it = memory_buffers_.find(module->code_file()); - if (it != memory_buffers_.end()) { - delete [] it->second; - memory_buffers_.erase(it); - } -} - -string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule* module) { - NSFileManager* mgr = [NSFileManager defaultManager]; - const char* moduleStr = module->code_file().c_str(); - NSString* modulePath = - [mgr stringWithFileSystemRepresentation:moduleStr length:strlen(moduleStr)]; - const char* searchStr = search_dir_.c_str(); - NSString* searchDir = - [mgr stringWithFileSystemRepresentation:searchStr length:strlen(searchStr)]; - - if ([mgr fileExistsAtPath:modulePath]) - return module->code_file(); - - // If the module is not found, try to start appending the components to the - // search string and stop if a file (not dir) is found or all components - // have been appended - NSArray* pathComponents = [modulePath componentsSeparatedByString:@"/"]; - size_t count = [pathComponents count]; - NSMutableString* path = [NSMutableString string]; - - for (size_t i = 0; i < count; ++i) { - [path setString:searchDir]; - - for (size_t j = 0; j < i + 1; ++j) { - size_t idx = count - 1 - i + j; - [path appendFormat:@"/%@", [pathComponents objectAtIndex:idx]]; - } - - BOOL isDir; - if ([mgr fileExistsAtPath:path isDirectory:&isDir] && (!isDir)) { - return [path fileSystemRepresentation]; - } - } - - return ""; -} - -string OnDemandSymbolSupplier::GetModulePath(const CodeModule* module) { - return module->code_file(); -} - -string OnDemandSymbolSupplier::GetNameForModule(const CodeModule* module) { - return PathnameStripper::File(module->code_file()); -} - -string OnDemandSymbolSupplier::GetModuleSymbolFile(const CodeModule* module) { - string name(GetNameForModule(module)); - map::iterator result = module_file_map_.find(name); - - return (result == module_file_map_.end()) ? "" : (*result).second; -} - -static float GetFileModificationTime(const char* path) { - float result = 0; - struct stat file_stat; - if (stat(path, &file_stat) == 0) - result = (float)file_stat.st_mtimespec.tv_sec + - (float)file_stat.st_mtimespec.tv_nsec / 1.0e9f; - - return result; -} - -bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule* module, - const SystemInfo* system_info) { - bool result = true; - string name = GetNameForModule(module); - string module_path = GetLocalModulePath(module); - NSString* symbol_path = [NSString stringWithFormat:@"/tmp/%s.%s.sym", - name.c_str(), system_info->cpu.c_str()]; - - if (module_path.empty()) - return false; - - // Check if there's already a symbol file cached. Ensure that the file is - // newer than the module. Otherwise, generate a new one. - BOOL generate_file = YES; - if ([[NSFileManager defaultManager] fileExistsAtPath:symbol_path]) { - // Check if the module file is newer than the saved symbols - float cache_time = - GetFileModificationTime([symbol_path fileSystemRepresentation]); - float module_time = - GetFileModificationTime(module_path.c_str()); - - if (cache_time > module_time) - generate_file = NO; - } - - if (generate_file) { - DumpSymbols dump(ALL_SYMBOL_DATA, false); - if (dump.Read(module_path)) { - // What Breakpad calls "x86" should be given to the system as "i386". - std::string architecture; - if (system_info->cpu.compare("x86") == 0) { - architecture = "i386"; - } else { - architecture = system_info->cpu; - } - - if (dump.SetArchitecture(architecture)) { - std::fstream file([symbol_path fileSystemRepresentation], - std::ios_base::out | std::ios_base::trunc); - dump.WriteSymbolFile(file); - } else { - printf("Architecture %s not available for %s\n", - system_info->cpu.c_str(), name.c_str()); - result = false; - } - } else { - printf("Unable to open %s\n", module_path.c_str()); - result = false; - } - } - - // Add the mapping - if (result) - module_file_map_[name] = [symbol_path fileSystemRepresentation]; - - return result; -} From 387a002c8979a257d10a650b29abdc426ddf5317 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 14 Dec 2022 13:26:57 -0500 Subject: [PATCH 142/195] Add option to use API key in `upload_system_symbols` Adds a new option, `-api-key`. If passed, `symupload` is invoked with the `sym-upload-v2` protocol, the key is passed through, and the V2 API upload servers are used. Bug: 1400770 Change-Id: I81255dccc54038a57900058a050603b89e37d716 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4103749 Reviewed-by: Robert Sesek --- .../upload_system_symbols.go | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index d38f439ab..03acb16cf 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -63,6 +63,7 @@ var ( dumpOnlyPath = flag.String("dump-to", "", "Dump the symbols to the specified directory, but do not upload them.") systemRoot = flag.String("system-root", "", "Path to the root of the Mac OS X system whose symbols will be dumped.") dumpArchitecture = flag.String("arch", "", "The CPU architecture for which symbols should be dumped. If not specified, dumps all architectures.") + apiKey = flag.String("api-key", "", "API key to use. If this is present, the `sym-upload-v2` protocol is used.\nSee https://chromium.googlesource.com/breakpad/breakpad/+/HEAD/docs/sym_upload_v2_protocol.md or\n`symupload`'s help for more information.") ) var ( @@ -80,11 +81,22 @@ var ( "/Library/QuickTime", } - // uploadServers are the list of servers to which symbols should be uploaded. - uploadServers = []string{ + // uploadServersV1 are the list of servers to which symbols should be + // uploaded when using the V1 protocol. + uploadServersV1 = []string{ "https://clients2.google.com/cr/symbol", "https://clients2.google.com/cr/staging_symbol", } + // uploadServersV2 are the list of servers to which symbols should be + // uploaded when using the V2 protocol. + uploadServersV2 = []string{ + "https://staging-crashsymbolcollector-pa.googleapis.com", + "https://prod-crashsymbolcollector-pa.googleapis.com", + } + + // uploadServers are the list of servers that should be used, accounting + // for whether v1 or v2 protocol is used. + uploadServers = uploadServersV1 // blacklistRegexps match paths that should be excluded from dumping. blacklistRegexps = []*regexp.Regexp{ @@ -137,6 +149,10 @@ func main() { defer os.RemoveAll(p) } } + // If `apiKey` is set, we're using the v2 protocol. + if len(*apiKey) > 0 { + uploadServers = uploadServersV2 + } dq := StartDumpQueue(*systemRoot, dumpPath, uq) dq.Wait() @@ -194,13 +210,20 @@ func (uq *UploadQueue) Done() { close(uq.queue) } -func (uq *UploadQueue) worker() { +func (uq *UploadQueue) runSymUpload(symfile, server string) *exec.Cmd { symUpload := path.Join(*breakpadTools, "symupload") + args := []string{symfile, server} + if len(*apiKey) > 0 { + args = append([]string{"-p", "sym-upload-v2", "-k", *apiKey}, args...) + } + return exec.Command(symUpload, args...) +} +func (uq *UploadQueue) worker() { for symfile := range uq.queue { for _, server := range uploadServers { for i := 0; i < 3; i++ { // Give each upload 3 attempts to succeed. - cmd := exec.Command(symUpload, symfile, server) + cmd := uq.runSymUpload(symfile, server) if output, err := cmd.Output(); err == nil { // Success. No retry needed. fmt.Printf("Uploaded %s to %s\n", symfile, server) From 6b7e8a80ba8bb38f3522f5017d9226d5566f67ed Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 3 Nov 2022 15:51:29 -0400 Subject: [PATCH 143/195] Mac dump_syms: delete unused WriteSymbolFile Bug: None Change-Id: I5aec8c07a01ee180c817fa79db39f9c2eb933e37 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4004598 Reviewed-by: Mark Mentovai --- src/common/mac/dump_syms.cc | 12 ------------ src/common/mac/dump_syms.h | 11 +++-------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 1f8303128..661cc89c2 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -678,18 +678,6 @@ bool DumpSymbols::ReadSymbolData(Module** out_module) { return true; } -bool DumpSymbols::WriteSymbolFile(std::ostream& stream) { - Module* module = NULL; - - if (ReadSymbolData(&module) && module) { - bool res = module->Write(stream, symbol_data_); - delete module; - return res; - } - - return false; -} - // Read the selected object file's debugging information, and write out the // header only to |stream|. Return true on success; if an error occurs, report // it and return false. diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index 97632ce02..c2e1b40b9 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -117,19 +117,14 @@ class DumpSymbols { return NULL; } - // Read the selected object file's debugging information, and write it out to - // |stream|. Return true on success; if an error occurs, report it and - // return false. - bool WriteSymbolFile(std::ostream& stream); - // Read the selected object file's debugging information, and write out the // header only to |stream|. Return true on success; if an error occurs, report // it and return false. bool WriteSymbolFileHeader(std::ostream& stream); - // As above, but simply return the debugging information in module - // instead of writing it to a stream. The caller owns the resulting - // module object and must delete it when finished. + // Read the selected object file's debugging information and store it in + // `module`. The caller owns the resulting module object and must delete + // it when finished. bool ReadSymbolData(Module** module); // Return an identifier string for the file this DumpSymbols is dumping. From 63af0cd7523b66327cda4318c8e607d5cf3ca39d Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 15 Dec 2022 12:27:22 +0800 Subject: [PATCH 144/195] Cleanup strncmp and use string_view in elf_reader.cc. Change-Id: I74c755f1ade80bb4313e4fd14e5dc6bab419a0a6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4099505 Reviewed-by: Mark Mentovai --- src/common/dwarf/elf_reader.cc | 36 ++++++++++++++++++++++------------ src/common/dwarf/elf_reader.h | 4 +++- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 5fd1cfb96..7664377cb 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -39,9 +39,9 @@ #include #include -#include #include #include +#include #include // TODO(saugustine): Add support for compressed debug. // Also need to add configure tests for zlib. @@ -107,6 +107,12 @@ const int kAARCH64PLT0Size = 0x20; // Suffix for PLT functions when it needs to be explicitly identified as such. const char kPLTFunctionSuffix[] = "@plt"; +// Replace callsites of this function to std::string_view::starts_with after +// adopting C++20. +bool StringViewStartsWith(std::string_view sv, std::string_view prefix) { + return sv.compare(0, prefix.size(), prefix) == 0; +} + } // namespace namespace google_breakpad { @@ -215,7 +221,7 @@ class ElfSectionReader { (header_.sh_offset - offset_aligned); // Check for and handle any compressed contents. - //if (name == ".zdebug_") + //if (StringViewStartsWith(name, ".zdebug_")) // DecompressZlibContents(); // TODO(saugustine): Add support for proposed elf-section flag // "SHF_COMPRESS". @@ -359,8 +365,8 @@ class ElfReaderImpl { // "opd_section_" must always be checked for NULL before use. opd_section_ = GetSectionInfoByName(".opd", &opd_info_); for (unsigned int k = 0u; k < GetNumSections(); ++k) { - const char* name = GetSectionName(section_headers_[k].sh_name); - if (strncmp(name, ".text", strlen(".text")) == 0) { + std::string_view name{GetSectionName(section_headers_[k].sh_name)}; + if (StringViewStartsWith(name, ".text")) { base_for_text_ = section_headers_[k].sh_addr - section_headers_[k].sh_offset; break; @@ -809,9 +815,11 @@ class ElfReaderImpl { // Debug sections are likely to be near the end, so reverse the // direction of iteration. for (int k = GetNumSections() - 1; k >= 0; --k) { - const char* name = GetSectionName(section_headers_[k].sh_name); - if (strncmp(name, ".debug", strlen(".debug")) == 0) return true; - if (strncmp(name, ".zdebug", strlen(".zdebug")) == 0) return true; + std::string_view name{GetSectionName(section_headers_[k].sh_name)}; + if (StringViewStartsWith(name, ".debug") || + StringViewStartsWith(name, ".zdebug")) { + return true; + } } return false; } @@ -1213,11 +1221,15 @@ const char* ElfReader::GetSectionInfoByName(const string& section_name, } } -bool ElfReader::SectionNamesMatch(const string& name, const string& sh_name) { - if ((name.find(".debug_", 0) == 0) && (sh_name.find(".zdebug_", 0) == 0)) { - const string name_suffix(name, strlen(".debug_")); - const string sh_name_suffix(sh_name, strlen(".zdebug_")); - return name_suffix == sh_name_suffix; +bool ElfReader::SectionNamesMatch(std::string_view name, + std::string_view sh_name) { + std::string_view debug_prefix{".debug_"}; + std::string_view zdebug_prefix{".zdebug_"}; + if (StringViewStartsWith(name, debug_prefix) && + StringViewStartsWith(sh_name, zdebug_prefix)) { + name.remove_prefix(debug_prefix.length()); + sh_name.remove_prefix(zdebug_prefix.length()); + return name == sh_name; } return name == sh_name; } diff --git a/src/common/dwarf/elf_reader.h b/src/common/dwarf/elf_reader.h index 672969d81..a6dec7555 100644 --- a/src/common/dwarf/elf_reader.h +++ b/src/common/dwarf/elf_reader.h @@ -16,6 +16,7 @@ #define COMMON_DWARF_ELF_READER_H__ #include +#include #include #include "common/dwarf/types.h" @@ -145,7 +146,8 @@ class ElfReader { // appears in the elf-file, adjusting for compressed debug section // names. For example, returns true if name == ".debug_abbrev" and // sh_name == ".zdebug_abbrev" - static bool SectionNamesMatch(const string& name, const string& sh_name); + static bool SectionNamesMatch(std::string_view name, + std::string_view sh_name); private: // Lazily initialize impl32_ and return it. From 80430d73aee1fe591bea1475ba3b7fc30c67dfc2 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 15 Dec 2022 17:11:01 -0500 Subject: [PATCH 145/195] upload_system_symbols: Fix sym-upload-v2 when uploading dumped symbols This was previously setting the right upload servers too late to use them when uploading previously dumped symbols (the `--upload-from` use case) Bug: 1400770 Change-Id: If5bb749707b9f0a181585619f30ec9cb011db5ed Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4111102 Reviewed-by: Robert Sesek --- .../mac/upload_system_symbols/upload_system_symbols.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index 03acb16cf..8f5c773ff 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -113,6 +113,11 @@ func main() { flag.Parse() log.SetFlags(0) + // If `apiKey` is set, we're using the v2 protocol. + if len(*apiKey) > 0 { + uploadServers = uploadServersV2 + } + var uq *UploadQueue if *uploadOnlyPath != "" { @@ -149,10 +154,6 @@ func main() { defer os.RemoveAll(p) } } - // If `apiKey` is set, we're using the v2 protocol. - if len(*apiKey) > 0 { - uploadServers = uploadServersV2 - } dq := StartDumpQueue(*systemRoot, dumpPath, uq) dq.Wait() From b14bb95d5de268b6231dc8c667fb0f7d73676856 Mon Sep 17 00:00:00 2001 From: Ian Barkley-Yeung Date: Tue, 20 Dec 2022 13:33:29 -0800 Subject: [PATCH 146/195] Handle compressed DWARF data in LoadDwarfCFI Emit STACK CFI records even in the presence of clang's "-gz" linker option. Needed for ChromeOS ARM boards' chrome binary. BUG=b:263148951,google-breakpad:874 Fixed: google-breakpad:874 Change-Id: I2fe697a56d3421609128d4e291ab1adc73314864 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4117692 Reviewed-by: Ivan Penkov Reviewed-by: Joshua Peraza --- src/common/linux/dump_symbols.cc | 39 +++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 4915e6ffc..b436f7653 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -495,9 +495,42 @@ bool LoadDwarfCFI(const string& dwarf_filename, google_breakpad::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename, section_name); - google_breakpad::CallFrameInfo parser(cfi, cfi_size, - &byte_reader, &handler, &dwarf_reporter, - eh_frame); + if (!IsCompressedHeader(section)) { + google_breakpad::CallFrameInfo parser(cfi, cfi_size, + &byte_reader, &handler, + &dwarf_reporter, eh_frame); + parser.Start(); + return true; + } + + typename ElfClass::Chdr chdr; + uint32_t compression_header_size = + GetCompressionHeader(chdr, cfi, cfi_size); + + if (compression_header_size == 0 || chdr.ch_size == 0) { + fprintf(stderr, "%s: decompression failed at header\n", + dwarf_filename.c_str()); + return false; + } + if (compression_header_size > cfi_size) { + fprintf(stderr, "%s: decompression error, compression_header too large\n", + dwarf_filename.c_str()); + return false; + } + + cfi += compression_header_size; + cfi_size -= compression_header_size; + + std::pair uncompressed = + UncompressSectionContents(cfi, cfi_size, chdr.ch_size); + + if (uncompressed.first == nullptr || uncompressed.second == 0) { + fprintf(stderr, "%s: decompression failed\n", dwarf_filename.c_str()); + return false; + } + google_breakpad::CallFrameInfo parser(uncompressed.first, uncompressed.second, + &byte_reader, &handler, &dwarf_reporter, + eh_frame); parser.Start(); return true; } From 6e03dc0f20feb45851318e58015b53e6be954aed Mon Sep 17 00:00:00 2001 From: Ian Barkley-Yeung Date: Thu, 22 Dec 2022 17:33:01 -0800 Subject: [PATCH 147/195] Fix test breakage from 9aa786f After https://chromium.googlesource.com/breakpad/breakpad/+/9aa786f03dbd1fca98eeae42c35c54d61b2a83b9, attempts to roll breakpad into ChromeOS fail with: make[1]: *** No rule to make target 'src/testing/googletest/src/gtest-all.cc', needed by 'src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.o'. Stop. (see https://logs.chromium.org/logs/chromeos/buildbucket/cr-buildbucket/8794115289064657457/+/u/run_SDK_package_unit_tests/call_chromite.api.TestService_BuildTargetUnitTest/stdout, the result of dry-running https://chrome-internal-review.googlesource.com/c/chromeos/manifest-internal/+/5238479, which just updates the breakpad revision to b14bb95d5de268b6231dc8c667fb0f7d73676856.) Change-Id: Ia6e47c044e74499a849f8b615594f403893d7653 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4120547 Reviewed-by: Mike Frysinger --- Makefile.am | 2 +- Makefile.in | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9e66a6852..9b7f72474 100644 --- a/Makefile.am +++ b/Makefile.am @@ -151,7 +151,6 @@ CLEANFILES = # if !SYSTEM_TEST_LIBS check_LIBRARIES += src/testing/libtesting.a -endif src_testing_libtesting_a_SOURCES = \ src/breakpad_googletest_includes.h \ src/testing/googletest/src/gtest-all.cc \ @@ -159,6 +158,7 @@ src_testing_libtesting_a_SOURCES = \ src/testing/googlemock/src/gmock-all.cc src_testing_libtesting_a_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) +endif # # General diff --git a/Makefile.in b/Makefile.in index 17a453517..d358b6b11 100644 --- a/Makefile.in +++ b/Makefile.in @@ -482,10 +482,14 @@ am_src_libbreakpad_a_OBJECTS = \ src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS) src_testing_libtesting_a_AR = $(AR) $(ARFLAGS) src_testing_libtesting_a_LIBADD = -am_src_testing_libtesting_a_OBJECTS = \ - src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ - src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ - src/testing/googlemock/src/libtesting_a-gmock-all.$(OBJEXT) +am__src_testing_libtesting_a_SOURCES_DIST = \ + src/breakpad_googletest_includes.h \ + src/testing/googletest/src/gtest-all.cc \ + src/testing/googletest/src/gtest_main.cc \ + src/testing/googlemock/src/gmock-all.cc +@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/libtesting_a-gmock-all.$(OBJEXT) src_testing_libtesting_a_OBJECTS = \ $(am_src_testing_libtesting_a_OBJECTS) src_third_party_libdisasm_libdisasm_a_AR = $(AR) $(ARFLAGS) @@ -549,9 +553,9 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/processor/proc_maps_linux.cc \ src/common/linux/breakpad_getcontext.S \ src/common/linux/breakpad_getcontext_unittest.cc -am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ - src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ - src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) +@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) @HAVE_GETCONTEXT_FALSE@am__objects_3 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT) am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ @@ -1664,7 +1668,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ DIST_SOURCES = \ $(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \ $(src_libbreakpad_a_SOURCES) \ - $(src_testing_libtesting_a_SOURCES) \ + $(am__src_testing_libtesting_a_SOURCES_DIST) \ $(src_third_party_libdisasm_libdisasm_a_SOURCES) \ $(src_client_linux_linux_client_unittest_SOURCES) \ $(am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST) \ @@ -2155,14 +2159,14 @@ noinst_LIBRARIES = $(am__append_7) lib_LIBRARIES = $(am__append_5) $(am__append_11) noinst_SCRIPTS = $(check_SCRIPTS) CLEANFILES = $(am__append_15) -src_testing_libtesting_a_SOURCES = \ - src/breakpad_googletest_includes.h \ - src/testing/googletest/src/gtest-all.cc \ - src/testing/googletest/src/gtest_main.cc \ - src/testing/googlemock/src/gmock-all.cc - -src_testing_libtesting_a_CPPFLAGS = \ - $(AM_CPPFLAGS) $(TEST_CFLAGS) +@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \ +@SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest-all.cc \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest_main.cc \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/gmock-all.cc + +@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_CPPFLAGS = \ +@SYSTEM_TEST_LIBS_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) @DISABLE_PROCESSOR_FALSE@check_SCRIPTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_test \ From 79326ebe9446add03e76b4422ff8036e812224d2 Mon Sep 17 00:00:00 2001 From: Ian Barkley-Yeung Date: Thu, 29 Dec 2022 11:52:38 -0800 Subject: [PATCH 148/195] Fix memory leak in Module::AddExtern If adding a duplicate extern, we need to `delete` the extra `Extern` object regardless of the value of enable_multiple_field_. Fixes ASAN build of ChromeOS: https://logs.chromium.org/logs/chromeos/buildbucket/cr-buildbucket/8793433395207218433/+/u/run_ebuild_tests/chromeos-base_google-breakpad_log BUG=b:263148951 Change-Id: Ib6c20e9c7aa38b1530e4bac8acbf481cc9136c36 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4129701 Reviewed-by: Joshua Peraza --- src/common/module.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/module.cc b/src/common/module.cc index 442b910dc..2e61693ca 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -208,8 +208,10 @@ void Module::AddExtern(Extern* ext) { } std::pair ret = externs_.insert(ext); - if (!ret.second && enable_multiple_field_) { - (*ret.first)->is_multiple = true; + if (!ret.second) { + if (enable_multiple_field_) { + (*ret.first)->is_multiple = true; + } // Free the duplicate that was not inserted because this Module // now owns it. delete ext; From d91b6cb75a34da9b11782c789b3d59706dfaaac9 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 21 Dec 2022 09:12:13 -0500 Subject: [PATCH 149/195] upload_system_symbols: Don't retry if file already exists on the server Bug: 1400770 Change-Id: I4c9c683c91848f7eb404ff3c86187dfa63d06e37 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4117730 Reviewed-by: Robert Sesek --- src/tools/mac/upload_system_symbols/upload_system_symbols.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index 8f5c773ff..52c197c41 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -229,6 +229,11 @@ func (uq *UploadQueue) worker() { // Success. No retry needed. fmt.Printf("Uploaded %s to %s\n", symfile, server) break + } else if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() == 2 && *apiKey != "" { + // Exit code 2 in protocol v2 means the file already exists on the server. + // No point retrying. + fmt.Printf("File %s already exists on %s\n", symfile, server) + break } else { log.Printf("Error running symupload(%s, %s), attempt %d: %v: %s\n", symfile, server, i, err, output) time.Sleep(1 * time.Second) From 1eafed6806e9f7fcf7235bb5817ba9cc99ab61eb Mon Sep 17 00:00:00 2001 From: Ian Barkley-Yeung Date: Thu, 29 Dec 2022 17:32:09 -0800 Subject: [PATCH 150/195] Fix more memory leaks with proper smart pointer usage Fix more memory leaks, specifically for Module::Extern and Module::StackFrameEntry that were outside the Module's AddressRange. To fix this, and to prevent issues like the one fixed by https://chromium.googlesource.com/breakpad/breakpad/+/79326ebe9446add03e76b4422ff8036e812224d2 in the future, switched to proper use of std::unique_ptr for Module's Extern and StackFrameEntry functions. These should enforce ownership correctly and make the ownership flow much more visible and clear. Change-Id: I7c943dff3501836a5e303febedc1b312e6f0a1fe Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4129821 Reviewed-by: Joshua Peraza --- src/common/dwarf_cfi_to_module.cc | 7 +- src/common/dwarf_cfi_to_module.h | 7 +- src/common/linux/elf_symbols_to_module.cc | 7 +- src/common/module.cc | 45 +++++------ src/common/module.h | 21 +++-- src/common/module_unittest.cc | 93 +++++++++++------------ src/common/stabs_to_module.cc | 6 +- src/tools/mac/dump_syms/dump_syms_tool.cc | 5 +- 8 files changed, 103 insertions(+), 88 deletions(-) diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index e7e595e76..7da8507d7 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -33,7 +33,9 @@ // Implementation of google_breakpad::DwarfCFIToModule. // See dwarf_cfi_to_module.h for details. +#include #include +#include #include "common/dwarf_cfi_to_module.h" @@ -151,7 +153,7 @@ bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length, // need to check them here. // Get ready to collect entries. - entry_ = new Module::StackFrameEntry; + entry_ = std::make_unique(); entry_->address = address; entry_->size = length; entry_offset_ = offset; @@ -258,8 +260,7 @@ bool DwarfCFIToModule::ValExpressionRule(uint64_t address, int reg, } bool DwarfCFIToModule::End() { - module_->AddStackFrameEntry(entry_); - entry_ = NULL; + module_->AddStackFrameEntry(std::move(entry_)); return true; } diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index 3b092654d..42b618d5b 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -43,6 +43,7 @@ #include #include +#include #include #include "common/module.h" @@ -131,9 +132,9 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { DwarfCFIToModule(Module* module, const vector& register_names, Reporter* reporter) : module_(module), register_names_(register_names), reporter_(reporter), - entry_(NULL), return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") { + return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") { } - virtual ~DwarfCFIToModule() { delete entry_; } + virtual ~DwarfCFIToModule() = default; virtual bool Entry(size_t offset, uint64_t address, uint64_t length, uint8_t version, const string& augmentation, @@ -170,7 +171,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { Reporter* reporter_; // The current entry we're constructing. - Module::StackFrameEntry* entry_; + std::unique_ptr entry_; // The section offset of the current frame description entry, for // use in error messages. diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc index 4aee38d6a..3c33be99a 100644 --- a/src/common/linux/elf_symbols_to_module.cc +++ b/src/common/linux/elf_symbols_to_module.cc @@ -36,6 +36,9 @@ #include #include +#include +#include + #include "common/byte_cursor.h" #include "common/module.h" @@ -156,7 +159,7 @@ bool ELFSymbolsToModule(const uint8_t* symtab_section, while(!iterator->at_end) { if (ELF32_ST_TYPE(iterator->info) == STT_FUNC && iterator->shndx != SHN_UNDEF) { - Module::Extern* ext = new Module::Extern(iterator->value); + auto ext = std::make_unique(iterator->value); ext->name = SymbolString(iterator->name_offset, strings); #if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle. int status = 0; @@ -168,7 +171,7 @@ bool ELFSymbolsToModule(const uint8_t* symtab_section, free(demangled); } #endif - module->AddExtern(ext); + module->AddExtern(std::move(ext)); } ++iterator; } diff --git a/src/common/module.cc b/src/common/module.cc index 2e61693ca..75782ab16 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -117,12 +117,6 @@ Module::~Module() { it != functions_.end(); ++it) { delete *it; } - for (vector::iterator it = stack_frame_entries_.begin(); - it != stack_frame_entries_.end(); ++it) { - delete *it; - } - for (ExternSet::iterator it = externs_.begin(); it != externs_.end(); ++it) - delete *it; } void Module::SetLoadAddress(Address address) { @@ -155,12 +149,11 @@ bool Module::AddFunction(Function* function) { } if (it_ext != externs_.end()) { if (enable_multiple_field_) { - Extern* found_ext = *it_ext; + Extern* found_ext = it_ext->get(); // If the PUBLIC is for the same symbol as the FUNC, don't mark multiple. function->is_multiple |= found_ext->name != function->name || found_ext->is_multiple; } - delete *it_ext; externs_.erase(it_ext); } #if _DEBUG @@ -194,27 +187,22 @@ bool Module::AddFunction(Function* function) { return true; } -void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) { +void Module::AddStackFrameEntry(std::unique_ptr stack_frame_entry) { if (!AddressIsInModule(stack_frame_entry->address)) { return; } - stack_frame_entries_.push_back(stack_frame_entry); + stack_frame_entries_.push_back(std::move(stack_frame_entry)); } -void Module::AddExtern(Extern* ext) { +void Module::AddExtern(std::unique_ptr ext) { if (!AddressIsInModule(ext->address)) { return; } - std::pair ret = externs_.insert(ext); - if (!ret.second) { - if (enable_multiple_field_) { - (*ret.first)->is_multiple = true; - } - // Free the duplicate that was not inserted because this Module - // now owns it. - delete ext; + std::pair ret = externs_.emplace(std::move(ext)); + if (!ret.second && enable_multiple_field_) { + (*ret.first)->is_multiple = true; } } @@ -225,7 +213,11 @@ void Module::GetFunctions(vector* vec, void Module::GetExterns(vector* vec, vector::iterator i) { - vec->insert(i, externs_.begin(), externs_.end()); + auto pos = vec->insert(i, externs_.size(), nullptr); + for (const std::unique_ptr& ext : externs_) { + *pos = ext.get(); + ++pos; + } } Module::File* Module::FindFile(const string& name) { @@ -267,7 +259,11 @@ void Module::GetFiles(vector* vec) { } void Module::GetStackFrameEntries(vector* vec) const { - *vec = stack_frame_entries_; + vec->clear(); + vec->reserve(stack_frame_entries_.size()); + for (const auto& ent : stack_frame_entries_) { + vec->push_back(ent.get()); + } } void Module::AssignSourceIds( @@ -443,7 +439,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { // Write out 'PUBLIC' records. for (ExternSet::const_iterator extern_it = externs_.begin(); extern_it != externs_.end(); ++extern_it) { - Extern* ext = *extern_it; + Extern* ext = extern_it->get(); stream << "PUBLIC " << (ext->is_multiple ? "m " : "") << hex << (ext->address - load_address_) << " 0 " << ext->name << dec << "\n"; @@ -452,10 +448,9 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { if (symbol_data & CFI) { // Write out 'STACK CFI INIT' and 'STACK CFI' records. - vector::const_iterator frame_it; - for (frame_it = stack_frame_entries_.begin(); + for (auto frame_it = stack_frame_entries_.begin(); frame_it != stack_frame_entries_.end(); ++frame_it) { - StackFrameEntry* entry = *frame_it; + StackFrameEntry* entry = frame_it->get(); stream << "STACK CFI INIT " << hex << (entry->address - load_address_) << " " << entry->size << " " << dec; diff --git a/src/common/module.h b/src/common/module.h index a8fcc81e0..c1fd9f59c 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -292,7 +292,18 @@ class Module { }; struct ExternCompare { - bool operator() (const Extern* lhs, const Extern* rhs) const { + // Defining is_transparent allows + // std::set, ExternCompare>::find() to be called + // with an Extern* and have set use the overloads below. + using is_transparent = void; + bool operator() (const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const { + return lhs->address < rhs->address; + } + bool operator() (const Extern* lhs, const std::unique_ptr& rhs) const { + return lhs->address < rhs->address; + } + bool operator() (const std::unique_ptr& lhs, const Extern* rhs) const { return lhs->address < rhs->address; } }; @@ -340,12 +351,12 @@ class Module { // Add STACK_FRAME_ENTRY to the module. // This module owns all StackFrameEntry objects added with this // function: destroying the module destroys them as well. - void AddStackFrameEntry(StackFrameEntry* stack_frame_entry); + void AddStackFrameEntry(std::unique_ptr stack_frame_entry); // Add PUBLIC to the module. // This module owns all Extern objects added with this function: // destroying the module destroys them as well. - void AddExtern(Extern* ext); + void AddExtern(std::unique_ptr ext); // If this module has a file named NAME, return a pointer to it. If // it has none, then create one and return a pointer to the new @@ -465,7 +476,7 @@ class Module { typedef set FunctionSet; // A set containing Extern structures, sorted by address. - typedef set ExternSet; + typedef set, ExternCompare> ExternSet; // The module owns all the files and functions that have been added // to it; destroying the module frees the Files and Functions these @@ -477,7 +488,7 @@ class Module { // The module owns all the call frame info entries that have been // added to it. - vector stack_frame_entries_; + vector> stack_frame_entries_; // The module owns all the externs that have been added to it; // destroying the module frees the Externs these point to. diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 220add030..39727554f 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -36,8 +36,10 @@ #include #include +#include #include #include +#include #include "breakpad_googletest_includes.h" #include "common/module.h" @@ -137,7 +139,7 @@ TEST(Module, WriteRelativeLoadAddress) { m.AddFunction(function); // Some stack information. - Module::StackFrameEntry* entry = new Module::StackFrameEntry(); + auto entry = std::make_unique(); entry->address = 0x30f9e5c83323973dULL; entry->size = 0x49fc9ca7c7c13dc2ULL; entry->initial_rules[".cfa"] = "he was a handsome man"; @@ -145,7 +147,7 @@ TEST(Module, WriteRelativeLoadAddress) { entry->rule_changes[0x30f9e5c83323973eULL]["how"] = "do you like your blueeyed boy"; entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death"; - m.AddStackFrameEntry(entry); + m.AddStackFrameEntry(std::move(entry)); // Set the load address. Doing this after adding all the data to // the module must work fine. @@ -242,7 +244,7 @@ TEST(Module, WriteNoCFI) { m.AddFunction(function); // Some stack information. - Module::StackFrameEntry* entry = new Module::StackFrameEntry(); + auto entry = std::make_unique(); entry->address = 0x30f9e5c83323973dULL; entry->size = 0x49fc9ca7c7c13dc2ULL; entry->initial_rules[".cfa"] = "he was a handsome man"; @@ -250,7 +252,7 @@ TEST(Module, WriteNoCFI) { entry->rule_changes[0x30f9e5c83323973eULL]["how"] = "do you like your blueeyed boy"; entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death"; - m.AddStackFrameEntry(entry); + m.AddStackFrameEntry(std::move(entry)); // Set the load address. Doing this after adding all the data to // the module must work fine. @@ -321,18 +323,18 @@ TEST(Module, WriteOutOfRangeAddresses) { // Add three stack frames (one lower, one in, and one higher than the allowed // address range). Only the middle frame should be captured. - Module::StackFrameEntry* entry1 = new Module::StackFrameEntry(); + auto entry1 = std::make_unique(); entry1->address = 0x1000ULL; entry1->size = 0x100ULL; - m.AddStackFrameEntry(entry1); - Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); + m.AddStackFrameEntry(std::move(entry1)); + auto entry2 = std::make_unique(); entry2->address = 0x2000ULL; entry2->size = 0x100ULL; - m.AddStackFrameEntry(entry2); - Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); + m.AddStackFrameEntry(std::move(entry2)); + auto entry3 = std::make_unique(); entry3->address = 0x3000ULL; entry3->size = 0x100ULL; - m.AddStackFrameEntry(entry3); + m.AddStackFrameEntry(std::move(entry3)); // Add a function outside the allowed range. Module::File* file = m.FindFile("file_name.cc"); @@ -346,9 +348,9 @@ TEST(Module, WriteOutOfRangeAddresses) { m.AddFunction(function); // Add an extern outside the allowed range. - Module::Extern* extern1 = new Module::Extern(0x5000ULL); + auto extern1 = std::make_unique(0x5000ULL); extern1->name = "_xyz"; - m.AddExtern(extern1); + m.AddExtern(std::move(extern1)); m.Write(s, ALL_SYMBOL_DATA); @@ -357,10 +359,7 @@ TEST(Module, WriteOutOfRangeAddresses) { s.str().c_str()); // Cleanup - Prevent Memory Leak errors. - delete (extern1); delete (function); - delete (entry3); - delete (entry1); } TEST(Module, ConstructAddFrames) { @@ -368,22 +367,22 @@ TEST(Module, ConstructAddFrames) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // First STACK CFI entry, with no initial rules or deltas. - Module::StackFrameEntry* entry1 = new Module::StackFrameEntry(); + auto entry1 = std::make_unique(); entry1->address = 0xddb5f41285aa7757ULL; entry1->size = 0x1486493370dc5073ULL; - m.AddStackFrameEntry(entry1); + m.AddStackFrameEntry(std::move(entry1)); // Second STACK CFI entry, with initial rules but no deltas. - Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); + auto entry2 = std::make_unique(); entry2->address = 0x8064f3af5e067e38ULL; entry2->size = 0x0de2a5ee55509407ULL; entry2->initial_rules[".cfa"] = "I think that I shall never see"; entry2->initial_rules["stromboli"] = "a poem lovely as a tree"; entry2->initial_rules["cannoli"] = "a tree whose hungry mouth is prest"; - m.AddStackFrameEntry(entry2); + m.AddStackFrameEntry(std::move(entry2)); // Third STACK CFI entry, with initial rules and deltas. - Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); + auto entry3 = std::make_unique(); entry3->address = 0x5e8d0db0a7075c6cULL; entry3->size = 0x1c7edb12a7aea229ULL; entry3->initial_rules[".cfa"] = "Whose woods are these"; @@ -395,7 +394,7 @@ TEST(Module, ConstructAddFrames) { "his house is in"; entry3->rule_changes[0x36682fad3763ffffULL][".cfa"] = "I think I know"; - m.AddStackFrameEntry(entry3); + m.AddStackFrameEntry(std::move(entry3)); // Check that Write writes STACK CFI records properly. m.Write(s, ALL_SYMBOL_DATA); @@ -541,13 +540,13 @@ TEST(Module, ConstructExterns) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_abc"; - Module::Extern* extern2 = new Module::Extern(0xaaaa); + auto extern2 = std::make_unique(0xaaaa); extern2->name = "_xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -566,13 +565,13 @@ TEST(Module, ConstructDuplicateExterns) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_xyz"; - Module::Extern* extern2 = new Module::Extern(0xffff); + auto extern2 = std::make_unique(0xffff); extern2->name = "_abc"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -589,13 +588,13 @@ TEST(Module, ConstructDuplicateExternsMultiple) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_xyz"; - Module::Extern* extern2 = new Module::Extern(0xffff); + auto extern2 = std::make_unique(0xffff); extern2->name = "_abc"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -613,13 +612,13 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddress) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xabc0); + auto extern1 = std::make_unique(0xabc0); extern1->name = "abc"; - Module::Extern* extern2 = new Module::Extern(0xfff0); + auto extern2 = std::make_unique(0xfff0); extern2->name = "xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); Module::Function* function = new Module::Function("_xyz", 0xfff0); Module::Range range(0xfff0, 0x10); @@ -644,13 +643,13 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddressMultiple) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xabc0); + auto extern1 = std::make_unique(0xabc0); extern1->name = "abc"; - Module::Extern* extern2 = new Module::Extern(0xfff0); + auto extern2 = std::make_unique(0xfff0); extern2->name = "xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); Module::Function* function = new Module::Function("_xyz", 0xfff0); Module::Range range(0xfff0, 0x10); @@ -676,17 +675,17 @@ TEST(Module, ConstructFunctionsAndThumbExternsWithSameAddress) { Module m(MODULE_NAME, MODULE_OS, "arm", MODULE_ID); // Two THUMB externs. - Module::Extern* thumb_extern1 = new Module::Extern(0xabc1); + auto thumb_extern1 = std::make_unique(0xabc1); thumb_extern1->name = "thumb_abc"; - Module::Extern* thumb_extern2 = new Module::Extern(0xfff1); + auto thumb_extern2 = std::make_unique(0xfff1); thumb_extern2->name = "thumb_xyz"; - Module::Extern* arm_extern1 = new Module::Extern(0xcc00); + auto arm_extern1 = std::make_unique(0xcc00); arm_extern1->name = "arm_func"; - m.AddExtern(thumb_extern1); - m.AddExtern(thumb_extern2); - m.AddExtern(arm_extern1); + m.AddExtern(std::move(thumb_extern1)); + m.AddExtern(std::move(thumb_extern2)); + m.AddExtern(std::move(arm_extern1)); // The corresponding function from the DWARF debug data have the actual // address. diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index 6cdb96a27..3d026c22c 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -36,6 +36,8 @@ #include #include +#include +#include #include "common/stabs_to_module.h" #include "common/using_std_string.h" @@ -132,7 +134,7 @@ bool StabsToModule::Line(uint64_t address, const char *name, int number) { } bool StabsToModule::Extern(const string& name, uint64_t address) { - Module::Extern *ext = new Module::Extern(address); + auto ext = std::make_unique(address); // Older libstdc++ demangle implementations can crash on unexpected // input, so be careful about what gets passed in. if (name.compare(0, 3, "__Z") == 0) { @@ -142,7 +144,7 @@ bool StabsToModule::Extern(const string& name, uint64_t address) { } else { ext->name = name; } - module_->AddExtern(ext); + module_->AddExtern(std::move(ext)); return true; } diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index d0f29ba7d..2e05cbf3b 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -36,6 +36,8 @@ #include #include +#include +#include #include #include "common/mac/dump_syms.h" @@ -108,7 +110,8 @@ static void CopyCFIDataBetweenModules(Module* to_module, // If the entry does not overlap, then it is safe to copy to |to_module|. if (to_it == to_data.end() || (from_entry->address < (*to_it)->address && from_entry_end < (*to_it)->address)) { - to_module->AddStackFrameEntry(new Module::StackFrameEntry(*from_entry)); + to_module->AddStackFrameEntry( + std::make_unique(*from_entry)); } } } From bae7147e789f03462b02e213152beb7571ae4122 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 17 Jan 2023 10:50:44 -0500 Subject: [PATCH 151/195] Decode Mach EXC_RESOURCE and EXC_GUARD exception reasons Change-Id: Iafe85ae2149961f13ba44664c99e18d92d1ec654 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4172753 Reviewed-by: Mark Mentovai --- src/google_breakpad/common/minidump_exception_mac.h | 4 ++++ src/processor/minidump_processor.cc | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h index feb47079f..acfafaa0f 100644 --- a/src/google_breakpad/common/minidump_exception_mac.h +++ b/src/google_breakpad/common/minidump_exception_mac.h @@ -65,6 +65,10 @@ typedef enum { MD_EXCEPTION_MAC_MACH_SYSCALL = 8, /* EXC_MACH_SYSCALL */ MD_EXCEPTION_MAC_RPC_ALERT = 9, + /* EXC_RESOURCE */ + MD_EXCEPTION_MAC_RESOURCE = 11, + /* EXC_GUARD */ + MD_EXCEPTION_MAC_GUARD = 12, /* EXC_RPC_ALERT */ MD_EXCEPTION_MAC_SIMULATED = 0x43507378, /* Fake exception code used by Crashpad's SimulateCrash ('CPsx'). */ diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index bf561dfa4..fb330e26e 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -1243,6 +1243,14 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, reason = "EXC_RPC_ALERT / "; reason.append(flags_string); break; + case MD_EXCEPTION_MAC_RESOURCE: + reason = "EXC_RESOURCE / "; + reason.append(flags_string); + break; + case MD_EXCEPTION_MAC_GUARD: + reason = "EXC_GUARD / "; + reason.append(flags_string); + break; case MD_EXCEPTION_MAC_SIMULATED: reason = "Simulated Exception"; break; From 934d6b2a5dd4e478369c09af41c2b1ccb521448d Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 18 Jan 2023 11:34:18 -0500 Subject: [PATCH 152/195] upload_system_symbols: Make /System/Library/Components optional Bug: 1400770 Change-Id: I81cb981bb9ca208ac2af9e27c00e75cab1c14717 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4178413 Reviewed-by: Robert Sesek --- src/tools/mac/upload_system_symbols/upload_system_symbols.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index 52c197c41..ba0672763 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -69,7 +69,6 @@ var ( var ( // pathsToScan are the subpaths in the systemRoot that should be scanned for shared libraries. pathsToScan = []string{ - "/System/Library/Components", "/System/Library/Frameworks", "/System/Library/PrivateFrameworks", "/usr/lib", @@ -79,6 +78,8 @@ var ( optionalPathsToScan = []string{ // Gone in 10.15. "/Library/QuickTime", + // Not present in dumped dyld_shared_caches + "/System/Library/Components", } // uploadServersV1 are the list of servers to which symbols should be From dd0ca9d70af2ded3cf6f561214284f3abdb26748 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 18 Jan 2023 16:15:04 -0500 Subject: [PATCH 153/195] Mac dump_syms: work around NXFindBestFatArch bug On macOS 13 x86_64 machines, NXFindBestFatArch does not correctly find arm64e slices. This is filed as FB11955188. I was hoping manually masking the subtype with CPU_SUBTYPE_MASK would be sufficient to work around but no luck. So let's just fall through to doing an exact* match if NXFindBestFatArch fails. * "Exact" meaning with CPU_SUBTYPE_MASK now masked off. But libmacho/arch.c calls that exact too, so I'm just going to go with it. Bug: 1400770 Change-Id: Id497946d3c719285c5d7508e589e4a466da1ceca Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4178621 Reviewed-by: Mark Mentovai --- src/common/mac/dump_syms.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 661cc89c2..9658b2c6d 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -268,7 +268,8 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( return &object_files_[i]; } assert(best_match == NULL); - return NULL; + // Fall through since NXFindBestFatArch can't find arm slices on x86_64 + // macOS 13. See FB11955188. } // Check for an exact match with cpu_type and cpu_subtype. @@ -276,7 +277,8 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( it != object_files_.end(); ++it) { if (static_cast(it->cputype) == cpu_type && - static_cast(it->cpusubtype) == cpu_subtype) + (static_cast(it->cpusubtype) & ~CPU_SUBTYPE_MASK) == + (cpu_subtype & ~CPU_SUBTYPE_MASK)) return &*it; } @@ -285,8 +287,11 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( // NXFindBestFatArch, located at // http://web.mit.edu/darwin/src/modules/cctools/libmacho/arch.c. fprintf(stderr, "Failed to find an exact match for an object file with cpu " - "type: %d and cpu subtype: %d. Furthermore, at least one object file is " - "larger than 2**32.\n", cpu_type, cpu_subtype); + "type: %d and cpu subtype: %d.\n", cpu_type, cpu_subtype); + if (!can_convert_to_fat_arch) { + fprintf(stderr, "Furthermore, at least one object file is larger " + "than 2**32.\n"); + } return NULL; } From b024566c443a2af73c4afa62db4b57ca63b89336 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 1 Dec 2022 15:02:51 -0800 Subject: [PATCH 154/195] Fix Cygwin builds after enabling c++17 mode. Remove the "noext" argument to AX_CXX_COMPILE_STDCXX(), so the configure script can figure out what works, instead of only allowing strict conformance mode. See discussion on https://crrev.com/c/3954471, which lead to this CL. Change-Id: I7688db2e267485003ae8f776fa3ca0dd63205b47 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4072453 Reviewed-by: Mark Mentovai --- configure | 1637 ++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 1638 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d131f5a91..76d4a9f61 100755 --- a/configure +++ b/configure @@ -7748,10 +7748,1647 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 +printf %s "checking whether $CXX supports C++17 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx17+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx17=yes +else $as_nop + ax_cv_cxx_compile_cxx17=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; } + if test x$ax_cv_cxx_compile_cxx17 = xyes; then + ac_success=yes + fi + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi + if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do diff --git a/configure.ac b/configure.ac index 69e23545f..ca2936695 100644 --- a/configure.ac +++ b/configure.ac @@ -75,7 +75,7 @@ AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create]) AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes]) AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes]) -AX_CXX_COMPILE_STDCXX(17, noext, mandatory) +AX_CXX_COMPILE_STDCXX(17, , mandatory) dnl Test supported warning flags. WARN_CXXFLAGS= From fc1a202855042a92d2179fa6d01b8adca683a85e Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Fri, 20 Jan 2023 13:30:35 -0500 Subject: [PATCH 155/195] Add address mask to MinidumpCrashpadInfo. Support reading both old and new crashpad_info structs. Change-Id: I780792988671683fedfbb5122fe8a14bf0a8b793 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3982824 Reviewed-by: Mark Mentovai --- src/google_breakpad/common/minidump_format.h | 2 + src/processor/minidump.cc | 47 ++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 9edead934..42bfca947 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1118,6 +1118,8 @@ typedef struct { MDGUID client_id; MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */ MDLocationDescriptor module_list; /* MDRawModuleCrashpadInfoList */ + uint32_t reserved; + uint64_t address_mask; } MDRawCrashpadInfo; #if defined(_MSC_VER) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index d56db98e9..51975fd74 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -5267,16 +5267,52 @@ MinidumpCrashpadInfo::MinidumpCrashpadInfo(Minidump* minidump) bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { valid_ = false; - if (expected_size != sizeof(crashpad_info_)) { - BPLOG(ERROR) << "MinidumpCrashpadInfo size mismatch, " << expected_size << - " != " << sizeof(crashpad_info_); + // Support old minidumps that do not implement newer crashpad_info_ + // fields, currently limited to the address mask. + static_assert(sizeof(crashpad_info_) == 64, + "Updated ::Read for new crashpad_info field."); + + constexpr size_t crashpad_info_min_size = + offsetof(decltype(crashpad_info_), reserved); + if (expected_size < crashpad_info_min_size) { + BPLOG(ERROR) << "MinidumpCrashpadInfo size mismatch, " << expected_size + << " < " << crashpad_info_min_size; return false; } - if (!minidump_->ReadBytes(&crashpad_info_, sizeof(crashpad_info_))) { + if (!minidump_->ReadBytes(&crashpad_info_, crashpad_info_min_size)) { BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad info"; return false; } + expected_size -= crashpad_info_min_size; + + // Read `reserved` if available. + size_t crashpad_reserved_size = sizeof(crashpad_info_.reserved); + if (expected_size >= crashpad_reserved_size) { + if (!minidump_->ReadBytes( + &crashpad_info_.reserved, + crashpad_reserved_size)) { + BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read reserved"; + return false; + } + expected_size -= crashpad_reserved_size; + } else { + crashpad_info_.reserved = 0; + } + + // Read `address_mask` if available. + size_t crashpad_address_mask_size = sizeof(crashpad_info_.address_mask); + if (expected_size >= crashpad_address_mask_size) { + if (!minidump_->ReadBytes( + &crashpad_info_.address_mask, + crashpad_address_mask_size)) { + BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read address mask"; + return false; + } + expected_size -= crashpad_address_mask_size; + } else { + crashpad_info_.address_mask = 0; + } if (minidump_->swap()) { Swap(&crashpad_info_.version); @@ -5284,6 +5320,8 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { Swap(&crashpad_info_.client_id); Swap(&crashpad_info_.simple_annotations); Swap(&crashpad_info_.module_list); + Swap(&crashpad_info_.reserved); + Swap(&crashpad_info_.address_mask); } if (crashpad_info_.simple_annotations.data_size) { @@ -5420,6 +5458,7 @@ void MinidumpCrashpadInfo::Print() { printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n", module_index, annot.first.c_str(), annot.second.c_str()); } + printf(" address_mask = %llu\n", crashpad_info_.address_mask); } printf("\n"); From 2c86c995b4339751e6642e622e330eef86069a28 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Fri, 20 Jan 2023 16:19:37 -0500 Subject: [PATCH 156/195] Use portable PRIu64 for printing uint64_t address_mask. Change-Id: I12b3970adc06cb48e9112726b423ab61271d0044 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4184479 Reviewed-by: Mark Mentovai --- src/processor/minidump.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 51975fd74..bfac6cb15 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -5458,7 +5459,7 @@ void MinidumpCrashpadInfo::Print() { printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n", module_index, annot.first.c_str(), annot.second.c_str()); } - printf(" address_mask = %llu\n", crashpad_info_.address_mask); + printf(" address_mask = %" PRIu64 "\n", crashpad_info_.address_mask); } printf("\n"); From a4f148b7a5003e2e6e76a92d8a5f65c8f7137b04 Mon Sep 17 00:00:00 2001 From: Zaid Elkurdi Date: Wed, 25 Jan 2023 15:56:36 -0800 Subject: [PATCH 157/195] Add support for reading annotation objects in Crashpad modules At the moment, the Minidump class only supports reading simple and list annotations from Crashpad minidumps. This change adds support for reading annotation objects stored in Crashpad modules (MDRawModuleCrashpadInfo) and exposes them via a new getter in MinidumpCrashpadInfo. Change-Id: I033fc4a4fdff5901babc2472e0150f79af56b830 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4195756 Reviewed-by: Joshua Peraza --- src/google_breakpad/common/minidump_format.h | 13 +++ src/google_breakpad/processor/minidump.h | 18 ++++ src/processor/minidump.cc | 87 ++++++++++++++++++ src/processor/minidump_unittest.cc | 37 ++++++++ .../testdata/minidump_crashpad_annotation.dmp | Bin 0 -> 332000 bytes 5 files changed, 155 insertions(+) create mode 100644 src/processor/testdata/minidump_crashpad_annotation.dmp diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 42bfca947..1526afcea 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1096,10 +1096,23 @@ typedef struct { MDRawSimpleStringDictionaryEntry entries[0]; } MDRawSimpleStringDictionary; +typedef struct { + MDRVA name; + uint16_t type; + uint16_t reserved; + MDRVA value; +} MDRawCrashpadAnnotation; + +typedef struct { + uint32_t count; + MDLocationDescriptor objects[0]; /* MDRawCrashpadAnnotation */ +} MDRawCrashpadAnnotationList; + typedef struct { uint32_t version; MDLocationDescriptor list_annotations; MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */ + MDLocationDescriptor annotation_objects; /* MDRawCrashpadAnnotationList */ } MDRawModuleCrashpadInfo; typedef struct { diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 54d288176..934a0e3ef 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -1189,10 +1189,21 @@ class MinidumpLinuxMapsList : public MinidumpStream { // at the time the minidump was generated. class MinidumpCrashpadInfo : public MinidumpStream { public: + struct AnnotationObject { + uint16_t type; + std::string name; + std::vector value; + }; + const MDRawCrashpadInfo* crashpad_info() const { return valid_ ? &crashpad_info_ : NULL; } + const std::vector>* + GetModuleCrashpadInfoAnnotationObjects() const { + return valid_ ? &module_crashpad_info_annotation_objects_ : NULL; + } + // Print a human-readable representation of the object to stdout. void Print(); @@ -1211,6 +1222,9 @@ class MinidumpCrashpadInfo : public MinidumpStream { std::vector> module_crashpad_info_list_annotations_; std::vector> module_crashpad_info_simple_annotations_; + std::vector> + module_crashpad_info_annotation_objects_; + std::map simple_annotations_; }; @@ -1320,6 +1334,10 @@ class Minidump { off_t offset, std::map* simple_string_dictionary); + bool ReadCrashpadAnnotationsList( + off_t offset, + std::vector* annotations_list); + // SeekToStreamType positions the file at the beginning of a stream // identified by stream_type, and informs the caller of the stream's // length by setting *stream_length. Because stream_map maps each stream diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index bfac6cb15..135770d50 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -216,6 +216,12 @@ inline void Swap(MDRawSimpleStringDictionaryEntry* entry) { Swap(&entry->value); } +inline void Swap(MDRawCrashpadAnnotation* annotation) { + Swap(&annotation->name); + Swap(&annotation->type); + Swap(&annotation->value); +} + inline void Swap(uint16_t* data, size_t size_in_bytes) { size_t data_length = size_in_bytes / sizeof(data[0]); for (size_t i = 0; i < data_length; i++) { @@ -5261,6 +5267,7 @@ MinidumpCrashpadInfo::MinidumpCrashpadInfo(Minidump* minidump) module_crashpad_info_(), module_crashpad_info_list_annotations_(), module_crashpad_info_simple_annotations_(), + module_crashpad_info_annotation_objects_(), simple_annotations_() { } @@ -5386,6 +5393,7 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { Swap(&module_crashpad_info.version); Swap(&module_crashpad_info.list_annotations); Swap(&module_crashpad_info.simple_annotations); + Swap(&module_crashpad_info.annotation_objects); } std::vector list_annotations; @@ -5410,11 +5418,23 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { } } + std::vector annotation_objects; + if (module_crashpad_info.annotation_objects.data_size) { + if (!minidump_->ReadCrashpadAnnotationsList( + module_crashpad_info.annotation_objects.rva, + &annotation_objects)) { + BPLOG(ERROR) + << "MinidumpCrashpadInfo cannot read Crashpad annotations list"; + return false; + } + } + module_crashpad_info_links_.push_back( module_crashpad_info_links[index].minidump_module_list_index); module_crashpad_info_.push_back(module_crashpad_info); module_crashpad_info_list_annotations_.push_back(list_annotations); module_crashpad_info_simple_annotations_.push_back(simple_annotations); + module_crashpad_info_annotation_objects_.push_back(annotation_objects); } } @@ -6265,6 +6285,73 @@ bool Minidump::ReadSimpleStringDictionary( return true; } +bool Minidump::ReadCrashpadAnnotationsList( + off_t offset, + std::vector* annotations_list) { + annotations_list->clear(); + + if (!SeekSet(offset)) { + BPLOG(ERROR) << "Minidump cannot seek to annotations_list"; + return false; + } + + uint32_t count; + if (!ReadBytes(&count, sizeof(count))) { + BPLOG(ERROR) << "Minidump cannot read annotations_list count"; + return false; + } + + if (swap_) { + Swap(&count); + } + + scoped_array objects( + new MDRawCrashpadAnnotation[count]); + + // Read the entire array in one fell swoop, instead of reading one entry + // at a time in the loop. + if (!ReadBytes(&objects[0], sizeof(MDRawCrashpadAnnotation) * count)) { + BPLOG(ERROR) << "Minidump could not read annotations_list"; + return false; + } + + for (uint32_t index = 0; index < count; ++index) { + MDRawCrashpadAnnotation annotation = objects[index]; + + if (swap_) { + Swap(&annotation); + } + + string name; + if (!ReadUTF8String(annotation.name, &name)) { + BPLOG(ERROR) << "Minidump could not read annotation name"; + return false; + } + + if (!SeekSet(annotation.value)) { + BPLOG(ERROR) << "Minidump cannot seek to annotations value"; + return false; + } + + uint32_t value_length; + if (!ReadBytes(&value_length, sizeof(value_length))) { + BPLOG(ERROR) << "Minidump could not read annotation value length"; + return false; + } + + std::vector value_data(value_length); + if (!ReadBytes(value_data.data(), value_length)) { + BPLOG(ERROR) << "Minidump could not read annotation value"; + return false; + } + + MinidumpCrashpadInfo::AnnotationObject object = {annotation.type, name, + value_data}; + annotations_list->push_back(object); + } + + return true; +} bool Minidump::SeekToStreamType(uint32_t stream_type, uint32_t* stream_length) { diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc index 9936a7e4a..53d44ae1e 100644 --- a/src/processor/minidump_unittest.cc +++ b/src/processor/minidump_unittest.cc @@ -47,6 +47,7 @@ namespace { using google_breakpad::Minidump; using google_breakpad::MinidumpContext; +using google_breakpad::MinidumpCrashpadInfo; using google_breakpad::MinidumpException; using google_breakpad::MinidumpMemoryInfo; using google_breakpad::MinidumpMemoryInfoList; @@ -130,6 +131,42 @@ TEST_F(MinidumpTest, TestMinidumpFromStream) { //TODO: add more checks here } +TEST_F(MinidumpTest, TestMinidumpWithCrashpadAnnotations) { + string crashpad_minidump_file = + string(getenv("srcdir") ? getenv("srcdir") : ".") + + "/src/processor/testdata/minidump_crashpad_annotation.dmp"; + + Minidump minidump(crashpad_minidump_file); + ASSERT_EQ(minidump.path(), crashpad_minidump_file); + ASSERT_TRUE(minidump.Read()); + + MinidumpCrashpadInfo* crashpad_info = minidump.GetCrashpadInfo(); + ASSERT_TRUE(crashpad_info != NULL); + + const std::vector>* + annotation_objects_list = + crashpad_info->GetModuleCrashpadInfoAnnotationObjects(); + ASSERT_EQ(2U, annotation_objects_list->size()); + + std::vector annotation_objects = + annotation_objects_list->at(0); + ASSERT_EQ(5U, annotation_objects.size()); + + std::vector annotation_names; + for (size_t i = 0; i < annotation_objects.size(); i++) { + MinidumpCrashpadInfo::AnnotationObject annotation_object = + annotation_objects.at(i); + annotation_names.push_back(annotation_object.name); + ASSERT_TRUE(annotation_object.type > 0); + ASSERT_TRUE(annotation_object.value.size() > 0); + } + + std::vector expected_strings{ + "exceptionReason", "exceptionName", "firstexception_bt", "firstexception", + "CounterAnnotation"}; + ASSERT_EQ(annotation_names, expected_strings); +} + TEST(Dump, ReadBackEmpty) { Dump dump(0); dump.Finish(); diff --git a/src/processor/testdata/minidump_crashpad_annotation.dmp b/src/processor/testdata/minidump_crashpad_annotation.dmp new file mode 100644 index 0000000000000000000000000000000000000000..00cfc5a3ad58c1a01b1b1dd21d8f7114690a4f01 GIT binary patch literal 332000 zcmeEP3qTZA_rC}#J`zgum5=q6G+{C`bzZ&_JcH^^^S$ahx~NHmf!&<}p;$tcK$2LALUjbsu7(Gm+W5;KJPLs&FP zgr8r(2mXB~)fB4a3nT(pwIl;LYJzJL$b%Mmo&?en1e^_o-@#NyIs@O0 zKv&*@<@}kyhuV?lHmpy!rYIz%&z zT?^Y2VruL~=>ws_J}0NoGgErgE9{yL3L?5cqeo@4R8F7!3Z)NQ#;*CD;N7M%`htdp zyey|Lc!Q;XfL*iO5|aBWqt6AUb?SnBehW1dD1B~Ac8zaMNZ==o-qZs0ikv<=fzoRp zWLL~@_HjlZ*2eBry8WXS@g=#fnBL`)YH`KL1KhX(Y3@C>>hgu@e3!z+Imlb`SmF8uYRbbEAn_bLIInS%+#@%ONP1b_1b z^H^5Kf7#!Qp%uU5X%8e<>3872E1sfzF(2{#_CVgK-Y;CdyXW#YSDHRh+vFSh_}Jb* zy?e3$q^nQ8xn|LpH{!ndqwTAUhY#u2`k5PsNn_J=iN{kWH)^tf`d2slHno1Rs&~MV zKKEa%e{`Gvp`=+KN4&H6>7z~V(aacge&&@WDW7{BZ}Uv{+D;FSc(dWUrjHDnv;0)& zl3}+791dCk?dxB*-L|d6df(9Pb^B#r-{}AA9~X_go-)oK{Ppu6zILJi)X;t{e=W%J zn(lw;><8!S))`y#i@zqjmn-+F@MB}WuO8|bz%SrTpAF^;<2F8#$%CmG|3_KfLJKv- z_YP}GQ{my!!gH%|4HGZ~RVMrrFSd6P>Ms6-r_a;bJo`UHpMi~t$F;J1Fe^2R!WSi@ z-fhA5sPx`22M^~fdj;qg6Kmy;S{#O^l){VyG=KKozdcKLaArq8%dRDNucg4<_V zE1B)fpX9G%zj=6}@Vu5csqGC!{5hw`t0x+E!qxUJ^;sB?$Di}7Gy9CiVCU*$pS?S& z;G4y}_lAq_W|jTUUpS`6A<1)*(w)18^OhZ0;kTwm&7fz7H1=<@w{zafqFuN4>$bPM z`P-7{p})5Ae|YiW_l|Cu`Ixoe``a?EeQ)lvgREVjatVXNXuIMddD{D zUpDzk+v>ZK=ccvO&mQ*Y!ii&#Y`=8h#)l>+`nCOT&j62|-uM6bYvbaaCf_8iOM3Fj zHlYQRUOe#Cr9Jn~Zdz;Kt`4;y-RAM_+Se~fz4+Y=$9Hcyap3)t6aU<};o%S6$;0i? zsQT=7zSe&~E$TBXw8gOf&yN}vu+O+Y8~P$^nX?s%->~=(B8DglhMib8KxsWFpttUp!8l!SJ8W(p1i$zw17R~&w0N1wW4@x zJoW`teWpr+^b0uCXEvKiN?6YQ{eu52>ucsaoUv*}Ka3LgS-vNUCxnOR3eWK&(s(|C zRG`1ug`OKuWIyn^t9Mzy>O224>j{aO@JepLjz}_2=0B4pM{lc(K7;DR$x#F?PW7nB z7f|(CMZVg9Zyaa(Y;XnaGwwfI*NXLR$iEm5FOWU=k`bbO+8q9HYkL==??gs!`ziOI z*&YZt)kdGmUrhb|ufBk)&;Hft`>%`q|EeKK4vK%Yvwz%>=d{^;naA9<>dzxkM+tn}yz z>C>Q<4X9sE7@k4o&!x1Ld5>d>vW5POir`>*_MHW--`{GppVlz;+oX@C;kh}& zb>1H}Fx_0?%K4#=mr=*da7j|H|M_1a0S$)uZv}Nyi)N_yTbYSF_Ym^2*ZEt5n~{cl z+)Z2CR{F!msWpU$>~--Fg9~d5Sj-Oo1ja(g1HBx}Sqj|7<=Gu8EyrpL4^Mm{rI6hR22!k>OM>Zx&Vc3pWyP?t`ak`ZEPd(Eym!6nxXA3sX(;B) z_kf7yNmhW+0B7(*eDkGI<@ti)r{wh4QVRL~Ob^7m7zcw{;qXSRZ$vDcES`syy@{0) z2`4!g%HiRIQVQ99{7V$;st*%^{UGzDK+k0(gm|4J#Ez`q&~vPI z#E(9x!!EXHcq7L`*=YBJ9f|!9(-4}k60mRZzD2HXM zn9Mf?ti?djv3U9N`59C8wMt{lu}}_^ev?wj?h6LiqnyfLPcPrYH(U(#B9{BQw+$qn zS}053?q_Q+3Swo7{(Zy(dJ(HX)xAWxNTbU0g}T>pTuLFkw|X$FLN+r9byPOcb1V-! z3kl-*(0F0e*v_y_Oq8T#lKatqRQH-#F}eczS_bqS3r5VdBs=1ze16S7B}rO-8`g#D z!;?#f(I@8sYYotgSghQU7|gdOUm9JWFAY3QJuRh>-Dj6{$9$ErZ$!=j)&igxv9M-` zL%6UX>@3G>2f>CjQVQ99;VfEzT{{>^AGAY$0X@g6M|CgE8@LC`7$ISlNI1!{P&VSB zR&aR~)}-I?av4*I9RX`T&~q$84p0zwiMLAAkz--`n)Hv9LUx}WQxm`8g=3rOgYEDQ z=L5Zn#rWm(8PqEz*DiUxAMjKIe?yDlk{)g|Z~k7HxM?iuD+aAY7!e3OWbP5`}_ zFX0=$j%;J{!&8uB1;7LAW&YI3HSZ4%e#48$Sj_q$8+ky_v2I7tW4^Xtb%Mczd?$M% z)>R|Z8%+SK5a>Bp2+=@>YZ4#4z^pszAfwj2w;VUtoRh3r0iWF5r1u%sz{fHvDupy&A_T*14c=QWT*^INj?r9VwI z=r<(3tjMB{3ITc%i`l5;1gi(6QRVqUz0q9IGg3O+eRc>fUnQ%0(;zSShG9T2Vlh4v ze|inG#e*9;RvQSbUxUf5l+Jb^{ZnoHhBxOlra?Y{6$tbqmJs)IOgS*$77uQmVzJs# zN+#Y%M^PPB8d{fz)j%wu7qJ+rXJ=Oa#E6bqo#0_$EropLKjek^DlKCJ@zA!J1oRxs zlZCfQ^bS}fF%4fSl+*H+?Wcg1|4w7f*X4sO znQMTx73dwXXpu14WyS6XL~jj$vl}U3S?AF5b<>AoVV#l-^bT0>JEkGW!uo5C(uAMv zT2%KI`!u9rzd^nVfZhQs&YQiA5=k zW4?-ovivvX%K-Eu)=%v9g^Lo_{fO0G0gFtfW%=@XMuYae3Ft*E7VfpX9;B3ORl@Rz zhe;h2umbnBp!{0JUjJLj*J7ZTV>Q)DQP{nlUx;OWKmp6Q9j(8v3-vPU`E@`q$0E6y zzOqkG0~E76DPR>beR%aet2(|0td&47$MX0XzhU`pSW6cLtiro}@f%*=$ja9-!~%K| z%YE6vvYaE-?{MpQgsr6C@UoHFhd%<=UZ5AT1p839NE49r3;k?cyD8)=?0K56Qo$dU z4_HTmUc@@hk{2#YSQ>bk*Fyn|{Miz}A+MTzLFNm9Uc_Sg_34h^Sh-DvWjVK}0#;EA zX0sja1C($8)?T0&v1ZjoM=!w(u_A@-kblEA@Fcsp0#;Z`! z_bJOE>W$n!3RtEMv|V{Ej_jCSUgAptME%I z8<(&=!*K!f8LcdM@p$b?3Rv0KXt^5(2H1DLg5fD><2r`^MyJ}Gh6|S{7w0FGnBzE(5F}pyya2WC|#hTEqu0Bwh;TP^VxU_V8o{tlWka zt9Uo7ml4Y=PQ)T)K2u)8MG7YWhM2E4@d{Y5uoL};J}f56VFA$deDQDSZ2X2C3(ImU z9TXycBguXKuT(Z{Zeu84*+9>+YLLHJ{lzX;Nlb@th%)b=q>wM)-x!vLrGnou8t6F| zA))MnaA7~#S)MQCSFuh3E1UT@ij9m0WnPmk#ahH32$%A(_NFLc`PQTSx+J{!4Ztb_ zdNE(IEP3IggoXMrN3Vbt&9F*FfgOzp@M}NNb1Z*y3*@i{sf!n)K?>U;|Ar`ssZ$lO z2wQ`uWE4w+>J6Z;2v!gzF*Hp9EAJob(<{Lb00+v(Y@p{@A>;@YJWt{S7msqwrgY1hSzYIXnv3U9N`4!(+x$S^09sg+x`6|q#`jC&QKz*15^di<1 z?CrAUFX?Fa_5_k9846fM9jF|ZEMaM(-iQWz5sSrjM>dcRB^CuNU*^Xq!h54^_-Be( zA>>vqLYfjEypU|WgyeFF^;f}kI}(-wehy@MgZqf^8{$v}@ho43p{(jaIm`!o5o<+#DvNk2$HvC8 z96wtLs|n2)j)lPk`L!76IaUaH86rbniI;NfN|cSD#}%-O{ODSIr9v6RvYZ6;9LrX| z8lY_C!Jl}@zbck5ja30l^ET^i+bE;~`fw7^i&))RWZ@zrIr0nhssLYr^v7!`>LbVIk001PkkwWzQ&J zfjpxfRW^swVENh)^c*XMJWlIMAG{C^dm-U0|AwfeOipYCTcq4Sm~CTaA&8X=^c>5R ze90cLOFsL-&T=el>4ZG1kS}X(ny+h1m}!P(ISJ@FRtR|w992HV2QQ>Z3gw^=+r!h6 z=M=C48Naytxei#GB_h`C$VOklDzvW(?B0#UH=?ppvWf*~{qam<^XH{l8up^XMH*TD z4ZFcZ3&eGKL<_dfD)tQ#Yn=qEKN;T!HG~gdh$c*$jvNd1MyV23AuC_}8=}m2enFZq z_scT&SDs#~lrMXJp=@ZDRSXMt@6i_(un5an$!_*_@EbOHNs1-RjBzqSM*a;^9~vO8 z%cJNgs(ZOOS3VgSiG(zBk8Nyo#grI08f)vDqvYzKP;C+^rb8YdO4OmW6aQh z*!(pmtTWVaQzDGTY6<)r3iKk@A1v~9ylAX&vK{h#p&b>StAw@oKGgFU&NG_BkS{CH zi&!kY?k_($QHc``BNEPXtnLt=v{nJDXj5Cny1bFa zJOo%dKrdnm2~#XzMJ%kp7OzvlDoncvv3T1Y$LVbadJ$_oOJBH1!Q}ZuIgETq0W1Gu zTE0qKu~hIInt;9{SZGK2tyjQ`9!|0L8<{^B%hyn#7qNu6&r5T}?&bMHnJ;`#0n4PL4;8Qq7*@$BMuYy1bwDp-2?M@_3&+N*JYQ(DMekI=%Knt*>q@AQ3dn{P=tV4S zyTTz{*bjD=V|9bz&bt(_NHNv(#e$wke#HZQMX=BhP`X(eB;*sRCB^=agSJgti{~MN5HR{DyT| zhJ_2q#;crPSf}KCrhpZgMzKl+8^9B=_5wY}^5jC{M)^X07`;ycE04{|B34F&SXn^N zu>wG6(1V$(>|Qv_^Mx|+_k{vh;Df9z3u$7V5()Gii|JmdZ?K@s4mlQn!$V&xU}+{( ztYROgdusv~`AUiYVDdrDbSmGi7hUniY z`BnkTdT(=TAD(AvpltYm=ZHm60m%+I7OlU&SHQ|`K=XC!AWNtd*x09mUd-2I_CUBu z;pAAY;bHy{3Rs07)Wv+2#(hGQSq%9)0rVo4Fi=3aC}E+AdEzGpEMI1C@b=dN!16jQ zVucVKgav&ZZj8l3EU%vxunOBS+a{nfedY5YhwXr#=j(Q`u$>ZgQ~}F3gN`vPIM&>T zH3{fB7Pr~l$=Cgmg5fs>tia2SkY9&{IggmHWk4^-B6HE6vOnaqfmmw_6|j8S*tt?8 zU5b++)&Zce2o~!3!s7~9fd}ar7!uED5X&2y$Q8i~04)EL3Ru3M(Xw0;AYzRN`ifwo zf5Y;p0+yA@VR0M~!h!k91$qZ8H|j6M+WD6PR$fSIieFU={Bv&>NG0p69DMLDR;I z)TS0r7~G4891BaRrbr3v8>%-*9y6Ez0jv<9=UBWflY9|_-^sDsz=I|i6|k(iw5}|L zwj>_dHV*-M5esY$JX*1f^eo3hd*i?*1+0P)I?lXwH}<6w@(W;<0KJGM#0_C>TuLOI z&!cJ%pRCDqt1-!^UFy+)Goq z404zQ^dgoJ7sgr04|%?@d@a7_NN0;@s@VqRuw)|(xdK=_fW9JFn6KO$N?3=4`is4# zAJ_o1^)^H}ZV7g|Kxu6|ll?w8ngumQjX~63Ev9pck=(xYr;dFJgtW z?T}+(3Ef+!g!MP&*OgT)3H*k|K<|K+YJ;%d$gyah;vo;UkrNVjh5GcajbddP^@cb2 z;zcZh_B^Cf&iWfTZuyX>0#+f**9E~o+yz+0Krdnm-^7i4p==zjseq*kuZjG+6u|Vu zS-|qD<%m_M1cf7du#ii7k*A6>@9ixQmBa{4p>wjX0UjQg0V@dT9rC52kL^zKRM9jJ ztSb+dM9C#IU$>4i+Xd%4Oagili_y9>ZW-&Zq4gE8@gWth%(4tV?Q8)tqaU#B|W} zZQ$Y2W(ruoyC}ad9&1XI!SVCtJ`u~4bcYOqDB^{LumV>zUrIbv59s>}19}mQrM|Z5Ot{hH zvtR5iPZj&W3fsv;B{A{}I-?vC4GSxVeEGE(vC0U7)FAF+`FBvlx}Ww1+zMd!#&yWo zB%tT{s!4=z$I7Ucy%9UhQ*8sm{tw7QB{AZ)bgbirCCsj^1+p<5=s6bGhwjYRL#!s9 z6tMDd((+Y&j0rWa+YZ6ulYbP$8tw+pszBuw*pq+2mV-= z541W8l+a!QtQ?@1W047vMiVlR5(y`HssRu_yN^6n5~HA)`2lthp@F!D$$FrdW8K{b zWh9qXs6upks%;=VtDihnAjV7KZ**QZ?v0HH+5jtoUc~Cn1W~v!Dt4Bq+8Tl_{pF#O z7^X&44zC^);zPc2fL_F6P+l`6afDlWs@VS(?8JX+i&^*p)rVJBVM!#U4dlxJ^m44a z_fxyrN{NJ%91CSWDO?^Zi4oR@`M%;9jRvr?fnJW~j^74tfJqSwSf&SQy?pr~V|yLI znho?K)*$v`IAlb2$WujrMGlgON+MaGt;gywrZ><(p9=IM7Q=Ao8=}qTJ46ACw5MYa zZU}Pt6<`eodO4QQF~lsAyriRTgZ6x6lmb@KAZj1p@L|b(0azxW7qNuRj)aR8Or9!A zSJE(fs3b43Et=sDKy zte4UOUgW?i1uS1&R2q)x8I&jsu!@1cB3K$orf9SRR{lUQiWS%!5y?NGdws`L3=8#q zNUQ>u@1LF&OIXus2IR{C^cBfhE5J$`r+}56T8m=kKabg>`I-;(6~RI|Tr*w)%l9lD zZ*%eB{S>PM=#2wF&#}18=HtfrdDMqnv7U2vgYp_ec zG#PoS__hZo$wMVE!XBkM>Ov^R{D$Y^6|l$zYGd;;W;mX$iPjN|yoV)~gyD%F@>H>%vLitr z%BkU6R7Cr~E~3D~f$M#p1A2MB>VAaz^QAQWBu^FJ=4g^UlvBese>wF76bp4F_M3a@ z9I@PyL(JD2Tms6~;oGGL>fX}xjNmF@9R_+aUo6}m-&b28-I1z*W!gvA?YZg0+Lb#1 z>nPBRSWGrNKB1Ul44IwfsiGY2ogxpF#0Wc2ZJV+<7Ipxz&H=px7Ji^|#=)ZAC^RTw z4bf=2|}btCassRg|aYQJHl_86srfTmxYToraTAu4ZSnup^_My61omdX&g%u*F6XX zdU?L6%h*>ViRftCplmeBRKN=KW9y|XsZG=Q39!O|UXDd_=(|{@VDeO3!$WUYy-Uf& z`@lhL?b!kr)Cj&|XP|e$I$1}IBizZcP|r7+DG!xIE4)JcQ*MPaIm9(*!hl}H8p4Q$ zizKFl9fkh+$VU~havQL|QK3(>2)>~S=tV5{4({*^^?d4M3RrWUu&LFz$#co5P%2^S?Sl#To+ z6|f4~oZ^dR^=UF_1DpeT5la{VAzYNOG>G-I0#+Vt6O}BfNt2;#5(2%5b%Pe-rZwoN z45LKCNuDaohT$1`s3b;F4eE0!KF?@y+}ARo7qQqUBteomF0iou)ozgjmX+m;`-pHn zb~MmCV7aj_7W%$UELOnE7REYi*vq0F<@>A?ta|LZ^ej&m{Wj~LlZQ%T6s(}*0m|Z- z>4!GQZRX{Xp%H}Q64IZk;~Toz98s%T(5FC z&{q^Ib-4l-`Lzk!hqnTl%~lFnD}i2)MfOVGPq>w*iuLmRm*t_7c)rJ}f8**#7KVC$ zJ%A+Ed2C-HtU`4N>eF1!{4V**QB-atkb2TIcs+FFFlRQUlhhip|tXmarIv8(8fC>*(7GSovpY8loTzBC&Yu(H#r9d-Hq-83ES%N`E& z;x`nMcf${Wa_FC@fK^yZ`@b&vurzV*QZ&$uSgcNQ$G?I4FnF^9mL`$5^{$pNEF8ZP z5A<>@k5=?~KBHo1d8(MN;alaQk{I!OsT`I;{~8`oL%u9P&#`VtHc$?iZBxK1dWPBn zmye;GfgJ?-+5z+;7CO#gU4805i>5UEBu^E~SI!Q3D5r*NA)AND$H8J>c0SN^Ebh~D z$47)VTl9wtSfrHBp}QH%@`YHlf!+b@aXJVlO!Afv<*OGwY`0SZD|?dACSvmTAz)1c zdJ#**j2<8MTnP)?=Fz*9uqII1C|SkoFKp{&0X@e`C7nv~J2t~hIleFahL(H6|mwr({ET3$5O#HOhSNO#6mv7AzauG zc9y4#cJJvg;#{-lUrMpGl-QlN1Fng2_$vjh!jEXa$~M-fY2v(5 zzXKvx2*C|uIudv0>|=k*j;|H43JR$IuyhXlNVq2aX`mOsp&;{zQ1q2$9{E*pPytKR zo0hNQV{K@@(BF&eaXDbQQNHen6i$4rfECz;`o1ofF@0DJSoOcF7*<=rI`_Q-R@mpX zfBA}$m07f-d=E*nSoknEz9Ckpg+C}@<>gTu;EGVbaQq?pQHte0zpyX+z)uQTxmj!- zGXV?pbq?qq_~k~v5NpQ~1+4r64cfgoM*$%m9+0oYKrdpkZ|IJWLYwXIFA7-kM`>BU ziXR&eEMHznMXV4yNW?uG0Q=2%{HlOebcWW;CA(Rbh(3oRpqJ;%oi-8Hl_!oVV3{sZ z{~^g|-wM~CuU{y|!ra0^^><)Cy%$dMR1u3DmxoGXWFKVxu!3(H$BX&{y_l~Pl-Qm9 z^-%Zj|3d*QUQ5^1B?T;BIPazu=tZnh7FoDR-qN8?L46o_N&zeT6Y94q3BXbh_Bik> z9_U3Z_6}Zi(H>E5e__2m>9hitwG-7*H|gF3u(k?dEdY8s7I6cs4PYgmQNo%?`$jLF z$5C5^>;rx+0D3vrm~B|tmGjjOC=BNmu!_8xZ+T+_graLZX9K;6b+j%aun!qt2y;A8 zLO97SRA9*OJhO6)3cBnV5989KxSf^wIy@52cTnc5$V1G&w(95w1tW^whm@mN4i#%1VzsL=Fs3b=I392_rLs_!`=cj0Z zo@03uSlAQ~cFCvr!bzSg`o5anl!r=U#Q#F`bxW9s_&H!j0zJpFwJY7o7izh7WeQk% zEt+Ea;%l^C0<57x?|^la)o+rwbSPigvY6!INN0;v@DK+mx>L<>Swhj_!qD=8aEY=;~R^`W(<0+wkQ zo&QzZiqYWSaBF~`V=+bOo<78SIj6P)R`x5*S9uI|EAwyU1HFjF#Lyjk1IzNtIto}t zS7=+WIFv$>&wyWhfu3XC&Nsw-?Wm`K74|+Ivs5aqfsFQiA<%Oyo6Nt6@8Zi|NI1*+ zg?i)kT?$yatPOif=;OEx_|>F=BbHzTgh|2VSRLS@x32+*Yl{8hrDu|}C!PkPL`*JpO#3BqU43e`Q@_b>R zRA6%jtgtoo8(uxg@`b*XB%tT{szs1du*g$GV+4bZBEocTm9c-Al3f+Ue+Ln+^0FOPD}!y9l3; zUgX~pW#0b*1+2hJ)DLj$ppXh+O#*t31$$*elJFld<>;vXNYP0F%XdG`7tZ^}1APwh zK+myk>t(SnMoPm^@_eCxgLF~A$~{eeDa9LKrb*!b=AD6F#Cnt^t;2Uw*1fHP!b_O5 z#v;kid97%ja&1&U`rtRzhd?i4vHbe1#I}XTF0wpds1HvED {0{e!?SeiKB!MmFj zONiUY4u<}aW1+pVjIO!kNJ~Qkt+fB^ijfU+@q}-<6X@mnaz`I(Ai?Y)g?wpDY+R)e zvs=*jl?U_=Sc5R%%KU1JSiKam^7^v5W&upl(4OB4^bS~V=#6%Ol@qLhmCMG#UPfgG z2ii6}fxaSGZ6JP5Uj?k9`>5}$WEE?}<|7u+J7Br-4JlTL0#9tm*!e)uu{_A*@Bm~GFT^(t&-{?*3+t4<0~N3e@2!dLuj`>yn-LsyTMYCZt0DOZ z+Fu^T3oqsDU)dTcc19{-#Sft4MQ?3nee~EiF9dpy6+%!s!MfjW=qQwpor4vyG>_14 zc+-gQO~_2d0(y>hJKs=)2}CJiWhYUrOQTp>UI17cpsxrPe#6LN3RwA%QLK_t_yq`= z2Uw{(-A@z$#3mSjB>0VlH4E2KtI%(YK9O!1B#y{F=k`#^Zq14(Ka_h5lZ{ z7zM0C6U8b!#_Zn504oRRD}vP)u=d6(U=d3PEMHdxu+AU^u}%YhMX=gK{N@iSUv>4 z5ZuVIFkj~;C}4%%$FMfCm^fC%Z=xgCu(g;*AvR=fha3xKzCPVI(MBS>Sw{W67lbuh z(N`G^^!yt>K?*>j)F2wX5KWjgvK$LMNu*@5Lca2Jv`#5H#@fp`r`Rt}#JU~bi+bK) ztAJ&CiH_g6DU>f<*Ks`1^L*K4BN5ZU)Wk!cFYLQXqI4pS-CcGR9ouvBJd26*q?Q4_ z91E*3IKt>zILWb)U$b=z`HE(3y_sd^7s@5th|SqZ+SPP z!Eu#~fnLO786tI<{iuZ10rRC-z_LbC-*VX~mL`t-S_AYBSg#0}5-|BUM1JK>Rlq7d zOnsHt0$5D!lPUyy2Q0b=i?ZE|WqE&^0#?|#d#Sx4V4)lq0lkO?o2lR-TU$YX{Ns4u|j5!s)hi@1H^kTjQjAWWd zzK|t)k>?A)VLOWwRt)`y7niV@=w}-a^l~hpF^H+582lv1Y6}lKPglT-{)^6sy|tUY zKib&QKrhE)TkI(JS0YwmmI78$N&w0R31e@GeZH|kFURunItLm!O!%NIXYzdEHw>Aj zfK_0>PCNQil7L>s5{z%*!cd%JQ9s*k1+4sKti3GQQ8y`L0y@%^8`93aUaXmlmT`x#Uc^r`jC=Sh0!n(!gn_C4P3-rZ6&+`R8 z*>MkIkudhd`59aHepc65S-|Z85>8C;&p`Afk!Xnpu11m$%S8l`@epDpNkm8DNH>^# z)0K3GKP{yXAQ6<#0#DN+7Scz;{dD*JVd{d-lA$kEl zgNB*yo;%Cm7#hzAbY}Q6&Qcu%m`1<|0GbT?9{61o;CB+_!T{$u2*)?TV@ynBOzfcT zMpKU&y_O!DGt1-56f1@&%`_y%W#}mpZgCPo#zHLoo|umWxJ!rcr-f87cNRcQhwy*< z#TfTc3Run}NN+L__&$gP!#M&LN$(Ce%plSe?t+Kkk=ti(*cMVDd8AluZkM@xQXl)V@z zYsf<#ln}>qF_>~4b-)ae12dTlv{=HT$S}(PuAntgE~FIF=Zw#{etoD;UhV^Z7v;3w zapL|dbWru!s9|~w@Ef-Ya3#lxrRr7G!(zR0J9@Puyd4aDM%|wTT;=tfb1plhWcPX8Oa@k6E$q~OkzcRZ9{*+ixH$8#C<75jvrZ}p->Gs?t@JwQ>JX~aO;FdPg@d)b zGcE6mn(_a)^-c7PW-aNz>6@gpP1idS%48cYc5R(;LX&7+qqfS#Oz%_g1xBS6aE2x0P9&c^2@m8~m}BGq$4f zz&7(zucE+#EAsnn2sNC0IKBnCeThMzFso~~uF!PWQ^NTwzwR)<5=kfc=Za^q^!w)B zv#I_1eDuX#$*)_DbQ33FRbr=3BG(qGJiEg@lWN(n;485&ZCKXoJi6_#;@2PUz2wmG z+8@pBoGFyGn3)+CU0T6+M(GMZO2@L+xAm-!n{PJn_QX%;j~)5-;sk+b z#)K(}UBd;Q!IoUAp8>vIW$;X@4ITZ4*rT9_{tfgY>A>qP_YtCJFA_XWXn~^d5Pe)D zfI1!iQsB24-r8B4Q#lUG0P5k*AweE1$k6_8_iz5t&28z_uN-Mi%uLgzTSjQpwJAC? zQGE}USDuw+!?`pJ26@5WC)O7=9e!b7nkzYQMa}rX>+wTV&gFg4bL03S4N|VWcm?HR zu->4HHXEnwlYsef98z^drPaa8{C7t;h&>G4%j8@iIMN|+Q3q_AyZOD%0foWyUl?*N za=@nZ7*6{f&=vu*rm!t70H8hyD$pc2dqsH1s-%)e3#NN z-Tz$3E6x24$vxM{UEMSJ`Ob7uWK-iaPeBn)OMI25$h4VYHB0 zbo3kAf6hz1GfGzOyG_2g?SybLk45N7}S)kVMm1e^^_tj^RY2dwMBZ7N?&UWmF zzC1q2+&g(;$m(@#QL`ZP198DNla4_nt5c~0fs9p;@0YFr)gFB8t3hxQyq zUrNs4lcn7=PlbMbPv*3#?|Byr{4<$#(=v6)LxF|MRQ}yz{*3^88T&QSdp-pIa5T3T ze&P5n$8xx8{)V@@9PHTrwIBSGQX6ExBk*yAF##OpLtwbQ)?neKu~g+{rSVd^u5`yg zrra0CEhXnQs(W!!Hn8j)8qa;Z!CR(~C!4`#*j&IG~*j#1~7v5_9j%Qxq?O`L^y|{BUT`6QtW_miby9XMz<|L_2 zeqGfwRitN}+vH=xPPL|FIUm0Xt($)bd_M<=q{fk2(SS<}EN5{`T4u z?!-h{KpA<^FI9i3>o@)0UhzZMpngw(iQ$9I#&nCU6`_vfsLr|q$L_d4yVw;qmx&_t zv+woU_EX@N{rUklA2HMUF=L~oGmBN-QJL$t{CnRO)(Hmcu}q}32kMb=v`smqoSt8I zVsbgDePr5$pN;;qdv@C2y|))Ee+I)Nj0S@)5!WFYr`OG3ZYy=nPgUs-=XPZ@v?DTL z1gO#)Bla|`u2^&>T7U9uOUOsf@_u;y>Z;+$@94~oR9tC9wI!;G$L`n?XLyP0nN@5pBj@7|P%oHZMKW9w4_7Tpr0bI*9_DEvm;|lK6lc(8rYEMxrRlU8nPweM91}W4RUcGU)g#Vr1soNO zen&I(S77;eHDb__j@1bd)Hqf*B>H&pt7ps|GasL~3S}T_R7|EhS(}LSgw!=^su#aU zL3zjWJOsuE52CeHGPMt|l=D$!SclkCFrGD$RdA*p$Utr4RD(Vx)gqA-weO=k z%L(uQ#2SU^6g}J-T=*eeQFEEt*7lpM+DGg3ee$oLnxEfu?>Y=eFZKv9P0V_&0e`Dw zWva70L<9HPirWdcepBZ@DQA?(U$jx5cx%tTWADD(d+Ed_ZPK;6l^7nag@wivaC9Xh zKdLrH71!4uOm z>9y^z(;Z~O$McajdW#;GI#6Y!I?KiwkbyL)9Z*xm!XK{290hF>6SQ4jjjU9T!)0Uk za{u_V4JHM?e|lrio+)_+G+dWvwCHf9=BRX2rbQiJU1js)-SLA(z)E>+PaxdQ#(C{w zPs4dX{miz@e|{3tYhA1SBgtd;(RD5(MntC?Ek<=cyei|lb9-R~l=>v73$#%Fai1gu z^ko`B4>;$yD{59B)Y&knXs-8f!7p2aJmMSwP1}(pbV+(`tkGylFlM2AsJ@2kTpu{I z262>qhRuR-E*Is;Avlv`9cKau9m=p6??-!HS|Ck;V{49o}ID}_f zjKj4vjbJjUHba%wAGaeHF)+$JReO9G?eyl=63;}~@a9%Gsqhz+iHw(i&M!fk&_szN;+7=7W(Y2Gq z6BBg?9rRzpfCzQ`OI6tk&UqdI@eayz%qls}nS#?|n5t`K_TJKSg!> zV7`(L>~E~r_x};~J+7Q?fVv+2N9FI?6%M`xdwQ<#pX|LV>cG+oJ)i#QpRB;Yx6>Vg zXemF&5{2{NjxL%TKfpdad5A z+JD>^OZ$?dMzMW5PpNvKiu8bUy+0QCh_(Dk;3<}Q9NA(&-q?9PP<}jCFI>n!bTV|p zd%MSRGOv>%fd^_@B(PKX!ldpPUn`;~!dx;cQ`2v?wj=xW;NN2RJ4H z=j<~7lafEe86}s2V*~yQot~4`@0q8ro!Wo?$u}`PI(23Sc%G;uLhXO7&g}@aAE)Ns; zPk2$^qG8W%3(j8|{Bit945#}$N({$ks!pgho#1>u2HvlXUPryKDm{*A#(BApYth%O z|H^@ho*hD;dUW9h!@T{}7Xa%oV0Uvyh8`BA*IQ=twdfbCyu8D_L_01M{@92j$6dHt zKf%d<9`Da;^J@R4GqzrvH1+jAup9yp^@*8@(89NE#Z6vN`FF?omqG1t9Q~07{d_n- zF@g3C;p!+jB1BpealXL5)P9frGb1E;<)j+flWuPMOWp^l={#7ymjKEEt z6OayLKKZIiIR0D8O;#rV-ZwmLUDRWNi>8H}a_`&Uj`P!)mS#+kFwZnuj9jgf*Hpe% z1HPJ|jIvQ%all*jo=CZhW%Pw7{bSbL^e`(Mru^F#w-B`8!!+H^0B-7!lWb5R0BhTIJpWSnNot{&kFCD%`;3cf9X`HT; zSUV~|tCpYA`ZA7=^ubkXq%9FC<$@R5JeAMYjL+%RW^!DO)Um$3dBkVS zsTVKz*xGwS>wRym;OmqN^=+bbc~M)r-lp=q+VLCr<;Imoao!HLeQ*vQ?sj38X>hEM zckByEkNl!*=(<1O=`pg|#q09&oo>-;%?1kG|_~&)+1id4@inb5`wZtzLY^IkOqi4z}kiv%^N7 z`T2(pXVU_ooRkpQxA5I>WqeJ~$PoRFs&1}Md`$*TjJ*JCmzZR*yRkNwTid9c3oq8( zU$_0kJ$5%KSlZt+B-x(F$vUkC_J~O~Xj3G*S?yP^PP|5)jQiQ!mtf@W-F|!HH}xXM75o&Q~AW!5c)mPKj~OT(-#(hw_twr;OAys$oaC~qP{YoY7O9> z(lcOz0nT-zmghfCf(VZ=7>dyVSPs7C&b4A9f*&=TTn(Mr7-to}U}_u18`kL&e$X2m}@Gdll7*OwOU zsSIs;5-d0?6x(-H-c~E#>cJ}+2mOQSt3u5!@BPKH+jmaK#i#28bXybp^20HQb)VSl z=L~&X+*F-8UB|nCRexl)(#u%yB9Be9wQHemBJ@Q&*25j@UW;!2%G%J6whm~S8r&@3 zkSfy zmx^;{_nrIF(|t;|JvqU?4&d)2`cj5h@LgQD9N2rjc%c96fvaYRJpIxTa#*<>%-(cjPRj3_d(P{oD_RuLM{6&0Vmnb<3RK^1)!HBSnnl!q z()NQZuA^^YEO4BzncD2}W@IfR%Er+9JW&+=xuWv2xXr;8K zNHR?)4cfLdz~gKN-&FwYj>dP+avhV^M{OVYrm$DTHhrE6n-&#P_s}mWA9Pk<$@dDZ z<=Kf+{pgsR+gT%8zS0}+UyChS>|4Uo9$g`qXa(5U-r~2hA2BVDjk19@-d&f&_xv-d zP0*&_M|ID>tL_2}r~8u$qot$LEzlpOrF)r_sAay=%KX2V83@#fz_TD=(rOxJF3+fb(e11u(2E*w(vx!E- zz|7=iotcmost&0%9pc>9<2Aw{p%%0Nzj56G97l%rx4k8Sb;1`n?s?;{od>$Vv}?h< z28W(KjC=(9537Yi=@z}kpi9%GTg1WI=Tx3n8c+Xyy@2g`oPWXQ%E@)T^U|&y2jv0f zWJBZd#S^2R?K{8airM#WemnxhN5ImfFr$uF2}ErtRGzKryu71EN9!2Nxx92UzFl4T z>C~UbrUouC)VzOHai>nmHz?n@;HbqQ7HgueCsMV%ivxQu8G6gGWyRW6&iQ%vk?y}{ zeYK^}v-|cYM_-x8=ROMjj7v;T)fr4WvyHRrx?5Gj*EHZEo6Cwl1L$?LuX$P7%nGU9 z{^<|;^;kXTNWSlo(~WIqGtFeiRh^|{w$(MA?=&CL=Z-6G>8Zbi`9&PZ41KdNpn<9W z$H7k*z2EQJlv$q$Jk**KQ}xqzUAuEn%u}k}RB3jT^SUt$>|O))W}!z*$~m-WrUY+z ze01=|?wdxPD*EE|U1b8_veFFQZA?>ncBji6diT;{W~ts`^d<5v)~oUH7MCvsZ<^LS ze#_$*Itn~9Xwy^ld`#CawVYL2Ia6+*3CeU;E(&EeV}?H2g3bkAFRE*5-8mgAa?Uj`oqLj{wI}26t@{cm zhkm;|aKTt>z2AS2;$t*z{1yGfoYO>YV^))L8wq;a`RXf-w|=WW+_P=R`yp!sHs4$^ z_tkf#WjE4p^%bJ-by012TK-zyhsnW5kG1|QaQV7NCw^x>_O=~gWeawzb4ja*ULFOu z(-g3r5^294_Pj^PS~IN7p8Vmj&=bGc>ap?0)p2!icHAxH?Wlw)x*`zjP?G@)`ZCtPbwvJAyp&asLnh7&-mT!7ojcmen{IE(bmAW?g!sZC?LomB-bD z$1$LVam)q!C|EB!TcZ%YyclNR62fv^=iZWr3-^59>)lSTmOim{N>4jp$5_nz^c3he zrRzLZKDF*q0Z(u8>)88QL&4c4^@s8OrKoN;+In6HQT>N^j*o1t ztAWe{Z<7|vVNWMz@%*IvIp-gIC}@pg?$_7ud7jU4Fw9ERcI~N_J&^Xw9WN=jix|(? zSW_IQ5=V7tD(F}X^qjr<$$D5aAz5hh}v>x4_x^Hf7o7lD!1^y+>>fW`RIO3eBV@d9y zUxAfF92<^3)zg7@&dc8Q-`-kx^!>QNwP6E3T&)`tAn;BPtEx}8b(%q-+E;z2%N_Pp zqfajbv?$KC#`5RrvpqY}&*RxT@AQ4=+s-r7&eRSU_?MWfHD~B7Q2vr;!q6Z>)Hdav zCx6~$$8>36nWkn;G zZL8m_`?=jY9y9%lW4mx(3Xah?kS=h}0BtKTsn}-Jrykn1-T$QlZ+urz-!0_T+5#_A zb^5d>q#~`FPV-FLci=(r{!@>hZ`BY)^F^y{QD(Gyw(o#6?h0k z^O9kw@WiQH*A}S0ol5iVD34b_{|%1q!WlC<7c;9lui3mBY*#v)FCnKwUSl~vd~MVG z;1-L6K3bjfO#`oyuYsUzKVG7e5?we1J8CBXL8}3A5}MZ(>Z_ty?kJOF&wl`f=l@j zDVTgr>mC%Dlsly7x_)U7^)Bp0=ip7(B@RbBy{`{7a()F;rWn?6FHVOu@TTa}ytQMrkPd`COASFgOi&+Fo; zI=vPapLywf&s8B@ZX#o%xv5H2xv9K1qq419RrL|mHv^&03a2H;(Wi8<-Oz5kFU0nF zY5A4MPBy9ikRUe$hlj`5oM6Fl)Io@>AvMe^Q=ephubakSNt>33q=n_OI_Z_E_+J^A`q9 zi?1cibG;jphy7jiTdmMnnxKhgAMnWB&5BICbPfXdMqCLtOCM zk&g3y-LSboHy<*o|GQt6o`3Jb4Rmjla2x>nVDupDKvKs&R-R4ad<-j&(82bF>#dCTFJ;OLOxf^ZWWbX=RQ`P;_gAs^z)T z%CmC2tg_@I733%xB*;-;9Dl1}arl#|-9P$h@ynk^$MN|@sne6Wx0#T`sytL-)?5XcXY7Xgxk^Dl7BpQDbL@0Gk}UF@%cD_?B6ZAIBj^H4UxrWg`~HAjRN#sZ7F z;*=^U|HX1*FCC~i=7$drUvy+h&!ubscwqUB&TZ^uLlBF-s!UX4nHWW4;qAt`^x=rl zk+;b6iyhDHf9JEi`Y--s;r8=8e|rMMN5#gBL%)q`J64|G=1$v=ympY+D#&k?gC6l- zd7IB{>9w>+@{FfGh@op)VwDgh?8Sm~rE1x)#$_LSV)$Ah1EJlCqYIMYecfq!x)+zr zO4}cX)jhI4EOg;$!_O(s1+N794$-6N zj;xd)kITuxWk0RD5`Oo9cdpml)yw-AI#(bn$)JnXr|HZ#DIw&9Dks%gPHtD1xTfcF zv8VXU_HS)X?78tq3vKU4|Gbak_L_qbb&PIxwmoo1H{9DCXAYwdNfK5Y!9HO<&AGS20u{CHeeK6`DTu_UrAXy+!w>PPxV!46>d`wPZcVBu#B zRL9^}gJ7{&Igby}-wX)lel|R((_}upgF?@tE zL2uBp-Ge1&3sLu^tj_vH%6a>`276rjE;!Em&fSU0xO!%L>}8xF@wUX<*MdzsI%=JrsW=Japrp8}HP+rybqDY@jhsU3dJB zuY1D!$GHV+pcbfm`&@nTY|B;W*Uswq?Ed8aUHiR&!(Olt1p3X zew*r}s3IHD`8YV-C6u*4ooj9JIkW5b?(X|R&-zaXy_)pZqV~p%#zrwf```2Vi{5WM-!O2+&exY; z>3xH)btddXZ-EUEwT75XlgVhN<0j9jI-!c>#+6PGTZ*o{1kR;IYVo^@$>gKy{hE^< zKa1}FR#NAOj?a4&GzV`V;x1BR>+ok)Hma3ui~>D@zR4lrn;b;n%$c@eBQUuH3Hds&2CQFQXWOfzQ=ddx06P)|VQ`FWERDMNeC64X&c{`wXL>rc>bgL^ zfcrRFz>Aa#_sO&_k?&@V{M;F|=lZI?-FvLq;$i-1O^e3`ei{tZ)4C)Zw3dX-*li_E+dZK5#}S(*@2`84J>c zDaxfts3U#|%<+2VeCWDXk^Q@eMe(&ZheVIXrX{!%&0{Tk$!6#39GlA14a#!l+>YS- ze;n{Q38ca3LTVi882@|Ue09sFUp^bKuFqM&w|1_ieN6Kcv2I~#v_Xu5*UJLi%skUIXvIWI*9Sda} z=hG#?Im<;UcSX&3|Mue^KHv3N7MOGY?A2c!_1cWQr{z4>Xfz}kv+(yhmH$=5fA{PJ z9H(G{5%b9D46qT=x1fieL(u2o++G+0Ph7`Ao})cEvuyvDU;dpDI=69T_eEEGm16i1 zv(}V4PM?vfHRxyQ%;ZN^HmXQAoY(!g(@q=$b1ufi+q1ncu8Nm4#gU83fHWxa+O}tu1R9Rc%|3eOj+pV-MoppnHV1{*P;fdW3_TRW8 z`1S2G`nBLPFr2Qdtn?w^yz}HnM=q~wXXP&tt)uj0i`5@+81o3qB%~{rDOykfugFb$AXUN&fTrRK)IU>TKharw!B*<^7O#H{n#BlIyF?nFC1Zb(& zU{a}D(7#Zg zKS`ux`oJS`+k4ME_)6gXroN4{n@{pW-lKmZJTpm;{v>tJo~q)vJMBxZ`T0B>=PgP( z74jHu$0ifL|JCqrqu`y{SEeue;yF4e7kQ6!XpkmH)&G^I|DE?MiKP=qsRNUvwR=e8oKlT!!5s?^*b%U&<3Q%H^u@3L^CYiP`Txjc*fxAz|M z670Numlund_tAr2>Chzbw~$qT9Mv@q>ym=uR8RzeB9?s&Q|IAVXBkNZy^sl3KJLYr zOnrse#uZm*6Q3h5QO^&Y>-CaG*R|J{Ud3Cdci%|$e4;kfFcqHfQFVN!>G*%sKZvWJ zM#7(S9&>%bsTiO4Sl?d!{p%n0+L@Aa=-tx~3`73YzM`neD7?>Ad0lC|F0Vef*XO*C zUk`QrOqpkw@$%`28>?3}s6Ak_U(fLMD;jk{{_%QUP}kVeueZ#!HP_WSiB;z3b;nl6 zIt6zYvY!WU@2_#D&&!X8vVnSj{pfoKU6_1#w~wb4MSZ_Bg0|yF#f0;LgUq`Fv}&JW zb*|rIz}im%4=;{AM%y1p1X$>pB-RFSCL_vmxO|)rZ?^ZjIS=$-yzt4XFMjL4AH!qx zDd{F-h6To}o1vkgj#sbNIt2NgCfUDNI_j`|P2z5BE-!ss4W2nR_3VI+KfZk5qNW!E zn7pJ7Hfz&#Y`mgPrH~rxJcmlNE$r>c2+##HK|A2Qg)I2P@r0<)0^n~Z)fhUE5yx?j z&ikPrgw_P^3mpR<1|0W@>2mARx$UVGgVjSmnaeEtExti3`py5j<;yiDqTD>Fovw{Z zH0wGMkiUd-z3DsP21P=v5mc+^MAv-!BX}NhCigE z$Hk|7uHaa>S_6%Y(D!PDHQyK@8vAXx4r^e@XUo$Qt=e|$6(P?+s zRvI~E_@FKsc0*y*^=a>zeN*{*hmD_iUQ02p!zj4U37KTvFbtG`qV)KpDYLhhONRPEKC11Df`%gU#A3J9FV52!rYq7vmrtn*x zw^3Cx;apF+>O*xd1FonU|8wTHUA9*HX3(niMXNR@bf#-iO8Z$+9@KvLs^Y&pI)QsY zqM_Y^wS*4ZBAK8a65!4Zb%%4QC@&WB9reS7Dr8zOV?;=+ZVke(W%CC z-N?+e1egenwCcR>%99c2{dEzrVlmFY(ZRoTxW_%&hl2#9z(40>C!gH(ZS2$%!+=#m z$KSQin*B8L4Q#@Q*db<}EskKBS!rqv_OrPO7sEh;}@V z%g89lE8vQn%R+WfL$h<<1N*G$_11@dVx(x0MP{&?WXL%4;UqDY0uIhw+ zqF5{7-kQ#}gK``$8^LB>okf#A?e>8s>w-zsX+4J1H5>+InRI5Db_JW~sq6SwXW58_ ze$EINGQgg3UKhrGnecbf-`y59Z~0J-u~Q$z@Ysk5az(ZMtFi6xO1nER^{kK5zSdA0 z)rq!3orf0P{hjYyy&bok&q{317=r2akvAd(M zT*X0IKp7df_RV@%2IchKJuPj~yIBvc!|)h=S|%(JXEY1LtyG(`I?F~RorNvc1#Hzf z=X%5yHJ68mL#G@vZ(cv(`K-9KdwWithT)MTBABw!>!_blox@R8^5Cj3Arb6FBY2E) zbzxWD;&7mmQnB*?xRo?|Ci2(rt4F`Hvf%5|BII{?VxloK-9mY-_9a#ouifz}MAG^| z3mO2&aN{~o=u33n&+M8W`HuC$uK7=0ZR}e==-Chac1{afkc#1vT8nmsKE*6-|Do=k zdB?^yRiuA;Fti*|4%q$ygQ?As0$M@7f=lxMwf7`&QB~bP#I04*G_!3oE7O2s2iF-k zAz3ECw5(tlh9!ZS22iwZG%HanY_-j>MNKVfQ!1-5HEpM|#jiA~ud=eDva*%`J@=e5 zym`zZRwn(wH~#Rvd+)jDo_p@O+j;k$EA_?qTfVO4WnBqh9(u%o$_t~fxjS^-WwSs3 z5#m$rR=8&%wcJ`##qP!RcaPn949OJV{rUQF@zpy2>xg~jVjcPT{8jbYJC~1Ib?xfq zA2l8?{l;aA1%>qdl0lc-31s~}Rd?2rNn-o}+f=3)St`XJyq$!R1J)b<^`o;KtQ&XT z`D;YWn6qM^?K#K&^)<_`hxkcVc2}mg(pqA#5Uzpra|;LZJ(c=BL&xtoy0-pE5njU7 zd(p0p9m&FLeP_8?KmOQ~eOdN-{UffviV-@Nb0%LxMIwI`>vQ>?fs@4)}YY-`n~N3tF5~-9!!vP0?ZWcI}yCy z2CY^&bNJVXuH^+CfPKnQi+2n^_Tx{+Uq55*&{5-WI0xb<*oEUTxk(XM+X(ZOm_(G9 zbsKm$wt@2)kR?t%Spuvid~vw_2Y%yfJ*Vi7s7Ft!?bo1O{R70qnYOG9i!xVl^8?oA z{?E3+S`hre6pA)fpJKtjnmRL~{>OKFMBH)vz^#?G3ui-HiT4l{cAK@353kJE+w321 zvm|j29c~4x5f&r(w%51iV2q7iH2K|W(`SuadHjafdi!$5j*yB3f^f^(^%lS-Qo3?Kgeuwy6M{)HGalywVrx--+u*>2%JGwq~ zZ~JUl^Z@j#Qv8D*Tp(-y{?lQ7I?Qt63C?rwi&$>l@NU87v$y%zC*k(J(r$zCNk41U zo#!X;5)EUJRlNPdZ6sT69}7i!<4)GxL%iTi(jz)<{3SX8Mj#KMzzastq|WV zpI7FDaELx%b>sQUEZW{FP8isw_t;#)X}0h=StGQhRK&sF6g-Ky+k*YCX7-l~>(A;N zi?$v1X3N-XZXfVXuW50gK)l)MEVrj8=jLXcYpP4dE5tGzA6rrO>U*Pqg)X&!;h^vvwAksn8}>rzF3Z_usJIPngczSWd!%$+35RzpSP>+zRR;9KC!&UUhQyHm*RmG7sSoc=a2(7hxmWD1gibs@m{G$_$g;|s6LK&>v23stPNoW36_mOdrw~+=!0OV zn74St#;Au{<5x`m(DGov59B%J9IMmma8>JP3A=Thr^~MpDy0XkuGzsm%fb3knKXLs zqD78T*Z%SK>7j2uy$RyeZH`Kn>08n7ob1l?d!`r#3gt)-yGfe}f!93$D}MjDtP97S zoBGl7nl5D^dwbeblUF|RXbi-YZ3(o+`vOG2^ZsDzivO{M-;#kZHLy!M$)g_JdQ>b{ znP9nA-(D6NAN64F{1^WA_ml zpLOEPUvG`?H*!tfy~|=hpXt1PC&Zi0X7$!X_xFC#_N4yjiLR|1{m&V`YmIPW4{N_I zg8eWA+PV10#jz#K{9Wi}^WTeY8WDVQ@ThY6tz@peP6FI7R4M<_ZI1`c_V{Pc_O;(Q z;ZU9A?ChOHXE{&@JS)RiW#ybRZtk*YLdP$8;R+Z_l3X*L)ed>oQy${d&&nUT`Nh8t z+9uCjImC(*-e+rX(1dkC(+MNv2Wm~o&Ug&kP1vGsHBLu)nXUcO%zN}c ze8Bp!|F-M66W}pAS+pd4%?xK*{N2AX`OWDeXCLuK%=J;L*A2-ok@qc#HuWz3VN_0@ zSt*XI@NFFWU6okM{dIy|nLqtRqjo6S23t?~4gH zraaJe(mk)5QAfmS+L;xFFiY@3CEYJ)ch(cQCp|ZSH3`$Wy|2!X=<((5$760ebjq!z z6EBed7sb&uMPI)ixc2qG27oiGRkBA<7cG|{{?uPt!T5djitAtcVA&@L^WIPSW=OxE z<@e-bu6Nn19Ocu)61?XLp4ZoJ2W>3csOt8ri?RrzS%zd;cHLt z{q)qGd*qlb_gnbAjBeXKaDBD&_U_7@9mrpqf4fZ}Y#y&~zsa&^=mm>L-Spk>wy^u% z@_SjeKQq8vruY8?*8jC*ca``Ks!VVp-FfMIAM%+%+1`G>hxNAm620BKMZ0V7K+^W-+e*IMx%9EE)*l$!iM&T^?S@CDFN#<-=*S(rXFpN{@#&d9ui*51 zQ4iWXxUQ__aPPc78Ug!ofB38uA%p$y&X~O*WLnf?7f*Ps-v@KPg!t6F_HVtm>T~}AoBRLz9xp}M>e07( zMF6Xt8iU(B`Q4RQoYr>SxOumIyVUicjB6o2rBe7XuTYdtdV6={_J*&zT=M+4|6P20 zI=A)FKZJ#~9veOG_AkEJw6Ni^|3ZAG)n#)CsJC@@AK%T&WMNVF-_|gyV>-8WQ|>Q| zCXX34_O35B#a?^jWAgl6YMyy=vOv(!ZFlFk?r5n^QW8Z^FB7)-67fHb^8U4;D>+#| zUJAbS?u0Y#qZUmq-89sl@-D>V`59r)O-gi?6_p6*5{j}~p92oq9I$_OJePRi3U?s; zJ42=3{o_7w>MfVd$-Jw^xa_MjA6+&wYXG#b*PiEdPReTrPQ zTHF7K(0Lxv39t!dMt}Na;``f2-Fn`r{x7Zb$ai}99hmpaZe2IJwM~G}R`6M!Dsgi_ ztr#odJB~mnY&*}xy3w>e{hP-w+HHI+V{zhLyRSME;^DgvdD2!Gie1(!<#v7CIAG(3 zc8-9Pm2l>!P`OB~{X?mZE9AG~kOuzApvBcQ0`&1!@s$PTpM{NGaL6}JRcW7m3hgN7 z14rRSwouWC6>$8r(q84A49?X3Ngc2@?R+lq|Nb6trNeKvpjV?OYJXp9`OiOHd@Bro zkijFe|G7eaBMF}KUBcy>x<88U-2Uypj%`Yj`*w>txw<3blMYpBJTO^*t+XpzONbLK`+de*7BLc!7Z#Mbe-tVI&qFz zJ%A2?_kP%GPNz^Hod}H2I`Kf$;^tRpjg4PWn4Fb=++p&2vvV9}HoIznq3c9<)`|8t zW7l*dFh1+V@(~HsW3DP0bN{x@D;9kay9VMlZjBX1w|^a^wPsh&z**$zz}5*|W5D{d z{eFfr8S-!G>S}J*mxu0uc=pi49*(@;zSGmZ=NfrN#$tDYp+c-R=uQS&qw41FtCaQ&Yk8i% zR=fuhCp1fS--+G&{6&t?6}TrD{Ai+&_A;>+4RlT~5H{;Y!uUM*`y-M^uUufctKX5g zULxc3l5*_ewOyXd)8C17Z~r+HgeEw;Xv6T2%ewHwF{KyGeSFQBB_BK;@%`lshC}=W zyTfa}(9i63=klU z!O{)?XK?rpSXWPP2FAztAWGgVFGg&8HnQP~IoG}MTYM_$0G!QhKeeg*S^GE66Ws3p z#|QuO1?K@BfOllo*98yRIrn-Rnvz>oJ0G;~KMTbh z*5Uv=lCI`vec9sr{37=sd82Rq%oA32UjJ7i9+ZUV6uFfxtSN^0UHUnUZoHob?>%;L z{^I?Dm=4dY2u(&f>$7oQo~u=mo9J0>1K4B}Jm_M$?oZCZw- zq{J?6ebe>gV68V`OaL1vo(uNB`rtDbdGcFv-*;*LXPVA(uwGnv?wJofHS@T!EA9*K zd41|^c~2<3bI;4mr9Fy%M`-t6gZQ>`S2Tg!ewl4$tgT{c!tyzn9KCJO5uZUkwY`2; z@1U(M{P%vda*kggApYAs5H`*Q`NMZ#6<r@_yGnJ1RbrU>+w1KYhF3)}m-Ph;MTj(uVL+Qp;ao4Kt#ANsjyZ*xsi8MqEmbiW|o zdEU@MvA zU6HmzpC=BOE@{6VZTAYwU-q@f1e)=Eza+)6A-w;~uej#djbD5I#GhSPeta3UG5Z!! zuLJmF();u_?j~()lV@w;zQ6WwNY!5oWBa;#w%$Fzb+d79@5^5NFniKZKJ9C>i5vY~ z)@nPquA=C7wH&zle}DQg+x*(sZ@#@3=5^bVc{7TZ-yCtvC8jH{yYsOt)oly*KDnr) zrftysZMW#R+^(5oCQlZBzO9OV_UjLpud!ZuXMFvTYiCdYZ_nP^cFjyrPUjx0_t);# zU)xWt`?f6f*M8B*ZO@vzYSf~`-KTGetTJ|JS9?*Jl^Ry}!_ht371|TNd4p5N>e&_A z^MVtl8job3Yt z8R}NW@psP!V=wAG?ALJ%ddzyg*ITQ6{HdQ^V|7)}g4vZvU`5gIF6tibJ4u|=gS!); zWh=y+5%95Q7jtZp_#eJpg*5Pn;*#Gbc5L_Ir~GhLd~(s4`DA z4p&9qOs74)NPH<$R$L~&8fn*o#rpcHTdc3(JE98F;{N*e_w&Dh{iTcEih26#=7`nj zzxBAfeXGhUinukK^|m}JRnq?bq~7)isqOv0>)?4hQ=EP9Z}C=RU>o;)dG6`U9aEx~zP&c= zQ^h8IBg2fHnV~3G>+O5M+E;7eK>v1deg*Cu4O5~tqcZeI%j)sxxlfoG*?9TlL8ZTi zKz9WDqu2>mhegqV{IcF=2dvHh`gn}iX6}Xl`=~Dtv@x{(&5bwR-*@+d*!9*cE`Hk> z{}99rn=^D({ad?(cIKcfb1=83Rjjb9#jXl>QpEzo&C+)9t_s%R)0A-GPYli~B#HQT zOm6?38`~z|w{!cbMYAuO`uf~KeYpLt&gvRC(yIFkJ8=7|zoXxS4;PEDj9A4^3+Ppf zHxhyRzdu~ogCW0G4mjuRSz~UyaL;2i7pI&i^`OjUDYwqdompwqeFk>xu^>tGcX$g0 zexk~RE(H1>zat*E|AkL(8nH0yk}*fR1?F{;QLV7F0dHF7DB`7axpX<9bE5e`XR-1NxbyZr%UUstTvltpP@VH3qkN z)8P+YnOVO)c16L~@w4CfwgBRVZMCGts{8fo-e-(E_T$di{(9uJ)o+&Uk0MZRkjPMp9%Z><#W;7YAU!Z@#=TRv#>hJT$& z5^F<;Jhj~Ut@XZG*zR*PFTX2!*(c-HeX{+#_qM-%oE#&{9W_OGWxc*fIB0F%6?*|# zZ_$@LyiHFRy!u}wcEp2r23yhQunB`!j@>qHQPI-ZZZP~T{efm?n5(Mn)#=#+XRv;b z`TyPg;C~d!6gG!k)%$z@Gm9FBbtvumU!NLQxjgofD;`}`)bOx)8zANmORijD9Ixxo z|CIjh>jo9nvUV)ip^Jb2^vk>MU!Cyu(yBWmf3Yti9ZIjTmI#ZbqKwh?=zmI&vcw7( z?B8Jbg6C?l?K{v62P0G9T&!n*?A|c{m>U<5yQ%)_8*fc~d@Si%mc7PhEzh!7&v3Y= zL7YL?xBn@9gPVZCAAgzfX4jd9sqt8+Mm{xm{e#gzMJ;+_){aMe-!_PJD$`o+DytO% zldenuQ@WHRbZMqojq`0_Rbu?I3GIS+cb(~0XZcvyA~QdKW%ve5)ZKeG{M1-K>KW3t z9P3Q!6|qWO2jmcLCX`{i&izm6T$cFi!7TI(X3Rj}u;SXw7nAiW>a*)cB%blvn6(?n zTsXDo=?2oPtYovxWfkAE>USL;tan9$c58fo{?FS915t*RRH|5gfyI%1y#~5n0(Gh* zHtW?b46aOm_v%vL-4Q&th!tHO@ow{&wOZ4?kw~ugD9d(*$<>DSOD~2wAaaqJ8DG)F9 z!%|aK>h*S|C{6m9(T&H9BqcJy_y8&JgSMX9WACGPZ#!+=9g%DMY#FxaU5HN-$+|E9 z?%e;iZwr%!%>(Zugj>^V#LNIE%R4`JxPLTQUlJDon!WRoV`FYVuIl;Gk4%1A>I=PV zOcoafxylM_s_jMcY+_G+|Jsem2bgE@4qMnEfWEYAM6QSdOGjt-sCPX->rTe@#tZX3 zPsPu9rgY+%LBYR4JosA`_6~bd5-3rwFnr+4f{*mMT8LAt6perRQ}GSbfzV~`B`UndA|9mY4WSFYd1do`_tyWH4yKs zGkiOUqTeaitds>czH==XC)wc3NnB-uj}kaJ9q0{4=Xs#bVV>E!_p#0Y z37@X#aXPw6`Ay$<9Hf0mSL~iya_`{?pc|drJGz#a zbw$a3{O8rX^T$0|HMQRd^P*-ze3rG+q0$v;?{18o%!5cX_n(g%y$b~(Xib(WUdyq*s0^}WLZ z+dF9682x9#t`NR3sG_}LjA+MbzioL-L}K+V_U&e%J?oWJ`{%SlH;{-T-X^8BMv z5oOsFi>uDnFKxd0>`R)TJbBs_^N?N-y)!0bUf3%(_x7{nh6$Wfcd&B2fd3V+r+^Cu zyi@$$C;l46Uz7OTB>uLEzxTyoUx8zDS*uE&R#{H42+tID3CQa#x5~K$;>xmfG0x?X zc#yBwCYGPVGmLmt0B5?mtPuE&5P#xTynF^;l-a?eri$e2-7AA-JVdL1CJ{JZ;Pn#l zd;x)uQ$Ph#N6t zgducletuT2Je+JaI0`Qk?}5$L>6JzH+EEvbG6?vG4G+=R=tE$?|P<|l@D^66-SQ}xC zGTP&;@kIt>ZCr72ywPZk7S}#Td4o~LXj?o40kbG7E~ZdE7uwZ~k4OrQG^WIaMkhu^h9;)Q#)T#)CnZHkB`3zl#w4F1NaP6S$|~%FMs}_t zA~r12Fg((j6cY()NFJOf`zb;>Oz_om?Pu$Mx z!$7b8BO$fcPl7=%FjzSI_EJonJ;6!=g%9neoMS&KcCX;49MTW(r95&eh5^6jNEj*h z?{~;IAD;^J_VsfvLODE8HbChNU-B-9HQa>w`=UF%YK%nrV;_jkclxKt`Ix_5*ZJc0 zOzkh_oAPm(PT|5n}HE$KCMVQ8Bj;{qfi{`Zz<9FP{|m&Z_Ump8wO;_useR(R=e>`1q8&7G_L{IJxfE z^7AKE*liz`TsUa(*6A<(I_g;W6L-gjZ%;Vw=fmG$TQ<39*3(HV7hd!J;QodgIp56u z@%obIgFYHsSHEoJS(*0_SaIwH6Rx=R(=+!@{A1j^V^+Vu^u<%wu04Hq$oO@Kj;{G- z&F~!`f9H7SYRBBvR~9|FBGPO@`>Gt9x|!d3!h)u)p~Um4}=Y4 zruHY>vOrM^dbad{ae(zXjdY0dIXxH#Eiv^1J;*yi{8QudGwU3Or`$P5>NRABpXo-_ z=a{!qe;E%`#n^KLrvJFKuN)78ln+ZIHq3dKN1%quN&$=$5tQCc_~G*qUn#n5^HuJ) zHaB!U_)+nqHIT z88=`$=Y#U#0vihn#6am{bjE&8^r1XC?ol~z6PCwxIL!GJ!UNjyYaxD4oP_*ftQbd# zzG3L$f3)2#dYgP(D)4uF9|Y~q^6(sw^4LnyMB^*VgXuAyh9je-zI?KCkmQ@oF^*VJ z4E1o+AYmjr4UcC3Cd;Szf{aEv?|91}Oyv{wXv$}OVmgiMJ!4>;9K7pE*)FWxOt+Ep zf6;gd@<(A#S6ceWe4JlV=DDGc?we8X6oQK?kCpjZ?*ipFzU-0p;rvF*&*hsa%=u4r z-+Mol$6>=QG`^d9%kt9BLOBYQM8LD9VtoBD)O&9^R4&u0`zj64y+6i-2m{5!dP7Cu z1ku+~xkjRIBz}Hx!=G_6^2hZgQeF^B{gcxfzu{KQ*GTybR${n-;)9RvBkK!;)1bE% z<j_h zg}Z3r*Ki|t1fZe*t$8X*me<^XeD)#yX5yc5=bnn~-AGWz6E5TUz~R_mm~XB>>lf^y z{Qg=W{L){%iR3u+NRppGGKjy1hIb_YduiMYeRP`)YiV$M^rd>WQhPKL)Z#0|$L}Jc zO(uFPE0+~M^5M=XRvx^rl6h3|KmznoX-j9zT8BTf?W!FZkpFAko#}JU0Ck6&_vW5l10ev7=NEL zMD|z4hIIi{bK zU#(`p5puULoylU@1zNBE(KrO=Q`Vc6Tma$Ed>iR;^nrrRUsv~MFB9Kg<>!HYAnrMK zm)s|7(KsLTH%}v1t^Bn44|Le+a)={Gc(;nSEMX1vwlAl7+m|BTq_^`3(sbN5I0@HF z8k^b_*kcNtnle~Gqxfs4d_2Cj+tds*%Bo8ZRb`daN*(3GK9N5ueS$D73eWQ?mD9^y zj>-yg&C?`jk+>f9P-5oq13~emzb1mtC8+=0pWPI`!hE6}FBne?nGUnY`8||>)j-To z=|P;I@j1+NI6wFE`eQNwF61*vsh%yzx4p!-LhA%0g(<(>8$lUOkAEupZzRb1DPIuN zaZ>*NxJ+U86z1Q=;|!HY{D=u3<;HZFe<$HH|0@vB%YTc8U(g%)Ev9@t-f;L$w1erxQK|UlX4!hqZ#+3T;9j8lYK?dls{2cIX$wSB}#tr&^|^(vfRsg z-i{|!x$T0LEo`e7#D)iu;tUP54c?BqkzhH@5J)s3vvI$ z`FI_{u$k~T-jDs0;|r)h+$-pY7jcZHuep3_-BLx}F0W3W6<=ll${bU448 z@-G;K`5U3opqgX6I$Uu59G|{d8oXHw}yDvTOvKkAARu_ z$xEN}bAOGvo$^zE(&k4!>zLp30P4f;#hAbKLT7^5uLm*x0;0#`8-;^fxL@Nq(}TnB zQatCktU&raUd%%~sds$yXz-gUO!G-l6WLWg1Y0%u3fo<2ysM@9u>BYEc?HW2poWx> z>!(nDE>AXKh!VtM=7;NNBz&$P4Oia!#Zo%!59xoyvZ7TvM&dHb}#B9 z>n*o0R0X>4mEvy%1peYrY=b0AZ0}|{vOS#Rc^tQpU7Yctc(9|x55^ymJ;2^17`BIV zel6Z}^j?GUHRer87yfgfcp{LHKe0cRJeLGv)X7s(s_;KP5h4Jd7aMTC2l}wLWV=Me zfJ1sg9@EhX{o#vb@9zrY;;V_HaW0{hhLgnpTkZ@nLjCN`{1+aWo^GE%`1X0wzu|M9 zmi7_T(HUqM6K$*2KQJ-C-}t}K?wpm!pH><#Tq*rvl6c~uEzK?ML0tI>m8yP`?}}<*wz*==CWjOzXB#|D=kU&IFESaLyj^@ zI|J|!a%rVE3Y^^7;Izo=msdMD!{CbwYlXpf;W5VI)4*AAh8jAM?fh zn5Z6%UqJYA2LJd|H25JTw_86&e76bhE={XG12HIz$$sQXZIJTuywgLDBkxiI@xDc8Tfp0dcIN6;R+{YP9W?*B=^O8&`!+tGElsDO;103 zzq6Aj8n+37pX0QN#XLn&heO&)nR$~Ood;5ALe_1*lKB)*UE$Q3Vyij zV3fwb&-xAL#^6^lwLsc^7;^l@n5+~MbWSiyc{1eqPONJ(X9)FoBBK;MjQTU4?Cpj} zFg!XK+t);4^PG13FSL8rE3IungZmllAFtsVwi5l4f%v|g%T23$LF(zsuSdoKy%no` z$A_NY`5DtoocMl}UzxD^iuvRBTO7}e80QmMpA{Pr8kgYv1Li|{8RJ77y#6&PM~Os( z_+uL=;KH+7-y!br{0(ji&c&UNQk5{;vMch~RummGDnCY{#-oUTJ%0=fh`N}zqci)lH< z{@1&_zEwhAf>U3`{5*~^ z9mYGN)hzjICj2?qoa(b*<KhMfuy(2^d_IrH`8f=Df9H?s^LeyJ4ZmC#uj`sMe0wtRJEM_jy<%Zp zH3T_#_S?G2R}LYsW0>;eNXjHWAtL3wSmr{=<9U$6@;n;U z4dyGO_~UkH-GcIJpI^0M$R)nf)y%ito(#3~ZDUA=oX_^&hxQ~kt65$``uuXYh1xGQ z(bryzrTY1w2r<2SqPNiIo1fDadSE_1gl{0y&Zp3>#(XOGBfotKwzYk>9`f=$uT<}m z=WFA^PNx5K3Fs2gCGanlz}$0v_Xj)<7QBe#^ZHY9JPlI%)~l<>cnsZypGWwfvERz^ z(X!z&XY~~=Jyypuk;hI_JH1A z;-i%y57v8Oq7?a<{$d*cxm=!4UNE41X3fC&D=aU@<9v+I@`AGAr^VxNE6qRVGkxXJ zKL4T|wC{6xzGSGKZ`tZJ@+v$x!0)I2Q;YnY`aUe*hXHROHz&QHVtQ_Rzx382u`<1$ z!u9n2NBw>Z@-scA&-+jg^ZN}b4}OeaK>O3FAK^I&E;o5lv(y{JZpY{MwM>`ka6IGx zaCV&Jo7IdTcuD;p0j^X+(6z2$_3=TIC{VI|>$1{IgdjY3w z<4xtbuF%G_p0d55h041!!zk-(d=>la)VL#j>>XS$0X@g;v6?u{bhsRa-ixvQpn&Lo zH*|}9@5_8~d)B{(q5d>{UpA5Ld}HeB(R ze6P;$E15sfHf*2qSNP|rz8TYZwH~t6tQJ$vo8yHTzcdLB=SoEO$#NA7};JG95`)TUv z%!l{;<)i5PWrA)hkH4Qb5q+lPc_C81f8Fu~j`ya?_HXIszm3Gd9F#3~Mjmu?u%%kzZNYF{J zo}h>1x0u52$*2b$P8)!7-7#*Q&-@zl7Pd3<&ro?6<9WZ#^?CX8RGD8po^d`N&rBM* zH|{`syDvh0+FyBS<;3}!&*7SSXz{gSu<{9>d-D3M#kpoP__uhM=9tZxh987OQb7($Tsw|)icoe3Osi67&;N8vh><*N`MPRh^v8?y3l z$^T-C55#`~rMn3-|1FyGxt#X(EY^qRrPa^j?_hc}(PeqEJklt=mC_Aw()dpYt6I*) zdNSXhK{WmobW?sF|5+YP$FmgAReI$?^-&(6{yYWe1LlkSGnZ>1edln8@t?{+@eLd| zubzW&(v>)W&v5&O-`i2KKgc^Kb|@^ihI{M5P&(fkDZ_fVcBNa^kEi+acH%lioHUGMPvhSxhD;)mBe zEMH#lKs%`EvYyJ94kCg1U_Q0_?xgh;>$~wilq=I=efQ3%_uzcWbh&KS4-RvB2+`xP zR^Pe49o9S4UwK`@>z(05ubKE}`pmaN={(+P*E@`F3b5WOD8cc$mgunDczjMHy*E*M z0YM($xP83+hwxcG4TOIatshxlTrP(h^7@6tA@5`RT>l2@FYBkbeQ3QS@MYI(c`{6{ zf7w4!DdlH6779BFnh3J|JmfEk{SPs|fz}sXKKmhRp!_@@c=PweaZ#ak=8MNiuHU}a zJ3PPhdWXwbXx^{S%Ib8z!{spKagyu9^L=9%*H27`A@jrXV15J2<1yUFvpjgc!~C$` zFrTknf#W!rW2Ez>H%!L$4#&H9qMq!pJXHRLo`X6?oQre^k7)JTKk__sn;Yk)xda=_ z&y@4X%w-69zsdD!A--5%8?LAMisa4pP52n~yXBei-(kPQepk3Z^10Zw6L9`+Cc3Qz zxj%Xu@jR{ja4gY8_$*JBANNO=Kl8n>bGUr2m(Sydw4mJCp277D1ULRVT*x(73Ht8Z zzF;SFe~9@#M8`?tiS%r~a{*e86m_=E!Eu|0A&*;AXVL*@4czg`oC^3vEN6|x_{_W;iO zO@wbC`Kj%Zf(19z)6zGM_LU#&8MEzf8ov?N@AHm9y=x-+1q2%idI;7N^p2;Cah>R) z`Hk`26L7uc?Y~67mGXPX56Z9HM(a(o*D+r_o^t*6Ss&6H9`_h3%A0cE+-U0WW5-}Q z1cIvZ!vi?nj~Ji%;`U&E+t-JCKeR{B9kH<)u-2E2SGLY$3>c!ureO z9m|L7$zcOMG=75e?9t2XB1JIESVQ|h8?`~oQ|Zf+>(LX=X!IpHIH~-4f;(yb)9@^g z&!$6(7U8qrHWR*feCB>~=awir-!MMw0duB&ihMux8;rB!+jB}VQhlaq`nxw@fCrWr z>k-$M(Rm#8e2L|@P&uEpq8~uUpU1|#kmiXpW!|9JIU*JZ9k7pL;PK#-^+Z^ z4m*E&^-z;xsq8mOIKl>^$Nj}vNZ+}TkAOxl??z$AEx>mtz?!PO=O8?7Dwfw2hUIZP zwCp0ee~ysb3G&Dv@!{o5DU|j+mY24ivyaAd78|h~6OpzTlMpz_j`A%tg7))8yy!6(0Yn9?jIw z+VL@s(pxEAJKjxEgboG;;8f>#kVQaQ|@RvvCj4=4{xXTD$_RR2QEulvkv9A+F3d$-tgt4CY1DxMzI!f|? z+C^wDR^$77Zu}bCljWt{gZA_Kdl4#>?p%-Sdab;;KHo)-@Zp=|SuO=P<9gu-dhf?} zZQu#^)fdx#k>?}k74#C)`N!?f`xAH5*K$7qox~sn?VfOyoHyAH;ii7d^C#~|n4XtU zqQmid)R2=1T1cNg-=MtM9!hQ~6y}Tb|5?~DrHAyt&G`+aSIobnERpt>t+bC>Oz9?q zdBNA9YYXDrN%8L&lD|EQcf9q>;$5p1CHbn~ZUs2ff;Td7n9Jw>AAj1#vVC_eM4u2i zo$2%V!u`Kp-n4!p{luY7wAr^P&!zowe0f3{;B(`HkzV=*3g} zF#ac3#7n&?p!~xq>`XM__(=RSoyCOLOz`9xn4jg~rhFDEm-7KW;4pt&f6m9{F+Rta zeuwooi1WxWPo8ojmN%CX#6dlH3+b;Ru|0ve zNZxTqI41y~tMCgRgpmJF77sne-^RQ9D7pDT5~`me4t$?KeRYs>$n3)vZ5uG14zNH` zwEQ?*aQsqUYmob;UC#s+;J7r;4f#2}h2)X^J^FK=e9oa#4=sC8PD(_+JRjoW^$*eW zj#u=aa~?q_<>U33Nkhl-JiRa8jDG*M{26}0a!r(Op)lhC@A5}{u)lteZlv;fyyN|O z;QX8uVJqe5`wTcA-)G>J1Mx+}lbkbw0`vPYoo{Jz93ju4vVIsTU*B0czH$817wkM0 z+Q;}K*8kOCY5e1QzU`Ll6V|uzTzhqOS!GF8n6q45NUZSrHihzE(*x)E*Qwn&AM1C+ zM2oaLaaeFJ!^)F*-vr|;RBmfeq{sA^UOq_PcOw;A)cflt=$C={-*YH_S93LrRpI(E zWc+U*#(XSC_b*ugffG<3EmWVe*Nv8EZNn#3*Y$wa%)MIR{A2BxQ>dN z0&aoIaX6~O!*gef`^PH0)VfTeK=_u`)U03$u9ND2LiwF4~&cO zW2oha=`n2WQha?0`Z;5IPRhr0m@bi57!Se* z_%8_C2_E6c`Qh0h{#dSV&3XdT;m7kX&+i|8f0~>J)cz+C6aWAJ>VHzy&g2pP27B}X zk$uo((Z`c+`=DaNc^^%S{Gs1lFW&Y{>bt)LFIv|$*fG)G=fx!#ytb&{h(8W}F7wwz zZkyfMciq#cegFDNmaGqKL*5uX=H)w{Ief}Jn|>K{{z4@$V#g!l+XgN_^QRrJrf>c7 z!RW=etjg+9(>mj=bEi+Ndu#ehO?@{R%TKV?=AQOq#2v4c^a`H(^2DI9F`FJJz3Y0z z(_hvvemuNk&x(uWThWzvA~Pyx(Jdw)?blMuMEbh4Rnu|I#6_KJ{GHD*0hMghj#oINto?G#`5k zlVdy%Ya#E08FISeRxHO8jP$vk>Z!bM5>EFiFXWT8a()fzu?`{SYYoEi<8xk@@vW49 zcnyB9!gRSj=EHCT`ejr;M7j*M{BS;&s}h9#K1<~_5Fa5?ZD=Fq3I>2JU-e}NiBboW zqA_2H1>@_9zS8^$(j%zKX9Ci9Q9cvpV|b5>KydzGj8CL{iM}GZWC+IpPH@3-82*7^%<&k$iQtSAFdU*8 z?^pD~_$enMoJR0cf_D&XCioS>GfqN$3&EKLA0zlJLDo8Zt=(2rZ7nRf=R2*{rDOk* zeRh(gvf5f!2^;!Eap8BlJ>2XR<_w$MO^2tXB&Qf765>K*5>w+sqZ7=rq2>s4VrWc! zLSjU6d{jbILVS3cqbgtCp`On-qF04kolbx8va0_d>y@6Jo1dGWIVr=Omz|TJdv0z< z_JsW0?4*e)d1J$?E1cmrM+FF_+#cp*83_{?VWV**tV_0$s+m>gj*=>eZJMGgF3p^i zlANEDlAAp#Cn+U2KRG=oB}p)H?mwbK$`nhIs`44;Nm)s0$@y94%#^WzPqmfgb2F0j zbFrF9=A^U~sN$cgT$0sRD(p~2Gs}y@BO{YyV>)XXx=uVy+$J6x5gQsACNC3L(k*G( zSt+U-=VWJ#R#x?!s_-c`N0B{0B04Nmb_M8V;tH=Sm4VD6u0Jn!xGJi`@xt@$Tw%My zD6h3DkU33Uj9y$;F6u!X3K}ANRau1#FF+U8H!3g3UgfB9f$5D4c`2FsndU6>gcKqDjz&L= zt8BWsqb${Bt+3B)TB=60wXj#J7&K2xPS4IyPB|wXy09f9JvT4kV$MtZXE|-}ur|?j#Hhm+ zX00hIbC7klT`gdgL+uZ26V4Fhm9HLj$qcNLOwOdNy!1>^)^srpoRgB1E7Wu>c1Afe z01G6me^D>Q#{Ks&99~o93NI|H9Q7|6>i%{7f{d&FZ9@LnF$_{Jci61updYG{CM{bG zx@p;B;nH!DszUqMP58WIImin|Vk7UI>`8g~DO2)NvXaHR)smBKNy*7ePx*%?WnQX1HVY?)kps*qIcNlSWOQrg()SYwz`{`_N2PEQtVwTQ?B zqdGl1IVB@MJvl`zU{ce?q8ZyEBIe8}6_)4#$&-@u@{=+IPh*qgqE%_U_Tg1eL~K~3 zD%qTql$JZTHa<2#R-FsilA?Zju+}{Y%SfSJu)=k?aLtPw#tw?A zs;qa!NKVhSWSGzWw~ibt-O3gFu9UG+9W_gA29n2i#U!AT59vsLdRA)oSf8DjAwDK9 zOmzNG0}cwK3?1Zb7~YlA&JZMMCn;!T=NdpC4a4PH9Mamy96v=UNzm8Ch(9S;3>yKa zS?}&okoud>lBjH4$#AwrH5i8{#ziE?#l{*#W6ddvq0w;(k)eqxk@2A^kuiyJ(J?8} z=J-hEU&Lx&rsYqXMzHDj=Zwx@l`9y=(0G)R1G`=v0VbtSEUQ*E(I|(jB+ORoa#WPn zRD_i{93|!UYH>Syn6NvBO1opI*X}sg7#&r7!BkgaXt}+_YMXh1l9!U3M-~gPkY#4) zrR19@Jzx@F-GEWm#=#kqDJlhJnS-UhT_GSIaI+i8yCgWwvYjv_NJ1DJf}^ zMOY+-T)|S)dEL&L7Hc~vV#Zk)%@Tc2oR$J(u#z)5Js(UE!k)rr%+9Ig7Us>GQDm&G zO;B+;!!Fj>RZhE2%mhVX_FzHCZF{OYBO}qAG_idJ@vqy&cQ{|h7OpC^S$eCOk)D`i z7WSuq<)**9tWfsT)C{w*obf$S&f-~PjkR&b@@I?|Ya=DoS}wL#S=LI&dBT+E#pE{} ze-Ct4yYee)DogBR{m_HnmS0tEwN3Mv>L-ILO7#K;%&Veu5msY_T=PYrX{=3%v_)GJ z>cy-o7VX>8&V`GZqqvLGGVtbr;?P86!+M;5M>=DscYhhtbWRWqp zI4U+aJ}O43F3pF{3=6=0$wfyh&h~mXxG8L;d)+DhyQ2rn^Be7$^c079N*>-%*dd)F zexnz$Twaj8^(zpz|M;L&78HB=6GtgKVD&JGSmeL2=|oKC`Vca|H)TF7RKE$K$H?=t zy-e9Y`53>J@SFrojz@eV8yHZ%e{Sm!I6Yd;D6hdxIB-rqMVEjs0bK%rNdog14B4>$ zfu@JNL>gUkyl?JL_uG3D@PUV=lSGh?YJ%%F*X}}` zmz)HRbn=@VM_&6?8Ztuot2rOB7d+IS6w2&ezs&Z+a-07c8o@1NrDFYe4@9 z2eOd;pxvP0IsFb<>J^{w20Ntx)rdI{-w0zFgvqd&yMkv%w; z<&V+ceU(0beaullNSFC2?717yQ+R1D!Ensm!Xaw zmwrXrUtumE459k{=QO;p^K+&D$-sI%$-yfRO}$y(M#{gUl;oqWcOLo==I92(zpmEn ze@P~#QF+lS`3Dc@T2A|HQi)U3GAXd<^1| zncc%O)cS8EvR>fcfPNZHt>~Y!iTp`Q1ZrC?ugM}2WTp0*t9}OmxzA(=N&mUqPF9`y zp;Ezr)#X26Ej&5>q`VE8=zrTyr+AESgh>BZ?BCWz_s{Y@wCv}}^dRc7aVfSZhxtAe zDpF}~z;yQ4$!hK<1a1CyI*3qzF6jl`uj*Xp%b$ntAKOaMP5iKbH7*ZpEykp!c#f9+ z(|YSqa!?+^da-=?a1)oSh1&XhsC=$3=T|iRGacsdP_KVwlo$I49IVRAEwjV1Mg*EKDga1M7NRh-!qNwyI+p-=W;on>&yBdG@w9| z@;r?G?HHf?Gnb>>hy2wp!SP`D^Z^B+r;s1ojKd0*>kSiuf_pLlp@VU}^wK4K4s-jv z3BUKQNIY*n>s9F&t#l9e!$xzn9CzvoFOmpweCRKDPXeb8UV`_eGoCvM{ReY-T)$O) z(0?%ZAI2BtrC($3jS>qn%m)Fr^el9LpNH@FA%1!Og)u_?Yo0>=hXyJm$%Xs3hx`(5 zCFr5{V13zoKgyTu(|88bbCW_^-uCT}Cc0N9jbI4nXL>C}pXoH;gZ(k+=mN=h!GowT zTpt7Fzk1|0*-l)ypNI~GL0>w+WyrUO@?THTN$`P3)6p+&`+aKY zznjN@ZYShG^?v|=xgk`ZLh}{-wPioIPD<~pzg(tgq{E!1FB6=l_rV<*xtXuKSZf4)oK8Io>ZEaOF)e-+uIcC-jQ0n{dqV!JE!( z{G|1nKepP}4f}oP^_H|9Lx-QcF!jOrADVfYd-UULtA2jd6?*+um*k$jChe~0^IHa; zocnS`?ZTxahE~2f_#Nv>Z)EMhcv#t`6F-|jb<*~A-ygST@`bjePkH0HaY5_*p7!>R zWA-c_{A%HfqN}bNI==b*n_qtE`{xE;dTj44&z#=plC?pvFI)OU`ps|L@X@mm{rBa^ zv!;Hw=Am<+^vm?$7|HY0pC(D`HXd&*4`4qIe+B)U?u%~gO2ps0700D!f(1l}`QtGA z0pI<@=&8L5?##f3p5F%dygu^E`^>+mCfq)Mm0G*MccjGg1^drsePR93 z`p;GGUnB+I-!NmOU-i`9>_7L~XEsgT9MbMT*Q4P5NSuw=U%X%Hp?p{hyl}mlFAlRl zY5nKMd+c6nVu);pdm}nU1o#L7v~|@g6bdF-@Uj&^3k{k%Req?t9PBD z#`ivJ+sB)rKm0FAfYvxPG<= z?!(6R*Y1MU*Cj-*RK zmw+w-T>`oUbP4DZ&?TTtK$n0n0bK&R1at}L63``}OF)-^E&*Kvx&(9y98d|EZo_j3 z9SSi}OzS7|JZ?a|4jDU-;Pb=x9qo%}BtFPpcySML&=pP^Kv<2*`5+yB99D==j8&B8 zTd-dIJ(3rX5cvBLK4-zO{eE@K&*#G!pU)XGY`PWk81gxj0xI8e{}3s^DT{saI9zZ$ z#xvyn4U~V~GR$A_F`k>8!uS+se6FuT=So-(0U_}n=zAmsrUx;7C*jAwa9sO&Z>P9- z9pd4~@)r==M(B$asrUS#!0VHY?Iqhzh0n4FGF)CWmA7pRmM3vUd0dXvN5uCj=h0oq z1$)Z@f>aLcFVi<3bB1zzgSN_+gj!KK1|O;_%^FAzVa60ael$F{Au&IQvTr!Fu$x6BU2s#P(IM& zc6+mKNH9DDzRV*a)Zaw)WBv-L|Ms7U^aYylkK5aT(Ss=!@|TM;DO$EBQApFiX-Y`=^o-})GO;CETW2=*nYFr<1hKNJ)n zh+#gc>z(3{eiG*Va6kVf*J}if3v`cZ`h1)4G99s@k|fW;XaQ; zMjnat6O|{*_lvKPJg1Bxd}^Qq;+G-Qci)Zlrw#JO=W)=)^&~plu%#`@hc80Y!9FCw z@^2*hAOF#@?duPbm*vcm@tX-h;Q3uj@ACQGRbTp^-)+7Z&+qa%Sxr5}5ncK7cYe2h zCe>uxk6`PECLYLUV>Bcp^X<98Xo!l zt|nR!>Jrc;pi4lPfGz=D0=fir3Fs2gC7??{mw+w-T>`oUbP4DZ&?TTtK$n0n0bK&R z1at}L63``}OF)-^E`fiw1o(Wbv6EVyCwxxBn|e4yI$)rp3>R?jD|nt@I6-Z8P7kJo zr%u9ao{#?I1D4lcaRYt$4Va4X8BsnQPYAvM!-{g0!t_3D8zlXLnKq+8s?~SDG5m|w z;y3}7*YfHBUw?aqr^Rn3{IoX_-&EhRXpOggKYu5oN>E2}X!7qX7}^)*#PUOYmF!tgh8*;F z5<*aOzT(qw(=aRHujYKjK%YtY;9CwQ3c&tO4m-X*?w@#aFI*~={GTZ4FP32l8ZG@j z{Y5eXvqv9b`T+~p6Lbma63``}OF)-^E&*Kvx&(9y=n~K+pi4lPfGz=D0=fir3Fs2g zC7??{mw+w-T>`oUbP4DZ&?WHilz@98zVB!58|eMNV#IS721@_#=zW}DU;+W)Z*W*b z{J6Xz1+S9}fd1#AdzifW`kKbzGuMYw`1}I%VWIl*`3f(A01r;W@9OyqzF_U=HsJt9 zxPoalqg)3QBhNfsSf1*97mwE#JkO?>2x`uEea7dz2!A!_ql)wyz%`QYx4Z#<;PYJ^)}bx| zT>`oUbP4DZ&?TTtK$n0n0bK&R1at}L63``}OF)-^E&*Kvx&(9y=n~K+pi4lPfGz=D z0=fir3Fs2gB@kEw#rp4{N}!3F#?-5!2l$nFox+<5HtaIVc)D(kkE^u>QAFubJg-LR z$~Uj9s)KWUN{nwjr$ZY2INW~s7{$EdP5{3#@o#Jh0>4fTpCV-Z*WSbMx`iz=9nOac zG-W&^&|^Fw;C9@Aa6ylecKo-g>RyhKrs z;f#L~dbR`=fZVQl|C`_1?rv)fIwd3++V!w=6lL$pNW87L;`R(|kbZ<-Y&uRH+v(S9 zV|{wvi%r6rk@xuo)$>WJXM^fl5cJ{?RXv}gdLE{FK2`O6n(Fy<)w8&z&P($Q)$<6| z^GMb6nX2bd)pMBYIb8KDZpib}k5D~Fs-B}%&(W&q7}fJ=)w4KD>ZLhW^*m1XoT_>j zzNftS8LDS-sh2nYT-Eb=s%LR|pBLwR)w8(7&l`WC>N#KaEEEB7CZ*MVVxDY1$DEg& zHhZ^G9NJ1-&@1Dz+VHfxtD1jpYkTUIKib-^{KeGonnOi@FxS0fuKOe7+WX%ZNp){- z__$|A-Dhca|Jl_h)G4Lz(qX?{xpCMoxJl4lmpp8jc}w!J_u)E2bKUvFT2kt&hy6EQ zjxr{JuB2?;5|k%k#Cvt`PBmY6!N&BuAM5^zc<)&lPo6vsQeMccYu)wa&w_)!ZPnWa zXQzEI)0k2BQ=6qAt#0F&Tk7lUo6ZYTdI*K>*Q=^;THTh<&uMLI+X(SfeB;M)ywf-S zG>&)p#vjS?(|zNA{D$by@QvTe@jHFvpXc~$-}tA*F=xrAxV}-%|1E^?ZJ0^WG*|8( zoKm;NT=%lM?yb7-MH{3oNC`=+>p3jBE_2(imR)UaV}lhXq~_G*x}WNHCf9wDT=!v0 z-QMH{ncLE?+%$Nq`F!&Q<_pdF7kqyBv7(86qBhny_4MVTKkyLo)O)SH!Ce|ZDL?aUvT`eT|>TXYfE2n>9D@(3o?d`1Tk eGzo1`(yn^1+LT$hA^nW)=?Sk_#iU);R{MYEgjdx7 literal 0 HcmV?d00001 From 236743ed0477279ba97f4ab68144b75c9f669762 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Fri, 27 Jan 2023 00:48:49 -0500 Subject: [PATCH 158/195] Update LICENSE file. Change-Id: I36d77f3efb30bf83911e25b7f9de6cfe1cdb2e7e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4199755 Reviewed-by: Joshua Peraza --- LICENSE | 1003 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 970 insertions(+), 33 deletions(-) diff --git a/LICENSE b/LICENSE index 832b4efb5..42af8c10c 100644 --- a/LICENSE +++ b/LICENSE @@ -27,32 +27,50 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------- +License for src/common/convert_UTF.cc, src/common/convert_UTF.h -Copyright 2001-2004 Unicode, Inc. +Copyright © 1991-2015 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in +http://www.unicode.org/copyright.html. -Disclaimer - -This source code is provided as is by Unicode, Inc. No claims are -made as to fitness for any particular purpose. No warranties of any -kind are expressed or implied. The recipient agrees to determine -applicability of information provided. If this file has been -purchased on magnetic or optical media from Unicode, Inc., the -sole remedy for any claim will be exchange of defective media -within 90 days of receipt. +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, +(b) this copyright and permission notice appear in associated +documentation, and +(c) there is clear notice in each modified Data File or in the Software +as well as in the documentation associated with the Data File(s) or +Software that the data or software has been modified. -Limitations on Rights to Redistribute This Code +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form -for internal or external distribution as long as this notice -remains attached. +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. -------------------------------------------------------------------- +License for src/common/linux/breakpad_getcontext.S libunwind - a platform-independent unwind library Copyright (C) 2008 Google, Inc - Contributed by Paul Pluzhnikov + Contributed by Paul Pluzhnikov Copyright (C) 2010 Konstantin Belousov Permission is hereby granted, free of charge, to any person obtaining @@ -75,29 +93,270 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -------------------------------------------------------------------- +License for +src/client/mac/handler/breakpad_nlist_64.cc +src/third_party/mac_headers/architecture/byte_order.h +src/third_party/mac_headers/mach-o/arch.h +src/third_party/mac_headers/mach-o/fat.h: +src/third_party/mac_headers/mach-o/loader.h +src/third_party/mac_headers/mach-o/nlist.h -Copyright (c) 1999 Apple Computer, Inc. All rights reserved. +APPLE PUBLIC SOURCE LICENSE -@APPLE_LICENSE_HEADER_START@ +Version 2.0 - August 6, 2003 -This file contains Original Code and/or Modifications of Original Code -as defined in and that are subject to the Apple Public Source License -Version 2.0 (the 'License'). You may not use this file except in -compliance with the License. Please obtain a copy of the License at -http://www.opensource.apple.com/apsl/ and read it before using this -file. +Please read this License carefully before downloading this software. By +downloading or using this software, you are agreeing to be bound by the terms +of this License. If you do not or cannot agree to the terms of this License, +please do not download or use the software. -The Original Code and all software distributed under the License are -distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, -INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. -Please see the License for the specific language governing rights and -limitations under the License. +Apple Note: In January 2007, Apple changed its corporate name from "Apple +Computer, Inc." to "Apple Inc." This change has been reflected below and +copyright years updated, but no other changes have been made to the APSL 2.0. + +1. General; Definitions. This License applies to any program or other work which Apple Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the +grantor of rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to Apple and (ii) that cover subject matter contained in +the Original Code, but only to the extent necessary to use, reproduce and/or +distribute the Original Code without infringement; and (b) in the case where +You are the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to You and (ii) that cover subject matter in +Your Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or contributes to +the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the combination of +Original Code and any Modifications, and/or any respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make +Covered Code available, directly or indirectly, to anyone other than You; +and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way +to provide a service, including but not limited to delivery of content, +through electronic communication with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions thereof +with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change to, the +substance and/or structure of the Original Code, any previous Modifications, +the combination of Original Code and any previous Modifications, and/or any +respective portions thereof. When code is released as a series of files, a +Modification is: (a) any addition to or deletion from the contents of a file +containing Covered Code; and/or (b) any new file or other representation of +computer program statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other work as +originally made available by Apple under this License, including the Source +Code of any updates or upgrades to such programs or works made available by +Apple under this License, and that has been expressly identified by Apple as +such in the header file(s) of such work; and (b) the object code compiled from +such Source Code and originally made available by Apple under this License + +1.8 "Source Code" means the human readable form of a program or other work +that is suitable for making modifications to it, including all modules it +contains, plus any associated interface definition files, scripts used to +control compilation and installation of an executable (object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising rights +under this License. For legal entities, "You" or "Your" includes any entity +which controls, is controlled by, or is under common control with, You, where +"control" means (a) the power, direct or indirect, to cause the direction or +management of such entity, whether by contract or otherwise, or (b) ownership +of fifty percent (50%) or more of the outstanding shares or beneficial +ownership of such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple's Applicable Patent Rights and copyrights covering the Original Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, internally +distribute within Your organization, and Externally Deploy verbatim, +unmodified copies of the Original Code, for commercial or non-commercial +purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the copyright +and other proprietary notices and disclaimers of Apple as they appear in the +Original Code, and keep intact all notices in the Original Code that refer to +this License; and + +(b) You must include a copy of this License with every copy of Source Code of +Covered Code and documentation You distribute or Externally Deploy, and You +may not offer or impose any terms on such Source Code that alter or restrict +this License or the recipients' rights hereunder, except as permitted +under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, display, +perform, internally distribute within Your organization, and Externally Deploy +Your Modifications and Covered Code, for commercial or non-commercial +purposes, provided that in each instance You also meet all of these +conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to the +Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the notice in +Exhibit A in each file of the Source Code of all Your Modifications, and cause +the modified files to carry prominent notices stating that You changed the +files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make Source Code of +all Your Externally Deployed Modifications either available to those to whom +You have Externally Deployed Your Modifications, or publicly available. Source +Code of Your Externally Deployed Modifications must be released under the +terms set forth in this License, including the license grants set forth in +Section 3 below, for as long as you Externally Deploy the Covered Code or +twelve (12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your Externally +Deployed Modifications electronically (e.g. download from a web site). + +2.3 Distribution of Executable Versions. In addition, if You Externally Deploy +Covered Code (Original Code and/or Modifications) in object code, executable +form only, You must include a prominent notice, in the code itself as well as +in related documentation, stating that Source Code of the Covered Code is +available under the terms of this License with information on how and where to +obtain such Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that although +Apple and each Contributor grants the licenses to their respective portions of +the Covered Code set forth herein, no assurances are provided by Apple or any +Contributor that the Covered Code does not infringe the patent or other +intellectual property rights of any other entity. Apple and each Contributor +disclaim any liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a condition to +exercising the rights and licenses granted hereunder, You hereby assume sole +responsibility to secure any other intellectual property rights needed, if +any. For example, if a third party patent license is required to allow You to +distribute the Covered Code, it is Your responsibility to acquire that license +before distributing the Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to any person or entity receiving or distributing Covered Code under this License a non-exclusive, royalty-free, perpetual, irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, sublicense, distribute and Externally Deploy Your Modifications of the same scope and extent as Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein. Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient's agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple. No one other than Apple has the right to modify the terms applicable to Covered Code created under this License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple's total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime Streaming Server" or any other trademarks, service marks, logos or trade names belonging to Apple (collectively "Apple Marks") or to any trademark, service mark, logo or trade name belonging to any Contributor. You agree not to use any Apple Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code other than as expressly permitted by and in strict compliance at all times with Apple's third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License. Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with any +term(s) of this License and fail to cure such breach within 30 days of +becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during the +term of this License, commence an action for patent infringement against +Apple; provided that Apple did not first commence an action for patent +infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately stop +any further use, reproduction, modification, sublicensing and distribution of +the Covered Code. All sublicenses to the Covered Code which have been properly +granted prior to termination shall survive any termination of this License. +Provisions which, by their nature, should remain in effect beyond the +termination of this License shall survive, including but not limited to +Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other +for compensation, indemnity or damages of any sort solely as a result of +terminating this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as defined +in FAR 2.101. Government software and technical data rights in the Covered +Code include only those rights customarily provided to the public as defined +in this License. This customary commercial license in technical data and +software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 +(Computer Software) and, for Department of Defense purchases, DFAR +252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in +Commercial Computer Software or Computer Software Documentation). Accordingly, +all U.S. Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as creating +an agency, partnership, joint venture or any other form of legal association +between or among You, Apple or any Contributor, and You will not represent to +the contrary, whether expressly, by implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair Apple's +right to acquire, license, develop, have others develop for it, market and/or +distribute technology or products that perform the same or similar functions +as, or otherwise compete with, Modifications, Larger Works, technology or +products that You may develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce any +provision of this License will not be deemed a waiver of future enforcement of +that or any other provision. Any law or regulation which provides that the +language of a contract shall be construed against the drafter will not apply +to this License. + +13.5 Severability. (a) If for any reason a court of competent jurisdiction +finds any provision of this License, or portion thereof, to be unenforceable, +that provision of the License will be enforced to the maximum extent +permissible so as to effect the economic benefits and intent of the parties, +and the remainder of this License will continue in full force and effect. (b) +Notwithstanding the foregoing, if applicable law prohibits or restricts You +from fully and/or specifically complying with Sections 2 and/or 3 or prevents +the enforceability of either of those Sections, this License will immediately +terminate and You must immediately discontinue any use of the Covered Code and +destroy all copies of it that are in your possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution between +You and Apple relating to this License shall take place in the Northern +District of California, and You and Apple hereby consent to the personal +jurisdiction of, and venue in, the state and federal courts within that +District with respect to this License. The application of the United Nations +Convention on Contracts for the International Sale of Goods is expressly +excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the entire +agreement between the parties with respect to the subject matter hereof. This +License shall be governed by the laws of the United States and the State of +California, except that body of California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following clause +applies: The parties hereby confirm that they have requested that this License +and all related documents be drafted in English. Les parties ont exigé que le +présent contrat et tous les documents connexes soient rédigés en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2007 Apple Inc. All Rights Reserved. + +This file contains Original Code and/or Modifications of Original Code as +defined in and that are subject to the Apple Public Source License Version 2.0 +(the 'License'). You may not use this file except in compliance with +the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this file. -@APPLE_LICENSE_HEADER_END@ +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the +License for the specific language governing rights and limitations under the +License." -------------------------------------------------------------------- +License for +src/client/mac/handler/breakpad_nlist_64.cc +src/third_party/mac_headers/mach-o/nlist.h Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. @@ -129,3 +388,681 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +License for +src/third_party/curl/curl.h +src/third_party/curl/curlbuild.h +src/third_party/curl/curlrules.h +src/third_party/curl/curlver.h +src/third_party/curl/easy.h +src/third_party/curl/mprintf.h +src/third_party/curl/multi.h +src/third_party/curl/stdcheaders.h +src/third_party/curl/typecheck-gcc.h + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2011, Daniel Stenberg, . + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. + +-------------------------------------------------------------------- +License for +src/common/mac/GTMDefines.h +src/common/mac/GTMLogger.h +src/common/mac/GTMLogger.m +src/common/mac/testing/GTMSenTestCase.h +src/common/mac/testing/GTMSenTestCase.m + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control with +that entity. For the purposes of this definition, "control" means (i) the +power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty percent +(50%) or more of the outstanding shares, or (iii) beneficial ownership of such +entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, and +configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object +code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice that is +included in or attached to the work (an example is provided in the Appendix +below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative +Works shall not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor for +inclusion in the Work by the copyright owner or by an individual or Legal +Entity authorized to submit on behalf of the copyright owner. For the purposes +of this definition, "submitted" means any form of electronic, verbal, or +written communication sent to the Licensor or its representatives, including +but not limited to communication on electronic mailing lists, source code +control systems, and issue tracking systems that are managed by, or on behalf +of, the Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a copy +of this License; and + +(b) You must cause any modified files to carry prominent notices stating that +You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices from the +Source form of the Work, excluding those notices that do not pertain to any +part of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its distribution, +then any Derivative Works that You distribute must include a readable copy of +the attribution notices contained within such NOTICE file, excluding those +notices that do not pertain to any part of the Derivative Works, in at least +one of the following places: within a NOTICE text file distributed as part of +the Derivative Works; within the Source form or documentation, if provided +along with the Derivative Works; or, within a display generated by the +Derivative Works, if and wherever such third-party notices normally appear. +The contents of the NOTICE file are for informational purposes only and do not +modify the License. You may add Your own attribution notices within Derivative +Works that You distribute, alongside or as an addendum to the NOTICE text from +the Work, provided that such additional attribution notices cannot be +construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a +whole, provided Your use, reproduction, and distribution of the Work otherwise +complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------------------------------------------------------- +License for INSTALL + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +-------------------------------------------------------------------- +License for src/common/mac/testing/GTMSenTestCase.h + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +License for src/third_party//libdisasm + + The "Clarified Artistic License" + + Preamble + +The intent of this document is to state the conditions under which a +Package may be copied, such that the Copyright Holder maintains some +semblance of artistic control over the development of the package, +while giving the users of the package the right to use and distribute +the Package in a more-or-less customary fashion, plus the right to make +reasonable modifications. + +Definitions: + + "Package" refers to the collection of files distributed by the + Copyright Holder, and derivatives of that collection of files + created through textual modification. + + "Standard Version" refers to such a Package if it has not been + modified, or has been modified in accordance with the wishes + of the Copyright Holder as specified below. + + "Copyright Holder" is whoever is named in the copyright or + copyrights for the package. + + "You" is you, if you're thinking about copying or distributing + this Package. + + "Distribution fee" is a fee you charge for providing a copy of this + Package to another party. + + "Freely Available" means that no fee is charged for the right to use + the item, though there may be fees involved in handling the item. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications +derived from the Public Domain, or those made Freely Available, or from +the Copyright Holder. A Package modified in such a way shall still be +considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided +that you insert a prominent notice in each changed file stating how and +when you changed that file, and provided that you do at least ONE of the +following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or + an equivalent medium, or placing the modifications on a major archive + site allowing unrestricted access to them, or by allowing the Copyright + Holder to include your modifications in the Standard Version of the + Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict + with standard executables, which must also be provided, and provide + a separate manual page for each non-standard executable that clearly + documents how it differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + + e) permit and encourge anyone who receives a copy of the modified Package + permission to make your modifications Freely Available in some specific + way. + +4. You may distribute the programs of this Package in object code or +executable form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where + to get the Standard Version. + + b) accompany the distribution with the machine-readable source of + the Package with your modifications. + + c) give non-standard executables non-standard names, and clearly + document the differences in manual pages (or equivalent), together + with instructions on where to get the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + + e) offer the machine-readable source of the Package, with your + modifications, by mail order. + +5. You may charge a distribution fee for any distribution of this Package. +If you offer support for this Package, you may charge any fee you choose +for that support. You may not charge a license fee for the right to use +this Package itself. You may distribute this Package in aggregate with +other (possibly commercial and possibly nonfree) programs as part of a +larger (possibly commercial and possibly nonfree) software distribution, +and charge license fees for other parts of that software distribution, +provided that you do not advertise this Package as a product of your own. +If the Package includes an interpreter, You may embed this Package's +interpreter within an executable of yours (by linking); this shall be +construed as a mere form of aggregation, provided that the complete +Standard Version of the interpreter is so embedded. + +6. The scripts and library files supplied as input to or produced as +output from the programs of this Package do not automatically fall +under the copyright of this Package, but belong to whoever generated +them, and may be sold commercially, and may be aggregated with this +Package. If such scripts or library files are aggregated with this +Package via the so-called "undump" or "unexec" methods of producing a +binary executable image, then distribution of such an image shall +neither be construed as a distribution of this Package nor shall it +fall under the restrictions of Paragraphs 3 and 4, provided that you do +not represent such an executable image as a Standard Version of this +Package. + +7. C subroutines (or comparably compiled subroutines in other +languages) supplied by you and linked into this Package in order to +emulate subroutines and variables of the language defined by this +Package shall not be considered part of this Package, but are the +equivalent of input as in Paragraph 6, provided these subroutines do +not change the language in any way that would cause it to fail the +regression tests for the language. + +8. Aggregation of the Standard Version of the Package with a commercial +distribution is always permitted provided that the use of this Package is +embedded; that is, when no overt attempt is made to make this Package's +interfaces visible to the end user of the commercial distribution. +Such use shall not be construed as a distribution of this Package. + +9. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + The End + +-------------------------------------------------------------------- +License for Autotools + +AUTOCONF CONFIGURE SCRIPT EXCEPTION + +Version 3.0, 18 August 2009 + +Copyright © 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +This Exception is an additional permission under section 7 of the GNU General +Public License, version 3 ("GPLv3"). It applies to a given file that bears a +notice placed by the copyright holder of the file stating that the file is +governed by GPLv3 along with this Exception. + +The purpose of this Exception is to allow distribution of Autoconf's +typical output under terms of the recipient's choice (including +proprietary). + +0. Definitions. +"Covered Code" is the source or object code of a version of Autoconf that is a +covered work under this License. + +"Normally Copied Code" for a version of Autoconf means all parts of its +Covered Code which that version can copy from its code (i.e., not from its +input file) into its minimally verbose, non-debugging and non-tracing output. + +"Ineligible Code" is Covered Code that is not Normally Copied Code. + +1. Grant of Additional Permission. +You have permission to propagate output of Autoconf, even if such propagation +would otherwise violate the terms of GPLv3. However, if by modifying Autoconf +you cause any Ineligible Code of the version you received to become Normally +Copied Code of your modified version, then you void this Exception for the +resulting covered work. If you convey that resulting covered work, you must +remove this Exception in accordance with the second paragraph of Section 7 of +GPLv3. + +2. No Weakening of Autoconf Copyleft. +The availability of this Exception does not imply any general presumption that +third-party software is unaffected by the copyleft requirements of the license +of Autoconf. + +-------------------------------------------------------------------- +License for Autotools + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +Autoconf Exception + +As a special exception, the Free Software Foundation gives unlimited +permission to copy, distribute and modify the configure scripts that are the +output of Autoconf. You need not follow the terms of the GNU General Public +License when using or distributing such scripts, even though portions of the +text of Autoconf appear in them. The GNU General Public License (GPL) does +govern all other use of the material that constitutes the Autoconf program. + +Certain portions of the Autoconf source text are designed to be copied (in +certain cases, depending on the input) into the output of Autoconf. We call +these the "data" portions. The rest of the Autoconf source text consists of +comments plus executable code that decides which of the data portions to +output in any given case. We call these comments and executable code the "non- +data" portions. Autoconf never copies any of the non-data portions into its +output. + +This special exception to the GPL applies to versions of Autoconf released by +the Free Software Foundation. When you make and distribute a modified version +of Autoconf, you may extend this special exception to the GPL to apply to your +modified version as well, *unless* your modified version has the potential to +copy into its output some of the text that was the non-data portion of the +version that you started with. (In other words, unless your change moves or +copies text from the non-data portions to the data portions.) If your +modification has such potential, you must delete any notice of this special +exception to the GPL from your modified version. + + From bae713be2e51faa5cbe0ac4bcd21c0a3ee72ff8e Mon Sep 17 00:00:00 2001 From: Jason Jeremy Iman Date: Wed, 25 Jan 2023 13:28:31 +0900 Subject: [PATCH 159/195] LibcurlWrapper uses curl_global_cleanup LibcurlWrapper is missing a curl_global_cleanup causing a memory leak. The curl_global_init is called automatically when calling curl_easy_init without first doing curl_global_init. BUG=chromium:1405410 TEST=units with asan Change-Id: I4982fd5265b0df91076ed428f1134a681a7f28c6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4189295 Reviewed-by: Joshua Peraza --- src/common/linux/libcurl_wrapper.cc | 5 +++++ src/common/linux/libcurl_wrapper.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc index 096681614..a53087d9c 100644 --- a/src/common/linux/libcurl_wrapper.cc +++ b/src/common/linux/libcurl_wrapper.cc @@ -47,6 +47,7 @@ LibcurlWrapper::LibcurlWrapper() LibcurlWrapper::~LibcurlWrapper() { if (init_ok_) { (*easy_cleanup_)(curl_); + (*global_cleanup_)(); dlclose(curl_lib_); } } @@ -262,6 +263,10 @@ bool LibcurlWrapper::SetFunctionPointers() { SET_AND_CHECK_FUNCTION_POINTER(formfree_, "curl_formfree", void(*)(curl_httppost*)); + + SET_AND_CHECK_FUNCTION_POINTER(global_cleanup_, + "curl_global_cleanup", + void(*)(void)); return true; } diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h index f4a4dca40..f8f961c1b 100644 --- a/src/common/linux/libcurl_wrapper.h +++ b/src/common/linux/libcurl_wrapper.h @@ -39,6 +39,9 @@ #include "third_party/curl/curl.h" namespace google_breakpad { + +// This class is only safe to be used on single-threaded code because of its +// usage of libcurl's curl_global_cleanup(). class LibcurlWrapper { public: LibcurlWrapper(); @@ -111,6 +114,7 @@ class LibcurlWrapper { CURLcode (*easy_getinfo_)(CURL*, CURLINFO info, ...); void (*easy_reset_)(CURL*); void (*formfree_)(struct curl_httppost*); + void (*global_cleanup_)(void); }; } From 95857a18bb8392be8d88f704d49e08f4075f3dac Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Mon, 30 Jan 2023 10:30:39 -0500 Subject: [PATCH 160/195] Mac: add shell script to coordinate dumping and uploading macOS system symbols. This checks in an edited version of a script that has been used by the Chrome Mac team for this purpose. It expects to reside in the same place as `dump_syms`, `dsc_extractor`[0], `symupload` and `upload_system_symbols` binaries. When called, it will: - Locate and extract any dyld_shared_caches found on the system - Dump the above - Dump any remaining uncached system libraries - Write the results to a directory passed as an argument - Provide (but not call) an `upload_system_symbols` invocation to upload the results [0] Not yet checked in Bug: 1400770 Change-Id: I30610c23d0c979e34dd3830eeedb5ceeae8ce66b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4111109 Reviewed-by: Mark Mentovai --- .../upload_system_symbols.sh | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100755 src/tools/mac/upload_system_symbols/upload_system_symbols.sh diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.sh b/src/tools/mac/upload_system_symbols/upload_system_symbols.sh new file mode 100755 index 000000000..43fd98ed5 --- /dev/null +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +# Copyright 2023 Google LLC +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google LLC nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Finds the dyld_shared_cache on a system, extracts it, and dumps the symbols +# in Breakpad format to the directory passed as the first argument +# The script must be in the same directory as `dump_syms`, +# `upload_system_symbols` and `dsc_extractor` binaries. +# Exits with 0 if all supported architectures for this OS version were found and +# dumped, and nonzero otherwise. + +set -ex + +if [[ $# -ne 1 ]]; then + echo "usage: $0 " >& 2 + exit 1 +fi + +destination_dir="$1" + +dir="$(dirname "$0")" +dir="$(cd "${dir}"; pwd)" +major_version=$(sw_vers -productVersion | cut -d . -f 1) +if [[ "${major_version}" -lt 13 ]]; then + dsc_directory="/System/Library/dyld" +else + dsc_directory="/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld" +fi + +working_dir=$(mktemp -d) +mkdir "${destination_dir}" +trap 'rm -rf "${working_dir}" "${destination_dir}"' EXIT + +architectures=(x86_64h) +missing_architectures=() +# macOS >= 13 on arm64 still has a x86_64 cache for Rosetta. +if [[ "${major_version}" -lt 13 ]] || [[ $(uname -p) == "arm" ]]; then + architectures+=( x86_64 ) +fi +if [[ "${major_version}" -ge 11 ]]; then + architectures+=( arm64e ) +fi + +for arch in "${architectures[@]}"; do + cache="${dsc_directory}/dyld_shared_cache_${arch}" + if [[ ! -f "${cache}" ]]; then + missing_architectures+=("${arch}") + continue + fi + "${dir}/dsc_extractor" \ + "${cache}" \ + "${working_dir}/${arch}" + "${dir}/upload_system_symbols" \ + --breakpad-tools="${dir}" \ + --system-root="${working_dir}/${arch}" \ + --dump-to="${destination_dir}" +done +if [[ "${#missing_architectures[@]}" -eq "${#architectures[@]}" ]]; then + echo "Couldn't locate dyld_shared_cache for any architectures" >& 2 + echo "in ${dsc_directory}. Exiting." >& 2 + exit 1 +fi + +rm -rf "${working_dir}" +# We have results now, so let's keep `destination_dir`. +trap '' EXIT + +"${dir}/upload_system_symbols" \ + --breakpad-tools="${dir}" \ + --system-root=/ \ + --dump-to="${destination_dir}" + +set +x +echo +echo "Dumped!" +echo "To upload, run:" +echo +echo "'${dir}/upload_system_symbols'" \\ +echo " --breakpad-tools='${dir}'" \\ +echo " --api-key=" \\ +echo " --upload-from='${destination_dir}'" + +if [[ "${#missing_architectures[@]}" -gt 0 ]]; then + echo "dyld_shared_cache not found for architecture(s):" >& 2 + echo " " "${missing_architectures[@]}" >& 2 + echo "You'll need to get symbols for them elsewhere." >& 2 + exit 1 +fi From f6178140175800cc6385a151e7f23d6e5c4968ca Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 30 Jan 2023 11:15:11 +0100 Subject: [PATCH 161/195] Remove disassembler_objdump from the build on non-linux platforms. Change-Id: I29d628ac7cf79bfca1794ba325c945a0f122b360 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964364 Reviewed-by: Ivan Penkov --- Makefile.am | 32 ++- Makefile.in | 389 ++++++++++++++++---------- src/processor/disassembler_objdump.cc | 21 +- src/processor/exploitability_linux.cc | 6 +- src/processor/minidump_processor.cc | 9 +- 5 files changed, 273 insertions(+), 184 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9b7f72474..688725fa7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -193,7 +193,6 @@ check_PROGRAMS += \ src/processor/basic_source_line_resolver_unittest \ src/processor/cfi_frame_info_unittest \ src/processor/contained_range_map_unittest \ - src/processor/disassembler_objdump_unittest \ src/processor/disassembler_x86_unittest \ src/processor/exploitability_unittest \ src/processor/fast_source_line_resolver_unittest \ @@ -221,6 +220,10 @@ check_PROGRAMS += \ src/processor/stackwalker_riscv64_unittest \ src/processor/stackwalker_x86_unittest \ src/processor/synth_minidump_unittest +if LINUX_HOST +check_PROGRAMS += \ + src/processor/disassembler_objdump_unittest +endif LINUX_HOST if SELFTEST check_PROGRAMS += \ src/processor/stackwalker_selftest @@ -366,8 +369,6 @@ src_libbreakpad_a_SOURCES = \ src/processor/contained_range_map.h \ src/processor/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ - src/processor/disassembler_objdump.h \ - src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ src/processor/dump_context.cc \ @@ -449,6 +450,11 @@ src_libbreakpad_a_SOURCES = \ src/processor/symbolic_constants_win.h \ src/processor/tokenize.cc \ src/processor/tokenize.h +if LINUX_HOST +src_libbreakpad_a_SOURCES += \ + src/processor/disassembler_objdump.cc \ + src/processor/disassembler_objdump.h +endif LINUX_HOST # libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ @@ -911,7 +917,6 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -947,6 +952,10 @@ src_processor_exploitability_unittest_LDADD = \ src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_exploitability_unittest_LDADD += \ + src/processor/disassembler_objdump.o +endif src_processor_disassembler_objdump_unittest_SOURCES = \ src/processor/disassembler_objdump_unittest.cc @@ -1044,7 +1053,6 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1077,6 +1085,10 @@ src_processor_minidump_processor_unittest_LDADD = \ src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_minidump_processor_unittest_LDADD += \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_unittest_SOURCES = \ src/common/test_assembler.cc \ @@ -1194,7 +1206,6 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -1220,6 +1231,10 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_stackwalker_selftest_LDADD += \ + src/processor/disassembler_objdump.o +endif src_processor_stackwalker_amd64_unittest_SOURCES = \ src/common/test_assembler.cc \ @@ -1416,7 +1431,6 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1449,6 +1463,10 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o \ src/third_party/libdisasm/libdisasm.a +if LINUX_HOST +src_processor_minidump_stackwalk_LDADD += \ + src/processor/disassembler_objdump.o +endif LINUX_HOST ## Additional files to be included in a source distribution ## diff --git a/Makefile.in b/Makefile.in index d358b6b11..54d8c2aa5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,11 +131,11 @@ host_triplet = @host@ # Build as PIC on Linux, for linux_client_unittest_shlib @LINUX_HOST_TRUE@am__append_2 = -fPIC @LINUX_HOST_TRUE@am__append_3 = -fPIC -libexec_PROGRAMS = $(am__EXEEXT_10) +libexec_PROGRAMS = $(am__EXEEXT_11) bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) check_PROGRAMS = src/common/safe_math_unittest$(EXEEXT) \ $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ - $(am__EXEEXT_8) $(am__EXEEXT_9) + $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) noinst_PROGRAMS = EXTRA_PROGRAMS = $(am__EXEEXT_1) @@ -164,7 +164,6 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest \ @@ -193,7 +192,10 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_10 = \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__append_10 = \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/processor/disassembler_objdump_unittest + +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_11 = \ @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest @@ -203,17 +205,17 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) # Currently Linux only, the macOS client # is built using an Xcode project instead. # -@LINUX_HOST_TRUE@am__append_11 = src/client/linux/libbreakpad_client.a -@LINUX_HOST_TRUE@am__append_12 = breakpad-client.pc -@LINUX_HOST_TRUE@am__append_13 = \ +@LINUX_HOST_TRUE@am__append_12 = src/client/linux/libbreakpad_client.a +@LINUX_HOST_TRUE@am__append_13 = breakpad-client.pc +@LINUX_HOST_TRUE@am__append_14 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test -@LINUX_HOST_TRUE@am__append_14 = \ +@LINUX_HOST_TRUE@am__append_15 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib -@LINUX_HOST_TRUE@am__append_15 = \ +@LINUX_HOST_TRUE@am__append_16 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib @@ -222,7 +224,7 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) # Various Breakpad tools # This includes symbol dumpers and uploaders # -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_16 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_17 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \ @@ -230,31 +232,47 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_17 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_18 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_18 = \ +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_19 = \ @DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_19 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_20 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_20 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_21 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest -@HAVE_GETCONTEXT_FALSE@am__append_21 = \ +@LINUX_HOST_TRUE@am__append_22 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.cc \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.h + +@HAVE_GETCONTEXT_FALSE@am__append_23 = \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S -@HAVE_GETCONTEXT_FALSE@am__append_22 = \ +@HAVE_GETCONTEXT_FALSE@am__append_24 = \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext_unittest.cc -@ANDROID_HOST_TRUE@am__append_23 = \ +@ANDROID_HOST_TRUE@am__append_25 = \ @ANDROID_HOST_TRUE@ -llog -lm -@ANDROID_HOST_TRUE@am__append_24 = \ +@ANDROID_HOST_TRUE@am__append_26 = \ @ANDROID_HOST_TRUE@ -llog +@LINUX_HOST_TRUE@am__append_27 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_28 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_29 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_30 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ @@ -306,7 +324,6 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest$(EXEEXT) \ -@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_objdump_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest$(EXEEXT) \ @@ -334,13 +351,14 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_6 = src/processor/stackwalker_selftest$(EXEEXT) -@LINUX_HOST_TRUE@am__EXEEXT_7 = src/client/linux/linux_client_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/processor/disassembler_objdump_unittest$(EXEEXT) +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_7 = src/processor/stackwalker_selftest$(EXEEXT) +@LINUX_HOST_TRUE@am__EXEEXT_8 = src/client/linux/linux_client_unittest$(EXEEXT) \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test$(EXEEXT) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_8 = src/common/dumper_unittest$(EXEEXT) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_9 = src/common/dumper_unittest$(EXEEXT) \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_9 = src/common/mac/macho_reader_unittest$(EXEEXT) -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__EXEEXT_10 = src/tools/linux/core_handler/core_handler$(EXEEXT) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_10 = src/common/mac/macho_reader_unittest$(EXEEXT) +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__EXEEXT_11 = src/tools/linux/core_handler/core_handler$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -436,13 +454,127 @@ src_client_linux_libbreakpad_client_a_OBJECTS = \ $(am_src_client_linux_libbreakpad_client_a_OBJECTS) src_libbreakpad_a_AR = $(AR) $(ARFLAGS) src_libbreakpad_a_LIBADD = +am__src_libbreakpad_a_SOURCES_DIST = \ + src/google_breakpad/common/breakpad_types.h \ + src/google_breakpad/common/minidump_format.h \ + src/google_breakpad/common/minidump_size.h \ + src/google_breakpad/processor/basic_source_line_resolver.h \ + src/google_breakpad/processor/call_stack.h \ + src/google_breakpad/processor/code_module.h \ + src/google_breakpad/processor/code_modules.h \ + src/google_breakpad/processor/dump_context.h \ + src/google_breakpad/processor/dump_object.h \ + src/google_breakpad/processor/exploitability.h \ + src/google_breakpad/processor/fast_source_line_resolver.h \ + src/google_breakpad/processor/memory_region.h \ + src/google_breakpad/processor/microdump.h \ + src/google_breakpad/processor/microdump_processor.h \ + src/google_breakpad/processor/minidump.h \ + src/google_breakpad/processor/minidump_processor.h \ + src/google_breakpad/processor/process_result.h \ + src/google_breakpad/processor/process_state.h \ + src/google_breakpad/processor/proc_maps_linux.h \ + src/google_breakpad/processor/source_line_resolver_base.h \ + src/google_breakpad/processor/source_line_resolver_interface.h \ + src/google_breakpad/processor/stack_frame.h \ + src/google_breakpad/processor/stack_frame_cpu.h \ + src/google_breakpad/processor/stack_frame_symbolizer.h \ + src/google_breakpad/processor/stackwalker.h \ + src/google_breakpad/processor/symbol_supplier.h \ + src/google_breakpad/processor/system_info.h \ + src/processor/address_map-inl.h src/processor/address_map.h \ + src/processor/basic_code_module.h \ + src/processor/basic_code_modules.cc \ + src/processor/basic_code_modules.h \ + src/processor/basic_source_line_resolver_types.h \ + src/processor/basic_source_line_resolver.cc \ + src/processor/call_stack.cc src/processor/cfi_frame_info.cc \ + src/processor/cfi_frame_info.h \ + src/processor/contained_range_map-inl.h \ + src/processor/contained_range_map.h \ + src/processor/convert_old_arm64_context.cc \ + src/processor/convert_old_arm64_context.h \ + src/processor/disassembler_x86.h \ + src/processor/disassembler_x86.cc \ + src/processor/dump_context.cc src/processor/dump_object.cc \ + src/processor/exploitability.cc \ + src/processor/exploitability_linux.h \ + src/processor/exploitability_linux.cc \ + src/processor/exploitability_win.h \ + src/processor/exploitability_win.cc \ + src/processor/fast_source_line_resolver_types.h \ + src/processor/fast_source_line_resolver.cc \ + src/processor/linked_ptr.h src/processor/logging.h \ + src/processor/logging.cc src/processor/map_serializers-inl.h \ + src/processor/map_serializers.h src/processor/microdump.cc \ + src/processor/microdump_processor.cc src/processor/minidump.cc \ + src/processor/minidump_processor.cc \ + src/processor/module_comparer.cc \ + src/processor/module_comparer.h src/processor/module_factory.h \ + src/processor/module_serializer.cc \ + src/processor/module_serializer.h \ + src/processor/pathname_stripper.cc \ + src/processor/pathname_stripper.h \ + src/processor/postfix_evaluator-inl.h \ + src/processor/postfix_evaluator.h \ + src/processor/process_state.cc \ + src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \ + src/processor/range_map.h \ + src/processor/simple_serializer-inl.h \ + src/processor/simple_serializer.h \ + src/processor/simple_symbol_supplier.cc \ + src/processor/simple_symbol_supplier.h \ + src/processor/windows_frame_info.h \ + src/processor/source_line_resolver_base_types.h \ + src/processor/source_line_resolver_base.cc \ + src/processor/stack_frame_cpu.cc \ + src/processor/stack_frame_symbolizer.cc \ + src/processor/stackwalk_common.cc \ + src/processor/stackwalk_common.h src/processor/stackwalker.cc \ + src/processor/stackwalker_amd64.cc \ + src/processor/stackwalker_amd64.h \ + src/processor/stackwalker_arm.cc \ + src/processor/stackwalker_arm.h \ + src/processor/stackwalker_arm64.cc \ + src/processor/stackwalker_arm64.h \ + src/processor/stackwalker_address_list.cc \ + src/processor/stackwalker_address_list.h \ + src/processor/stackwalker_mips.cc \ + src/processor/stackwalker_mips.h \ + src/processor/stackwalker_ppc.cc \ + src/processor/stackwalker_ppc.h \ + src/processor/stackwalker_ppc64.cc \ + src/processor/stackwalker_ppc64.h \ + src/processor/stackwalker_riscv.cc \ + src/processor/stackwalker_riscv.h \ + src/processor/stackwalker_riscv64.cc \ + src/processor/stackwalker_riscv64.h \ + src/processor/stackwalker_sparc.cc \ + src/processor/stackwalker_sparc.h \ + src/processor/stackwalker_x86.cc \ + src/processor/stackwalker_x86.h \ + src/processor/static_address_map-inl.h \ + src/processor/static_address_map.h \ + src/processor/static_contained_range_map-inl.h \ + src/processor/static_contained_range_map.h \ + src/processor/static_map_iterator-inl.h \ + src/processor/static_map_iterator.h \ + src/processor/static_map-inl.h src/processor/static_map.h \ + src/processor/static_range_map-inl.h \ + src/processor/static_range_map.h \ + src/processor/symbolic_constants_win.cc \ + src/processor/symbolic_constants_win.h \ + src/processor/tokenize.cc src/processor/tokenize.h \ + src/processor/disassembler_objdump.cc \ + src/processor/disassembler_objdump.h +@LINUX_HOST_TRUE@am__objects_2 = \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.$(OBJEXT) am_src_libbreakpad_a_OBJECTS = \ src/processor/basic_code_modules.$(OBJEXT) \ src/processor/basic_source_line_resolver.$(OBJEXT) \ src/processor/call_stack.$(OBJEXT) \ src/processor/cfi_frame_info.$(OBJEXT) \ src/processor/convert_old_arm64_context.$(OBJEXT) \ - src/processor/disassembler_objdump.$(OBJEXT) \ src/processor/disassembler_x86.$(OBJEXT) \ src/processor/dump_context.$(OBJEXT) \ src/processor/dump_object.$(OBJEXT) \ @@ -478,7 +610,7 @@ am_src_libbreakpad_a_OBJECTS = \ src/processor/stackwalker_sparc.$(OBJEXT) \ src/processor/stackwalker_x86.$(OBJEXT) \ src/processor/symbolic_constants_win.$(OBJEXT) \ - src/processor/tokenize.$(OBJEXT) + src/processor/tokenize.$(OBJEXT) $(am__objects_2) src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS) src_testing_libtesting_a_AR = $(AR) $(ARFLAGS) src_testing_libtesting_a_LIBADD = @@ -553,13 +685,13 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/processor/proc_maps_linux.cc \ src/common/linux/breakpad_getcontext.S \ src/common/linux/breakpad_getcontext_unittest.cc -@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@am__objects_3 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ @SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ @SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) -@HAVE_GETCONTEXT_FALSE@am__objects_3 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ +@HAVE_GETCONTEXT_FALSE@am__objects_4 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT) am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ - $(am__objects_2) \ + $(am__objects_3) \ src/client/linux/handler/linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \ src/client/linux/microdump_writer/linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \ src/client/linux/minidump_writer/linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \ @@ -585,7 +717,7 @@ am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ src/processor/client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \ src/processor/client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \ src/processor/client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \ - $(am__objects_3) + $(am__objects_4) src_client_linux_linux_client_unittest_shlib_OBJECTS = \ $(am_src_client_linux_linux_client_unittest_shlib_OBJECTS) src_client_linux_linux_client_unittest_shlib_LINK = $(CXXLD) \ @@ -769,9 +901,7 @@ src_processor_exploitability_unittest_OBJECTS = \ src_processor_exploitability_unittest_DEPENDENCIES = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ - src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ + src/processor/process_state.o src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ src/processor/exploitability_win.o \ @@ -801,7 +931,7 @@ src_processor_exploitability_unittest_DEPENDENCIES = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_27) am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT) src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fast_source_line_resolver_unittest_OBJECTS) src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = \ @@ -901,7 +1031,6 @@ src_processor_minidump_processor_unittest_DEPENDENCIES = \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o src/processor/dump_context.o \ src/processor/dump_object.o src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -927,7 +1056,7 @@ src_processor_minidump_processor_unittest_DEPENDENCIES = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_28) am_src_processor_minidump_stackwalk_OBJECTS = \ src/processor/minidump_stackwalk.$(OBJEXT) src_processor_minidump_stackwalk_OBJECTS = \ @@ -937,7 +1066,6 @@ src_processor_minidump_stackwalk_DEPENDENCIES = \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o src/processor/dump_context.o \ src/processor/dump_object.o src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -962,7 +1090,8 @@ src_processor_minidump_stackwalk_DEPENDENCIES = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ - src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__append_30) am_src_processor_minidump_unittest_OBJECTS = src/common/processor_minidump_unittest-test_assembler.$(OBJEXT) \ src/processor/minidump_unittest-minidump_unittest.$(OBJEXT) \ src/processor/minidump_unittest-synth_minidump.$(OBJEXT) @@ -1082,9 +1211,7 @@ src_processor_stackwalker_selftest_OBJECTS = \ src_processor_stackwalker_selftest_DEPENDENCIES = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ + src/processor/call_stack.o src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ src/processor/exploitability_win.o src/processor/logging.o \ @@ -1105,7 +1232,7 @@ src_processor_stackwalker_selftest_DEPENDENCIES = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_29) am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \ src/processor/stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) src_processor_stackwalker_x86_unittest_OBJECTS = \ @@ -1667,7 +1794,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES) DIST_SOURCES = \ $(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \ - $(src_libbreakpad_a_SOURCES) \ + $(am__src_libbreakpad_a_SOURCES_DIST) \ $(am__src_testing_libtesting_a_SOURCES_DIST) \ $(src_third_party_libdisasm_libdisasm_a_SOURCES) \ $(src_client_linux_linux_client_unittest_SOURCES) \ @@ -2132,7 +2259,7 @@ includec_HEADERS = $(top_srcdir)/src/common/*.h includepdir = $(includedir)/$(PACKAGE)/processor includep_HEADERS = $(top_srcdir)/src/processor/*.h pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = $(am__append_6) $(am__append_12) +pkgconfig_DATA = $(am__append_6) $(am__append_13) @SYSTEM_TEST_LIBS_FALSE@TEST_CFLAGS = \ @SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/include \ @SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest/include \ @@ -2156,9 +2283,9 @@ pkgconfig_DATA = $(am__append_6) $(am__append_12) @ANDROID_HOST_TRUE@LOG_DRIVER = $(top_srcdir)/android/test-driver check_LIBRARIES = $(am__append_4) noinst_LIBRARIES = $(am__append_7) -lib_LIBRARIES = $(am__append_5) $(am__append_11) +lib_LIBRARIES = $(am__append_5) $(am__append_12) noinst_SCRIPTS = $(check_SCRIPTS) -CLEANFILES = $(am__append_15) +CLEANFILES = $(am__append_16) @SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \ @SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \ @SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest-all.cc \ @@ -2196,7 +2323,7 @@ src_common_safe_math_unittest_LDADD = \ # Breakpad processor library -src_libbreakpad_a_SOURCES = \ +src_libbreakpad_a_SOURCES = \ src/google_breakpad/common/breakpad_types.h \ src/google_breakpad/common/minidump_format.h \ src/google_breakpad/common/minidump_size.h \ @@ -2224,26 +2351,21 @@ src_libbreakpad_a_SOURCES = \ src/google_breakpad/processor/stackwalker.h \ src/google_breakpad/processor/symbol_supplier.h \ src/google_breakpad/processor/system_info.h \ - src/processor/address_map-inl.h \ - src/processor/address_map.h \ + src/processor/address_map-inl.h src/processor/address_map.h \ src/processor/basic_code_module.h \ src/processor/basic_code_modules.cc \ src/processor/basic_code_modules.h \ src/processor/basic_source_line_resolver_types.h \ src/processor/basic_source_line_resolver.cc \ - src/processor/call_stack.cc \ - src/processor/cfi_frame_info.cc \ + src/processor/call_stack.cc src/processor/cfi_frame_info.cc \ src/processor/cfi_frame_info.h \ src/processor/contained_range_map-inl.h \ src/processor/contained_range_map.h \ src/processor/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ - src/processor/disassembler_objdump.h \ - src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ - src/processor/dump_context.cc \ - src/processor/dump_object.cc \ + src/processor/dump_context.cc src/processor/dump_object.cc \ src/processor/exploitability.cc \ src/processor/exploitability_linux.h \ src/processor/exploitability_linux.cc \ @@ -2251,18 +2373,13 @@ src_libbreakpad_a_SOURCES = \ src/processor/exploitability_win.cc \ src/processor/fast_source_line_resolver_types.h \ src/processor/fast_source_line_resolver.cc \ - src/processor/linked_ptr.h \ - src/processor/logging.h \ - src/processor/logging.cc \ - src/processor/map_serializers-inl.h \ - src/processor/map_serializers.h \ - src/processor/microdump.cc \ - src/processor/microdump_processor.cc \ - src/processor/minidump.cc \ + src/processor/linked_ptr.h src/processor/logging.h \ + src/processor/logging.cc src/processor/map_serializers-inl.h \ + src/processor/map_serializers.h src/processor/microdump.cc \ + src/processor/microdump_processor.cc src/processor/minidump.cc \ src/processor/minidump_processor.cc \ src/processor/module_comparer.cc \ - src/processor/module_comparer.h \ - src/processor/module_factory.h \ + src/processor/module_comparer.h src/processor/module_factory.h \ src/processor/module_serializer.cc \ src/processor/module_serializer.h \ src/processor/pathname_stripper.cc \ @@ -2270,8 +2387,7 @@ src_libbreakpad_a_SOURCES = \ src/processor/postfix_evaluator-inl.h \ src/processor/postfix_evaluator.h \ src/processor/process_state.cc \ - src/processor/proc_maps_linux.cc \ - src/processor/range_map-inl.h \ + src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \ src/processor/range_map.h \ src/processor/simple_serializer-inl.h \ src/processor/simple_serializer.h \ @@ -2283,8 +2399,7 @@ src_libbreakpad_a_SOURCES = \ src/processor/stack_frame_cpu.cc \ src/processor/stack_frame_symbolizer.cc \ src/processor/stackwalk_common.cc \ - src/processor/stackwalk_common.h \ - src/processor/stackwalker.cc \ + src/processor/stackwalk_common.h src/processor/stackwalker.cc \ src/processor/stackwalker_amd64.cc \ src/processor/stackwalker_amd64.h \ src/processor/stackwalker_arm.cc \ @@ -2313,15 +2428,13 @@ src_libbreakpad_a_SOURCES = \ src/processor/static_contained_range_map.h \ src/processor/static_map_iterator-inl.h \ src/processor/static_map_iterator.h \ - src/processor/static_map-inl.h \ - src/processor/static_map.h \ + src/processor/static_map-inl.h src/processor/static_map.h \ src/processor/static_range_map-inl.h \ src/processor/static_range_map.h \ src/processor/symbolic_constants_win.cc \ src/processor/symbolic_constants_win.h \ - src/processor/tokenize.cc \ - src/processor/tokenize.h - + src/processor/tokenize.cc src/processor/tokenize.h \ + $(am__append_22) # libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ @@ -2382,7 +2495,7 @@ src_client_linux_libbreakpad_client_a_SOURCES = \ src/common/linux/guid_creator.h \ src/common/linux/linux_libc_support.cc \ src/common/linux/memory_mapped_file.cc \ - src/common/linux/safe_readlink.cc $(am__append_21) + src/common/linux/safe_readlink.cc $(am__append_23) # Client tests src_client_linux_linux_dumper_unittest_helper_SOURCES = \ @@ -2420,12 +2533,12 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/processor/dump_context.cc src/processor/dump_object.cc \ src/processor/logging.cc src/processor/minidump.cc \ src/processor/pathname_stripper.cc \ - src/processor/proc_maps_linux.cc $(am__append_22) + src/processor/proc_maps_linux.cc $(am__append_24) src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) src_client_linux_linux_client_unittest_shlib_LDFLAGS = -shared \ - -Wl,-h,linux_client_unittest_shlib $(am__append_23) + -Wl,-h,linux_client_unittest_shlib $(am__append_25) src_client_linux_linux_client_unittest_shlib_LDADD = \ src/client/linux/crash_generation/crash_generation_client.o \ src/client/linux/dump_writer_common/thread_info.o \ @@ -2461,7 +2574,7 @@ src_client_linux_linux_client_unittest_SOURCES = src_client_linux_linux_client_unittest_LDFLAGS = \ -Wl,-rpath,'$$ORIGIN' \ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \ - $(am__append_24) + $(am__append_26) src_client_linux_linux_client_unittest_LDADD = \ src/client/linux/linux_client_unittest_shlib \ $(TEST_LIBS) @@ -2765,23 +2878,18 @@ src_processor_exploitability_unittest_SOURCES = \ src_processor_exploitability_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_processor_exploitability_unittest_LDADD = \ +src_processor_exploitability_unittest_LDADD = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ - src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ + src/processor/process_state.o src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ src/processor/exploitability_win.o \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/cfi_frame_info.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/logging.o \ - src/processor/minidump.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ + src/processor/dump_context.o src/processor/dump_object.o \ + src/processor/logging.o src/processor/minidump.o \ src/processor/pathname_stripper.o \ src/processor/proc_maps_linux.o \ src/processor/simple_symbol_supplier.o \ @@ -2801,11 +2909,9 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ - src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a \ - $(TEST_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_27) src_processor_disassembler_objdump_unittest_SOURCES = \ src/processor/disassembler_objdump_unittest.cc @@ -2908,25 +3014,18 @@ src_processor_minidump_processor_unittest_SOURCES = \ src_processor_minidump_processor_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_processor_minidump_processor_unittest_LDADD = \ +src_processor_minidump_processor_unittest_LDADD = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/cfi_frame_info.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/exploitability.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/exploitability.o \ src/processor/exploitability_linux.o \ - src/processor/exploitability_win.o \ - src/processor/logging.o \ - src/processor/minidump_processor.o \ - src/processor/minidump.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump_processor.o src/processor/minidump.o \ src/processor/pathname_stripper.o \ - src/processor/process_state.o \ - src/processor/proc_maps_linux.o \ + src/processor/process_state.o src/processor/proc_maps_linux.o \ src/processor/source_line_resolver_base.o \ src/processor/stack_frame_cpu.o \ src/processor/stack_frame_symbolizer.o \ @@ -2943,11 +3042,9 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ - src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a \ - $(TEST_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_28) src_processor_minidump_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/minidump_unittest.cc \ @@ -3080,18 +3177,14 @@ src_processor_range_map_unittest_LDADD = \ src_processor_stackwalker_selftest_SOURCES = \ src/processor/stackwalker_selftest.cc -src_processor_stackwalker_selftest_LDADD = \ +src_processor_stackwalker_selftest_LDADD = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ + src/processor/call_stack.o src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ - src/processor/exploitability_win.o \ - src/processor/logging.o \ - src/processor/minidump.o \ - src/processor/pathname_stripper.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump.o src/processor/pathname_stripper.o \ src/processor/proc_maps_linux.o \ src/processor/source_line_resolver_base.o \ src/processor/stack_frame_cpu.o \ @@ -3107,10 +3200,8 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(am__append_29) src_processor_stackwalker_amd64_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/stackwalker_amd64_unittest.cc @@ -3328,32 +3419,23 @@ src_processor_microdump_stackwalk_LDADD = \ src_processor_minidump_stackwalk_SOURCES = \ src/processor/minidump_stackwalk.cc -src_processor_minidump_stackwalk_LDADD = \ - src/common/path_helper.o \ +src_processor_minidump_stackwalk_LDADD = src/common/path_helper.o \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/cfi_frame_info.o \ + src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/exploitability.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/exploitability.o \ src/processor/exploitability_linux.o \ - src/processor/exploitability_win.o \ - src/processor/logging.o \ - src/processor/minidump.o \ - src/processor/minidump_processor.o \ + src/processor/exploitability_win.o src/processor/logging.o \ + src/processor/minidump.o src/processor/minidump_processor.o \ src/processor/pathname_stripper.o \ - src/processor/process_state.o \ - src/processor/proc_maps_linux.o \ + src/processor/process_state.o src/processor/proc_maps_linux.o \ src/processor/simple_symbol_supplier.o \ src/processor/source_line_resolver_base.o \ src/processor/stack_frame_cpu.o \ src/processor/stack_frame_symbolizer.o \ - src/processor/stackwalk_common.o \ - src/processor/stackwalker.o \ + src/processor/stackwalk_common.o src/processor/stackwalker.o \ src/processor/stackwalker_address_list.o \ src/processor/stackwalker_amd64.o \ src/processor/stackwalker_arm.o \ @@ -3366,9 +3448,8 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ - src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a - + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__append_30) EXTRA_DIST = \ $(SCRIPTS) \ src/client/linux/data/linux-gate-amd.sym \ @@ -3965,9 +4046,6 @@ src/processor/cfi_frame_info.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/convert_old_arm64_context.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) -src/processor/disassembler_objdump.$(OBJEXT): \ - src/processor/$(am__dirstamp) \ - src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/disassembler_x86.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -4067,6 +4145,9 @@ src/processor/symbolic_constants_win.$(OBJEXT): \ src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/tokenize.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) +src/processor/disassembler_objdump.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) @@ -8766,13 +8847,6 @@ src/processor/contained_range_map_unittest.log: src/processor/contained_range_ma --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -src/processor/disassembler_objdump_unittest.log: src/processor/disassembler_objdump_unittest$(EXEEXT) - @p='src/processor/disassembler_objdump_unittest$(EXEEXT)'; \ - b='src/processor/disassembler_objdump_unittest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/disassembler_x86_unittest.log: src/processor/disassembler_x86_unittest$(EXEEXT) @p='src/processor/disassembler_x86_unittest$(EXEEXT)'; \ b='src/processor/disassembler_x86_unittest'; \ @@ -8962,6 +9036,13 @@ src/processor/synth_minidump_unittest.log: src/processor/synth_minidump_unittest --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/processor/disassembler_objdump_unittest.log: src/processor/disassembler_objdump_unittest$(EXEEXT) + @p='src/processor/disassembler_objdump_unittest$(EXEEXT)'; \ + b='src/processor/disassembler_objdump_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT) @p='src/processor/stackwalker_selftest$(EXEEXT)'; \ b='src/processor/stackwalker_selftest'; \ diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc index dfe10d58e..c6b6ac57f 100644 --- a/src/processor/disassembler_objdump.cc +++ b/src/processor/disassembler_objdump.cc @@ -32,7 +32,6 @@ #include "processor/disassembler_objdump.h" -#ifdef __linux__ #include #include #include @@ -498,23 +497,5 @@ bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, uint64_t& address) { return CalculateAddress(context, dest_, address); } -} // namespace google_breakpad -#else // __linux__ -namespace google_breakpad { -DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu, - const MemoryRegion* memory_region, - uint64_t address) {} - -bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context, - uint64_t& address) { - return false; -} - -bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, - uint64_t& address) { - return false; -} -} // namespace google_breakpad - -#endif // __linux__ +} // namespace google_breakpad \ No newline at end of file diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 63a126560..c48bbdf5c 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -41,7 +41,9 @@ #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/stack_frame.h" +#ifdef __linux__ #include "processor/disassembler_objdump.h" +#endif #include "processor/logging.h" namespace { @@ -156,7 +158,7 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() { } bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { -#ifdef _WIN32 +#ifndef __linux__ BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method."; return false; #else @@ -220,7 +222,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { } else { return false; } -#endif // _WIN32 +#endif // __linux__ } bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) { diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index fb330e26e..d72926cb5 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -44,11 +44,14 @@ #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/exploitability.h" #include "google_breakpad/processor/stack_frame_symbolizer.h" -#include "processor/disassembler_objdump.h" #include "processor/logging.h" #include "processor/stackwalker_x86.h" #include "processor/symbolic_constants_win.h" +#ifdef __linux__ +#include "processor/disassembler_objdump.h" +#endif + namespace google_breakpad { MinidumpProcessor::MinidumpProcessor(SymbolSupplier* supplier, @@ -770,6 +773,7 @@ static bool IsCanonicalAddress(uint64_t address) { return true; } +#ifdef __linux__ static void CalculateFaultAddressFromInstruction(Minidump* dump, uint64_t* address) { MinidumpException* exception = dump->GetException(); @@ -832,6 +836,7 @@ static void CalculateFaultAddressFromInstruction(Minidump* dump, *address = write_address; } } +#endif // __linux__ // static string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, @@ -2070,6 +2075,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, static_cast(raw_system_info->processor_architecture), *address); +#ifdef __linux__ // For invalid accesses to non-canonical addresses, amd64 cpus don't provide // the fault address, so recover it from the disassembly and register state // if possible. @@ -2078,6 +2084,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, && std::numeric_limits::max() == *address) { CalculateFaultAddressFromInstruction(dump, address); } +#endif // __linux__ } return reason; From 9a87ff661e3ff2d6b4b4390a3e129bb933a36502 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 30 Jan 2023 11:19:45 +0100 Subject: [PATCH 162/195] Add ScopedTmpFile. This replaces the existing AutoTestFile implementation with a simpler implementation that uses O_TMPFILE to avoid having the temporary files linked in the filesystem. Refactor the existing tests to use the new ScopedTmpFile instead of duplicating the same ScopedTestFile wrapper into each test. Change-Id: Iee9416e52269eff271f748ec9d822aee6e28f59a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3971917 Reviewed-by: Lei Zhang --- Makefile.am | 16 ++- Makefile.in | 85 +++++++++++- .../linux/minidump_writer/cpu_set_unittest.cc | 60 ++++----- .../minidump_writer/line_reader_unittest.cc | 41 +++--- .../proc_cpuinfo_reader_unittest.cc | 56 +++----- src/common/linux/scoped_tmpfile.cc | 99 ++++++++++++++ src/common/linux/scoped_tmpfile.h | 85 ++++++++++++ src/common/linux/scoped_tmpfile_unittest.cc | 46 +++++++ src/common/linux/tests/auto_testfile.h | 123 ------------------ 9 files changed, 388 insertions(+), 223 deletions(-) create mode 100644 src/common/linux/scoped_tmpfile.cc create mode 100644 src/common/linux/scoped_tmpfile.h create mode 100644 src/common/linux/scoped_tmpfile_unittest.cc delete mode 100644 src/common/linux/tests/auto_testfile.h diff --git a/Makefile.am b/Makefile.am index 688725fa7..dea7b53d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -222,7 +222,8 @@ check_PROGRAMS += \ src/processor/synth_minidump_unittest if LINUX_HOST check_PROGRAMS += \ - src/processor/disassembler_objdump_unittest + src/processor/disassembler_objdump_unittest \ + src/common/linux/scoped_tmpfile_unittest endif LINUX_HOST if SELFTEST check_PROGRAMS += \ @@ -529,7 +530,6 @@ src_client_linux_libbreakpad_client_a_SOURCES += \ endif # Client tests - src_client_linux_linux_dumper_unittest_helper_SOURCES = \ src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc src_client_linux_linux_dumper_unittest_helper_LDFLAGS=$(PTHREAD_CFLAGS) @@ -558,7 +558,8 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ - src/common/linux/tests/auto_testfile.h \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h \ @@ -957,6 +958,15 @@ src_processor_exploitability_unittest_LDADD += \ src/processor/disassembler_objdump.o endif +src_common_linux_scoped_tmpfile_unittest_SOURCES = \ + src/common/linux/scoped_tmpfile_unittest.cc +src_common_linux_scoped_tmpfile_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_linux_scoped_tmpfile_unittest_LDADD = \ + src/common/linux/scoped_tmpfile.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_processor_disassembler_objdump_unittest_SOURCES = \ src/processor/disassembler_objdump_unittest.cc src_processor_disassembler_objdump_unittest_CPPFLAGS = \ diff --git a/Makefile.in b/Makefile.in index 54d8c2aa5..33e374585 100644 --- a/Makefile.in +++ b/Makefile.in @@ -193,7 +193,8 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__append_10 = \ -@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/processor/disassembler_objdump_unittest +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/processor/disassembler_objdump_unittest \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_11 = \ @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest @@ -351,7 +352,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) -@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/processor/disassembler_objdump_unittest$(EXEEXT) +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/processor/disassembler_objdump_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest$(EXEEXT) @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_7 = src/processor/stackwalker_selftest$(EXEEXT) @LINUX_HOST_TRUE@am__EXEEXT_8 = src/client/linux/linux_client_unittest$(EXEEXT) \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test$(EXEEXT) @@ -672,7 +674,8 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ - src/common/linux/tests/auto_testfile.h \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \ @@ -706,6 +709,7 @@ am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(OBJEXT) \ src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \ src/common/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \ src/common/tests/client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \ @@ -809,6 +813,12 @@ src_common_linux_google_crashdump_uploader_test_OBJECTS = \ src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) +am_src_common_linux_scoped_tmpfile_unittest_OBJECTS = src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT) +src_common_linux_scoped_tmpfile_unittest_OBJECTS = \ + $(am_src_common_linux_scoped_tmpfile_unittest_OBJECTS) +src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES = \ + src/common/linux/scoped_tmpfile.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \ src/common/mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \ src/common/mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \ @@ -1521,6 +1531,7 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po \ + src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po \ @@ -1550,6 +1561,7 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/linux_libc_support.Po \ src/common/linux/$(DEPDIR)/memory_mapped_file.Po \ src/common/linux/$(DEPDIR)/safe_readlink.Po \ + src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po \ src/common/linux/$(DEPDIR)/symbol_collector_client.Po \ src/common/linux/$(DEPDIR)/symbol_upload.Po \ src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po \ @@ -1744,6 +1756,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ $(src_common_test_assembler_unittest_SOURCES) \ @@ -1804,6 +1817,7 @@ DIST_SOURCES = \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ $(src_common_test_assembler_unittest_SOURCES) \ @@ -2523,7 +2537,8 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ - src/common/linux/tests/auto_testfile.h \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \ @@ -2912,6 +2927,17 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ $(am__append_27) +src_common_linux_scoped_tmpfile_unittest_SOURCES = \ + src/common/linux/scoped_tmpfile_unittest.cc + +src_common_linux_scoped_tmpfile_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_linux_scoped_tmpfile_unittest_LDADD = \ + src/common/linux/scoped_tmpfile.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_processor_disassembler_objdump_unittest_SOURCES = \ src/processor/disassembler_objdump_unittest.cc @@ -4293,6 +4319,9 @@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT): \ src/common/linux/$(am__dirstamp) \ src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) src/common/linux/tests/$(am__dirstamp): @$(MKDIR_P) src/common/linux/tests @: > src/common/linux/tests/$(am__dirstamp) @@ -4539,6 +4568,13 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT): \ src/common/linux/google_crashdump_uploader_test$(EXEEXT): $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) $(EXTRA_src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) src/common/linux/$(am__dirstamp) @rm -f src/common/linux/google_crashdump_uploader_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_LDADD) $(LIBS) +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) + +src/common/linux/scoped_tmpfile_unittest$(EXEEXT): $(src_common_linux_scoped_tmpfile_unittest_OBJECTS) $(src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES) $(EXTRA_src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES) src/common/linux/$(am__dirstamp) + @rm -f src/common/linux/scoped_tmpfile_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_scoped_tmpfile_unittest_OBJECTS) $(src_common_linux_scoped_tmpfile_unittest_LDADD) $(LIBS) src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT): \ src/common/$(am__dirstamp) \ src/common/$(DEPDIR)/$(am__dirstamp) @@ -5329,6 +5365,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po@am__quote@ # am--include-marker @@ -5358,6 +5395,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_collector_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po@am__quote@ # am--include-marker @@ -5854,6 +5892,20 @@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_uni @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj `if test -f 'src/common/linux/linux_libc_support_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support_unittest.cc'; fi` +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o: src/common/linux/scoped_tmpfile.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o `test -f 'src/common/linux/scoped_tmpfile.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o `test -f 'src/common/linux/scoped_tmpfile.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile.cc + +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj: src/common/linux/scoped_tmpfile.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj `if test -f 'src/common/linux/scoped_tmpfile.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj `if test -f 'src/common/linux/scoped_tmpfile.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile.cc'; fi` + src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.o: src/common/linux/tests/crash_generator.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.o -MD -MP -MF src/common/linux/tests/$(DEPDIR)/client_linux_linux_client_unittest_shlib-crash_generator.Tpo -c -o src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.o `test -f 'src/common/linux/tests/crash_generator.cc' || echo '$(srcdir)/'`src/common/linux/tests/crash_generator.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/tests/$(DEPDIR)/client_linux_linux_client_unittest_shlib-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/client_linux_linux_client_unittest_shlib-crash_generator.Po @@ -6792,6 +6844,20 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj: src/common/ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj `if test -f 'src/common/linux/libcurl_wrapper.cc'; then $(CYGPATH_W) 'src/common/linux/libcurl_wrapper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/libcurl_wrapper.cc'; fi` +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o: src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o `test -f 'src/common/linux/scoped_tmpfile_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile_unittest.cc' object='src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o `test -f 'src/common/linux/scoped_tmpfile_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile_unittest.cc + +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj: src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj `if test -f 'src/common/linux/scoped_tmpfile_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile_unittest.cc' object='src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj `if test -f 'src/common/linux/scoped_tmpfile_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile_unittest.cc'; fi` + src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/mac_macho_reader_unittest-dwarf_cfi_to_module.Po @@ -9043,6 +9109,13 @@ src/processor/disassembler_objdump_unittest.log: src/processor/disassembler_objd --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/common/linux/scoped_tmpfile_unittest.log: src/common/linux/scoped_tmpfile_unittest$(EXEEXT) + @p='src/common/linux/scoped_tmpfile_unittest$(EXEEXT)'; \ + b='src/common/linux/scoped_tmpfile_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT) @p='src/processor/stackwalker_selftest$(EXEEXT)'; \ b='src/processor/stackwalker_selftest'; \ @@ -9535,6 +9608,7 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po @@ -9564,6 +9638,7 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po -rm -f src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po @@ -9889,6 +9964,7 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po @@ -9918,6 +9994,7 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po -rm -f src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po diff --git a/src/client/linux/minidump_writer/cpu_set_unittest.cc b/src/client/linux/minidump_writer/cpu_set_unittest.cc index 1db74410d..e9d4e87ac 100644 --- a/src/client/linux/minidump_writer/cpu_set_unittest.cc +++ b/src/client/linux/minidump_writer/cpu_set_unittest.cc @@ -35,7 +35,7 @@ #include "breakpad_googletest_includes.h" #include "client/linux/minidump_writer/cpu_set.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.h" using namespace google_breakpad; @@ -43,15 +43,6 @@ namespace { typedef testing::Test CpuSetTest; -// Helper class to write test text file to a temporary file and return -// its file descriptor. -class ScopedTestFile : public AutoTestFile { -public: - explicit ScopedTestFile(const char* text) - : AutoTestFile("cpu_set", text) { - } -}; - } TEST(CpuSetTest, EmptyCount) { @@ -60,8 +51,8 @@ TEST(CpuSetTest, EmptyCount) { } TEST(CpuSetTest, OneCpu) { - ScopedTestFile file("10"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("10")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -69,8 +60,8 @@ TEST(CpuSetTest, OneCpu) { } TEST(CpuSetTest, OneCpuTerminated) { - ScopedTestFile file("10\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("10\n")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -78,8 +69,8 @@ TEST(CpuSetTest, OneCpuTerminated) { } TEST(CpuSetTest, TwoCpusWithComma) { - ScopedTestFile file("1,10"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("1,10")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -87,8 +78,8 @@ TEST(CpuSetTest, TwoCpusWithComma) { } TEST(CpuSetTest, TwoCpusWithRange) { - ScopedTestFile file("1-2"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("1-2")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -96,8 +87,8 @@ TEST(CpuSetTest, TwoCpusWithRange) { } TEST(CpuSetTest, TenCpusWithRange) { - ScopedTestFile file("9-18"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("9-18")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -105,8 +96,8 @@ TEST(CpuSetTest, TenCpusWithRange) { } TEST(CpuSetTest, MultiItems) { - ScopedTestFile file("0, 2-4, 128"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("0, 2-4, 128")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -114,14 +105,16 @@ TEST(CpuSetTest, MultiItems) { } TEST(CpuSetTest, IntersectWith) { - ScopedTestFile file1("9-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("9-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(11, set1.GetCount()); - ScopedTestFile file2("16-24"); - ASSERT_TRUE(file2.IsOk()); + ScopedTmpFile file2; + ASSERT_TRUE(file2.InitString("16-24")); + CpuSet set2; ASSERT_TRUE(set2.ParseSysFile(file2.GetFd())); ASSERT_EQ(9, set2.GetCount()); @@ -132,8 +125,9 @@ TEST(CpuSetTest, IntersectWith) { } TEST(CpuSetTest, SelfIntersection) { - ScopedTestFile file1("9-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("9-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(11, set1.GetCount()); @@ -143,14 +137,16 @@ TEST(CpuSetTest, SelfIntersection) { } TEST(CpuSetTest, EmptyIntersection) { - ScopedTestFile file1("0-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("0-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(20, set1.GetCount()); - ScopedTestFile file2("20-39"); - ASSERT_TRUE(file2.IsOk()); + ScopedTmpFile file2; + ASSERT_TRUE(file2.InitString("20-39")); + CpuSet set2; ASSERT_TRUE(set2.ParseSysFile(file2.GetFd())); ASSERT_EQ(20, set2.GetCount()); diff --git a/src/client/linux/minidump_writer/line_reader_unittest.cc b/src/client/linux/minidump_writer/line_reader_unittest.cc index 3062c39f7..b96ebf9d0 100644 --- a/src/client/linux/minidump_writer/line_reader_unittest.cc +++ b/src/client/linux/minidump_writer/line_reader_unittest.cc @@ -32,7 +32,7 @@ #include "client/linux/minidump_writer/line_reader.h" #include "breakpad_googletest_includes.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.h" using namespace google_breakpad; @@ -40,22 +40,11 @@ namespace { typedef testing::Test LineReaderTest; -class ScopedTestFile : public AutoTestFile { -public: - explicit ScopedTestFile(const char* text) - : AutoTestFile("line_reader", text) { - } - - ScopedTestFile(const char* text, size_t text_len) - : AutoTestFile("line_reader", text, text_len) { - } -}; - } TEST(LineReaderTest, EmptyFile) { - ScopedTestFile file(""); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("")); LineReader reader(file.GetFd()); const char* line; @@ -64,8 +53,8 @@ TEST(LineReaderTest, EmptyFile) { } TEST(LineReaderTest, OneLineTerminated) { - ScopedTestFile file("a\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\n")); LineReader reader(file.GetFd()); const char* line; @@ -80,8 +69,8 @@ TEST(LineReaderTest, OneLineTerminated) { } TEST(LineReaderTest, OneLine) { - ScopedTestFile file("a"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a")); LineReader reader(file.GetFd()); const char* line; @@ -96,8 +85,8 @@ TEST(LineReaderTest, OneLine) { } TEST(LineReaderTest, TwoLinesTerminated) { - ScopedTestFile file("a\nb\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\nb\n")); LineReader reader(file.GetFd()); const char* line; @@ -118,8 +107,8 @@ TEST(LineReaderTest, TwoLinesTerminated) { } TEST(LineReaderTest, TwoLines) { - ScopedTestFile file("a\nb"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\nb")); LineReader reader(file.GetFd()); const char* line; @@ -142,8 +131,8 @@ TEST(LineReaderTest, TwoLines) { TEST(LineReaderTest, MaxLength) { char l[LineReader::kMaxLineLen-1]; memset(l, 'a', sizeof(l)); - ScopedTestFile file(l, sizeof(l)); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitData(l, sizeof(l))); LineReader reader(file.GetFd()); const char* line; @@ -158,8 +147,8 @@ TEST(LineReaderTest, TooLong) { // Note: this writes kMaxLineLen 'a' chars in the test file. char l[LineReader::kMaxLineLen]; memset(l, 'a', sizeof(l)); - ScopedTestFile file(l, sizeof(l)); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitData(l, sizeof(l))); LineReader reader(file.GetFd()); const char* line; diff --git a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc index f6d3e2859..cbdc5fbce 100644 --- a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc +++ b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @@ -35,33 +35,19 @@ #include "client/linux/minidump_writer/proc_cpuinfo_reader.h" #include "breakpad_googletest_includes.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.h" using namespace google_breakpad; -#if !defined(__ANDROID__) -#define TEMPDIR "/tmp" -#else -#define TEMPDIR "/data/local/tmp" -#endif - - namespace { typedef testing::Test ProcCpuInfoReaderTest; -class ScopedTestFile : public AutoTestFile { -public: - explicit ScopedTestFile(const char* text) - : AutoTestFile("proc_cpuinfo_reader", text) { - } -}; - } TEST(ProcCpuInfoReaderTest, EmptyFile) { - ScopedTestFile file(""); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -69,8 +55,8 @@ TEST(ProcCpuInfoReaderTest, EmptyFile) { } TEST(ProcCpuInfoReaderTest, OneLineTerminated) { - ScopedTestFile file("foo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -82,8 +68,8 @@ TEST(ProcCpuInfoReaderTest, OneLineTerminated) { } TEST(ProcCpuInfoReaderTest, OneLine) { - ScopedTestFile file("foo : bar"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -97,8 +83,8 @@ TEST(ProcCpuInfoReaderTest, OneLine) { } TEST(ProcCpuInfoReaderTest, TwoLinesTerminated) { - ScopedTestFile file("foo : bar\nzoo : tut\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\nzoo : tut\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -114,8 +100,8 @@ TEST(ProcCpuInfoReaderTest, TwoLinesTerminated) { } TEST(ProcCpuInfoReaderTest, SkipMalformedLine) { - ScopedTestFile file("this line should have a column\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("this line should have a column\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -127,8 +113,8 @@ TEST(ProcCpuInfoReaderTest, SkipMalformedLine) { } TEST(ProcCpuInfoReaderTest, SkipOneEmptyLine) { - ScopedTestFile file("\n\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("\n\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -140,8 +126,8 @@ TEST(ProcCpuInfoReaderTest, SkipOneEmptyLine) { } TEST(ProcCpuInfoReaderTest, SkipEmptyField) { - ScopedTestFile file(" : bar\nzoo : tut\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString(" : bar\nzoo : tut\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -153,8 +139,8 @@ TEST(ProcCpuInfoReaderTest, SkipEmptyField) { } TEST(ProcCpuInfoReaderTest, SkipTwoEmptyLines) { - ScopedTestFile file("foo : bar\n\n\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\n\n\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -170,8 +156,8 @@ TEST(ProcCpuInfoReaderTest, SkipTwoEmptyLines) { } TEST(ProcCpuInfoReaderTest, FieldWithSpaces) { - ScopedTestFile file("foo bar : zoo\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo bar : zoo\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -183,8 +169,8 @@ TEST(ProcCpuInfoReaderTest, FieldWithSpaces) { } TEST(ProcCpuInfoReaderTest, EmptyValue) { - ScopedTestFile file("foo :\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo :\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; diff --git a/src/common/linux/scoped_tmpfile.cc b/src/common/linux/scoped_tmpfile.cc new file mode 100644 index 000000000..229e8d42c --- /dev/null +++ b/src/common/linux/scoped_tmpfile.cc @@ -0,0 +1,99 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Utility class for creating a temporary file that is deleted in the +// destructor. + +#include "common/linux/scoped_tmpfile.h" + +#include +#include +#include +#include +#include + +#include "common/linux/eintr_wrapper.h" + +#if !defined(__ANDROID__) +#define TEMPDIR "/tmp" +#else +#define TEMPDIR "/data/local/tmp" +#endif + +namespace google_breakpad { + +ScopedTmpFile::ScopedTmpFile() = default; + +ScopedTmpFile::~ScopedTmpFile() { + if (fd_ >= 0) { + close(fd_); + fd_ = -1; + } +} + +bool ScopedTmpFile::InitEmpty() { + // Prevent calling Init when fd_ is already valid, leaking the file. + if (fd_ != -1) { + return false; + } + + // Respect the TMPDIR environment variable. + const char* tempdir = getenv("TMPDIR"); + if (!tempdir) { + tempdir = TEMPDIR; + } + + // Create a temporary file that is not linked in to the filesystem, and that + // is only accessible by the current user. + fd_ = open(tempdir, O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR); + + return fd_ >= 0; +} + +bool ScopedTmpFile::InitString(const char* text) { + return InitData(text, strlen(text)); +} + +bool ScopedTmpFile::InitData(const void* data, size_t data_len) { + if (!InitEmpty()) { + return false; + } + + return SetContents(data, data_len); +} + +bool ScopedTmpFile::SetContents(const void* data, size_t data_len) { + ssize_t r = HANDLE_EINTR(write(fd_, data, data_len)); + if (r != static_cast(data_len)) { + return false; + } + + return 0 == lseek(fd_, 0, SEEK_SET); +} + +} // namespace google_breakpad diff --git a/src/common/linux/scoped_tmpfile.h b/src/common/linux/scoped_tmpfile.h new file mode 100644 index 000000000..dffec182f --- /dev/null +++ b/src/common/linux/scoped_tmpfile.h @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Utility class for creating a temporary file for that is deleted in the +// destructor. + +#ifndef COMMON_LINUX_SCOPED_TMPFILE_H_ +#define COMMON_LINUX_SCOPED_TMPFILE_H_ + +#include + +namespace google_breakpad { + +// Small RAII wrapper for temporary files. +// +// Example: +// ScopedTmpFile tmp; +// if (tmp.Init("Some file contents")) { +// ... +// } +class ScopedTmpFile { + public: + // Initialize the ScopedTmpFile object - this does not create the temporary + // file until Init is called. + ScopedTmpFile(); + + // Destroy temporary file on scope exit. + ~ScopedTmpFile(); + + // Creates the empty temporary file - returns true iff the temporary file was + // created successfully. Should always be checked before using the file. + bool InitEmpty(); + + // Creates the temporary file with the provided C string. The terminating null + // is not written. Returns true iff the temporary file was created + // successfully and the contents were written successfully. + bool InitString(const char* text); + + // Creates the temporary file with the provided data. Returns true iff the + // temporary file was created successfully and the contents were written + // successfully. + bool InitData(const void* data, size_t data_len); + + // Returns the Posix file descriptor for the test file, or -1 if Init() + // returned false. Note: on Windows, this always returns -1. + int GetFd() const { + return fd_; + } + + private: + // Set the contents of the temporary file, and seek back to the start of the + // file. On failure, returns false. + bool SetContents(const void* data, size_t data_len); + + int fd_ = -1; +}; + +} // namespace google_breakpad + +#endif // COMMON_LINUX_SCOPED_TMPFILE_H_ diff --git a/src/common/linux/scoped_tmpfile_unittest.cc b/src/common/linux/scoped_tmpfile_unittest.cc new file mode 100644 index 000000000..f82c5998b --- /dev/null +++ b/src/common/linux/scoped_tmpfile_unittest.cc @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// scoped_tmpfile_unittest.cc: Unit tests for google_breakpad::ScopedTmpfile. + +#include "common/linux/scoped_tmpfile.h" + +#include + +#include "breakpad_googletest_includes.h" + +using google_breakpad::ScopedTmpFile; + +TEST(ScopedTmpFileTest, CheckContentsMatch) { + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("Test")); + + char file_contents[5] = {0}; + ASSERT_EQ(4, read(file.GetFd(), file_contents, sizeof(file_contents))); + EXPECT_STREQ(file_contents, "Test"); +} diff --git a/src/common/linux/tests/auto_testfile.h b/src/common/linux/tests/auto_testfile.h deleted file mode 100644 index e2d2ff23b..000000000 --- a/src/common/linux/tests/auto_testfile.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2013 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Utility class for creating a temporary file for unit tests -// that is deleted in the destructor. - -#ifndef GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE -#define GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE - -#include -#include - -#include - -#include "breakpad_googletest_includes.h" -#include "common/linux/eintr_wrapper.h" -#include "common/tests/auto_tempdir.h" - -namespace google_breakpad { - -class AutoTestFile { - public: - // Create a new empty test file. - // test_prefix: (input) test-specific prefix, can't be NULL. - explicit AutoTestFile(const char* test_prefix) { - Init(test_prefix); - } - - // Create a new test file, and fill it with initial data from a C string. - // The terminating zero is not written. - // test_prefix: (input) test-specific prefix, can't be NULL. - // text: (input) initial content. - AutoTestFile(const char* test_prefix, const char* text) { - Init(test_prefix); - if (fd_ >= 0) - WriteText(text, static_cast(strlen(text))); - } - - AutoTestFile(const char* test_prefix, const char* text, size_t text_len) { - Init(test_prefix); - if (fd_ >= 0) - WriteText(text, text_len); - } - - // Destroy test file on scope exit. - ~AutoTestFile() { - if (fd_ >= 0) { - close(fd_); - fd_ = -1; - } - } - - // Returns true iff the test file could be created properly. - // Useful in tests inside EXPECT_TRUE(file.IsOk()); - bool IsOk() { - return fd_ >= 0; - } - - // Returns the Posix file descriptor for the test file, or -1 - // If IsOk() returns false. Note: on Windows, this always returns -1. - int GetFd() { - return fd_; - } - - private: - void Init(const char* test_prefix) { - fd_ = -1; - char path_templ[PATH_MAX]; - int ret = snprintf(path_templ, sizeof(path_templ), - TEMPDIR "/%s-unittest.XXXXXX", - test_prefix); - if (ret >= static_cast(sizeof(path_templ))) - return; - - fd_ = mkstemp(path_templ); - if (fd_ < 0) - return; - - unlink(path_templ); - } - - void WriteText(const char* text, size_t text_len) { - ssize_t r = HANDLE_EINTR(write(fd_, text, text_len)); - if (r != static_cast(text_len)) { - close(fd_); - fd_ = -1; - return; - } - - lseek(fd_, 0, SEEK_SET); - } - - int fd_; -}; - -} // namespace google_breakpad - -#endif // GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE From 5daa41904a02ab68b872758bc17a5d066244e5c2 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 30 Jan 2023 11:33:04 +0100 Subject: [PATCH 163/195] Add ScopedPipe. This provides a similar wrapper to ScopedTmpFile for linux pipes. Change-Id: I53b377085322f61d87525d215ecd703f13ae9ae7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3971918 Reviewed-by: Lei Zhang --- Makefile.am | 12 +++ Makefile.in | 77 ++++++++++++++ src/common/linux/scoped_pipe.cc | 128 +++++++++++++++++++++++ src/common/linux/scoped_pipe.h | 115 ++++++++++++++++++++ src/common/linux/scoped_pipe_unittest.cc | 71 +++++++++++++ 5 files changed, 403 insertions(+) create mode 100644 src/common/linux/scoped_pipe.cc create mode 100644 src/common/linux/scoped_pipe.h create mode 100644 src/common/linux/scoped_pipe_unittest.cc diff --git a/Makefile.am b/Makefile.am index dea7b53d4..da13cce12 100644 --- a/Makefile.am +++ b/Makefile.am @@ -223,6 +223,7 @@ check_PROGRAMS += \ if LINUX_HOST check_PROGRAMS += \ src/processor/disassembler_objdump_unittest \ + src/common/linux/scoped_pipe_unittest \ src/common/linux/scoped_tmpfile_unittest endif LINUX_HOST if SELFTEST @@ -558,6 +559,8 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ + src/common/linux/scoped_pipe.h \ + src/common/linux/scoped_pipe.cc \ src/common/linux/scoped_tmpfile.h \ src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ @@ -958,6 +961,15 @@ src_processor_exploitability_unittest_LDADD += \ src/processor/disassembler_objdump.o endif +src_common_linux_scoped_pipe_unittest_SOURCES = \ + src/common/linux/scoped_pipe_unittest.cc +src_common_linux_scoped_pipe_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_linux_scoped_pipe_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_common_linux_scoped_tmpfile_unittest_SOURCES = \ src/common/linux/scoped_tmpfile_unittest.cc src_common_linux_scoped_tmpfile_unittest_CPPFLAGS = \ diff --git a/Makefile.in b/Makefile.in index 33e374585..ef7e8fe69 100644 --- a/Makefile.in +++ b/Makefile.in @@ -194,6 +194,7 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__append_10 = \ @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/processor/disassembler_objdump_unittest \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe_unittest \ @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_11 = \ @@ -353,6 +354,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/processor/disassembler_objdump_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest$(EXEEXT) @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_7 = src/processor/stackwalker_selftest$(EXEEXT) @LINUX_HOST_TRUE@am__EXEEXT_8 = src/client/linux/linux_client_unittest$(EXEEXT) \ @@ -674,6 +676,7 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ + src/common/linux/scoped_pipe.h src/common/linux/scoped_pipe.cc \ src/common/linux/scoped_tmpfile.h \ src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ @@ -709,6 +712,7 @@ am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(OBJEXT) \ src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \ src/common/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \ @@ -813,6 +817,12 @@ src_common_linux_google_crashdump_uploader_test_OBJECTS = \ src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) +am_src_common_linux_scoped_pipe_unittest_OBJECTS = src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.$(OBJEXT) +src_common_linux_scoped_pipe_unittest_OBJECTS = \ + $(am_src_common_linux_scoped_pipe_unittest_OBJECTS) +src_common_linux_scoped_pipe_unittest_DEPENDENCIES = \ + src/common/linux/scoped_pipe.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_src_common_linux_scoped_tmpfile_unittest_OBJECTS = src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT) src_common_linux_scoped_tmpfile_unittest_OBJECTS = \ $(am_src_common_linux_scoped_tmpfile_unittest_OBJECTS) @@ -1531,6 +1541,7 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po \ + src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po \ @@ -1561,6 +1572,7 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/linux_libc_support.Po \ src/common/linux/$(DEPDIR)/memory_mapped_file.Po \ src/common/linux/$(DEPDIR)/safe_readlink.Po \ + src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po \ src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po \ src/common/linux/$(DEPDIR)/symbol_collector_client.Po \ src/common/linux/$(DEPDIR)/symbol_upload.Po \ @@ -1756,6 +1768,7 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_pipe_unittest_SOURCES) \ $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ @@ -1817,6 +1830,7 @@ DIST_SOURCES = \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_pipe_unittest_SOURCES) \ $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ @@ -2537,6 +2551,7 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \ src/common/linux/elf_core_dump.cc \ src/common/linux/linux_libc_support_unittest.cc \ + src/common/linux/scoped_pipe.h src/common/linux/scoped_pipe.cc \ src/common/linux/scoped_tmpfile.h \ src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ @@ -2927,6 +2942,17 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ $(am__append_27) +src_common_linux_scoped_pipe_unittest_SOURCES = \ + src/common/linux/scoped_pipe_unittest.cc + +src_common_linux_scoped_pipe_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_linux_scoped_pipe_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + src_common_linux_scoped_tmpfile_unittest_SOURCES = \ src/common/linux/scoped_tmpfile_unittest.cc @@ -4319,6 +4345,9 @@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT): \ src/common/linux/$(am__dirstamp) \ src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(OBJEXT): \ src/common/linux/$(am__dirstamp) \ src/common/linux/$(DEPDIR)/$(am__dirstamp) @@ -4568,6 +4597,13 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT): \ src/common/linux/google_crashdump_uploader_test$(EXEEXT): $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) $(EXTRA_src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) src/common/linux/$(am__dirstamp) @rm -f src/common/linux/google_crashdump_uploader_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_LDADD) $(LIBS) +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) + +src/common/linux/scoped_pipe_unittest$(EXEEXT): $(src_common_linux_scoped_pipe_unittest_OBJECTS) $(src_common_linux_scoped_pipe_unittest_DEPENDENCIES) $(EXTRA_src_common_linux_scoped_pipe_unittest_DEPENDENCIES) src/common/linux/$(am__dirstamp) + @rm -f src/common/linux/scoped_pipe_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_scoped_pipe_unittest_OBJECTS) $(src_common_linux_scoped_pipe_unittest_LDADD) $(LIBS) src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT): \ src/common/linux/$(am__dirstamp) \ src/common/linux/$(DEPDIR)/$(am__dirstamp) @@ -5365,6 +5401,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po@am__quote@ # am--include-marker @@ -5395,6 +5432,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_collector_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@ # am--include-marker @@ -5892,6 +5930,20 @@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_uni @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj `if test -f 'src/common/linux/linux_libc_support_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support_unittest.cc'; fi` +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o: src/common/linux/scoped_pipe.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o `test -f 'src/common/linux/scoped_pipe.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o `test -f 'src/common/linux/scoped_pipe.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe.cc + +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj: src/common/linux/scoped_pipe.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj `if test -f 'src/common/linux/scoped_pipe.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj `if test -f 'src/common/linux/scoped_pipe.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe.cc'; fi` + src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o: src/common/linux/scoped_tmpfile.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o `test -f 'src/common/linux/scoped_tmpfile.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po @@ -6844,6 +6896,20 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj: src/common/ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj `if test -f 'src/common/linux/libcurl_wrapper.cc'; then $(CYGPATH_W) 'src/common/linux/libcurl_wrapper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/libcurl_wrapper.cc'; fi` +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o: src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o `test -f 'src/common/linux/scoped_pipe_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe_unittest.cc' object='src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o `test -f 'src/common/linux/scoped_pipe_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe_unittest.cc + +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj: src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj `if test -f 'src/common/linux/scoped_pipe_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe_unittest.cc' object='src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj `if test -f 'src/common/linux/scoped_pipe_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe_unittest.cc'; fi` + src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o: src/common/linux/scoped_tmpfile_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o `test -f 'src/common/linux/scoped_tmpfile_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile_unittest.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po @@ -9109,6 +9175,13 @@ src/processor/disassembler_objdump_unittest.log: src/processor/disassembler_objd --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +src/common/linux/scoped_pipe_unittest.log: src/common/linux/scoped_pipe_unittest$(EXEEXT) + @p='src/common/linux/scoped_pipe_unittest$(EXEEXT)'; \ + b='src/common/linux/scoped_pipe_unittest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) src/common/linux/scoped_tmpfile_unittest.log: src/common/linux/scoped_tmpfile_unittest$(EXEEXT) @p='src/common/linux/scoped_tmpfile_unittest$(EXEEXT)'; \ b='src/common/linux/scoped_tmpfile_unittest'; \ @@ -9608,6 +9681,7 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po @@ -9638,6 +9712,7 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po @@ -9964,6 +10039,7 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po @@ -9994,6 +10070,7 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po diff --git a/src/common/linux/scoped_pipe.cc b/src/common/linux/scoped_pipe.cc new file mode 100644 index 000000000..b13f8d459 --- /dev/null +++ b/src/common/linux/scoped_pipe.cc @@ -0,0 +1,128 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/linux/scoped_pipe.h" + +#include + +#include "common/linux/eintr_wrapper.h" + +namespace google_breakpad { + +ScopedPipe::ScopedPipe() { + fds_[0] = -1; + fds_[1] = -1; +} + +ScopedPipe::~ScopedPipe() { + CloseReadFd(); + CloseWriteFd(); +} + +bool ScopedPipe::Init() { + return pipe(fds_) == 0; +} + +void ScopedPipe::CloseReadFd() { + if (fds_[0] != -1) { + close(fds_[0]); + fds_[0] = -1; + } +} + +void ScopedPipe::CloseWriteFd() { + if (fds_[1] != -1) { + close(fds_[1]); + fds_[1] = -1; + } +} + +bool ScopedPipe::ReadLine(std::string& line) { + // Simple buffered file read. `read_buffer_` stores previously read bytes, and + // we either return a line from this buffer, or we append blocks of read bytes + // to the buffer until we have a complete line. + size_t eol_index = read_buffer_.find('\n'); + + // While we don't have a full line, and read pipe is valid. + while (eol_index == std::string::npos && GetReadFd() != -1) { + // Read a block of 128 bytes from the read pipe. + char read_buf[128]; + ssize_t read_len = HANDLE_EINTR( + read(GetReadFd(), read_buf, sizeof(read_buf))); + if (read_len <= 0) { + // Pipe error, or pipe has been closed. + CloseReadFd(); + break; + } + + // Append the block, and check if we have a full line now. + read_buffer_.append(read_buf, read_len); + eol_index = read_buffer_.find('\n'); + } + + if (eol_index != std::string::npos) { + // We have a full line to output. + line = read_buffer_.substr(0, eol_index); + if (eol_index < read_buffer_.size()) { + read_buffer_ = read_buffer_.substr(eol_index + 1); + } else { + read_buffer_ = ""; + } + + return true; + } + + if (read_buffer_.size()) { + // We don't have a full line to output, but we can only reach here if the + // pipe has closed and there are some bytes left at the end, so we should + // return those bytes. + line = std::move(read_buffer_); + read_buffer_ = ""; + + return true; + } + + // We don't have any buffered data left, and the pipe has closed. + return false; +} + +int ScopedPipe::Dup2WriteFd(int new_fd) const { + return dup2(fds_[1], new_fd); +} + +bool ScopedPipe::WriteForTesting(const void* bytes, size_t bytes_len) { + ssize_t r = HANDLE_EINTR(write(GetWriteFd(), bytes, bytes_len)); + if (r != static_cast(bytes_len)) { + CloseWriteFd(); + return false; + } + + return true; +} + +} // namespace google_breakpad diff --git a/src/common/linux/scoped_pipe.h b/src/common/linux/scoped_pipe.h new file mode 100644 index 000000000..25394c2ab --- /dev/null +++ b/src/common/linux/scoped_pipe.h @@ -0,0 +1,115 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_LINUX_SCOPED_PIPE_H_ +#define COMMON_LINUX_SCOPED_PIPE_H_ + +#include +#include + +namespace google_breakpad { + +// Small RAII wrapper for a pipe pair. +// +// Example (both ends of pipe in same process): +// ScopedPipe tmp; +// std::string line; +// if (tmp.Init() && tmp.Write(bytes, bytes_len)) { +// tmp.CloseWriteFd(); +// while (tmp.ReadLine(&line)) { +// std::cerr << line << std::endl; +// } +// } +// +// Example (reading output from a child process): +// ScopedPipe tmp; +// if (fork()) { +// // Parent process, read from the read end of the pipe. +// std::string line; +// while (tmp.ReadLine(line)) { +// // Process output... +// } +// // Close read pipe once done processing the output that we wanted, this +// // should ensure that the child process exits even if we didn't read all +// // of the output. +// tmp.CloseReadFd(); +// // Parent process should handle waiting for child to exit here... +// } else { +// // Child process, close the read fd and dup the write fd before exec'ing. +// tmp.CloseReadFd(); +// tmp.Dup2WriteFd(STDOUT_FILENO); +// tmp.Dup2WriteFd(STDERR_FILENO); +// execl("some-command", "some-arguments"); +// } +class ScopedPipe { + public: + ScopedPipe(); + ~ScopedPipe(); + + // Creates the pipe pair - returns false on error. + bool Init(); + + // Close the read pipe. This only needs to be used when the read pipe needs to + // be closed earlier. + void CloseReadFd(); + + // Close the write pipe. This only needs to be used when the write pipe needs + // to be closed earlier. + void CloseWriteFd(); + + // Reads characters until newline or end of pipe. On read failure this will + // close the read pipe, but continue to return true and read buffered lines + // until the internal buffering is exhausted. This will block if there is no + // data available on the read pipe. + bool ReadLine(std::string& line); + + // Writes bytes to the write end of the pipe, returns false and closes write + // pipe on failure. + bool WriteForTesting(const void* bytes, size_t bytes_len); + + // Calls the dup2 system call to replace any existing open file descriptor + // with number new_fd with a copy of the current write end file descriptor + // for the pipe. + int Dup2WriteFd(int new_fd) const; + + private: + int GetReadFd() const { + return fds_[0]; + } + + int GetWriteFd() const { + return fds_[1]; + } + + int fds_[2]; + std::string read_buffer_; +}; + +} // namespace google_breakpad + +#endif // COMMON_LINUX_SCOPED_PIPE_H_ diff --git a/src/common/linux/scoped_pipe_unittest.cc b/src/common/linux/scoped_pipe_unittest.cc new file mode 100644 index 000000000..a7d6272cf --- /dev/null +++ b/src/common/linux/scoped_pipe_unittest.cc @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// scoped_pipe_unittest.cc: Unit tests for google_breakpad::ScopedPipe. + +#include "common/linux/scoped_pipe.h" + +#include "breakpad_googletest_includes.h" + +namespace google_breakpad { + +TEST(ScopedPipeTest, WriteAndClose) { + const char kTestData[] = "One\nTwo\nThree"; + ScopedPipe pipe; + std::string line; + + ASSERT_TRUE(pipe.Init()); + ASSERT_TRUE(pipe.WriteForTesting(kTestData, strlen(kTestData))); + pipe.CloseWriteFd(); + + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "One"); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Two"); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Three"); + ASSERT_FALSE(pipe.ReadLine(line)); +} + +TEST(ScopedPipeTest, MultipleWrites) { + const char kTestDataOne[] = "One\n"; + const char kTestDataTwo[] = "Two\n"; + ScopedPipe pipe; + std::string line; + + ASSERT_TRUE(pipe.Init()); + ASSERT_TRUE(pipe.WriteForTesting(kTestDataOne, strlen(kTestDataOne))); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "One"); + + ASSERT_TRUE(pipe.WriteForTesting(kTestDataTwo, strlen(kTestDataTwo))); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Two"); +} + +} // namespace google_breakpad From 38115b0c5f57544e88e108fa1616acfaa7b9d984 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 30 Jan 2023 11:33:54 +0100 Subject: [PATCH 164/195] Refactor DisassemblerObjdump. This change removes ScopedTmpFile from DisassemblerObjdump, and replaces it with the use of the implementation in linux/common. It also switches to using ScopedPipe to read the output from objdump, and directly execing objdump instead of using system. Change-Id: I6d425190fb4a20d6b265c72aa7315026687cb86a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3971919 Reviewed-by: Ivan Penkov --- Makefile.am | 32 ++++- Makefile.in | 111 +++++++++++------ src/processor/disassembler_objdump.cc | 172 ++++++++++++-------------- 3 files changed, 178 insertions(+), 137 deletions(-) diff --git a/Makefile.am b/Makefile.am index da13cce12..1d45f8e56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -454,9 +454,13 @@ src_libbreakpad_a_SOURCES = \ src/processor/tokenize.h if LINUX_HOST src_libbreakpad_a_SOURCES += \ - src/processor/disassembler_objdump.cc \ - src/processor/disassembler_objdump.h -endif LINUX_HOST + src/common/linux/scoped_pipe.h \ + src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc +endif # libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ @@ -958,6 +962,8 @@ src_processor_exploitability_unittest_LDADD = \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) if LINUX_HOST src_processor_exploitability_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o endif @@ -984,6 +990,8 @@ src_processor_disassembler_objdump_unittest_SOURCES = \ src_processor_disassembler_objdump_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) src_processor_disassembler_objdump_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1064,6 +1072,12 @@ src_processor_microdump_processor_unittest_LDADD = \ src/processor/tokenize.o \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_microdump_processor_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_processor_unittest_SOURCES = \ src/processor/minidump_processor_unittest.cc @@ -1109,6 +1123,8 @@ src_processor_minidump_processor_unittest_LDADD = \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) if LINUX_HOST src_processor_minidump_processor_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o endif @@ -1255,6 +1271,8 @@ src_processor_stackwalker_selftest_LDADD = \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) if LINUX_HOST src_processor_stackwalker_selftest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o endif @@ -1443,6 +1461,12 @@ src_processor_microdump_stackwalk_LDADD = \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ src/third_party/libdisasm/libdisasm.a +if LINUX_HOST +src_processor_microdump_stackwalk_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_stackwalk_SOURCES = \ src/processor/minidump_stackwalk.cc @@ -1487,6 +1511,8 @@ src_processor_minidump_stackwalk_LDADD = \ src/third_party/libdisasm/libdisasm.a if LINUX_HOST src_processor_minidump_stackwalk_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o endif LINUX_HOST diff --git a/Makefile.in b/Makefile.in index ef7e8fe69..d790cac43 100644 --- a/Makefile.in +++ b/Makefile.in @@ -248,8 +248,12 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest @LINUX_HOST_TRUE@am__append_22 = \ -@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.cc \ -@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.h +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.h \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.cc \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.h \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.cc \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.h \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.cc @HAVE_GETCONTEXT_FALSE@am__append_23 = \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S @@ -264,15 +268,33 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @ANDROID_HOST_TRUE@ -llog @LINUX_HOST_TRUE@am__append_27 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ @LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o @LINUX_HOST_TRUE@am__append_28 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ @LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o @LINUX_HOST_TRUE@am__append_29 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ @LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o @LINUX_HOST_TRUE@am__append_30 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_31 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_32 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ @LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o subdir = . @@ -569,9 +591,14 @@ am__src_libbreakpad_a_SOURCES_DIST = \ src/processor/symbolic_constants_win.cc \ src/processor/symbolic_constants_win.h \ src/processor/tokenize.cc src/processor/tokenize.h \ - src/processor/disassembler_objdump.cc \ - src/processor/disassembler_objdump.h + src/common/linux/scoped_pipe.h src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc @LINUX_HOST_TRUE@am__objects_2 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.$(OBJEXT) \ @LINUX_HOST_TRUE@ src/processor/disassembler_objdump.$(OBJEXT) am_src_libbreakpad_a_OBJECTS = \ src/processor/basic_code_modules.$(OBJEXT) \ @@ -903,6 +930,8 @@ am_src_processor_disassembler_objdump_unittest_OBJECTS = src/processor/disassemb src_processor_disassembler_objdump_unittest_OBJECTS = \ $(am_src_processor_disassembler_objdump_unittest_OBJECTS) src_processor_disassembler_objdump_unittest_DEPENDENCIES = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o src/processor/dump_object.o \ src/processor/logging.o src/processor/pathname_stripper.o \ @@ -999,7 +1028,7 @@ src_processor_microdump_processor_unittest_DEPENDENCIES = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_28) am_src_processor_microdump_stackwalk_OBJECTS = \ src/processor/microdump_stackwalk.$(OBJEXT) src_processor_microdump_stackwalk_OBJECTS = \ @@ -1031,7 +1060,7 @@ src_processor_microdump_stackwalk_DEPENDENCIES = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a + src/third_party/libdisasm/libdisasm.a $(am__append_31) am_src_processor_minidump_dump_OBJECTS = \ src/processor/minidump_dump.$(OBJEXT) src_processor_minidump_dump_OBJECTS = \ @@ -1076,7 +1105,7 @@ src_processor_minidump_processor_unittest_DEPENDENCIES = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__append_28) + $(am__DEPENDENCIES_1) $(am__append_29) am_src_processor_minidump_stackwalk_OBJECTS = \ src/processor/minidump_stackwalk.$(OBJEXT) src_processor_minidump_stackwalk_OBJECTS = \ @@ -1111,7 +1140,7 @@ src_processor_minidump_stackwalk_DEPENDENCIES = \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ - $(am__append_30) + $(am__append_32) am_src_processor_minidump_unittest_OBJECTS = src/common/processor_minidump_unittest-test_assembler.$(OBJEXT) \ src/processor/minidump_unittest-minidump_unittest.$(OBJEXT) \ src/processor/minidump_unittest-synth_minidump.$(OBJEXT) @@ -1252,7 +1281,7 @@ src_processor_stackwalker_selftest_DEPENDENCIES = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_29) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_30) am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \ src/processor/stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) src_processor_stackwalker_x86_unittest_OBJECTS = \ @@ -1572,7 +1601,9 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/linux_libc_support.Po \ src/common/linux/$(DEPDIR)/memory_mapped_file.Po \ src/common/linux/$(DEPDIR)/safe_readlink.Po \ + src/common/linux/$(DEPDIR)/scoped_pipe.Po \ src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po \ + src/common/linux/$(DEPDIR)/scoped_tmpfile.Po \ src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po \ src/common/linux/$(DEPDIR)/symbol_collector_client.Po \ src/common/linux/$(DEPDIR)/symbol_upload.Po \ @@ -2971,6 +3002,8 @@ src_processor_disassembler_objdump_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) src_processor_disassembler_objdump_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -3028,17 +3061,14 @@ src_processor_microdump_processor_unittest_SOURCES = \ src_processor_microdump_processor_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_processor_microdump_processor_unittest_LDADD = \ +src_processor_microdump_processor_unittest_LDADD = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o \ - src/processor/convert_old_arm64_context.o \ - src/processor/cfi_frame_info.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/logging.o \ - src/processor/microdump.o \ - src/processor/microdump_processor.o \ + src/processor/convert_old_arm64_context.o \ + src/processor/cfi_frame_info.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/logging.o \ + src/processor/microdump.o src/processor/microdump_processor.o \ src/processor/pathname_stripper.o \ src/processor/process_state.o \ src/processor/simple_symbol_supplier.o \ @@ -3055,11 +3085,9 @@ src_processor_microdump_processor_unittest_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - $(TEST_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_28) src_processor_minidump_processor_unittest_SOURCES = \ src/processor/minidump_processor_unittest.cc @@ -3096,7 +3124,7 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ - $(am__append_28) + $(am__append_29) src_processor_minidump_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/minidump_unittest.cc \ @@ -3253,7 +3281,7 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(am__append_29) + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(am__append_30) src_processor_stackwalker_amd64_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/stackwalker_amd64_unittest.cc @@ -3433,27 +3461,22 @@ src_processor_minidump_dump_LDADD = \ src_processor_microdump_stackwalk_SOURCES = \ src/processor/microdump_stackwalk.cc -src_processor_microdump_stackwalk_LDADD = \ - src/common/path_helper.o \ +src_processor_microdump_stackwalk_LDADD = src/common/path_helper.o \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o \ src/processor/convert_old_arm64_context.o \ src/processor/cfi_frame_info.o \ - src/processor/disassembler_x86.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/logging.o \ - src/processor/microdump.o \ - src/processor/microdump_processor.o \ + src/processor/disassembler_x86.o src/processor/dump_context.o \ + src/processor/dump_object.o src/processor/logging.o \ + src/processor/microdump.o src/processor/microdump_processor.o \ src/processor/pathname_stripper.o \ src/processor/process_state.o \ src/processor/simple_symbol_supplier.o \ src/processor/source_line_resolver_base.o \ src/processor/stack_frame_cpu.o \ src/processor/stack_frame_symbolizer.o \ - src/processor/stackwalk_common.o \ - src/processor/stackwalker.o \ + src/processor/stackwalk_common.o src/processor/stackwalker.o \ src/processor/stackwalker_address_list.o \ src/processor/stackwalker_amd64.o \ src/processor/stackwalker_arm.o \ @@ -3464,10 +3487,8 @@ src_processor_microdump_stackwalk_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a $(am__append_31) src_processor_minidump_stackwalk_SOURCES = \ src/processor/minidump_stackwalk.cc @@ -3501,7 +3522,7 @@ src_processor_minidump_stackwalk_LDADD = src/common/path_helper.o \ src/processor/stackwalker_x86.o \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ - $(am__append_30) + $(am__append_32) EXTRA_DIST = \ $(SCRIPTS) \ src/client/linux/data/linux-gate-amd.sym \ @@ -4197,6 +4218,12 @@ src/processor/symbolic_constants_win.$(OBJEXT): \ src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/tokenize.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) +src/common/linux/scoped_pipe.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/common/linux/scoped_tmpfile.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) src/processor/disassembler_objdump.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -5432,7 +5459,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_pipe.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_collector_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@ # am--include-marker @@ -9712,7 +9741,9 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe.Po -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po @@ -10070,7 +10101,9 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe.Po -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc index c6b6ac57f..f000b4b41 100644 --- a/src/processor/disassembler_objdump.cc +++ b/src/processor/disassembler_objdump.cc @@ -33,6 +33,9 @@ #include "processor/disassembler_objdump.h" #include +#include + +#include #include #include #include @@ -40,76 +43,15 @@ #include #include +#include "common/linux/eintr_wrapper.h" +#include "common/linux/scoped_pipe.h" +#include "common/linux/scoped_tmpfile.h" #include "processor/logging.h" namespace google_breakpad { namespace { -const size_t kMaxX86InstructionLength = 15; - -// Small RAII wrapper for temporary files. -// -// Example: -// ScopedTmpFile tmp("/tmp/tmpfile-XXXX"); -// if (tmp.Create()) { -// std::cerr << tmp.path() << std::endl; -// } -class ScopedTmpFile { - public: - // Initialize the ScopedTmpFile object - this does not create the temporary - // file yet. - ScopedTmpFile(const char* path_format); - ~ScopedTmpFile(); - - // Creates the temporary file, returns true on success. - bool Create(); - - // Writes bytes to the temporary file, returns true on success. - bool Write(const uint8_t* bytes, unsigned int bytes_len); - - // Returns the path of the temporary file. - string path() const { return path_; } - - private: - int fd_; - string path_; -}; - -ScopedTmpFile::ScopedTmpFile(const char* path_format) : path_(path_format) {} - -ScopedTmpFile::~ScopedTmpFile() { - if (fd_) { - close(fd_); - unlink(path_.c_str()); - } -} - -bool ScopedTmpFile::Create() { - fd_ = mkstemp(path_.data()); - if (fd_ < 0) { - unlink(path_.c_str()); - fd_ = 0; - path_ = ""; - return false; - } - return true; -} - -bool ScopedTmpFile::Write(const uint8_t* bytes, unsigned int bytes_len) { - if (fd_) { - do { - ssize_t result = write(fd_, bytes, bytes_len); - if (result < 0) { - break; - } - - bytes += result; - bytes_len -= result; - } while (bytes_len); - } - - return bytes_len == 0; -} +const size_t kMaxX86InstructionLength = 15; bool IsInstructionPrefix(const string& token) { if (token == "lock" || token == "rep" || token == "repz" || @@ -284,47 +226,87 @@ bool DisassemblerObjdump::DisassembleInstruction(uint32_t cpu, return false; } - // Create two temporary files, one for the raw instruction bytes to pass to - // objdump, and one for the output, and write the bytes to the input file. - ScopedTmpFile raw_bytes_file("/tmp/breakpad_mem_region-raw_bytes-XXXXXX"); - ScopedTmpFile disassembly_file("/tmp/breakpad_mem_region-disassembly-XXXXXX"); - if (!raw_bytes_file.Create() || !disassembly_file.Create() || - !raw_bytes_file.Write(raw_bytes, raw_bytes_len)) { - BPLOG(ERROR) << "Failed creating temporary files."; + // Create a temporary file for the raw instruction bytes to pass to + // objdump, and write the bytes to the input file. + ScopedTmpFile raw_bytes_file; + if (!raw_bytes_file.InitData(raw_bytes, raw_bytes_len)) { + BPLOG(ERROR) << "Failed creating temporary file."; return false; } - char cmd[1024] = {0}; - snprintf(cmd, 1024, - "objdump -D --no-show-raw-insn -b binary -M intel -m %s %s > %s", - architecture.c_str(), raw_bytes_file.path().c_str(), - disassembly_file.path().c_str()); - if (system(cmd)) { - BPLOG(ERROR) << "Failed to call objdump."; + // Create a pipe to use to read the disassembly back from objdump. + ScopedPipe disassembly_pipe; + if (!disassembly_pipe.Init()) { + BPLOG(ERROR) << "Failed creating pipe for output."; return false; } - // Pipe each output line into the string until the string contains the first - // instruction from objdump. - std::ifstream objdump_stream(disassembly_file.path()); + pid_t child_pid = fork(); + if (child_pid < 0) { + BPLOG(ERROR) << "Fork failed."; + return false; + } - // Match the instruction line, from: - // 0: lock cmpxchg DWORD PTR [esi+0x10],eax - // extract the string "lock cmpxchg DWORD PTR [esi+0x10],eax" - std::regex instruction_regex( - "^\\s+[0-9a-f]+:\\s+" // " 0:" - "((?:\\s*\\S*)+)$"); // "lock cmpxchg..." + if (child_pid == 0) { + // In the child process, set up the input and output file descriptors. + if (dup2(raw_bytes_file.GetFd(), STDIN_FILENO) < 0 || + disassembly_pipe.Dup2WriteFd(STDOUT_FILENO) < 0 || + disassembly_pipe.Dup2WriteFd(STDERR_FILENO) < 0) { + BPLOG(ERROR) << "Failed dup'ing file descriptors."; + exit(-1); + } - std::string line; - std::smatch match; - do { - if (!getline(objdump_stream, line)) { - BPLOG(INFO) << "Failed to find instruction in objdump output."; + // We need to close the read end of the pipe in the child process so that + // when the parent closes it, the pipe is disconnected. + disassembly_pipe.CloseReadFd(); + + // We use "/proc/self/fd/0" here to allow objdump to parse an unnamed file, + // since objdump does not have a mode to read from stdin. This cannot be + // used with a pipe, since objdump requires that the input is a standard + // file. + execlp("objdump", "objdump", "-D", "--no-show-raw-insn", "-b", "binary", + "-M", "intel", "-m", architecture.c_str(), "/proc/self/fd/0", + nullptr); + + BPLOG(ERROR) << "Failed to exec objdump."; + exit(-1); + } else { + // In the parent process, parse the objdump output. + + // Match the instruction line, from: + // 0: lock cmpxchg DWORD PTR [esi+0x10],eax + // extract the string "lock cmpxchg DWORD PTR [esi+0x10],eax" + std::regex instruction_regex( + "^\\s+[0-9a-f]+:\\s+" // " 0:" + "((?:\\s*\\S*)+)$"); // "lock cmpxchg..." + + std::string line; + std::smatch match; + while (disassembly_pipe.ReadLine(line)) { + if (std::regex_match(line, match, instruction_regex)) { + instruction = match[1].str(); + break; + } + } + + // Close the read pipe so that objdump will exit (in case we broke out of + // the loop above before reading all of the output). + disassembly_pipe.CloseReadFd(); + + // Now wait for objdump to exit. + int status = 0; + HANDLE_EINTR(waitpid(child_pid, &status, 0)); + + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + BPLOG(ERROR) << "objdump didn't run successfully."; return false; } - } while (!std::regex_match(line, match, instruction_regex)); - instruction = match[1].str(); + if (instruction == "") { + BPLOG(ERROR) << "Failed to find instruction in objdump output."; + return false; + } + } return true; } From bc25ffb613086afa4184af3aca1722ff747a21fc Mon Sep 17 00:00:00 2001 From: Hiroyuki Komatsu Date: Mon, 6 Feb 2023 21:02:22 +0900 Subject: [PATCH 165/195] Change CLANG_CXX_LANGUAGE_STANDARD from "c++0x" to "c++17". * This fixes build errors with `xcodebuild`. * CLANG_CXX_LANGUAGE_STANDARD represents "-std" (e.g. "=std=c++17"). Change-Id: Ibeeccb2d77518d2e767a6cf4840ff673427d98ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4218220 Reviewed-by: Mike Frysinger Reviewed-by: Nelson Billing --- src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj | 4 ++-- src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj index 5b644e24c..c98b6ac54 100644 --- a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj +++ b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj @@ -1251,7 +1251,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; HEADER_SEARCH_PATHS = ( ../../.., ../../../common/mac/include/, @@ -1264,7 +1264,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; HEADER_SEARCH_PATHS = ( ../../.., ../../../common/mac/include/, diff --git a/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj b/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj index 903c66f15..b1dd6a112 100644 --- a/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj +++ b/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ 1DEB927508733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; HEADER_SEARCH_PATHS = ( ../../.., @@ -385,7 +385,7 @@ 1DEB927608733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NDEBUG, From 5687ac51caab4f7100ddcb9dea92ca6bd6be66e7 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Tue, 7 Feb 2023 15:44:24 -0500 Subject: [PATCH 166/195] Fix Mac build https://chromium.googlesource.com/breakpad/breakpad/+/f6178140175800cc6385a151e7f23d6e5c4968ca missed marking `IsCanonicalAddress` Linux-only. Bug: None Change-Id: Ia936db4b5541f22abcc884d410e7eae3818b4c0f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4227418 Reviewed-by: Mark Mentovai --- src/processor/minidump_processor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index d72926cb5..0073ae4e5 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -763,6 +763,8 @@ bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump, return true; } +#ifdef __linux__ + static bool IsCanonicalAddress(uint64_t address) { uint64_t sign_bit = (address >> 63) & 1; for (int shift = 48; shift < 63; ++shift) { @@ -773,7 +775,6 @@ static bool IsCanonicalAddress(uint64_t address) { return true; } -#ifdef __linux__ static void CalculateFaultAddressFromInstruction(Minidump* dump, uint64_t* address) { MinidumpException* exception = dump->GetException(); From 5f72a811c1304885766d8594ae12f57709387b72 Mon Sep 17 00:00:00 2001 From: Xinan Lin Date: Sat, 11 Feb 2023 18:26:02 +0900 Subject: [PATCH 167/195] [linux] Report error message if failed to send http request If symupload client failed to connect the backend, we need this error message to be exposed. This could help the failure we are facing in official staging builders. BUG=chromium:1401761 TEST=NA Change-Id: Ic720aff9cb523c38553d6c02bf72aa5b95e862a7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4240299 Reviewed-by: Nelson Billing --- src/common/linux/libcurl_wrapper.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc index a53087d9c..c4a174a8a 100644 --- a/src/common/linux/libcurl_wrapper.cc +++ b/src/common/linux/libcurl_wrapper.cc @@ -303,12 +303,10 @@ bool LibcurlWrapper::SendRequestInner(const string& url, (*easy_getinfo_)(curl_, CURLINFO_RESPONSE_CODE, http_status_code); } -#ifndef NDEBUG if (err_code != CURLE_OK) fprintf(stderr, "Failed to send http request to %s, error: %s\n", url.c_str(), (*easy_strerror_)(err_code)); -#endif Reset(); From 984e043d7999c866d20b7bc08eb1c1d641ca9266 Mon Sep 17 00:00:00 2001 From: Brian Sheedy Date: Thu, 16 Feb 2023 10:51:13 -0800 Subject: [PATCH 168/195] Print Crashpad annotation objects Updates minidump_dump to print out any Crashpad annotation objects that are in a minidump. If an annotation contains a string value, it will be printed out as such, otherwise it will be printed out as hex bytes. Bug: crashpad:329 Change-Id: Ieecd6381c623f9011b16357742f7145a118dbc3c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4261631 Reviewed-by: Joshua Peraza --- src/processor/minidump.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 135770d50..2df932f41 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -5479,6 +5479,27 @@ void MinidumpCrashpadInfo::Print() { printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n", module_index, annot.first.c_str(), annot.second.c_str()); } + const auto& crashpad_annots = + module_crashpad_info_annotation_objects_[module_index]; + for (const AnnotationObject& annot : crashpad_annots) { + std::string str_value; + if (annot.type == 1) { + // Value represents a C-style string. + for (const uint8_t& v : annot.value) { + str_value.append(1, static_cast(v)); + } + } else { + // Value represents something else. + char buffer[3]; + for (const uint8_t& v : annot.value) { + sprintf(buffer, "%X", v); + str_value.append(buffer); + } + } + printf( + " module_list[%d].crashpad_annotations[\"%s\"] (type = %u) = %s\n", + module_index, annot.name.c_str(), annot.type, str_value.c_str()); + } printf(" address_mask = %" PRIu64 "\n", crashpad_info_.address_mask); } From abb105db21e962eda5b7d9b7a0ac8dd701e0b987 Mon Sep 17 00:00:00 2001 From: Brian Sheedy Date: Thu, 16 Feb 2023 12:35:22 -0800 Subject: [PATCH 169/195] Fix sprintf usage Changes a recent introduction of sprintf to snprintf since sprintf is deprecated in Chromium. Bug: crashpad:329 Change-Id: Icd346da4c86bd8e867266dfebaf617991dd90113 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4261633 Reviewed-by: Joshua Peraza --- src/processor/minidump.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 2df932f41..8c4f75d63 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -5492,7 +5492,7 @@ void MinidumpCrashpadInfo::Print() { // Value represents something else. char buffer[3]; for (const uint8_t& v : annot.value) { - sprintf(buffer, "%X", v); + snprintf(buffer, sizeof(buffer), "%X", v); str_value.append(buffer); } } From f5123d71965578abf905d6388a79a232597bb1eb Mon Sep 17 00:00:00 2001 From: Ian Barkley-Yeung Date: Fri, 24 Feb 2023 11:14:53 -0800 Subject: [PATCH 170/195] Add #include to the beginning of all cc files Added #ifdef HAVE_CONFIG_H #include #endif to the beginning of all source files that didn't have it. This ensures that configuration options are respected in all source files. In particular, it ensures that the defines needed to fix Large File System issues are set before including system headers. More generally, it ensures consistency between the source files, and avoids the possibility of ODR violations between source files that were including config.h and source files that were not. Process: Ran find . \( -name third_party -prune \) -o \( -name '.git*' -prune \) -o \( \( -name '*.cc' -o -name '*.c' \) -exec sed -i '0,/^#include/ s/^#include/#ifdef HAVE_CONFIG_H\n#include \/\/ Must come first\n#endif\n\n#include/' {} + \) and then manually fixed up src/common/linux/guid_creator.cc, src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc, src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc, src/common/stabs_reader.h, and src/common/linux/breakpad_getcontext.h. BUG=google-breakpad:877 Fixed: google-breakpad:877 TEST=./configure && make && make check TEST=Did the find/sed in ChromeOS's copy, ensured emerge-hana google-breakpad worked and had fewer LFS violations. TEST=Did the find/sed in Chrome's copy, ensured compiling hana, windows, linux, and eve still worked (since Chrome doesn't used config.h) Change-Id: I16cededbba0ea0c28e919b13243e35300999e799 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4289676 Reviewed-by: Mike Frysinger --- src/client/ios/exception_handler_no_mach.cc | 4 ++++ src/client/linux/crash_generation/crash_generation_client.cc | 4 ++++ src/client/linux/crash_generation/crash_generation_server.cc | 4 ++++ src/client/linux/dump_writer_common/thread_info.cc | 4 ++++ src/client/linux/dump_writer_common/ucontext_reader.cc | 4 ++++ src/client/linux/handler/exception_handler.cc | 4 ++++ src/client/linux/handler/exception_handler_unittest.cc | 4 ++++ src/client/linux/handler/minidump_descriptor.cc | 4 ++++ src/client/linux/log/log.cc | 4 ++++ src/client/linux/microdump_writer/microdump_writer.cc | 4 ++++ .../linux/microdump_writer/microdump_writer_unittest.cc | 4 ++++ src/client/linux/minidump_writer/cpu_set_unittest.cc | 4 ++++ .../linux/minidump_writer/directory_reader_unittest.cc | 4 ++++ src/client/linux/minidump_writer/line_reader_unittest.cc | 4 ++++ src/client/linux/minidump_writer/linux_core_dumper.cc | 4 ++++ .../linux/minidump_writer/linux_core_dumper_unittest.cc | 4 ++++ src/client/linux/minidump_writer/linux_dumper.cc | 4 ++++ .../linux/minidump_writer/linux_dumper_unittest_helper.cc | 4 ++++ src/client/linux/minidump_writer/linux_ptrace_dumper.cc | 4 ++++ .../linux/minidump_writer/linux_ptrace_dumper_unittest.cc | 4 ++++ src/client/linux/minidump_writer/minidump_writer.cc | 4 ++++ src/client/linux/minidump_writer/minidump_writer_unittest.cc | 4 ++++ .../linux/minidump_writer/minidump_writer_unittest_utils.cc | 4 ++++ src/client/linux/minidump_writer/pe_file.cc | 4 ++++ .../linux/minidump_writer/proc_cpuinfo_reader_unittest.cc | 4 ++++ src/client/linux/sender/google_crash_report_sender.cc | 4 ++++ src/client/mac/crash_generation/crash_generation_client.cc | 4 ++++ src/client/mac/crash_generation/crash_generation_server.cc | 4 ++++ src/client/mac/handler/breakpad_nlist_64.cc | 4 ++++ src/client/mac/handler/dynamic_images.cc | 4 ++++ src/client/mac/handler/exception_handler.cc | 4 ++++ src/client/mac/handler/minidump_generator.cc | 4 ++++ src/client/mac/handler/protected_memory_allocator.cc | 4 ++++ src/client/mac/handler/testcases/DynamicImagesTests.cc | 4 ++++ src/client/mac/handler/testcases/breakpad_nlist_test.cc | 4 ++++ src/client/mac/tests/crash_generation_server_test.cc | 4 ++++ src/client/mac/tests/exception_handler_test.cc | 4 ++++ src/client/mac/tests/minidump_generator_test.cc | 4 ++++ src/client/mac/tests/minidump_generator_test_helper.cc | 4 ++++ src/client/minidump_file_writer.cc | 4 ++++ src/client/minidump_file_writer_unittest.cc | 4 ++++ src/client/solaris/handler/exception_handler.cc | 4 ++++ src/client/solaris/handler/exception_handler_test.cc | 4 ++++ src/client/solaris/handler/minidump_generator.cc | 4 ++++ src/client/solaris/handler/minidump_test.cc | 4 ++++ src/client/solaris/handler/solaris_lwp.cc | 4 ++++ src/client/windows/crash_generation/client_info.cc | 4 ++++ .../windows/crash_generation/crash_generation_client.cc | 4 ++++ .../windows/crash_generation/crash_generation_server.cc | 4 ++++ src/client/windows/crash_generation/minidump_generator.cc | 4 ++++ src/client/windows/handler/exception_handler.cc | 4 ++++ src/client/windows/sender/crash_report_sender.cc | 4 ++++ .../windows/tests/crash_generation_app/abstract_class.cc | 4 ++++ .../tests/crash_generation_app/crash_generation_app.cc | 4 ++++ src/client/windows/unittests/crash_generation_server_test.cc | 4 ++++ src/client/windows/unittests/dump_analysis.cc | 4 ++++ src/client/windows/unittests/exception_handler_death_test.cc | 4 ++++ .../windows/unittests/exception_handler_nesting_test.cc | 4 ++++ src/client/windows/unittests/exception_handler_test.cc | 4 ++++ src/client/windows/unittests/minidump_test.cc | 4 ++++ src/common/byte_cursor_unittest.cc | 4 ++++ src/common/convert_UTF.cc | 4 ++++ src/common/dwarf/bytereader.cc | 4 ++++ src/common/dwarf/bytereader_unittest.cc | 4 ++++ src/common/dwarf/cfi_assembler.cc | 4 ++++ src/common/dwarf/dwarf2diehandler.cc | 4 ++++ src/common/dwarf/dwarf2diehandler_unittest.cc | 4 ++++ src/common/dwarf/dwarf2reader.cc | 4 ++++ src/common/dwarf/dwarf2reader_cfi_unittest.cc | 4 ++++ src/common/dwarf/dwarf2reader_die_unittest.cc | 4 ++++ src/common/dwarf/dwarf2reader_lineinfo_unittest.cc | 4 ++++ src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc | 4 ++++ src/common/dwarf/elf_reader.cc | 4 ++++ src/common/dwarf/functioninfo.cc | 4 ++++ src/common/dwarf_cfi_to_module.cc | 4 ++++ src/common/dwarf_cfi_to_module_unittest.cc | 4 ++++ src/common/dwarf_cu_to_module.cc | 4 ++++ src/common/dwarf_cu_to_module_unittest.cc | 4 ++++ src/common/dwarf_line_to_module.cc | 4 ++++ src/common/dwarf_line_to_module_unittest.cc | 4 ++++ src/common/dwarf_range_list_handler.cc | 4 ++++ src/common/language.cc | 4 ++++ src/common/linux/breakpad_getcontext.h | 4 ---- src/common/linux/breakpad_getcontext_unittest.cc | 4 ++++ src/common/linux/crc32.cc | 4 ++++ src/common/linux/dump_symbols.cc | 4 ++++ src/common/linux/dump_symbols_unittest.cc | 4 ++++ src/common/linux/elf_core_dump.cc | 4 ++++ src/common/linux/elf_core_dump_unittest.cc | 4 ++++ src/common/linux/elf_symbols_to_module.cc | 4 ++++ src/common/linux/elf_symbols_to_module_unittest.cc | 4 ++++ src/common/linux/elfutils.cc | 4 ++++ src/common/linux/file_id.cc | 4 ++++ src/common/linux/file_id_unittest.cc | 4 ++++ src/common/linux/google_crashdump_uploader.cc | 4 ++++ src/common/linux/google_crashdump_uploader_test.cc | 4 ++++ src/common/linux/guid_creator.cc | 2 +- src/common/linux/http_upload.cc | 4 ++++ src/common/linux/libcurl_wrapper.cc | 4 ++++ src/common/linux/linux_libc_support.cc | 4 ++++ src/common/linux/linux_libc_support_unittest.cc | 4 ++++ src/common/linux/memory_mapped_file.cc | 4 ++++ src/common/linux/memory_mapped_file_unittest.cc | 4 ++++ src/common/linux/safe_readlink.cc | 4 ++++ src/common/linux/safe_readlink_unittest.cc | 4 ++++ src/common/linux/scoped_pipe.cc | 4 ++++ src/common/linux/scoped_pipe_unittest.cc | 4 ++++ src/common/linux/scoped_tmpfile.cc | 4 ++++ src/common/linux/scoped_tmpfile_unittest.cc | 4 ++++ src/common/linux/symbol_collector_client.cc | 4 ++++ src/common/linux/symbol_upload.cc | 4 ++++ src/common/linux/synth_elf.cc | 4 ++++ src/common/linux/synth_elf_unittest.cc | 4 ++++ src/common/linux/tests/crash_generator.cc | 4 ++++ src/common/long_string_dictionary.cc | 4 ++++ src/common/long_string_dictionary_unittest.cc | 4 ++++ src/common/mac/arch_utilities.cc | 4 ++++ src/common/mac/bootstrap_compat.cc | 4 ++++ src/common/mac/dump_syms.cc | 4 ++++ src/common/mac/file_id.cc | 4 ++++ src/common/mac/launch_reporter.cc | 4 ++++ src/common/mac/macho_id.cc | 4 ++++ src/common/mac/macho_reader.cc | 4 ++++ src/common/mac/macho_reader_unittest.cc | 4 ++++ src/common/mac/macho_utilities.cc | 4 ++++ src/common/mac/macho_walker.cc | 4 ++++ src/common/mac/string_utilities.cc | 4 ++++ src/common/md5.cc | 4 ++++ src/common/memory_allocator_unittest.cc | 4 ++++ src/common/memory_range_unittest.cc | 4 ++++ src/common/module.cc | 4 ++++ src/common/module_unittest.cc | 4 ++++ src/common/path_helper.cc | 4 ++++ src/common/safe_math_unittest.cc | 4 ++++ src/common/simple_string_dictionary.cc | 4 ++++ src/common/simple_string_dictionary_unittest.cc | 4 ++++ src/common/solaris/dump_symbols.cc | 4 ++++ src/common/solaris/file_id.cc | 4 ++++ src/common/solaris/guid_creator.cc | 4 ++++ src/common/stabs_reader.cc | 4 ++++ src/common/stabs_reader.h | 4 ---- src/common/stabs_reader_unittest.cc | 4 ++++ src/common/stabs_to_module.cc | 4 ++++ src/common/stabs_to_module_unittest.cc | 4 ++++ src/common/string_conversion.cc | 4 ++++ src/common/string_conversion_unittest.cc | 4 ++++ src/common/test_assembler.cc | 4 ++++ src/common/test_assembler_unittest.cc | 4 ++++ src/common/tests/file_utils.cc | 4 ++++ src/common/windows/dia_util.cc | 4 ++++ src/common/windows/guid_string.cc | 4 ++++ src/common/windows/http_upload.cc | 4 ++++ src/common/windows/omap.cc | 4 ++++ src/common/windows/omap_unittest.cc | 4 ++++ src/common/windows/pdb_source_line_writer.cc | 4 ++++ src/common/windows/pe_source_line_writer.cc | 4 ++++ src/common/windows/pe_util.cc | 4 ++++ src/common/windows/string_utils.cc | 4 ++++ src/common/windows/sym_upload_v2_protocol.cc | 4 ++++ src/common/windows/symbol_collector_client.cc | 4 ++++ src/processor/address_map_unittest.cc | 4 ++++ src/processor/basic_code_modules.cc | 4 ++++ src/processor/basic_source_line_resolver.cc | 4 ++++ src/processor/basic_source_line_resolver_unittest.cc | 4 ++++ src/processor/call_stack.cc | 4 ++++ src/processor/cfi_frame_info.cc | 4 ++++ src/processor/cfi_frame_info_unittest.cc | 4 ++++ src/processor/contained_range_map_unittest.cc | 4 ++++ src/processor/convert_old_arm64_context.cc | 4 ++++ src/processor/disassembler_objdump.cc | 4 ++++ src/processor/disassembler_objdump_unittest.cc | 4 ++++ src/processor/disassembler_x86.cc | 4 ++++ src/processor/disassembler_x86_unittest.cc | 4 ++++ src/processor/dump_context.cc | 4 ++++ src/processor/dump_object.cc | 4 ++++ src/processor/exploitability.cc | 4 ++++ src/processor/exploitability_linux.cc | 4 ++++ src/processor/exploitability_unittest.cc | 4 ++++ src/processor/exploitability_win.cc | 4 ++++ src/processor/fast_source_line_resolver.cc | 4 ++++ src/processor/fast_source_line_resolver_unittest.cc | 4 ++++ src/processor/logging.cc | 4 ++++ src/processor/map_serializers_unittest.cc | 4 ++++ src/processor/microdump.cc | 4 ++++ src/processor/microdump_processor.cc | 4 ++++ src/processor/microdump_processor_unittest.cc | 4 ++++ src/processor/microdump_stackwalk.cc | 4 ++++ src/processor/minidump.cc | 4 ++++ src/processor/minidump_dump.cc | 4 ++++ src/processor/minidump_processor.cc | 4 ++++ src/processor/minidump_processor_unittest.cc | 4 ++++ src/processor/minidump_stackwalk.cc | 4 ++++ src/processor/minidump_unittest.cc | 4 ++++ src/processor/module_comparer.cc | 4 ++++ src/processor/module_serializer.cc | 4 ++++ src/processor/pathname_stripper.cc | 4 ++++ src/processor/pathname_stripper_unittest.cc | 4 ++++ src/processor/postfix_evaluator_unittest.cc | 4 ++++ src/processor/proc_maps_linux.cc | 4 ++++ src/processor/proc_maps_linux_unittest.cc | 4 ++++ src/processor/process_state.cc | 4 ++++ src/processor/range_map_truncate_lower_unittest.cc | 4 ++++ src/processor/range_map_truncate_upper_unittest.cc | 4 ++++ src/processor/range_map_unittest.cc | 4 ++++ src/processor/simple_symbol_supplier.cc | 4 ++++ src/processor/source_line_resolver_base.cc | 4 ++++ src/processor/stack_frame_cpu.cc | 4 ++++ src/processor/stack_frame_symbolizer.cc | 4 ++++ src/processor/stackwalk_common.cc | 4 ++++ src/processor/stackwalker.cc | 4 ++++ src/processor/stackwalker_address_list.cc | 4 ++++ src/processor/stackwalker_address_list_unittest.cc | 4 ++++ src/processor/stackwalker_amd64.cc | 4 ++++ src/processor/stackwalker_amd64_unittest.cc | 4 ++++ src/processor/stackwalker_arm.cc | 4 ++++ src/processor/stackwalker_arm64.cc | 4 ++++ src/processor/stackwalker_arm64_unittest.cc | 4 ++++ src/processor/stackwalker_arm_unittest.cc | 4 ++++ src/processor/stackwalker_mips.cc | 4 ++++ src/processor/stackwalker_mips64_unittest.cc | 4 ++++ src/processor/stackwalker_mips_unittest.cc | 4 ++++ src/processor/stackwalker_ppc.cc | 4 ++++ src/processor/stackwalker_ppc64.cc | 4 ++++ src/processor/stackwalker_riscv.cc | 4 ++++ src/processor/stackwalker_riscv64.cc | 4 ++++ src/processor/stackwalker_riscv64_unittest.cc | 4 ++++ src/processor/stackwalker_riscv_unittest.cc | 4 ++++ src/processor/stackwalker_selftest.cc | 4 ++++ src/processor/stackwalker_sparc.cc | 4 ++++ src/processor/stackwalker_x86.cc | 4 ++++ src/processor/stackwalker_x86_unittest.cc | 4 ++++ src/processor/static_address_map_unittest.cc | 4 ++++ src/processor/static_contained_range_map_unittest.cc | 4 ++++ src/processor/static_map_unittest.cc | 4 ++++ src/processor/static_range_map_unittest.cc | 4 ++++ src/processor/symbolic_constants_win.cc | 4 ++++ src/processor/synth_minidump.cc | 4 ++++ src/processor/synth_minidump_unittest.cc | 4 ++++ src/processor/testdata/linux_test_app.cc | 4 ++++ src/processor/testdata/test_app.cc | 4 ++++ src/processor/tokenize.cc | 4 ++++ src/tools/linux/core2md/core2md.cc | 4 ++++ src/tools/linux/core_handler/core_handler.cc | 4 ++++ src/tools/linux/dump_syms/dump_syms.cc | 4 ++++ src/tools/linux/md2core/minidump-2-core.cc | 4 ++++ src/tools/linux/md2core/minidump_memory_range_unittest.cc | 4 ++++ src/tools/linux/pid2md/pid2md.cc | 4 ++++ src/tools/linux/symupload/minidump_upload.cc | 4 ++++ src/tools/linux/symupload/sym_upload.cc | 4 ++++ src/tools/mac/dump_syms/dump_syms_tool.cc | 4 ++++ src/tools/mac/dump_syms/macho_dump.cc | 4 ++++ src/tools/solaris/dump_syms/dump_syms.cc | 4 ++++ src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc | 4 ++++ src/tools/windows/converter/ms_symbol_server_converter.cc | 4 ++++ src/tools/windows/converter_exe/converter.cc | 4 ++++ src/tools/windows/converter_exe/escaping.cc | 4 ++++ src/tools/windows/converter_exe/http_download.cc | 4 ++++ src/tools/windows/converter_exe/tokenizer.cc | 4 ++++ src/tools/windows/converter_exe/winhttp_client.cc | 4 ++++ src/tools/windows/converter_exe/wininet_client.cc | 4 ++++ src/tools/windows/dump_syms/dump_syms.cc | 4 ++++ src/tools/windows/dump_syms/dump_syms_unittest.cc | 4 ++++ src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc | 5 +++++ src/tools/windows/symupload/symupload.cc | 4 ++++ 264 files changed, 1046 insertions(+), 9 deletions(-) diff --git a/src/client/ios/exception_handler_no_mach.cc b/src/client/ios/exception_handler_no_mach.cc index 6bb410210..0b2182ea7 100644 --- a/src/client/ios/exception_handler_no_mach.cc +++ b/src/client/ios/exception_handler_no_mach.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/linux/crash_generation/crash_generation_client.cc b/src/client/linux/crash_generation/crash_generation_client.cc index 5a8c6b4c9..f06273d58 100644 --- a/src/client/linux/crash_generation/crash_generation_client.cc +++ b/src/client/linux/crash_generation/crash_generation_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/crash_generation/crash_generation_client.h" #include diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc index 56cc0cd7b..e3270c9d4 100644 --- a/src/client/linux/crash_generation/crash_generation_server.cc +++ b/src/client/linux/crash_generation/crash_generation_server.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/dump_writer_common/thread_info.cc b/src/client/linux/dump_writer_common/thread_info.cc index d8bf80b0c..fc82c0c62 100644 --- a/src/client/linux/dump_writer_common/thread_info.cc +++ b/src/client/linux/dump_writer_common/thread_info.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/dump_writer_common/thread_info.h" #include diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc index 97ed2a9f4..c6a8e9aad 100644 --- a/src/client/linux/dump_writer_common/ucontext_reader.cc +++ b/src/client/linux/dump_writer_common/ucontext_reader.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/dump_writer_common/ucontext_reader.h" #include "common/linux/linux_libc_support.h" diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index bbdb798b5..9e23c1194 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -62,6 +62,10 @@ // alternative malloc. Each function should have comment above it detailing the // context which it runs in. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/handler/exception_handler.h" #include diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 691ea1335..b2d8d4681 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/handler/minidump_descriptor.cc b/src/client/linux/handler/minidump_descriptor.cc index 517fce975..db2f9b180 100644 --- a/src/client/linux/handler/minidump_descriptor.cc +++ b/src/client/linux/handler/minidump_descriptor.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/linux/handler/minidump_descriptor.h" diff --git a/src/client/linux/log/log.cc b/src/client/linux/log/log.cc index c45de64b7..2a48d7fea 100644 --- a/src/client/linux/log/log.cc +++ b/src/client/linux/log/log.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/log/log.h" #if defined(__ANDROID__) diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc index 1f19d3bb6..93dae35e5 100644 --- a/src/client/linux/microdump_writer/microdump_writer.cc +++ b/src/client/linux/microdump_writer/microdump_writer.cc @@ -29,6 +29,10 @@ // This translation unit generates microdumps into the console (logcat on // Android). See crbug.com/410294 for more info and design docs. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/microdump_writer/microdump_writer.h" #include diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc index 848656643..b1d570eb4 100644 --- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc +++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/cpu_set_unittest.cc b/src/client/linux/minidump_writer/cpu_set_unittest.cc index e9d4e87ac..b99e98de3 100644 --- a/src/client/linux/minidump_writer/cpu_set_unittest.cc +++ b/src/client/linux/minidump_writer/cpu_set_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/directory_reader_unittest.cc b/src/client/linux/minidump_writer/directory_reader_unittest.cc index ffc5fbfd9..708d586ed 100644 --- a/src/client/linux/minidump_writer/directory_reader_unittest.cc +++ b/src/client/linux/minidump_writer/directory_reader_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/linux/minidump_writer/line_reader_unittest.cc b/src/client/linux/minidump_writer/line_reader_unittest.cc index b96ebf9d0..bc1f9d399 100644 --- a/src/client/linux/minidump_writer/line_reader_unittest.cc +++ b/src/client/linux/minidump_writer/line_reader_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc index 2c507c1bf..4bf9094e9 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper.cc @@ -29,6 +29,10 @@ // linux_core_dumper.cc: Implement google_breakpad::LinuxCoreDumper. // See linux_core_dumper.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/minidump_writer/linux_core_dumper.h" #include diff --git a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc index 157e4f897..72790422e 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc @@ -29,6 +29,10 @@ // linux_core_dumper_unittest.cc: // Unit tests for google_breakpad::LinuxCoreDumoer. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc index 01b06facf..85922a9c4 100644 --- a/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/client/linux/minidump_writer/linux_dumper.cc @@ -34,6 +34,10 @@ // rules apply as detailed at the top of minidump_writer.h: no libc calls and // use the alternative allocator. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/minidump_writer/linux_dumper.h" #include diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc index bc1e4fbef..5a135fda0 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc @@ -30,6 +30,10 @@ // threads. The first word of each thread's stack is set to the thread // id. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc index 718fab7c5..0e58236b6 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc @@ -35,6 +35,10 @@ // rules apply as detailed at the top of minidump_writer.h: no libc calls and // use the alternative allocator. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/minidump_writer/linux_ptrace_dumper.h" #include diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index a8455165d..16a9daf1d 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -32,6 +32,10 @@ // This file was renamed from linux_dumper_unittest.cc and modified due // to LinuxDumper being splitted into two classes. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index a5f9b8416..a95dd2548 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -42,6 +42,10 @@ // a canonical instance in the LinuxDumper object. We use the placement // new form to allocate objects and we don't delete them. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/linux/handler/minidump_descriptor.h" #include "client/linux/minidump_writer/minidump_writer.h" #include "client/minidump_file_writer-inl.h" diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index 2601d29b6..effedc5e1 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc index 92cae92e2..399f1a123 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc @@ -29,6 +29,10 @@ // minidump_writer_unittest_utils.cc: // Shared routines used by unittests under client/linux/minidump_writer. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/linux/minidump_writer/pe_file.cc b/src/client/linux/minidump_writer/pe_file.cc index 960b978b6..7b3fe6c08 100644 --- a/src/client/linux/minidump_writer/pe_file.cc +++ b/src/client/linux/minidump_writer/pe_file.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/linux/minidump_writer/pe_file.h" diff --git a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc index cbdc5fbce..4ac525695 100644 --- a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc +++ b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/linux/sender/google_crash_report_sender.cc b/src/client/linux/sender/google_crash_report_sender.cc index 6f45d831a..f6e481939 100644 --- a/src/client/linux/sender/google_crash_report_sender.cc +++ b/src/client/linux/sender/google_crash_report_sender.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/google_crashdump_uploader.h" #include #include diff --git a/src/client/mac/crash_generation/crash_generation_client.cc b/src/client/mac/crash_generation/crash_generation_client.cc index 32f1c827d..7622dddd2 100644 --- a/src/client/mac/crash_generation/crash_generation_client.cc +++ b/src/client/mac/crash_generation/crash_generation_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/mac/crash_generation/crash_generation_client.h" #include "client/mac/crash_generation/crash_generation_server.h" diff --git a/src/client/mac/crash_generation/crash_generation_server.cc b/src/client/mac/crash_generation/crash_generation_server.cc index 6bbd4bb50..8d742f361 100644 --- a/src/client/mac/crash_generation/crash_generation_server.cc +++ b/src/client/mac/crash_generation/crash_generation_server.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/mac/crash_generation/crash_generation_server.h" #include diff --git a/src/client/mac/handler/breakpad_nlist_64.cc b/src/client/mac/handler/breakpad_nlist_64.cc index b4f04c917..d59c7b080 100644 --- a/src/client/mac/handler/breakpad_nlist_64.cc +++ b/src/client/mac/handler/breakpad_nlist_64.cc @@ -65,6 +65,10 @@ * I've modified it to be compatible with 64-bit images. */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_nlist_64.h" #include diff --git a/src/client/mac/handler/dynamic_images.cc b/src/client/mac/handler/dynamic_images.cc index b1d2c464e..3db7467bf 100644 --- a/src/client/mac/handler/dynamic_images.cc +++ b/src/client/mac/handler/dynamic_images.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/mac/handler/dynamic_images.h" extern "C" { // needed to compile on Leopard diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc index c091209fb..968e551c1 100644 --- a/src/client/mac/handler/exception_handler.cc +++ b/src/client/mac/handler/exception_handler.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index 3738416e5..fd863aea9 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/mac/handler/protected_memory_allocator.cc b/src/client/mac/handler/protected_memory_allocator.cc index 833832636..8205a214d 100644 --- a/src/client/mac/handler/protected_memory_allocator.cc +++ b/src/client/mac/handler/protected_memory_allocator.cc @@ -30,6 +30,10 @@ // // See the header file for documentation +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "protected_memory_allocator.h" #include diff --git a/src/client/mac/handler/testcases/DynamicImagesTests.cc b/src/client/mac/handler/testcases/DynamicImagesTests.cc index 14ea88d23..d7564fc9c 100644 --- a/src/client/mac/handler/testcases/DynamicImagesTests.cc +++ b/src/client/mac/handler/testcases/DynamicImagesTests.cc @@ -33,6 +33,10 @@ // Copyright 2008 Google LLC // +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/mac/handler/testcases/DynamicImagesTests.h" #include "client/mac/handler/dynamic_images.h" diff --git a/src/client/mac/handler/testcases/breakpad_nlist_test.cc b/src/client/mac/handler/testcases/breakpad_nlist_test.cc index a89d8c440..3779e357a 100644 --- a/src/client/mac/handler/testcases/breakpad_nlist_test.cc +++ b/src/client/mac/handler/testcases/breakpad_nlist_test.cc @@ -33,6 +33,10 @@ // Copyright 2008 Google LLC // +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/mac/handler/testcases/breakpad_nlist_test.h" #include #include "client/mac/handler/breakpad_nlist_64.h" diff --git a/src/client/mac/tests/crash_generation_server_test.cc b/src/client/mac/tests/crash_generation_server_test.cc index 50825a938..743b268e0 100644 --- a/src/client/mac/tests/crash_generation_server_test.cc +++ b/src/client/mac/tests/crash_generation_server_test.cc @@ -29,6 +29,10 @@ // crash_generation_server_test.cc // Unit tests for CrashGenerationServer +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc index eb9aa1bcd..91b931b94 100644 --- a/src/client/mac/tests/exception_handler_test.cc +++ b/src/client/mac/tests/exception_handler_test.cc @@ -28,6 +28,10 @@ // exception_handler_test.cc: Unit tests for google_breakpad::ExceptionHandler +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/mac/tests/minidump_generator_test.cc b/src/client/mac/tests/minidump_generator_test.cc index 1a889dfec..2606e14f5 100644 --- a/src/client/mac/tests/minidump_generator_test.cc +++ b/src/client/mac/tests/minidump_generator_test.cc @@ -28,6 +28,10 @@ // minidump_generator_test.cc: Unit tests for google_breakpad::MinidumpGenerator +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #ifndef MAC_OS_X_VERSION_10_6 #define MAC_OS_X_VERSION_10_6 1060 diff --git a/src/client/mac/tests/minidump_generator_test_helper.cc b/src/client/mac/tests/minidump_generator_test_helper.cc index 93cbe1bba..8177eeab7 100644 --- a/src/client/mac/tests/minidump_generator_test_helper.cc +++ b/src/client/mac/tests/minidump_generator_test_helper.cc @@ -30,6 +30,10 @@ // minidump_generator_test.cc can launch to test certain things // that require a separate executable. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/mac/handler/exception_handler.h" diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc index d5193e2c0..c00af36c8 100644 --- a/src/client/minidump_file_writer.cc +++ b/src/client/minidump_file_writer.cc @@ -30,6 +30,10 @@ // // See minidump_file_writer.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/minidump_file_writer_unittest.cc b/src/client/minidump_file_writer_unittest.cc index bb3a02693..21e0b8a1a 100644 --- a/src/client/minidump_file_writer_unittest.cc +++ b/src/client/minidump_file_writer_unittest.cc @@ -36,6 +36,10 @@ -o minidump_file_writer_unittest */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/solaris/handler/exception_handler.cc b/src/client/solaris/handler/exception_handler.cc index b7b702acf..0e5f44976 100644 --- a/src/client/solaris/handler/exception_handler.cc +++ b/src/client/solaris/handler/exception_handler.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/solaris/handler/exception_handler_test.cc b/src/client/solaris/handler/exception_handler_test.cc index a84f2df13..3d656820d 100644 --- a/src/client/solaris/handler/exception_handler_test.cc +++ b/src/client/solaris/handler/exception_handler_test.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/solaris/handler/minidump_generator.cc b/src/client/solaris/handler/minidump_generator.cc index 8f2f6ee25..5d24d0ae8 100644 --- a/src/client/solaris/handler/minidump_generator.cc +++ b/src/client/solaris/handler/minidump_generator.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/solaris/handler/minidump_test.cc b/src/client/solaris/handler/minidump_test.cc index 00f8d9a5b..a8f690632 100644 --- a/src/client/solaris/handler/minidump_test.cc +++ b/src/client/solaris/handler/minidump_test.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/solaris/handler/solaris_lwp.cc b/src/client/solaris/handler/solaris_lwp.cc index d707a5b31..02f1c37e8 100644 --- a/src/client/solaris/handler/solaris_lwp.cc +++ b/src/client/solaris/handler/solaris_lwp.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc index f0a4b9119..61ee21262 100644 --- a/src/client/windows/crash_generation/client_info.cc +++ b/src/client/windows/crash_generation/client_info.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/crash_generation/client_info.h" #include "client/windows/common/ipc_protocol.h" diff --git a/src/client/windows/crash_generation/crash_generation_client.cc b/src/client/windows/crash_generation/crash_generation_client.cc index d6da09eb9..c3d6a2bc8 100644 --- a/src/client/windows/crash_generation/crash_generation_client.cc +++ b/src/client/windows/crash_generation/crash_generation_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/crash_generation/crash_generation_client.h" #include #include diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc index bf80ee9cf..61b0cbc0b 100644 --- a/src/client/windows/crash_generation/crash_generation_server.cc +++ b/src/client/windows/crash_generation/crash_generation_server.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/crash_generation/crash_generation_server.h" #include #include diff --git a/src/client/windows/crash_generation/minidump_generator.cc b/src/client/windows/crash_generation/minidump_generator.cc index 523db27ae..a0454cf94 100644 --- a/src/client/windows/crash_generation/minidump_generator.cc +++ b/src/client/windows/crash_generation/minidump_generator.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/crash_generation/minidump_generator.h" #include diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc index 3b3938aa5..64b297999 100644 --- a/src/client/windows/handler/exception_handler.cc +++ b/src/client/windows/handler/exception_handler.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/windows/sender/crash_report_sender.cc b/src/client/windows/sender/crash_report_sender.cc index 27a7ec393..6ce0026ce 100644 --- a/src/client/windows/sender/crash_report_sender.cc +++ b/src/client/windows/sender/crash_report_sender.cc @@ -29,6 +29,10 @@ // Disable exception handler warnings. #pragma warning( disable : 4530 ) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/windows/sender/crash_report_sender.h" diff --git a/src/client/windows/tests/crash_generation_app/abstract_class.cc b/src/client/windows/tests/crash_generation_app/abstract_class.cc index 28b8ee14d..737c817c9 100644 --- a/src/client/windows/tests/crash_generation_app/abstract_class.cc +++ b/src/client/windows/tests/crash_generation_app/abstract_class.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/tests/crash_generation_app/abstract_class.h" namespace google_breakpad { diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc index 883afcc69..9ae4679e3 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc @@ -29,6 +29,10 @@ // crash_generation_app.cpp : Defines the entry point for the application. // +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/tests/crash_generation_app/crash_generation_app.h" #include diff --git a/src/client/windows/unittests/crash_generation_server_test.cc b/src/client/windows/unittests/crash_generation_server_test.cc index cd624f072..adb03f400 100644 --- a/src/client/windows/unittests/crash_generation_server_test.cc +++ b/src/client/windows/unittests/crash_generation_server_test.cc @@ -27,6 +27,10 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "client/windows/crash_generation/crash_generation_server.h" #include "client/windows/common/ipc_protocol.h" diff --git a/src/client/windows/unittests/dump_analysis.cc b/src/client/windows/unittests/dump_analysis.cc index 24a33769c..c403d8556 100644 --- a/src/client/windows/unittests/dump_analysis.cc +++ b/src/client/windows/unittests/dump_analysis.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/windows/unittests/exception_handler_death_test.cc b/src/client/windows/unittests/exception_handler_death_test.cc index a7679dd66..50d3fda9d 100644 --- a/src/client/windows/unittests/exception_handler_death_test.cc +++ b/src/client/windows/unittests/exception_handler_death_test.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/client/windows/unittests/exception_handler_nesting_test.cc b/src/client/windows/unittests/exception_handler_nesting_test.cc index 81ae7dc7d..7fa6ac226 100644 --- a/src/client/windows/unittests/exception_handler_nesting_test.cc +++ b/src/client/windows/unittests/exception_handler_nesting_test.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/client/windows/unittests/exception_handler_test.cc b/src/client/windows/unittests/exception_handler_test.cc index 237af29dd..f658726ba 100644 --- a/src/client/windows/unittests/exception_handler_test.cc +++ b/src/client/windows/unittests/exception_handler_test.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "client/windows/unittests/exception_handler_test.h" #include diff --git a/src/client/windows/unittests/minidump_test.cc b/src/client/windows/unittests/minidump_test.cc index 7bfc8d772..741447df4 100644 --- a/src/client/windows/unittests/minidump_test.cc +++ b/src/client/windows/unittests/minidump_test.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/byte_cursor_unittest.cc b/src/common/byte_cursor_unittest.cc index 00648f764..41180ca2e 100644 --- a/src/common/byte_cursor_unittest.cc +++ b/src/common/byte_cursor_unittest.cc @@ -31,6 +31,10 @@ // byte_cursor_unittest.cc: Unit tests for google_breakpad::ByteBuffer // and google_breakpad::ByteCursor. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/convert_UTF.cc b/src/common/convert_UTF.cc index 4a5df1eb2..6e95b2f9b 100644 --- a/src/common/convert_UTF.cc +++ b/src/common/convert_UTF.cc @@ -55,6 +55,10 @@ See the header file "ConvertUTF.h" for complete documentation. ------------------------------------------------------------------------ */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "convert_UTF.h" #ifdef CVTUTF_DEBUG #include diff --git a/src/common/dwarf/bytereader.cc b/src/common/dwarf/bytereader.cc index 46bed6d03..faa7d680a 100644 --- a/src/common/dwarf/bytereader.cc +++ b/src/common/dwarf/bytereader.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/dwarf/bytereader_unittest.cc b/src/common/dwarf/bytereader_unittest.cc index c23c737be..a5eb0da53 100644 --- a/src/common/dwarf/bytereader_unittest.cc +++ b/src/common/dwarf/bytereader_unittest.cc @@ -30,6 +30,10 @@ // bytereader_unittest.cc: Unit tests for google_breakpad::ByteReader +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/cfi_assembler.cc b/src/common/dwarf/cfi_assembler.cc index 9ed979b41..b3e064f06 100644 --- a/src/common/dwarf/cfi_assembler.cc +++ b/src/common/dwarf/cfi_assembler.cc @@ -31,6 +31,10 @@ // cfi_assembler.cc: Implementation of google_breakpad::CFISection class. // See cfi_assembler.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/dwarf/cfi_assembler.h" #include diff --git a/src/common/dwarf/dwarf2diehandler.cc b/src/common/dwarf/dwarf2diehandler.cc index ea3ac71c8..8aea0f2ff 100644 --- a/src/common/dwarf/dwarf2diehandler.cc +++ b/src/common/dwarf/dwarf2diehandler.cc @@ -31,6 +31,10 @@ // dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class. // See dwarf2diehandler.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/dwarf2diehandler_unittest.cc b/src/common/dwarf/dwarf2diehandler_unittest.cc index 67c9489dc..afcbf6254 100644 --- a/src/common/dwarf/dwarf2diehandler_unittest.cc +++ b/src/common/dwarf/dwarf2diehandler_unittest.cc @@ -32,6 +32,10 @@ // dwarf2diehander_unittest.cc: Unit tests for google_breakpad::DIEDispatcher. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index b191d78c5..65cb8e7d7 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -31,6 +31,10 @@ // Implementation of LineInfo, CompilationUnit, // and CallFrameInfo. See dwarf2reader.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/dwarf/dwarf2reader.h" #include diff --git a/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/src/common/dwarf/dwarf2reader_cfi_unittest.cc index dc4418c72..67b662a35 100644 --- a/src/common/dwarf/dwarf2reader_cfi_unittest.cc +++ b/src/common/dwarf/dwarf2reader_cfi_unittest.cc @@ -30,6 +30,10 @@ // dwarf2reader_cfi_unittest.cc: Unit tests for google_breakpad::CallFrameInfo +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/dwarf2reader_die_unittest.cc b/src/common/dwarf/dwarf2reader_die_unittest.cc index fc639a64b..442fa66c1 100644 --- a/src/common/dwarf/dwarf2reader_die_unittest.cc +++ b/src/common/dwarf/dwarf2reader_die_unittest.cc @@ -30,6 +30,10 @@ // dwarf2reader_die_unittest.cc: Unit tests for google_breakpad::CompilationUnit +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc b/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc index 033c63336..7de627d3c 100644 --- a/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc +++ b/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc @@ -30,6 +30,10 @@ // dwarf2reader_lineinfo_unittest.cc: Unit tests for google_breakpad::LineInfo +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc b/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc index 9ceea1097..12b27e686 100644 --- a/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc +++ b/src/common/dwarf/dwarf2reader_splitfunctions_unittest.cc @@ -32,6 +32,10 @@ // information generated when with splitting optimizations such as // -fsplit-machine-functions (clang) -freorder-blocks-and-partition (gcc). +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 7664377cb..31deb9db4 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -30,6 +30,10 @@ #define _GNU_SOURCE // needed for pread() #endif +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/dwarf/functioninfo.cc b/src/common/dwarf/functioninfo.cc index d8fdb842d..5b0ce81a4 100644 --- a/src/common/dwarf/functioninfo.cc +++ b/src/common/dwarf/functioninfo.cc @@ -29,6 +29,10 @@ // This is a client for the dwarf2reader to extract function and line // information from the debug info. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index 7da8507d7..287c851e6 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -33,6 +33,10 @@ // Implementation of google_breakpad::DwarfCFIToModule. // See dwarf_cfi_to_module.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/dwarf_cfi_to_module_unittest.cc b/src/common/dwarf_cfi_to_module_unittest.cc index 0b677b211..43b5e7c49 100644 --- a/src/common/dwarf_cfi_to_module_unittest.cc +++ b/src/common/dwarf_cfi_to_module_unittest.cc @@ -30,6 +30,10 @@ // dwarf_cfi_to_module_unittest.cc: Tests for google_breakpad::DwarfCFIToModule. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index a5a1fd069..43b468c19 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -35,6 +35,10 @@ #define __STDC_FORMAT_MACROS #endif /* __STDC_FORMAT_MACROS */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/dwarf_cu_to_module.h" #include diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index f3fa49032..7ab2f15cd 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -30,6 +30,10 @@ // dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc index e716d483c..940ab2d69 100644 --- a/src/common/dwarf_line_to_module.cc +++ b/src/common/dwarf_line_to_module.cc @@ -31,6 +31,10 @@ // dwarf_line_to_module.cc: Implementation of DwarfLineToModule class. // See dwarf_line_to_module.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/dwarf_line_to_module_unittest.cc b/src/common/dwarf_line_to_module_unittest.cc index c4a02dfa2..9eb1469fa 100644 --- a/src/common/dwarf_line_to_module_unittest.cc +++ b/src/common/dwarf_line_to_module_unittest.cc @@ -30,6 +30,10 @@ // dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/common/dwarf_range_list_handler.cc b/src/common/dwarf_range_list_handler.cc index 4d3dbd2eb..c40a5c3bc 100644 --- a/src/common/dwarf_range_list_handler.cc +++ b/src/common/dwarf_range_list_handler.cc @@ -32,6 +32,10 @@ // dwarf_range_list_handler.cc: Implementation of DwarfRangeListHandler class. // See dwarf_range_list_handler.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/dwarf_range_list_handler.h" diff --git a/src/common/language.cc b/src/common/language.cc index 0096a8d1e..61693a8cd 100644 --- a/src/common/language.cc +++ b/src/common/language.cc @@ -31,6 +31,10 @@ // language.cc: Subclasses and singletons for google_breakpad::Language. // See language.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/language.h" #include diff --git a/src/common/linux/breakpad_getcontext.h b/src/common/linux/breakpad_getcontext.h index c553219f8..d64784d46 100644 --- a/src/common/linux/breakpad_getcontext.h +++ b/src/common/linux/breakpad_getcontext.h @@ -29,10 +29,6 @@ #ifndef GOOGLE_BREAKPAD_COMMON_LINUX_INCLUDE_UCONTEXT_H #define GOOGLE_BREAKPAD_COMMON_LINUX_INCLUDE_UCONTEXT_H -#ifdef HAVE_CONFIG_H -#include -#endif - #ifndef HAVE_GETCONTEXT #include diff --git a/src/common/linux/breakpad_getcontext_unittest.cc b/src/common/linux/breakpad_getcontext_unittest.cc index 573ddd88c..5b340eb74 100644 --- a/src/common/linux/breakpad_getcontext_unittest.cc +++ b/src/common/linux/breakpad_getcontext_unittest.cc @@ -29,6 +29,10 @@ // asm/sigcontext.h can't be included with signal.h on glibc or // musl, so only compare _libc_fpstate and _fpstate on Android. #if defined(__ANDROID__) && defined(__x86_64__) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #endif diff --git a/src/common/linux/crc32.cc b/src/common/linux/crc32.cc index c02f06c4f..cf386a24c 100644 --- a/src/common/linux/crc32.cc +++ b/src/common/linux/crc32.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/crc32.h" namespace google_breakpad { diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index b436f7653..48e4c9265 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -31,6 +31,10 @@ // dump_symbols.cc: implement google_breakpad::WriteSymbolFile: // Find all the debugging info in a file and dump it as a Breakpad symbol file. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/dump_symbols.h" #include diff --git a/src/common/linux/dump_symbols_unittest.cc b/src/common/linux/dump_symbols_unittest.cc index 97d5827e2..55dcdeed8 100644 --- a/src/common/linux/dump_symbols_unittest.cc +++ b/src/common/linux/dump_symbols_unittest.cc @@ -31,6 +31,10 @@ // dump_symbols_unittest.cc: // Unittests for google_breakpad::DumpSymbols +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/linux/elf_core_dump.cc b/src/common/linux/elf_core_dump.cc index f5ee30337..67257fd27 100644 --- a/src/common/linux/elf_core_dump.cc +++ b/src/common/linux/elf_core_dump.cc @@ -29,6 +29,10 @@ // elf_core_dump.cc: Implement google_breakpad::ElfCoreDump. // See elf_core_dump.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/elf_core_dump.h" #include diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc index 6789dd84c..25cab99f8 100644 --- a/src/common/linux/elf_core_dump_unittest.cc +++ b/src/common/linux/elf_core_dump_unittest.cc @@ -28,6 +28,10 @@ // elf_core_dump_unittest.cc: Unit tests for google_breakpad::ElfCoreDump. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc index 3c33be99a..70d50f891 100644 --- a/src/common/linux/elf_symbols_to_module.cc +++ b/src/common/linux/elf_symbols_to_module.cc @@ -30,6 +30,10 @@ // Original author: Ted Mielczarek +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/elf_symbols_to_module.h" #include diff --git a/src/common/linux/elf_symbols_to_module_unittest.cc b/src/common/linux/elf_symbols_to_module_unittest.cc index 17eb670ff..a74b29f0f 100644 --- a/src/common/linux/elf_symbols_to_module_unittest.cc +++ b/src/common/linux/elf_symbols_to_module_unittest.cc @@ -31,6 +31,10 @@ // elf_symbols_to_module_unittest.cc: // Unittests for google_breakpad::ELFSymbolsToModule +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/linux/elfutils.cc b/src/common/linux/elfutils.cc index a68cc0af3..95b5db829 100644 --- a/src/common/linux/elfutils.cc +++ b/src/common/linux/elfutils.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/elfutils.h" #include diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc index 0bd2a759e..d8fcbd8d6 100644 --- a/src/common/linux/file_id.cc +++ b/src/common/linux/file_id.cc @@ -31,6 +31,10 @@ // See file_id.h for documentation // +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/file_id.h" #include diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index 74bf9e1b5..0ef453532 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -28,6 +28,10 @@ // Unit tests for FileID +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/linux/google_crashdump_uploader.cc b/src/common/linux/google_crashdump_uploader.cc index 6242e6d23..8c5e04925 100644 --- a/src/common/linux/google_crashdump_uploader.cc +++ b/src/common/linux/google_crashdump_uploader.cc @@ -27,6 +27,10 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/google_crashdump_uploader.h" #include diff --git a/src/common/linux/google_crashdump_uploader_test.cc b/src/common/linux/google_crashdump_uploader_test.cc index 39aab65d0..e81f21d64 100644 --- a/src/common/linux/google_crashdump_uploader_test.cc +++ b/src/common/linux/google_crashdump_uploader_test.cc @@ -28,6 +28,10 @@ // Unit test for crash dump uploader. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/linux/google_crashdump_uploader.h" diff --git a/src/common/linux/guid_creator.cc b/src/common/linux/guid_creator.cc index 31a326c71..8635f9dc0 100644 --- a/src/common/linux/guid_creator.cc +++ b/src/common/linux/guid_creator.cc @@ -27,7 +27,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef HAVE_CONFIG_H -#include +#include // Must come first #endif #include "common/linux/eintr_wrapper.h" diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc index 1b576ea60..0a5bdb502 100644 --- a/src/common/linux/http_upload.cc +++ b/src/common/linux/http_upload.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/http_upload.h" #include diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc index c4a174a8a..2b6390981 100644 --- a/src/common/linux/libcurl_wrapper.cc +++ b/src/common/linux/libcurl_wrapper.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/linux/linux_libc_support.cc b/src/common/linux/linux_libc_support.cc index 10cbeaef1..abcbfde8a 100644 --- a/src/common/linux/linux_libc_support.cc +++ b/src/common/linux/linux_libc_support.cc @@ -30,6 +30,10 @@ // we call the libc functions directly we risk crashing in the dynamic linker // as it tries to resolve uncached PLT entries. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/linux_libc_support.h" #include diff --git a/src/common/linux/linux_libc_support_unittest.cc b/src/common/linux/linux_libc_support_unittest.cc index 449f995fc..30dd1430c 100644 --- a/src/common/linux/linux_libc_support_unittest.cc +++ b/src/common/linux/linux_libc_support_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/linux/linux_libc_support.h" diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc index 7e4446070..568312cf3 100644 --- a/src/common/linux/memory_mapped_file.cc +++ b/src/common/linux/memory_mapped_file.cc @@ -29,6 +29,10 @@ // memory_mapped_file.cc: Implement google_breakpad::MemoryMappedFile. // See memory_mapped_file.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/memory_mapped_file.h" #include diff --git a/src/common/linux/memory_mapped_file_unittest.cc b/src/common/linux/memory_mapped_file_unittest.cc index 5ed677df8..b7a61a70e 100644 --- a/src/common/linux/memory_mapped_file_unittest.cc +++ b/src/common/linux/memory_mapped_file_unittest.cc @@ -29,6 +29,10 @@ // memory_mapped_file_unittest.cc: // Unit tests for google_breakpad::MemoryMappedFile. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/linux/safe_readlink.cc b/src/common/linux/safe_readlink.cc index 97ea62c03..a42b01a5f 100644 --- a/src/common/linux/safe_readlink.cc +++ b/src/common/linux/safe_readlink.cc @@ -29,6 +29,10 @@ // safe_readlink.cc: Implement google_breakpad::SafeReadLink. // See safe_readlink.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "third_party/lss/linux_syscall_support.h" diff --git a/src/common/linux/safe_readlink_unittest.cc b/src/common/linux/safe_readlink_unittest.cc index 6f5f9d753..8fa6d0656 100644 --- a/src/common/linux/safe_readlink_unittest.cc +++ b/src/common/linux/safe_readlink_unittest.cc @@ -28,6 +28,10 @@ // safe_readlink_unittest.cc: Unit tests for google_breakpad::SafeReadLink. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/linux/safe_readlink.h" diff --git a/src/common/linux/scoped_pipe.cc b/src/common/linux/scoped_pipe.cc index b13f8d459..8de04ce95 100644 --- a/src/common/linux/scoped_pipe.cc +++ b/src/common/linux/scoped_pipe.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/scoped_pipe.h" #include diff --git a/src/common/linux/scoped_pipe_unittest.cc b/src/common/linux/scoped_pipe_unittest.cc index a7d6272cf..4daa5c255 100644 --- a/src/common/linux/scoped_pipe_unittest.cc +++ b/src/common/linux/scoped_pipe_unittest.cc @@ -28,6 +28,10 @@ // scoped_pipe_unittest.cc: Unit tests for google_breakpad::ScopedPipe. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/scoped_pipe.h" #include "breakpad_googletest_includes.h" diff --git a/src/common/linux/scoped_tmpfile.cc b/src/common/linux/scoped_tmpfile.cc index 229e8d42c..2395a64e8 100644 --- a/src/common/linux/scoped_tmpfile.cc +++ b/src/common/linux/scoped_tmpfile.cc @@ -29,6 +29,10 @@ // Utility class for creating a temporary file that is deleted in the // destructor. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/scoped_tmpfile.h" #include diff --git a/src/common/linux/scoped_tmpfile_unittest.cc b/src/common/linux/scoped_tmpfile_unittest.cc index f82c5998b..f0bb2bbb4 100644 --- a/src/common/linux/scoped_tmpfile_unittest.cc +++ b/src/common/linux/scoped_tmpfile_unittest.cc @@ -28,6 +28,10 @@ // scoped_tmpfile_unittest.cc: Unit tests for google_breakpad::ScopedTmpfile. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/scoped_tmpfile.h" #include diff --git a/src/common/linux/symbol_collector_client.cc b/src/common/linux/symbol_collector_client.cc index 1c1dc97a5..e9a1893c2 100644 --- a/src/common/linux/symbol_collector_client.cc +++ b/src/common/linux/symbol_collector_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/symbol_collector_client.h" #include diff --git a/src/common/linux/symbol_upload.cc b/src/common/linux/symbol_upload.cc index c080533af..8ab143c6f 100644 --- a/src/common/linux/symbol_upload.cc +++ b/src/common/linux/symbol_upload.cc @@ -29,6 +29,10 @@ // symbol_upload.cc: implemented google_breakpad::sym_upload::Start, a helper // function for linux symbol upload tool. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/symbol_upload.h" #include diff --git a/src/common/linux/synth_elf.cc b/src/common/linux/synth_elf.cc index 2ba25e611..8e9170e7f 100644 --- a/src/common/linux/synth_elf.cc +++ b/src/common/linux/synth_elf.cc @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/synth_elf.h" #include diff --git a/src/common/linux/synth_elf_unittest.cc b/src/common/linux/synth_elf_unittest.cc index 44ef6ef3b..578f6a261 100644 --- a/src/common/linux/synth_elf_unittest.cc +++ b/src/common/linux/synth_elf_unittest.cc @@ -31,6 +31,10 @@ // synth_elf_unittest.cc: // Unittests for google_breakpad::synth_elf::ELF +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc index 0db0c4a24..1cad9ae26 100644 --- a/src/common/linux/tests/crash_generator.cc +++ b/src/common/linux/tests/crash_generator.cc @@ -29,6 +29,10 @@ // crash_generator.cc: Implement google_breakpad::CrashGenerator. // See crash_generator.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/linux/tests/crash_generator.h" #include diff --git a/src/common/long_string_dictionary.cc b/src/common/long_string_dictionary.cc index f504aa429..19a649e7b 100644 --- a/src/common/long_string_dictionary.cc +++ b/src/common/long_string_dictionary.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/long_string_dictionary.h" #include diff --git a/src/common/long_string_dictionary_unittest.cc b/src/common/long_string_dictionary_unittest.cc index be34efdfc..f10dc0d97 100644 --- a/src/common/long_string_dictionary_unittest.cc +++ b/src/common/long_string_dictionary_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index 392efe786..543c7c4a2 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/arch_utilities.h" #include diff --git a/src/common/mac/bootstrap_compat.cc b/src/common/mac/bootstrap_compat.cc index 6647bae36..408589ba9 100644 --- a/src/common/mac/bootstrap_compat.cc +++ b/src/common/mac/bootstrap_compat.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/bootstrap_compat.h" namespace breakpad { diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 9658b2c6d..e1025f79e 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -32,6 +32,10 @@ // dump_syms.cc: Create a symbol file for use with minidumps +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/dump_syms.h" #include diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc index a6c1d26f6..ee4a66bbe 100644 --- a/src/common/mac/file_id.cc +++ b/src/common/mac/file_id.cc @@ -32,6 +32,10 @@ // // Author: Dan Waylonis +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/file_id.h" #include diff --git a/src/common/mac/launch_reporter.cc b/src/common/mac/launch_reporter.cc index de554ee3a..f6b8aed1c 100644 --- a/src/common/mac/launch_reporter.cc +++ b/src/common/mac/launch_reporter.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc index e67ccddb7..bb0058ced 100644 --- a/src/common/mac/macho_id.cc +++ b/src/common/mac/macho_id.cc @@ -33,6 +33,10 @@ // Author: Dan Waylonis +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/mac/macho_reader.cc b/src/common/mac/macho_reader.cc index 23c809c48..0324be143 100644 --- a/src/common/mac/macho_reader.cc +++ b/src/common/mac/macho_reader.cc @@ -31,6 +31,10 @@ // macho_reader.cc: Implementation of google_breakpad::Mach_O::FatReader and // google_breakpad::Mach_O::Reader. See macho_reader.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/macho_reader.h" #include diff --git a/src/common/mac/macho_reader_unittest.cc b/src/common/mac/macho_reader_unittest.cc index 3beec341f..4b5ac6ca0 100644 --- a/src/common/mac/macho_reader_unittest.cc +++ b/src/common/mac/macho_reader_unittest.cc @@ -31,6 +31,10 @@ // macho_reader_unittest.cc: Unit tests for google_breakpad::Mach_O::FatReader // and google_breakpad::Mach_O::Reader. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/mac/macho_utilities.cc b/src/common/mac/macho_utilities.cc index 16e430df9..113e8d3fa 100644 --- a/src/common/mac/macho_utilities.cc +++ b/src/common/mac/macho_utilities.cc @@ -30,6 +30,10 @@ // // Author: Dave Camp +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/mac/byteswap.h" #include "common/mac/macho_utilities.h" diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc index 505a4df1d..f9cd93277 100644 --- a/src/common/mac/macho_walker.cc +++ b/src/common/mac/macho_walker.cc @@ -32,6 +32,10 @@ // // Author: Dan Waylonis +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/mac/string_utilities.cc b/src/common/mac/string_utilities.cc index 861029d4e..3b83351f4 100644 --- a/src/common/mac/string_utilities.cc +++ b/src/common/mac/string_utilities.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "common/mac/string_utilities.h" diff --git a/src/common/md5.cc b/src/common/md5.cc index b6e710da9..86298f4de 100644 --- a/src/common/md5.cc +++ b/src/common/md5.cc @@ -13,6 +13,10 @@ * will fill a supplied 16-byte array with the digest. */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/md5.h" diff --git a/src/common/memory_allocator_unittest.cc b/src/common/memory_allocator_unittest.cc index 6ca625bb5..8ef68913b 100644 --- a/src/common/memory_allocator_unittest.cc +++ b/src/common/memory_allocator_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/memory_allocator.h" diff --git a/src/common/memory_range_unittest.cc b/src/common/memory_range_unittest.cc index f112e7616..f081d6798 100644 --- a/src/common/memory_range_unittest.cc +++ b/src/common/memory_range_unittest.cc @@ -28,6 +28,10 @@ // memory_range_unittest.cc: Unit tests for google_breakpad::MemoryRange. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/memory_range.h" diff --git a/src/common/module.cc b/src/common/module.cc index 75782ab16..a5c1b6ad0 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -30,6 +30,10 @@ // module.cc: Implement google_breakpad::Module. See module.h. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/module.h" #include "common/string_view.h" diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 39727554f..213b3154c 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -30,6 +30,10 @@ // module_unittest.cc: Unit tests for google_breakpad::Module. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/path_helper.cc b/src/common/path_helper.cc index e51a1b681..fbbcfca31 100644 --- a/src/common/path_helper.cc +++ b/src/common/path_helper.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/path_helper.h" #include diff --git a/src/common/safe_math_unittest.cc b/src/common/safe_math_unittest.cc index 1908155d4..453afbe03 100644 --- a/src/common/safe_math_unittest.cc +++ b/src/common/safe_math_unittest.cc @@ -28,6 +28,10 @@ // safe_math_unittest.cc: Unit tests for SafeMath +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "safe_math.h" #include "breakpad_googletest_includes.h" diff --git a/src/common/simple_string_dictionary.cc b/src/common/simple_string_dictionary.cc index 682888978..d3e09b8fc 100644 --- a/src/common/simple_string_dictionary.cc +++ b/src/common/simple_string_dictionary.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/simple_string_dictionary.h" namespace google_breakpad { diff --git a/src/common/simple_string_dictionary_unittest.cc b/src/common/simple_string_dictionary_unittest.cc index 4f3f1f5c3..b4dd7fe90 100644 --- a/src/common/simple_string_dictionary_unittest.cc +++ b/src/common/simple_string_dictionary_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/simple_string_dictionary.h" diff --git a/src/common/solaris/dump_symbols.cc b/src/common/solaris/dump_symbols.cc index 8277fd661..09e5b376b 100644 --- a/src/common/solaris/dump_symbols.cc +++ b/src/common/solaris/dump_symbols.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/solaris/file_id.cc b/src/common/solaris/file_id.cc index 53d205b67..5a9982bb4 100644 --- a/src/common/solaris/file_id.cc +++ b/src/common/solaris/file_id.cc @@ -32,6 +32,10 @@ // // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/solaris/guid_creator.cc b/src/common/solaris/guid_creator.cc index 4802f5a74..998d24991 100644 --- a/src/common/solaris/guid_creator.cc +++ b/src/common/solaris/guid_creator.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/stabs_reader.cc b/src/common/stabs_reader.cc index 30118830a..e18780c9d 100644 --- a/src/common/stabs_reader.cc +++ b/src/common/stabs_reader.cc @@ -31,6 +31,10 @@ // This file implements the google_breakpad::StabsReader class. // See stabs_reader.h. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/stabs_reader.h" #include diff --git a/src/common/stabs_reader.h b/src/common/stabs_reader.h index 3f5f0a8f2..655683f12 100644 --- a/src/common/stabs_reader.h +++ b/src/common/stabs_reader.h @@ -49,10 +49,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #ifdef HAVE_MACH_O_NLIST_H #include #elif defined(HAVE_A_OUT_H) diff --git a/src/common/stabs_reader_unittest.cc b/src/common/stabs_reader_unittest.cc index 79888815e..294e8836a 100644 --- a/src/common/stabs_reader_unittest.cc +++ b/src/common/stabs_reader_unittest.cc @@ -30,6 +30,10 @@ // stabs_reader_unittest.cc: Unit tests for google_breakpad::StabsReader. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index 3d026c22c..f04c987ad 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -30,6 +30,10 @@ // dump_stabs.cc --- implement the StabsToModule class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc index 95bdb261f..c6d40281b 100644 --- a/src/common/stabs_to_module_unittest.cc +++ b/src/common/stabs_to_module_unittest.cc @@ -30,6 +30,10 @@ // dump_stabs_unittest.cc: Unit tests for StabsToModule. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc index 213d6ed7c..a4e64ff06 100644 --- a/src/common/string_conversion.cc +++ b/src/common/string_conversion.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/convert_UTF.h" diff --git a/src/common/string_conversion_unittest.cc b/src/common/string_conversion_unittest.cc index 2e64a9576..0f372c800 100644 --- a/src/common/string_conversion_unittest.cc +++ b/src/common/string_conversion_unittest.cc @@ -28,6 +28,10 @@ // string_conversion_unittest.cc: Unit tests for google_breakpad::UTF* helpers. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/test_assembler.cc b/src/common/test_assembler.cc index 918996638..6b1c1fd35 100644 --- a/src/common/test_assembler.cc +++ b/src/common/test_assembler.cc @@ -31,6 +31,10 @@ // test_assembler.cc: Implementation of google_breakpad::TestAssembler. // See test_assembler.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/test_assembler.h" #include diff --git a/src/common/test_assembler_unittest.cc b/src/common/test_assembler_unittest.cc index f16594f1d..0307fdbf4 100644 --- a/src/common/test_assembler_unittest.cc +++ b/src/common/test_assembler_unittest.cc @@ -30,6 +30,10 @@ // test_assembler_unittest.cc: Unit tests for google_breakpad::TestAssembler. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/tests/file_utils.cc b/src/common/tests/file_utils.cc index 814b2094f..84a228095 100644 --- a/src/common/tests/file_utils.cc +++ b/src/common/tests/file_utils.cc @@ -29,6 +29,10 @@ // file_utils.cc: Implement utility functions for file manipulation. // See file_utils.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/common/windows/dia_util.cc b/src/common/windows/dia_util.cc index dcfe0ef97..a5d984d1a 100644 --- a/src/common/windows/dia_util.cc +++ b/src/common/windows/dia_util.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/dia_util.h" #include diff --git a/src/common/windows/guid_string.cc b/src/common/windows/guid_string.cc index be9eb8a39..2c298c33a 100644 --- a/src/common/windows/guid_string.cc +++ b/src/common/windows/guid_string.cc @@ -30,6 +30,10 @@ // // See guid_string.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/windows/string_utils-inl.h" diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index 088a5e54d..bd48a2339 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include // Disable exception handler warnings. diff --git a/src/common/windows/omap.cc b/src/common/windows/omap.cc index ad9169974..1ffcec765 100644 --- a/src/common/windows/omap.cc +++ b/src/common/windows/omap.cc @@ -100,6 +100,10 @@ // position) so that resolution will work as expected for translated addresses. // This is transparent to the rest of the toolchain. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/omap.h" #include diff --git a/src/common/windows/omap_unittest.cc b/src/common/windows/omap_unittest.cc index 841e53910..ebe0d47e3 100644 --- a/src/common/windows/omap_unittest.cc +++ b/src/common/windows/omap_unittest.cc @@ -28,6 +28,10 @@ // Unittests for OMAP related functions. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/omap.h" #include "breakpad_googletest_includes.h" diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index 800c316fb..dd80a6d25 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/pdb_source_line_writer.h" #include diff --git a/src/common/windows/pe_source_line_writer.cc b/src/common/windows/pe_source_line_writer.cc index a568e0c75..d1d25cf43 100644 --- a/src/common/windows/pe_source_line_writer.cc +++ b/src/common/windows/pe_source_line_writer.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/pe_source_line_writer.h" #include "common/windows/pe_util.h" diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc index 1df931051..2d4aebe79 100644 --- a/src/common/windows/pe_util.cc +++ b/src/common/windows/pe_util.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "pe_util.h" #include diff --git a/src/common/windows/string_utils.cc b/src/common/windows/string_utils.cc index 01dca1937..1e570b525 100644 --- a/src/common/windows/string_utils.cc +++ b/src/common/windows/string_utils.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/common/windows/sym_upload_v2_protocol.cc b/src/common/windows/sym_upload_v2_protocol.cc index f2dc660cf..450f3626b 100644 --- a/src/common/windows/sym_upload_v2_protocol.cc +++ b/src/common/windows/sym_upload_v2_protocol.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/sym_upload_v2_protocol.h" #include diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc index 187b100ec..d91b702b0 100644 --- a/src/common/windows/symbol_collector_client.cc +++ b/src/common/windows/symbol_collector_client.cc @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/windows/symbol_collector_client.h" #include diff --git a/src/processor/address_map_unittest.cc b/src/processor/address_map_unittest.cc index 1bf0d7180..2d754b602 100644 --- a/src/processor/address_map_unittest.cc +++ b/src/processor/address_map_unittest.cc @@ -30,6 +30,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/basic_code_modules.cc b/src/processor/basic_code_modules.cc index 57021d479..bdfc8f3de 100644 --- a/src/processor/basic_code_modules.cc +++ b/src/processor/basic_code_modules.cc @@ -33,6 +33,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/basic_code_modules.h" #include diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index 07aba6bc2..220bd746c 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -31,6 +31,10 @@ // See basic_source_line_resolver.h and basic_source_line_resolver_types.h // for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index fba4e9a6b..a73ded8b7 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/call_stack.cc b/src/processor/call_stack.cc index 87ffd1ae3..6ecae6dcb 100644 --- a/src/processor/call_stack.cc +++ b/src/processor/call_stack.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/stack_frame.h" diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc index 5216a44ea..2094e0941 100644 --- a/src/processor/cfi_frame_info.cc +++ b/src/processor/cfi_frame_info.cc @@ -31,6 +31,10 @@ // cfi_frame_info.cc: Implementation of CFIFrameInfo class. // See cfi_frame_info.h for details. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/cfi_frame_info.h" #include diff --git a/src/processor/cfi_frame_info_unittest.cc b/src/processor/cfi_frame_info_unittest.cc index 85f970a5e..0cf4562d3 100644 --- a/src/processor/cfi_frame_info_unittest.cc +++ b/src/processor/cfi_frame_info_unittest.cc @@ -31,6 +31,10 @@ // cfi_frame_info_unittest.cc: Unit tests for CFIFrameInfo, // CFIRuleParser, CFIFrameInfoParseHandler, and SimpleCFIWalker. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/processor/contained_range_map_unittest.cc b/src/processor/contained_range_map_unittest.cc index 670bb1898..1d681fdfd 100644 --- a/src/processor/contained_range_map_unittest.cc +++ b/src/processor/contained_range_map_unittest.cc @@ -30,6 +30,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "processor/contained_range_map-inl.h" diff --git a/src/processor/convert_old_arm64_context.cc b/src/processor/convert_old_arm64_context.cc index 8347064a2..768475b2f 100644 --- a/src/processor/convert_old_arm64_context.cc +++ b/src/processor/convert_old_arm64_context.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/convert_old_arm64_context.h" #include diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc index f000b4b41..9f9569a5e 100644 --- a/src/processor/disassembler_objdump.cc +++ b/src/processor/disassembler_objdump.cc @@ -30,6 +30,10 @@ // // Author: Mark Brand +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/disassembler_objdump.h" #include diff --git a/src/processor/disassembler_objdump_unittest.cc b/src/processor/disassembler_objdump_unittest.cc index 4b4ce6c30..30a60da5a 100644 --- a/src/processor/disassembler_objdump_unittest.cc +++ b/src/processor/disassembler_objdump_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/disassembler_x86.cc b/src/processor/disassembler_x86.cc index dffb996de..741cec7fd 100644 --- a/src/processor/disassembler_x86.cc +++ b/src/processor/disassembler_x86.cc @@ -33,6 +33,10 @@ // // Author: Cris Neckar +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/disassembler_x86.h" #include diff --git a/src/processor/disassembler_x86_unittest.cc b/src/processor/disassembler_x86_unittest.cc index 117b3bf8e..18525b825 100644 --- a/src/processor/disassembler_x86_unittest.cc +++ b/src/processor/disassembler_x86_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "breakpad_googletest_includes.h" diff --git a/src/processor/dump_context.cc b/src/processor/dump_context.cc index a8ab00840..93d826c4a 100644 --- a/src/processor/dump_context.cc +++ b/src/processor/dump_context.cc @@ -30,6 +30,10 @@ // // See dump_context.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/dump_context.h" #include diff --git a/src/processor/dump_object.cc b/src/processor/dump_object.cc index 6186c8faf..4050b11e2 100644 --- a/src/processor/dump_object.cc +++ b/src/processor/dump_object.cc @@ -28,6 +28,10 @@ // dump_object.cc: A base class for all mini/micro dump object. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/dump_object.h" namespace google_breakpad { diff --git a/src/processor/exploitability.cc b/src/processor/exploitability.cc index 7a4107bf9..89064c9b1 100644 --- a/src/processor/exploitability.cc +++ b/src/processor/exploitability.cc @@ -33,6 +33,10 @@ // Author: Cris Neckar +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/scoped_ptr.h" diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index c48bbdf5c..76e78f45b 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -33,6 +33,10 @@ // // Author: Matthew Riley +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/exploitability_linux.h" #include diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index bc1823c67..5f8cee0ac 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/exploitability_win.cc b/src/processor/exploitability_win.cc index accaadd3e..b94e87255 100644 --- a/src/processor/exploitability_win.cc +++ b/src/processor/exploitability_win.cc @@ -33,6 +33,10 @@ // // Author: Cris Neckar +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "processor/exploitability_win.h" diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 0d1ebc6b4..79803f2ca 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -36,6 +36,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/fast_source_line_resolver.h" #include "processor/fast_source_line_resolver_types.h" diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc index 1bb350193..08340c15a 100644 --- a/src/processor/fast_source_line_resolver_unittest.cc +++ b/src/processor/fast_source_line_resolver_unittest.cc @@ -36,6 +36,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/logging.cc b/src/processor/logging.cc index 136f4f8f4..46386eb5f 100644 --- a/src/processor/logging.cc +++ b/src/processor/logging.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/map_serializers_unittest.cc b/src/processor/map_serializers_unittest.cc index 74ebd5e5a..cd31ddc83 100644 --- a/src/processor/map_serializers_unittest.cc +++ b/src/processor/map_serializers_unittest.cc @@ -31,6 +31,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc index 83fb098cc..94d2c200a 100644 --- a/src/processor/microdump.cc +++ b/src/processor/microdump.cc @@ -30,6 +30,10 @@ // // See microdump.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/microdump.h" #include diff --git a/src/processor/microdump_processor.cc b/src/processor/microdump_processor.cc index be6150cdd..3c25d5cf0 100644 --- a/src/processor/microdump_processor.cc +++ b/src/processor/microdump_processor.cc @@ -30,6 +30,10 @@ // // See microdump_processor.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/microdump_processor.h" #include diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc index 3362431b0..47f5e35ec 100644 --- a/src/processor/microdump_processor_unittest.cc +++ b/src/processor/microdump_processor_unittest.cc @@ -28,6 +28,10 @@ // Unit test for MicrodumpProcessor. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/microdump_stackwalk.cc b/src/processor/microdump_stackwalk.cc index 593b07d68..222310f76 100644 --- a/src/processor/microdump_stackwalk.cc +++ b/src/processor/microdump_stackwalk.cc @@ -29,6 +29,10 @@ // microdump_stackwalk.cc: Process a microdump with MicrodumpProcessor, printing // the results, including stack traces. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 8c4f75d63..63f48ffe5 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/minidump.h" #include diff --git a/src/processor/minidump_dump.cc b/src/processor/minidump_dump.cc index 83afd1da5..d3c33ad4f 100644 --- a/src/processor/minidump_dump.cc +++ b/src/processor/minidump_dump.cc @@ -31,6 +31,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index 0073ae4e5..d56a7d63e 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/minidump_processor.h" #include diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 1ca8c9fbd..de3cfdd59 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -29,6 +29,10 @@ // Unit test for MinidumpProcessor. Uses a pre-generated minidump and // corresponding symbol file, and checks the stack frames for correctness. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc index cee9a734d..5ff61b3c8 100644 --- a/src/processor/minidump_stackwalk.cc +++ b/src/processor/minidump_stackwalk.cc @@ -31,6 +31,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc index 53d44ae1e..719adf78a 100644 --- a/src/processor/minidump_unittest.cc +++ b/src/processor/minidump_unittest.cc @@ -29,6 +29,10 @@ // Unit test for Minidump. Uses a pre-generated minidump and // verifies that certain streams are correct. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/module_comparer.cc b/src/processor/module_comparer.cc index 389712c50..1bf0b316d 100644 --- a/src/processor/module_comparer.cc +++ b/src/processor/module_comparer.cc @@ -31,6 +31,10 @@ // // Author: lambxsy@google.com (Siyang Xie) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/module_comparer.h" #include diff --git a/src/processor/module_serializer.cc b/src/processor/module_serializer.cc index d04450946..91d0006e6 100644 --- a/src/processor/module_serializer.cc +++ b/src/processor/module_serializer.cc @@ -32,6 +32,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/module_serializer.h" #include diff --git a/src/processor/pathname_stripper.cc b/src/processor/pathname_stripper.cc index f34b53f7f..11dc6974e 100644 --- a/src/processor/pathname_stripper.cc +++ b/src/processor/pathname_stripper.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/pathname_stripper.h" namespace google_breakpad { diff --git a/src/processor/pathname_stripper_unittest.cc b/src/processor/pathname_stripper_unittest.cc index ff474a7b7..c5c39cc80 100644 --- a/src/processor/pathname_stripper_unittest.cc +++ b/src/processor/pathname_stripper_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "processor/pathname_stripper.h" diff --git a/src/processor/postfix_evaluator_unittest.cc b/src/processor/postfix_evaluator_unittest.cc index 76d857511..d3c524092 100644 --- a/src/processor/postfix_evaluator_unittest.cc +++ b/src/processor/postfix_evaluator_unittest.cc @@ -30,6 +30,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/proc_maps_linux.cc b/src/processor/proc_maps_linux.cc index 05c1145a9..6fcb909a1 100644 --- a/src/processor/proc_maps_linux.cc +++ b/src/processor/proc_maps_linux.cc @@ -6,6 +6,10 @@ #define __STDC_FORMAT_MACROS #endif +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/proc_maps_linux.h" #include diff --git a/src/processor/proc_maps_linux_unittest.cc b/src/processor/proc_maps_linux_unittest.cc index dc51babb9..3d683cad7 100644 --- a/src/processor/proc_maps_linux_unittest.cc +++ b/src/processor/proc_maps_linux_unittest.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/using_std_string.h" #include "google_breakpad/processor/proc_maps_linux.h" diff --git a/src/processor/process_state.cc b/src/processor/process_state.cc index 95bbd48dc..c5c38b6cc 100644 --- a/src/processor/process_state.cc +++ b/src/processor/process_state.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_modules.h" diff --git a/src/processor/range_map_truncate_lower_unittest.cc b/src/processor/range_map_truncate_lower_unittest.cc index 12dad8733..b3599fc50 100644 --- a/src/processor/range_map_truncate_lower_unittest.cc +++ b/src/processor/range_map_truncate_lower_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/range_map_truncate_upper_unittest.cc b/src/processor/range_map_truncate_upper_unittest.cc index 57046e196..aa058ad46 100644 --- a/src/processor/range_map_truncate_upper_unittest.cc +++ b/src/processor/range_map_truncate_upper_unittest.cc @@ -31,6 +31,10 @@ // // Author: Ivan Penkov +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/range_map_unittest.cc b/src/processor/range_map_unittest.cc index 2745e8097..8735bb095 100644 --- a/src/processor/range_map_unittest.cc +++ b/src/processor/range_map_unittest.cc @@ -31,6 +31,10 @@ // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/simple_symbol_supplier.cc b/src/processor/simple_symbol_supplier.cc index 5b3f6819e..0de34c949 100644 --- a/src/processor/simple_symbol_supplier.cc +++ b/src/processor/simple_symbol_supplier.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/simple_symbol_supplier.h" #include diff --git a/src/processor/source_line_resolver_base.cc b/src/processor/source_line_resolver_base.cc index 5c0b6cd7a..da9ff7624 100644 --- a/src/processor/source_line_resolver_base.cc +++ b/src/processor/source_line_resolver_base.cc @@ -33,6 +33,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stack_frame_cpu.cc b/src/processor/stack_frame_cpu.cc index e31a31988..4a4a052cc 100644 --- a/src/processor/stack_frame_cpu.cc +++ b/src/processor/stack_frame_cpu.cc @@ -32,6 +32,10 @@ // // Author: Colin Blundell +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/stack_frame_cpu.h" namespace google_breakpad { diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc index 0d124a021..3afd471b8 100644 --- a/src/processor/stack_frame_symbolizer.cc +++ b/src/processor/stack_frame_symbolizer.cc @@ -31,6 +31,10 @@ // line information in a stack frame, and also looks up WindowsFrameInfo or // CFIFrameInfo for a stack frame. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/stack_frame_symbolizer.h" #include diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index a1b6364d1..3a842959d 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -31,6 +31,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/stackwalk_common.h" #include diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index e607b7212..1ff6cf7cb 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/stackwalker.h" #include diff --git a/src/processor/stackwalker_address_list.cc b/src/processor/stackwalker_address_list.cc index b393d4757..7c346c665 100644 --- a/src/processor/stackwalker_address_list.cc +++ b/src/processor/stackwalker_address_list.cc @@ -32,6 +32,10 @@ // // Author: Chris Hamilton +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/stackwalker_address_list_unittest.cc b/src/processor/stackwalker_address_list_unittest.cc index feda62681..1b5a4fc79 100644 --- a/src/processor/stackwalker_address_list_unittest.cc +++ b/src/processor/stackwalker_address_list_unittest.cc @@ -31,6 +31,10 @@ // // Author: Chris Hamilton +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index 6a539709f..b934e73b4 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai, Ted Mielczarek +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/scoped_ptr.h" diff --git a/src/processor/stackwalker_amd64_unittest.cc b/src/processor/stackwalker_amd64_unittest.cc index a7e513e93..88f6ef7f0 100644 --- a/src/processor/stackwalker_amd64_unittest.cc +++ b/src/processor/stackwalker_amd64_unittest.cc @@ -30,6 +30,10 @@ // stackwalker_amd64_unittest.cc: Unit tests for StackwalkerAMD64 class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_arm.cc b/src/processor/stackwalker_arm.cc index 7df2eb6d3..5f6f3e8da 100644 --- a/src/processor/stackwalker_arm.cc +++ b/src/processor/stackwalker_arm.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai, Ted Mielczarek, Jim Blandy +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/scoped_ptr.h" diff --git a/src/processor/stackwalker_arm64.cc b/src/processor/stackwalker_arm64.cc index ae3a05958..9c09835fe 100644 --- a/src/processor/stackwalker_arm64.cc +++ b/src/processor/stackwalker_arm64.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai, Ted Mielczarek, Jim Blandy, Colin Blundell +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/scoped_ptr.h" diff --git a/src/processor/stackwalker_arm64_unittest.cc b/src/processor/stackwalker_arm64_unittest.cc index 37475058f..f302d7d56 100644 --- a/src/processor/stackwalker_arm64_unittest.cc +++ b/src/processor/stackwalker_arm64_unittest.cc @@ -30,6 +30,10 @@ // stackwalker_arm64_unittest.cc: Unit tests for StackwalkerARM64 class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_arm_unittest.cc b/src/processor/stackwalker_arm_unittest.cc index 20c810a71..6103e2029 100644 --- a/src/processor/stackwalker_arm_unittest.cc +++ b/src/processor/stackwalker_arm_unittest.cc @@ -30,6 +30,10 @@ // stackwalker_arm_unittest.cc: Unit tests for StackwalkerARM class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_mips.cc b/src/processor/stackwalker_mips.cc index 11b08fae7..7195c1627 100644 --- a/src/processor/stackwalker_mips.cc +++ b/src/processor/stackwalker_mips.cc @@ -32,6 +32,10 @@ // // Author: Tata Elxsi +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_modules.h" diff --git a/src/processor/stackwalker_mips64_unittest.cc b/src/processor/stackwalker_mips64_unittest.cc index aefcf8eec..55b7503fa 100644 --- a/src/processor/stackwalker_mips64_unittest.cc +++ b/src/processor/stackwalker_mips64_unittest.cc @@ -31,6 +31,10 @@ // stackwalker_mips64_unittest.cc: Unit tests for StackwalkerMIPS class for // mips64 platforms. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_mips_unittest.cc b/src/processor/stackwalker_mips_unittest.cc index ac7324c46..305f4db8d 100644 --- a/src/processor/stackwalker_mips_unittest.cc +++ b/src/processor/stackwalker_mips_unittest.cc @@ -30,6 +30,10 @@ // stackwalker_mips_unittest.cc: Unit tests for StackwalkerMIPS class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_ppc.cc b/src/processor/stackwalker_ppc.cc index e71d91380..0083392b5 100644 --- a/src/processor/stackwalker_ppc.cc +++ b/src/processor/stackwalker_ppc.cc @@ -33,6 +33,10 @@ // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "processor/stackwalker_ppc.h" #include "google_breakpad/processor/call_stack.h" diff --git a/src/processor/stackwalker_ppc64.cc b/src/processor/stackwalker_ppc64.cc index 9ac8e45bd..c36d16be3 100644 --- a/src/processor/stackwalker_ppc64.cc +++ b/src/processor/stackwalker_ppc64.cc @@ -31,6 +31,10 @@ // See stackwalker_ppc64.h for documentation. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "processor/stackwalker_ppc64.h" #include "google_breakpad/processor/call_stack.h" diff --git a/src/processor/stackwalker_riscv.cc b/src/processor/stackwalker_riscv.cc index 3d8a64f4f..c3681a617 100644 --- a/src/processor/stackwalker_riscv.cc +++ b/src/processor/stackwalker_riscv.cc @@ -33,6 +33,10 @@ * Author: Iacopo Colonnelli */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_modules.h" diff --git a/src/processor/stackwalker_riscv64.cc b/src/processor/stackwalker_riscv64.cc index d97bad631..0ed7b5e65 100644 --- a/src/processor/stackwalker_riscv64.cc +++ b/src/processor/stackwalker_riscv64.cc @@ -33,6 +33,10 @@ * Author: Iacopo Colonnelli */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "common/scoped_ptr.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_modules.h" diff --git a/src/processor/stackwalker_riscv64_unittest.cc b/src/processor/stackwalker_riscv64_unittest.cc index 73c062642..c8579b9b9 100644 --- a/src/processor/stackwalker_riscv64_unittest.cc +++ b/src/processor/stackwalker_riscv64_unittest.cc @@ -31,6 +31,10 @@ * Author: Iacopo Colonnelli */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_riscv_unittest.cc b/src/processor/stackwalker_riscv_unittest.cc index f4a6b79cc..37f0e233a 100644 --- a/src/processor/stackwalker_riscv_unittest.cc +++ b/src/processor/stackwalker_riscv_unittest.cc @@ -31,6 +31,10 @@ * Author: Iacopo Colonnelli */ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/stackwalker_selftest.cc b/src/processor/stackwalker_selftest.cc index 2737f64dc..4f3483b41 100644 --- a/src/processor/stackwalker_selftest.cc +++ b/src/processor/stackwalker_selftest.cc @@ -48,6 +48,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "processor/logging.h" diff --git a/src/processor/stackwalker_sparc.cc b/src/processor/stackwalker_sparc.cc index fb76744cb..ed7f7dc3d 100644 --- a/src/processor/stackwalker_sparc.cc +++ b/src/processor/stackwalker_sparc.cc @@ -33,6 +33,10 @@ // Author: Michael Shang +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/memory_region.h" #include "google_breakpad/processor/stack_frame_cpu.h" diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc index b598c5bd6..9bda5f8c4 100644 --- a/src/processor/stackwalker_x86.cc +++ b/src/processor/stackwalker_x86.cc @@ -32,6 +32,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/stackwalker_x86_unittest.cc b/src/processor/stackwalker_x86_unittest.cc index 3d786b8e3..b614b0e44 100644 --- a/src/processor/stackwalker_x86_unittest.cc +++ b/src/processor/stackwalker_x86_unittest.cc @@ -30,6 +30,10 @@ // stackwalker_x86_unittest.cc: Unit tests for StackwalkerX86 class. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/static_address_map_unittest.cc b/src/processor/static_address_map_unittest.cc index 2e206a099..aebab976c 100644 --- a/src/processor/static_address_map_unittest.cc +++ b/src/processor/static_address_map_unittest.cc @@ -30,6 +30,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/static_contained_range_map_unittest.cc b/src/processor/static_contained_range_map_unittest.cc index cdc11c1db..d0507a4b1 100644 --- a/src/processor/static_contained_range_map_unittest.cc +++ b/src/processor/static_contained_range_map_unittest.cc @@ -31,6 +31,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/scoped_ptr.h" #include "processor/contained_range_map-inl.h" diff --git a/src/processor/static_map_unittest.cc b/src/processor/static_map_unittest.cc index 4360e8c61..67b201b63 100644 --- a/src/processor/static_map_unittest.cc +++ b/src/processor/static_map_unittest.cc @@ -30,6 +30,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/static_range_map_unittest.cc b/src/processor/static_range_map_unittest.cc index 3903e9486..d4ddec0c5 100644 --- a/src/processor/static_range_map_unittest.cc +++ b/src/processor/static_range_map_unittest.cc @@ -30,6 +30,10 @@ // // Author: Siyang Xie (lambxsy@google.com) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "common/scoped_ptr.h" #include "processor/range_map-inl.h" diff --git a/src/processor/symbolic_constants_win.cc b/src/processor/symbolic_constants_win.cc index 0c57b6868..98c2b4dde 100644 --- a/src/processor/symbolic_constants_win.cc +++ b/src/processor/symbolic_constants_win.cc @@ -32,6 +32,10 @@ // // Author: Ben Wagner +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "common/stdio_wrapper.h" diff --git a/src/processor/synth_minidump.cc b/src/processor/synth_minidump.cc index 9dacb395a..e51d1060a 100644 --- a/src/processor/synth_minidump.cc +++ b/src/processor/synth_minidump.cc @@ -30,6 +30,10 @@ // synth_minidump.cc: Implementation of SynthMinidump. See synth_minidump.h +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "processor/synth_minidump.h" namespace google_breakpad { diff --git a/src/processor/synth_minidump_unittest.cc b/src/processor/synth_minidump_unittest.cc index 4bc46747b..3b803afe3 100644 --- a/src/processor/synth_minidump_unittest.cc +++ b/src/processor/synth_minidump_unittest.cc @@ -31,6 +31,10 @@ // synth_minidump_unittest.cc: Unit tests for google_breakpad::SynthMinidump // classes. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/processor/testdata/linux_test_app.cc b/src/processor/testdata/linux_test_app.cc index 4ff4f7076..b0bbb6698 100644 --- a/src/processor/testdata/linux_test_app.cc +++ b/src/processor/testdata/linux_test_app.cc @@ -38,6 +38,10 @@ // generate an executable with STABS symbols (needs -m32), or -gdwarf-2 for one // with DWARF symbols (32- or 64-bit) +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/processor/testdata/test_app.cc b/src/processor/testdata/test_app.cc index 79cabef09..83468fbbf 100644 --- a/src/processor/testdata/test_app.cc +++ b/src/processor/testdata/test_app.cc @@ -31,6 +31,10 @@ // google_breakpad/src/client/windows/releasestaticcrt/exception_handler.lib // Then run test_app to generate a dump, and dump_syms to create the .sym file. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/windows/handler/exception_handler.h" diff --git a/src/processor/tokenize.cc b/src/processor/tokenize.cc index 4e62f2ea8..a46c9644c 100644 --- a/src/processor/tokenize.cc +++ b/src/processor/tokenize.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/tools/linux/core2md/core2md.cc b/src/tools/linux/core2md/core2md.cc index 3f34294f5..ec4a012a9 100644 --- a/src/tools/linux/core2md/core2md.cc +++ b/src/tools/linux/core2md/core2md.cc @@ -28,6 +28,10 @@ // core2md.cc: A utility to convert an ELF core file to a minidump file. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "client/linux/minidump_writer/minidump_writer.h" diff --git a/src/tools/linux/core_handler/core_handler.cc b/src/tools/linux/core_handler/core_handler.cc index 224073d34..8a1d97662 100644 --- a/src/tools/linux/core_handler/core_handler.cc +++ b/src/tools/linux/core_handler/core_handler.cc @@ -28,6 +28,10 @@ // core_handler.cc: A tool to handle coredumps on Linux +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index 8998b3b35..531a60bae 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index a4ddbe8e9..f12f2841a 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -30,6 +30,10 @@ // Large parts lifted from the userspace core dumper: // http://code.google.com/p/google-coredumper/ +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/linux/md2core/minidump_memory_range_unittest.cc b/src/tools/linux/md2core/minidump_memory_range_unittest.cc index 9012101d6..c939dd647 100644 --- a/src/tools/linux/md2core/minidump_memory_range_unittest.cc +++ b/src/tools/linux/md2core/minidump_memory_range_unittest.cc @@ -29,6 +29,10 @@ // minidump_memory_range_unittest.cc: // Unit tests for google_breakpad::MinidumpMemoryRange. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "breakpad_googletest_includes.h" #include "tools/linux/md2core/minidump_memory_range.h" diff --git a/src/tools/linux/pid2md/pid2md.cc b/src/tools/linux/pid2md/pid2md.cc index ca1cb6377..add12a738 100644 --- a/src/tools/linux/pid2md/pid2md.cc +++ b/src/tools/linux/pid2md/pid2md.cc @@ -28,6 +28,10 @@ // pid2md.cc: An utility to generate a minidump from a running process +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/linux/symupload/minidump_upload.cc b/src/tools/linux/symupload/minidump_upload.cc index 6adead034..9f2c96744 100644 --- a/src/tools/linux/symupload/minidump_upload.cc +++ b/src/tools/linux/symupload/minidump_upload.cc @@ -33,6 +33,10 @@ // ver: the product version // symbol_file: the breakpad format symbol file +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/linux/symupload/sym_upload.cc b/src/tools/linux/symupload/sym_upload.cc index 8f5e8a507..a76c55f7d 100644 --- a/src/tools/linux/symupload/sym_upload.cc +++ b/src/tools/linux/symupload/sym_upload.cc @@ -38,6 +38,10 @@ // cpu: the CPU that the module was built for // symbol_file: the contents of the breakpad-format symbol file +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 2e05cbf3b..2f2815c52 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -31,6 +31,10 @@ // dump_syms_tool.cc: Command line tool that uses the DumpSymbols class. // TODO(waylonis): accept stdin +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/tools/mac/dump_syms/macho_dump.cc b/src/tools/mac/dump_syms/macho_dump.cc index b724cc740..2610025c2 100644 --- a/src/tools/mac/dump_syms/macho_dump.cc +++ b/src/tools/mac/dump_syms/macho_dump.cc @@ -31,6 +31,10 @@ // macho_dump.cc: Dump the contents of a Mach-O file. This is mostly // a test program for the Mach_O::FatReader and Mach_O::Reader classes. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/solaris/dump_syms/dump_syms.cc b/src/tools/solaris/dump_syms/dump_syms.cc index fc331c21b..ead160011 100644 --- a/src/tools/solaris/dump_syms/dump_syms.cc +++ b/src/tools/solaris/dump_syms/dump_syms.cc @@ -28,6 +28,10 @@ // Author: Alfred Peng +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc b/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc index b4d191bde..fb6c883b5 100644 --- a/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc +++ b/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc @@ -28,6 +28,10 @@ // ./dump_syms dump_syms_regtest.pdb > dump_syms_regtest.sym +#ifdef HAVE_CONFIG_H +#include +#endif + namespace google_breakpad { class C { diff --git a/src/tools/windows/converter/ms_symbol_server_converter.cc b/src/tools/windows/converter/ms_symbol_server_converter.cc index bfe46925c..f7d9d9431 100644 --- a/src/tools/windows/converter/ms_symbol_server_converter.cc +++ b/src/tools/windows/converter/ms_symbol_server_converter.cc @@ -33,6 +33,10 @@ // // Author: Mark Mentovai +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc index 75ec55b0f..92c41774a 100644 --- a/src/tools/windows/converter_exe/converter.cc +++ b/src/tools/windows/converter_exe/converter.cc @@ -31,6 +31,10 @@ #pragma comment(lib, "diaguids.lib") #pragma comment(lib, "imagehlp.lib") +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/windows/converter_exe/escaping.cc b/src/tools/windows/converter_exe/escaping.cc index de0742984..e399c0f48 100644 --- a/src/tools/windows/converter_exe/escaping.cc +++ b/src/tools/windows/converter_exe/escaping.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "tools/windows/converter_exe/escaping.h" #include diff --git a/src/tools/windows/converter_exe/http_download.cc b/src/tools/windows/converter_exe/http_download.cc index 75f674e08..de8241980 100644 --- a/src/tools/windows/converter_exe/http_download.cc +++ b/src/tools/windows/converter_exe/http_download.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include diff --git a/src/tools/windows/converter_exe/tokenizer.cc b/src/tools/windows/converter_exe/tokenizer.cc index 6d627536d..08480d7be 100644 --- a/src/tools/windows/converter_exe/tokenizer.cc +++ b/src/tools/windows/converter_exe/tokenizer.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include "tools/windows/converter_exe/tokenizer.h" diff --git a/src/tools/windows/converter_exe/winhttp_client.cc b/src/tools/windows/converter_exe/winhttp_client.cc index f8c1492d5..425a9daad 100644 --- a/src/tools/windows/converter_exe/winhttp_client.cc +++ b/src/tools/windows/converter_exe/winhttp_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "tools/windows/converter_exe/winhttp_client.h" #include diff --git a/src/tools/windows/converter_exe/wininet_client.cc b/src/tools/windows/converter_exe/wininet_client.cc index 90cf114ca..571ab86c6 100644 --- a/src/tools/windows/converter_exe/wininet_client.cc +++ b/src/tools/windows/converter_exe/wininet_client.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include "tools/windows/converter_exe/wininet_client.h" #include diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc index 26c226a25..1979d4306 100644 --- a/src/tools/windows/dump_syms/dump_syms.cc +++ b/src/tools/windows/dump_syms/dump_syms.cc @@ -29,6 +29,10 @@ // Windows utility to dump the line number data from a pdb file to // a text-based format that we can use from the minidump processor. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/tools/windows/dump_syms/dump_syms_unittest.cc b/src/tools/windows/dump_syms/dump_syms_unittest.cc index 97dc5c9b9..73c48a2f4 100644 --- a/src/tools/windows/dump_syms/dump_syms_unittest.cc +++ b/src/tools/windows/dump_syms/dump_syms_unittest.cc @@ -26,6 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc index 442676bae..90d00af2e 100644 --- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc +++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc @@ -35,6 +35,11 @@ // cl /Zi dump_syms_regtest64.cc /link /PROFILE // dump_syms dump_syms_regtest64.pdb > dump_syms_regtest64.sym +#ifdef HAVE_CONFIG_H +#include +#endif + + namespace google_breakpad { class C { diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 65123a280..46ace95ad 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -42,6 +42,10 @@ // cpu: the CPU that the module was built for, typically "x86". // symbol_file: the contents of the breakpad-format symbol file +#ifdef HAVE_CONFIG_H +#include // Must come first +#endif + #include #include #include From ef55207540d1d0b686f53145d87f6fb29edf3380 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 9 Mar 2023 09:54:53 -0500 Subject: [PATCH 171/195] Mac: stop using NXArchInfo as a vocabulary type It's deprecated in macOS 13/iOS 16, so this is an incremental step towards using newly introduced APIs for those OSes. Since the description field is no longer available in the new mach-o/util.h API, stop using it, especially since architecture name is sufficiently informative. Bug: chromium:1420654 Change-Id: If2cec4f1fc88d13a71f011822bff61f173486b68 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4322265 Reviewed-by: Mark Mentovai --- src/common/mac/arch_utilities.cc | 79 ++++++----------------- src/common/mac/arch_utilities.h | 26 +++++--- src/common/mac/dump_syms.cc | 47 +++++--------- src/common/mac/dump_syms.h | 20 ++---- src/common/mac/macho_walker.cc | 9 ++- src/tools/mac/dump_syms/dump_syms_tool.cc | 26 +++----- 6 files changed, 72 insertions(+), 135 deletions(-) diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index 543c7c4a2..cdc1dfa50 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -53,86 +53,44 @@ #define CPU_SUBTYPE_ARM64_E (static_cast(2)) #endif // CPU_SUBTYPE_ARM64_E -namespace { - -const NXArchInfo* ArchInfo_arm64(cpu_subtype_t cpu_subtype) { - const char* name = NULL; - switch (cpu_subtype) { - case CPU_SUBTYPE_ARM64_ALL: - name = "arm64"; - break; - case CPU_SUBTYPE_ARM64_E: - name = "arm64e"; - break; - default: - return NULL; - } - - NXArchInfo* arm64 = new NXArchInfo; - *arm64 = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM, - CPU_SUBTYPE_ARM_V7); - arm64->name = name; - arm64->cputype = CPU_TYPE_ARM64; - arm64->cpusubtype = cpu_subtype; - arm64->description = "arm 64"; - return arm64; -} - -const NXArchInfo* ArchInfo_armv7s() { - NXArchInfo* armv7s = new NXArchInfo; - *armv7s = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM, - CPU_SUBTYPE_ARM_V7); - armv7s->name = "armv7s"; - armv7s->cpusubtype = CPU_SUBTYPE_ARM_V7S; - armv7s->description = "arm v7s"; - return armv7s; -} - -} // namespace - -namespace google_breakpad { - -const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name) { +std::optional GetArchInfoFromName(const char* arch_name) { // TODO: Remove this when the OS knows about arm64. if (!strcmp("arm64", arch_name)) - return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64, - CPU_SUBTYPE_ARM64_ALL); + return ArchInfo{CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_ALL}; if (!strcmp("arm64e", arch_name)) - return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64, - CPU_SUBTYPE_ARM64_E); - + return ArchInfo{CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_E}; // TODO: Remove this when the OS knows about armv7s. if (!strcmp("armv7s", arch_name)) - return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S); + return ArchInfo{CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S}; - return NXGetArchInfoFromName(arch_name); + const NXArchInfo* info = NXGetArchInfoFromName(arch_name); + if (info) + return ArchInfo{info->cputype, info->cpusubtype}; + return std::nullopt; } -const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype) { +const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { // TODO: Remove this when the OS knows about arm64. if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_ALL) { - static const NXArchInfo* arm64 = ArchInfo_arm64(cpu_subtype); - return arm64; + return "arm64"; } if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_E) { - static const NXArchInfo* arm64e = ArchInfo_arm64(cpu_subtype); - return arm64e; + return "arm64e"; } // TODO: Remove this when the OS knows about armv7s. if (cpu_type == CPU_TYPE_ARM && cpu_subtype == CPU_SUBTYPE_ARM_V7S) { - static const NXArchInfo* armv7s = ArchInfo_armv7s(); - return armv7s; + return "armv7s"; } - return NXGetArchInfoFromCpuType(cpu_type, cpu_subtype); + const NXArchInfo* info = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype); + if (info) + return info->name; + return kUnknownArchName; } -} // namespace google_breakpad - // TODO(crbug.com/1242776): The "#ifndef __APPLE__" should be here, but the // system version of NXGetLocalArchInfo returns incorrect information on // x86_64 machines (treating them as just x86), so use the Breakpad version @@ -207,7 +165,7 @@ const NXArchInfo kKnownArchitectures[] = { } // namespace -const NXArchInfo *NXGetLocalArchInfo(void) { +ArchInfo GetLocalArchInfo(void) { Architecture arch; #if defined(__i386__) arch = kArch_i386; @@ -222,7 +180,8 @@ const NXArchInfo *NXGetLocalArchInfo(void) { #else #error "Unsupported CPU architecture" #endif - return &kKnownArchitectures[arch]; + NXArchInfo info = kKnownArchitectures[arch]; + return {info.cputype, info.cpusubtype}; } #ifndef __APPLE__ diff --git a/src/common/mac/arch_utilities.h b/src/common/mac/arch_utilities.h index d267c43b8..3b036738a 100644 --- a/src/common/mac/arch_utilities.h +++ b/src/common/mac/arch_utilities.h @@ -31,16 +31,26 @@ #ifndef COMMON_MAC_ARCH_UTILITIES_H__ #define COMMON_MAC_ARCH_UTILITIES_H__ -#include +#include -namespace google_breakpad { +#include -// Custom implementation of |NXGetArchInfoFromName| and -// |NXGetArchInfoFromCpuType| that handle newer CPU on older OSes. -const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name); -const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype); +static constexpr const char* kUnknownArchName = ""; -} // namespace google_breakpad +struct ArchInfo { + cpu_type_t cputype; + cpu_subtype_t cpusubtype; +}; + +// Returns architecture info if `arch_name` corresponds to a valid, known +// architecture, and std::nullopt otherwise. +std::optional GetArchInfoFromName(const char* arch_name); + +// Returns the name of the architecture specified by `cpu_type` and +// `cpu_subtype`, or `kUnknownArchName` if it's unknown or invalid. +const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); + +// Returns the architecture of the machine this code is running on. +ArchInfo GetLocalArchInfo(); #endif // COMMON_MAC_ARCH_UTILITIES_H__ diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index e1025f79e..efa60f5b3 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -221,11 +221,10 @@ bool DumpSymbols::ReadData(uint8_t* contents, size_t size, return true; } -bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype) { +bool DumpSymbols::SetArchitecture(const ArchInfo& info) { // Find the best match for the architecture the user requested. - const SuperFatArch* best_match = FindBestMatchForArchitecture( - cpu_type, cpu_subtype); + const SuperFatArch* best_match = + FindBestMatchForArchitecture(info.cputype, info.cpusubtype); if (!best_match) return false; // Record the selected object file. @@ -233,16 +232,6 @@ bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, return true; } -bool DumpSymbols::SetArchitecture(const std::string& arch_name) { - bool arch_set = false; - const NXArchInfo* arch_info = - google_breakpad::BreakpadGetArchInfoFromName(arch_name.c_str()); - if (arch_info) { - arch_set = SetArchitecture(arch_info->cputype, arch_info->cpusubtype); - } - return arch_set; -} - SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { // Check if all the object files can be converted to struct fat_arch. @@ -402,8 +391,8 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { selected_object_file_ = &object_files_[0]; else { // Look for an object file whose architecture matches our own. - const NXArchInfo* local_arch = NXGetLocalArchInfo(); - if (!SetArchitecture(local_arch->cputype, local_arch->cpusubtype)) { + ArchInfo local_arch = GetLocalArchInfo(); + if (!SetArchitecture(local_arch)) { fprintf(stderr, "%s: object file contains more than one" " architecture, none of which match the current" " architecture; specify an architecture explicitly" @@ -418,18 +407,16 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { // Find the name of the selected file's architecture, to appear in // the MODULE record and in error messages. - const NXArchInfo* selected_arch_info = - google_breakpad::BreakpadGetArchInfoFromCpuType( - selected_object_file_->cputype, selected_object_file_->cpusubtype); + const char* selected_arch_name = GetNameFromCPUType( + selected_object_file_->cputype, selected_object_file_->cpusubtype); // In certain cases, it is possible that architecture info can't be reliably // determined, e.g. new architectures that breakpad is unware of. In that // case, avoid crashing and return false instead. - if (selected_arch_info == NULL) { + if (selected_arch_name == kUnknownArchName) { return false; } - const char* selected_arch_name = selected_arch_info->name; if (strcmp(selected_arch_name, "i386") == 0) selected_arch_name = "x86"; @@ -540,16 +527,14 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module* module, register_names = DwarfCFIToModule::RegisterNames::ARM64(); break; default: { - const NXArchInfo* arch = google_breakpad::BreakpadGetArchInfoFromCpuType( - macho_reader.cpu_type(), macho_reader.cpu_subtype()); - fprintf(stderr, "%s: cannot convert DWARF call frame information for ", - selected_object_name_.c_str()); - if (arch) - fprintf(stderr, "architecture '%s'", arch->name); - else - fprintf(stderr, "architecture %d,%d", - macho_reader.cpu_type(), macho_reader.cpu_subtype()); - fprintf(stderr, " to Breakpad symbol file: no register name table\n"); + const char* arch_name = GetNameFromCPUType(macho_reader.cpu_type(), + macho_reader.cpu_subtype()); + fprintf( + stderr, + "%s: cannot convert DWARF call frame information for architecture " + "'%s' (%d, %d) to Breakpad symbol file: no register name table\n", + selected_object_name_.c_str(), arch_name, macho_reader.cpu_type(), + macho_reader.cpu_subtype()); return false; } } diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index c2e1b40b9..c22a05754 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -43,6 +43,7 @@ #include #include "common/byte_cursor.h" +#include "common/mac/arch_utilities.h" #include "common/mac/macho_reader.h" #include "common/mac/super_fat_arch.h" #include "common/module.h" @@ -82,26 +83,15 @@ class DumpSymbols { // problem reading |contents|, report it and return false. bool ReadData(uint8_t* contents, size_t size, const std::string& filename); - // If this dumper's file includes an object file for |cpu_type| and - // |cpu_subtype|, then select that object file for dumping, and return - // true. Otherwise, return false, and leave this dumper's selected - // architecture unchanged. + // If this dumper's file includes an object file for `info`, then select that + // object file for dumping, and return true. Otherwise, return false, and + // leave this dumper's selected architecture unchanged. // // By default, if this dumper's file contains only one object file, then // the dumper will dump those symbols; and if it contains more than one // object file, then the dumper will dump the object file whose // architecture matches that of this dumper program. - bool SetArchitecture(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); - - // If this dumper's file includes an object file for |arch_name|, then select - // that object file for dumping, and return true. Otherwise, return false, - // and leave this dumper's selected architecture unchanged. - // - // By default, if this dumper's file contains only one object file, then - // the dumper will dump those symbols; and if it contains more than one - // object file, then the dumper will dump the object file whose - // architecture matches that of this dumper program. - bool SetArchitecture(const std::string& arch_name); + bool SetArchitecture(const ArchInfo& info); // Return a pointer to an array of SuperFatArch structures describing the // object files contained in this dumper's file. Set *|count| to the number diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc index f9cd93277..4b9f56c2a 100644 --- a/src/common/mac/macho_walker.cc +++ b/src/common/mac/macho_walker.cc @@ -38,15 +38,15 @@ #include #include -#include #include #include #include #include +#include "common/mac/arch_utilities.h" #include "common/mac/byteswap.h" -#include "common/mac/macho_walker.h" #include "common/mac/macho_utilities.h" +#include "common/mac/macho_walker.h" namespace MacFileUtilities { @@ -85,9 +85,8 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { cpu_subtype_t valid_cpu_subtype = cpu_subtype; // if |cpu_type| is 0, use the native cpu type. if (cpu_type == 0) { - const NXArchInfo* arch = NXGetLocalArchInfo(); - assert(arch); - valid_cpu_type = arch->cputype; + ArchInfo arch = GetLocalArchInfo(); + valid_cpu_type = arch.cputype; valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE; } off_t offset; diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 2f2815c52..4d6f25c9d 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -67,7 +67,7 @@ struct Options { string srcPath; string dsymPath; - const NXArchInfo *arch; + std::optional arch; bool header_only; bool cfi; bool handle_inter_cu_refs; @@ -121,11 +121,12 @@ static void CopyCFIDataBetweenModules(Module* to_module, } static bool SetArchitecture(DumpSymbols& dump_symbols, - const NXArchInfo* arch, + const ArchInfo& arch, const std::string& filename) { - if (!dump_symbols.SetArchitecture(arch->cputype, arch->cpusubtype)) { + if (!dump_symbols.SetArchitecture(arch)) { fprintf(stderr, "%s: no architecture '%s' is present in file.\n", - filename.c_str(), arch->name); + filename.c_str(), + GetNameFromCPUType(arch.cputype, arch.cpusubtype)); size_t available_size; const SuperFatArch* available = dump_symbols.AvailableArchitectures(&available_size); @@ -135,14 +136,8 @@ static bool SetArchitecture(DumpSymbols& dump_symbols, fprintf(stderr, "architectures present in the file are:\n"); for (size_t i = 0; i < available_size; i++) { const SuperFatArch* arch = &available[i]; - const NXArchInfo* arch_info = - google_breakpad::BreakpadGetArchInfoFromCpuType(arch->cputype, - arch->cpusubtype); - if (arch_info) - fprintf(stderr, "%s (%s)\n", arch_info->name, arch_info->description); - else - fprintf(stderr, "unrecognized cpu type 0x%x, subtype 0x%x\n", - arch->cputype, arch->cpusubtype); + fprintf(stderr, "%s\n", + GetNameFromCPUType(arch->cputype, arch->cpusubtype)); } return false; } @@ -173,7 +168,7 @@ static bool Start(const Options& options) { return false; if (options.arch && - !SetArchitecture(dump_symbols, options.arch, primary_file)) { + !SetArchitecture(dump_symbols, *options.arch, primary_file)) { return false; } @@ -193,7 +188,7 @@ static bool Start(const Options& options) { return false; if (options.arch && - !SetArchitecture(dump_symbols, options.arch, options.srcPath)) { + !SetArchitecture(dump_symbols, *options.arch, options.srcPath)) { return false; } Module* cfi_module = NULL; @@ -248,8 +243,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { options->header_only = true; break; case 'a': { - const NXArchInfo *arch_info = - google_breakpad::BreakpadGetArchInfoFromName(optarg); + std::optional arch_info = GetArchInfoFromName(optarg); if (!arch_info) { fprintf(stderr, "%s: Invalid architecture: %s\n", argv[0], optarg); Usage(argc, argv); From 3848d7e3b5365b53452e123c65bcf07a633c58ff Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Fri, 10 Mar 2023 17:18:22 -0500 Subject: [PATCH 172/195] Mac: delete unused macho_dump.cc The only references to this are in derelict Xcode projects. Bug: chromium:1420654 Change-Id: If0d7064f32bab23630f79f459bb1dc429a203b88 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4329733 Reviewed-by: Mark Mentovai --- src/tools/mac/dump_syms/macho_dump.cc | 206 -------------------------- 1 file changed, 206 deletions(-) delete mode 100644 src/tools/mac/dump_syms/macho_dump.cc diff --git a/src/tools/mac/dump_syms/macho_dump.cc b/src/tools/mac/dump_syms/macho_dump.cc deleted file mode 100644 index 2610025c2..000000000 --- a/src/tools/mac/dump_syms/macho_dump.cc +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2010 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Original author: Jim Blandy - -// macho_dump.cc: Dump the contents of a Mach-O file. This is mostly -// a test program for the Mach_O::FatReader and Mach_O::Reader classes. - -#ifdef HAVE_CONFIG_H -#include // Must come first -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "common/byte_cursor.h" -#include "common/mac/arch_utilities.h" -#include "common/mac/macho_reader.h" -#include "common/path_helper.h" - -using google_breakpad::ByteBuffer; -using std::ostringstream; -using std::string; -using std::vector; - -namespace { -namespace mach_o = google_breakpad::mach_o; - -string program_name; - -int check_syscall(int result, const char* operation, const char* filename) { - if (result < 0) { - fprintf(stderr, "%s: %s '%s': %s\n", - program_name.c_str(), operation, - filename, strerror(errno)); - exit(1); - } - return result; -} - -class DumpSection: public mach_o::Reader::SectionHandler { - public: - DumpSection() : index_(0) { } - bool HandleSection(const mach_o::Section& section) { - printf(" section %d '%s' in segment '%s'\n" - " address: 0x%llx\n" - " alignment: 1 << %d B\n" - " flags: %d\n" - " size: %ld\n", - index_++, section.section_name.c_str(), section.segment_name.c_str(), - section.address, section.align, - mach_o::SectionFlags(section.flags), - section.contents.Size()); - return true; - } - - private: - int index_; -}; - -class DumpCommand: public mach_o::Reader::LoadCommandHandler { - public: - DumpCommand(mach_o::Reader* reader) : reader_(reader), index_(0) { } - bool UnknownCommand(mach_o::LoadCommandType type, - const ByteBuffer& contents) { - printf(" load command %d: %d", index_++, type); - return true; - } - bool SegmentCommand(const mach_o::Segment& segment) { - printf(" load command %d: %s-bit segment '%s'\n" - " address: 0x%llx\n" - " memory size: 0x%llx\n" - " maximum protection: 0x%x\n" - " initial protection: 0x%x\n" - " flags: %d\n" - " section_list size: %ld B\n", - index_++, (segment.bits_64 ? "64" : "32"), segment.name.c_str(), - segment.vmaddr, segment.vmsize, segment.maxprot, - segment.initprot, mach_o::SegmentFlags(segment.flags), - segment.section_list.Size()); - - DumpSection dump_section; - return reader_->WalkSegmentSections(segment, &dump_section); - } - private: - mach_o::Reader* reader_; - int index_; -}; - -void DumpFile(const char* filename) { - int fd = check_syscall(open(filename, O_RDONLY), "opening", filename); - struct stat attributes; - check_syscall(fstat(fd, &attributes), - "getting file attributes for", filename); - void* mapping = mmap(NULL, attributes.st_size, PROT_READ, - MAP_PRIVATE, fd, 0); - close(fd); - check_syscall(mapping == (void*)-1 ? -1 : 0, - "mapping contents of", filename); - - mach_o::FatReader::Reporter fat_reporter(filename); - mach_o::FatReader fat_reader(&fat_reporter); - if (!fat_reader.Read(reinterpret_cast(mapping), - attributes.st_size)) { - exit(1); - } - printf("filename: %s\n", filename); - size_t object_files_size; - const SuperFatArch* super_fat_object_files = - fat_reader.object_files(&object_files_size); - struct fat_arch* object_files; - if (!super_fat_object_files->ConvertToFatArch(object_files)) { - exit(1); - } - printf(" object file count: %ld\n", object_files_size); - for (size_t i = 0; i < object_files_size; i++) { - const struct fat_arch& file = object_files[i]; - const NXArchInfo* fat_arch_info = - google_breakpad::BreakpadGetArchInfoFromCpuType( - file.cputype, file.cpusubtype); - printf("\n object file %ld:\n" - " fat header:\n:" - " CPU type: %s (%s)\n" - " size: %d B\n" - " alignment: 1<<%d B\n", - i, fat_arch_info->name, fat_arch_info->description, - file.size, file.align); - - ostringstream name; - name << filename; - if (object_files_size > 1) - name << ", object file #" << i; - ByteBuffer file_contents(reinterpret_cast(mapping) - + file.offset, file.size); - mach_o::Reader::Reporter reporter(name.str()); - mach_o::Reader reader(&reporter); - if (!reader.Read(file_contents, file.cputype, file.cpusubtype)) { - exit(1); - } - - const NXArchInfo* macho_arch_info = - NXGetArchInfoFromCpuType(reader.cpu_type(), - reader.cpu_subtype()); - printf(" Mach-O header:\n" - " word size: %s\n" - " CPU type: %s (%s)\n" - " File type: %d\n" - " flags: %x\n", - (reader.bits_64() ? "64 bits" : "32 bits"), - macho_arch_info->name, macho_arch_info->description, - reader.file_type(), reader.flags()); - - DumpCommand dump_command(&reader); - reader.WalkLoadCommands(&dump_command); - } - munmap(mapping, attributes.st_size); -} - -} // namespace - -int main(int argc, char** argv) { - program_name = google_breakpad::BaseName(argv[0]); - if (argc == 1) { - fprintf(stderr, "Usage: %s FILE ...\n" - "Dump the contents of the Mach-O or fat binary files " - "'FILE ...'.\n", program_name.c_str()); - } - for (int i = 1; i < argc; i++) { - DumpFile(argv[i]); - } -} From 309534f959c47b1518a1a01817ad7ab4ec20a12b Mon Sep 17 00:00:00 2001 From: Ziad Youssef Date: Wed, 15 Mar 2023 15:34:30 +0000 Subject: [PATCH 173/195] Add brief flag to minidump_stackwalk The added flag will print only one line per frame for the requesting thread (This is mostly the crashing thread). Refactor the code for printing the frame so it can be reused. Bug: 1374075 Change-Id: I8a1c8b1a09740fcaa23c3cc642468622ee64ea73 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4339771 Reviewed-by: Joshua Peraza --- src/processor/minidump_stackwalk.cc | 10 ++++- src/processor/stackwalk_common.cc | 69 ++++++++++++++++++----------- src/processor/stackwalk_common.h | 1 + 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc index 5ff61b3c8..08c30ed3e 100644 --- a/src/processor/minidump_stackwalk.cc +++ b/src/processor/minidump_stackwalk.cc @@ -61,6 +61,7 @@ struct Options { bool machine_readable; bool output_stack_contents; bool output_requesting_thread_only; + bool brief; string minidump_file; std::vector symbol_paths; @@ -114,6 +115,8 @@ bool PrintMinidumpProcess(const Options& options) { if (options.machine_readable) { PrintProcessStateMachineReadable(process_state); + } else if (options.brief) { + PrintRequestingThreadBrief(process_state); } else { PrintProcessState(process_state, options.output_stack_contents, options.output_requesting_thread_only, &resolver); @@ -135,6 +138,7 @@ static void Usage(int argc, const char *argv[], bool error) { " -m Output in machine-readable format\n" " -s Output stack contents\n" " -c Output thread that causes crash or dump only\n", + " -b Brief of the thread that causes crash or dump\n", google_breakpad::BaseName(argv[0]).c_str()); } @@ -144,14 +148,18 @@ static void SetupOptions(int argc, const char *argv[], Options* options) { options->machine_readable = false; options->output_stack_contents = false; options->output_requesting_thread_only = false; + options->brief = false; - while ((ch = getopt(argc, (char * const*)argv, "chms")) != -1) { + while ((ch = getopt(argc, (char* const*)argv, "bchms")) != -1) { switch (ch) { case 'h': Usage(argc, argv, false); exit(0); break; + case 'b': + options->brief = true; + break; case 'c': options->output_requesting_thread_only = true; break; diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index 3a842959d..889931ea1 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -277,6 +277,33 @@ static void PrintStackContents(const string& indent, printf("\n"); } +static void PrintFrameHeader(const StackFrame* frame, int frame_index) { + printf("%2d ", frame_index); + + uint64_t instruction_address = frame->ReturnAddress(); + + if (frame->module) { + printf("%s", PathnameStripper::File(frame->module->code_file()).c_str()); + if (!frame->function_name.empty()) { + printf("!%s", frame->function_name.c_str()); + if (!frame->source_file_name.empty()) { + string source_file = PathnameStripper::File(frame->source_file_name); + printf(" [%s : %d + 0x%" PRIx64 "]", source_file.c_str(), + frame->source_line, + instruction_address - frame->source_line_base); + } else { + printf(" + 0x%" PRIx64, instruction_address - frame->function_base); + } + } else { + printf(" + 0x%" PRIx64, + instruction_address - frame->module->base_address()); + } + } else { + printf("0x%" PRIx64, instruction_address); + } + printf("\n "); +} + // PrintStack prints the call stack in |stack| to stdout, in a reasonably // useful form. Module, function, and source file names are displayed if // they are available. The code offset to the base code address of the @@ -298,31 +325,7 @@ static void PrintStack(const CallStack* stack, } for (int frame_index = 0; frame_index < frame_count; ++frame_index) { const StackFrame* frame = stack->frames()->at(frame_index); - printf("%2d ", frame_index); - - uint64_t instruction_address = frame->ReturnAddress(); - - if (frame->module) { - printf("%s", PathnameStripper::File(frame->module->code_file()).c_str()); - if (!frame->function_name.empty()) { - printf("!%s", frame->function_name.c_str()); - if (!frame->source_file_name.empty()) { - string source_file = PathnameStripper::File(frame->source_file_name); - printf(" [%s : %d + 0x%" PRIx64 "]", - source_file.c_str(), - frame->source_line, - instruction_address - frame->source_line_base); - } else { - printf(" + 0x%" PRIx64, instruction_address - frame->function_base); - } - } else { - printf(" + 0x%" PRIx64, - instruction_address - frame->module->base_address()); - } - } else { - printf("0x%" PRIx64, instruction_address); - } - printf("\n "); + PrintFrameHeader(frame, frame_index); // Inlined frames don't have registers info. if (frame->trust != StackFrameAMD64::FRAME_TRUST_INLINE) { @@ -1281,4 +1284,20 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) { } } +void PrintRequestingThreadBrief(const ProcessState& process_state) { + int requesting_thread = process_state.requesting_thread(); + if (requesting_thread == -1) { + printf(" \n"); + return; + } + + printf("Thread %d (%s)\n", requesting_thread, + process_state.crashed() ? "crashed" : "requested dump, did not crash"); + const CallStack* stack = process_state.threads()->at(requesting_thread); + int frame_count = stack->frames()->size(); + for (int frame_index = 0; frame_index < frame_count; ++frame_index) { + PrintFrameHeader(stack->frames()->at(frame_index), frame_index); + } +} + } // namespace google_breakpad diff --git a/src/processor/stackwalk_common.h b/src/processor/stackwalk_common.h index bb12b98f4..3782f987b 100644 --- a/src/processor/stackwalk_common.h +++ b/src/processor/stackwalk_common.h @@ -43,6 +43,7 @@ void PrintProcessState(const ProcessState& process_state, bool output_stack_contents, bool output_requesting_thread_only, SourceLineResolverInterface* resolver); +void PrintRequestingThreadBrief(const ProcessState& process_state); } // namespace google_breakpad From 9bf8d1ec526cec139b2d3fba148ce81ccf2cceab Mon Sep 17 00:00:00 2001 From: Ziad Youssef Date: Thu, 16 Mar 2023 12:05:56 +0000 Subject: [PATCH 174/195] Remove extra comma in minidump_stackwalk.cc Bug: 1374075 Change-Id: I1fb0f73b286625f3c99735e51418393af891a2b8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4345752 Reviewed-by: Joshua Peraza --- src/processor/minidump_stackwalk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc index 08c30ed3e..74b41acf7 100644 --- a/src/processor/minidump_stackwalk.cc +++ b/src/processor/minidump_stackwalk.cc @@ -137,7 +137,7 @@ static void Usage(int argc, const char *argv[], bool error) { "\n" " -m Output in machine-readable format\n" " -s Output stack contents\n" - " -c Output thread that causes crash or dump only\n", + " -c Output thread that causes crash or dump only\n" " -b Brief of the thread that causes crash or dump\n", google_breakpad::BaseName(argv[0]).c_str()); } From 9cc38fec8bbf4efc58f077c975e7f2b422a74ee3 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 20 Mar 2023 11:45:05 -0600 Subject: [PATCH 175/195] [dump_syms/Mac] New -n MODULE arg to Mac dump_syms Previously, dump_syms always used the basename of the on-disk file as the Breakpad module name and required that the on-disk filename of the dSYM and binary file match, or it would exit with an error. Build automation often uses filenames unrelated to the Breakpad module name, so this CL adds a new optional "-n MODULE" argument to Mac dump_syms that allows passing in the Breakpad module name from outside. In this case, the basename of the on-disk file(s) is ignored and no longer required to match. Change-Id: Ic38e8cf762c79bce61d289b397293eff6c0039ce Bug: b/273531493 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4338857 Reviewed-by: Robert Sesek --- src/common/mac/dump_syms.cc | 7 +++- src/common/mac/dump_syms.h | 17 ++++++-- src/tools/mac/dump_syms/dump_syms_tool.cc | 49 +++++++++++++++++++---- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index efa60f5b3..6396e97a4 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -429,7 +429,12 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { } // Compute a module name, to appear in the MODULE record. - string module_name = google_breakpad::BaseName(object_filename_); + string module_name; + if (!module_name_.empty()) { + module_name = module_name_; + } else { + module_name = google_breakpad::BaseName(object_filename_); + } // Choose an identifier string, to appear in the MODULE record. string identifier = Identifier(); diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index c22a05754..d5aa7185f 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -56,7 +56,8 @@ class DumpSymbols { public: DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs, - bool enable_multiple = false) + bool enable_multiple = false, + const std::string& module_name = "") : symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs), object_filename_(), @@ -66,12 +67,18 @@ class DumpSymbols { object_files_(), selected_object_file_(), selected_object_name_(), - enable_multiple_(enable_multiple) {} + enable_multiple_(enable_multiple), + module_name_(module_name) {} ~DumpSymbols() = default; // Prepare to read debugging information from |filename|. |filename| may be // the name of a fat file, a Mach-O file, or a dSYM bundle containing either - // of the above. On success, return true; if there is a problem reading + // of the above. + // + // If |module_name_| is empty, uses the basename of |filename| as the module + // name. Otherwise, uses |module_name_| as the module name. + // + // On success, return true; if there is a problem reading // |filename|, report it and return false. bool Read(const std::string& filename); @@ -194,6 +201,10 @@ class DumpSymbols { // See: https://crbug.com/google-breakpad/751 and docs at // docs/symbol_files.md#records-3 bool enable_multiple_; + + // If non-empty, used as the module name. Otherwise, the basename of + // |object_filename_| is used as the module name. + const std::string module_name_; }; } // namespace google_breakpad diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index 4d6f25c9d..ab36164f4 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -63,7 +63,8 @@ struct Options { cfi(true), handle_inter_cu_refs(true), handle_inlines(false), - enable_multiple(false) {} + enable_multiple(false), + module_name() {} string srcPath; string dsymPath; @@ -73,6 +74,7 @@ struct Options { bool handle_inter_cu_refs; bool handle_inlines; bool enable_multiple; + string module_name; }; static bool StackFrameEntryComparator(const Module::StackFrameEntry* a, @@ -149,7 +151,7 @@ static bool Start(const Options& options) { (options.handle_inlines ? INLINES : NO_DATA) | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs, - options.enable_multiple); + options.enable_multiple, options.module_name); // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the // Mach-O file, which is not copied into the dSYM. Whereas in i386, the CFI @@ -196,13 +198,38 @@ static bool Start(const Options& options) { return false; scoped_ptr scoped_cfi_module(cfi_module); + bool name_matches; + if (!options.module_name.empty()) { + // Ignore the basename of the dSYM and binary and use the passed-in module + // name. + name_matches = true; + } else { + name_matches = cfi_module->name() == module->name(); + } + // Ensure that the modules are for the same debug code file. - if (cfi_module->name() != module->name() || - cfi_module->os() != module->os() || + if (!name_matches || cfi_module->os() != module->os() || cfi_module->architecture() != module->architecture() || cfi_module->identifier() != module->identifier()) { fprintf(stderr, "Cannot generate a symbol file from split sources that do" " not match.\n"); + if (!name_matches) { + fprintf(stderr, "Name mismatch: binary=[%s], dSYM=[%s]\n", + cfi_module->name().c_str(), module->name().c_str()); + } + if (cfi_module->os() != module->os()) { + fprintf(stderr, "OS mismatch: binary=[%s], dSYM=[%s]\n", + cfi_module->os().c_str(), module->os().c_str()); + } + if (cfi_module->architecture() != module->architecture()) { + fprintf(stderr, "Architecture mismatch: binary=[%s], dSYM=[%s]\n", + cfi_module->architecture().c_str(), + module->architecture().c_str()); + } + if (cfi_module->identifier() != module->identifier()) { + fprintf(stderr, "Identifier mismatch: binary=[%s], dSYM=[%s]\n", + cfi_module->identifier().c_str(), module->identifier().c_str()); + } return false; } @@ -215,8 +242,10 @@ static bool Start(const Options& options) { //============================================================================= static void Usage(int argc, const char *argv[]) { fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n"); - fprintf(stderr, "Usage: %s [-a ARCHITECTURE] [-c] [-g dSYM path] " - "\n", argv[0]); + fprintf(stderr, + "Usage: %s [-a ARCHITECTURE] [-c] [-g dSYM path] " + "[-n MODULE] \n", + argv[0]); fprintf(stderr, "\t-i: Output module header information only.\n"); fprintf(stderr, "\t-a: Architecture type [default: native, or whatever is\n"); fprintf(stderr, "\t in the file, if it contains only one architecture]\n"); @@ -228,6 +257,9 @@ static void Usage(int argc, const char *argv[]) { fprintf(stderr, "\t-m: Enable writing the optional 'm' field on FUNC " "and PUBLIC, denoting multiple symbols for the address.\n"); + fprintf(stderr, + "\t-n: Use MODULE as the name of the module rather than \n" + "the basename of the Mach-O file/dSYM.\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -237,7 +269,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; signed char ch; - while ((ch = getopt(argc, (char* const*)argv, "ia:g:crdm?h")) != -1) { + while ((ch = getopt(argc, (char* const*)argv, "ia:g:crdm?hn:")) != -1) { switch (ch) { case 'i': options->header_only = true; @@ -267,6 +299,9 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { case 'm': options->enable_multiple = true; break; + case 'n': + options->module_name = optarg; + break; case '?': case 'h': Usage(argc, argv); From c179ddaa58e0ec3093f98de555ad5791e9cb432a Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Mon, 13 Mar 2023 18:14:34 -0400 Subject: [PATCH 176/195] Mac: don't call NXFindBestFatArch `NXFindBestFatArch` is deprecated in macOS 13. We use this when an architecture is passed in via the `-a` flag. Unfortunately, neither of the potential replacements can help with this use case: - `macho_for_each_slice` as suggested in a reply to FB11955188 just enumerates slices, without the logic for inexact matches (for example, x86_64h -> x86_64 or arm64e -> arm64). - `macho_best_slice` as recommended by the deprecation notice only supports finding a suitable slice to run on the local machine. We could adapt the logic in `NXFindBestFatArch` but it gets quite complex for some architectures. Instead, this change adapts the `NXFindBestFatArch` polyfill used in `dump_syms_mac` for Linux, which returns an exact match if possible, and the first slice that matches the requested CPU type otherwise. I think this is probably Good Enough for most cases; if not, we can try porting the x86_64 and ARM logic and falling back to this for the rest. Change-Id: I3b269dab7246eced768cecd994e915debd95721a Bug: chromium:14206541420654 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4335477 Reviewed-by: Mark Mentovai --- src/common/mac/arch_utilities.cc | 18 -------- src/common/mac/dump_syms.cc | 75 +++++++++++--------------------- 2 files changed, 26 insertions(+), 67 deletions(-) diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index cdc1dfa50..febf8a222 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -210,22 +210,4 @@ const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype, } return candidate; } - -struct fat_arch *NXFindBestFatArch(cpu_type_t cputype, - cpu_subtype_t cpusubtype, - struct fat_arch *fat_archs, - uint32_t nfat_archs) { - struct fat_arch *candidate = NULL; - for (uint32_t f = 0; f < nfat_archs; ++f) { - if (fat_archs[f].cputype == cputype) { - if (fat_archs[f].cpusubtype == cpusubtype) { - return &fat_archs[f]; - } - if (!candidate) { - candidate = &fat_archs[f]; - } - } - } - return candidate; -} #endif // !__APPLE__ diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 6396e97a4..04ccae250 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -232,60 +232,37 @@ bool DumpSymbols::SetArchitecture(const ArchInfo& info) { return true; } -SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( - cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - // Check if all the object files can be converted to struct fat_arch. - bool can_convert_to_fat_arch = true; - vector fat_arch_vector; - for (vector::const_iterator it = object_files_.begin(); - it != object_files_.end(); - ++it) { - struct fat_arch arch; - bool success = it->ConvertToFatArch(&arch); - if (!success) { - can_convert_to_fat_arch = false; - break; - } - fat_arch_vector.push_back(arch); - } - - // If all the object files can be converted to struct fat_arch, use - // NXFindBestFatArch. - if (can_convert_to_fat_arch) { - const struct fat_arch* best_match - = NXFindBestFatArch(cpu_type, cpu_subtype, &fat_arch_vector[0], - static_cast(fat_arch_vector.size())); - for (size_t i = 0; i < fat_arch_vector.size(); ++i) { - if (best_match == &fat_arch_vector[i]) - return &object_files_[i]; +SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( + cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype) { + SuperFatArch* closest_match = nullptr; + for (auto& object_file : object_files_) { + if (static_cast(object_file.cputype) == cpu_type) { + // If there's an exact match, return it directly. + if ((static_cast(object_file.cpusubtype) & + ~CPU_SUBTYPE_MASK) == (cpu_subtype & ~CPU_SUBTYPE_MASK)) { + return &object_file; + } + // Otherwise, hold on to this as the closest match since at least the CPU + // type matches. + if (!closest_match) { + closest_match = &object_file; + } } - assert(best_match == NULL); - // Fall through since NXFindBestFatArch can't find arm slices on x86_64 - // macOS 13. See FB11955188. } - - // Check for an exact match with cpu_type and cpu_subtype. - for (vector::iterator it = object_files_.begin(); - it != object_files_.end(); - ++it) { - if (static_cast(it->cputype) == cpu_type && - (static_cast(it->cpusubtype) & ~CPU_SUBTYPE_MASK) == - (cpu_subtype & ~CPU_SUBTYPE_MASK)) - return &*it; - } - // No exact match found. - // TODO(erikchen): If it becomes necessary, we can copy the implementation of - // NXFindBestFatArch, located at - // http://web.mit.edu/darwin/src/modules/cctools/libmacho/arch.c. - fprintf(stderr, "Failed to find an exact match for an object file with cpu " - "type: %d and cpu subtype: %d.\n", cpu_type, cpu_subtype); - if (!can_convert_to_fat_arch) { - fprintf(stderr, "Furthermore, at least one object file is larger " - "than 2**32.\n"); + fprintf(stderr, + "Failed to find an exact match for an object file with cpu " + "type: %d and cpu subtype: %d.\n", + cpu_type, cpu_subtype); + if (closest_match) { + fprintf(stderr, "Using %s as the closest match.\n", + GetNameFromCPUType(closest_match->cputype, + closest_match->cpusubtype)); + return closest_match; } - return NULL; + return nullptr; } string DumpSymbols::Identifier() { From b0dc1f3529caa497e292707845ed77573d745d9e Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Tue, 28 Mar 2023 19:09:16 +0000 Subject: [PATCH 177/195] Add EM_RISCV as recognized value for ELF e_machine `dump_syms` fails to write symbol file without knowing how to convert the ELF `e_machine` field to a string. Use "riscv" as the value because ELF `e_machine` does not distinguish between 32 bit and 64 bit RISC-V. Test: run `dump_syms` on the libc++ that's shipped with the Clang toolchain, or any other riscv binary: `./dump_syms -r -n libc++.so -o Fuchsia /lib/riscv64-unknown-fuchsia/libc++.so.2.0` Bug: fuchsia:124084 Change-Id: Ic04db96ec3d3d484350bdd0b90c9dfb70d7f7eb2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4376828 Reviewed-by: Mike Frysinger --- src/common/linux/dump_symbols.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 48e4c9265..36687bf48 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -1022,6 +1022,7 @@ const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) { case EM_SPARC: return "sparc"; case EM_SPARCV9: return "sparcv9"; case EM_X86_64: return "x86_64"; + case EM_RISCV: return "riscv"; default: return NULL; } } From 4d8bb33976e00c4bed675949fca6a5aafb118a97 Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Tue, 28 Mar 2023 21:14:44 +0000 Subject: [PATCH 178/195] Add RISC-V register names RISC-V register names are needed in order to load DWARF call frame information. Bug: fuchsia:124084 Change-Id: I2791b3a38ea35ddc2bb293f60f75dcc86338e354 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4376827 Reviewed-by: Mike Frysinger --- src/common/dwarf_cfi_to_module.cc | 23 ++++++++++++++++++++++ src/common/dwarf_cfi_to_module.h | 3 +++ src/common/dwarf_cfi_to_module_unittest.cc | 12 +++++++++++ src/common/linux/dump_symbols.cc | 3 +++ 4 files changed, 41 insertions(+) diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index 287c851e6..7e04d3c55 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -147,6 +147,29 @@ vector DwarfCFIToModule::RegisterNames::MIPS() { sizeof(kRegisterNames) / sizeof(kRegisterNames[0])); } +vector DwarfCFIToModule::RegisterNames::RISCV() { + static const char *const names[] = { + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", + "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", + "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", + "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", + "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31" + }; + + return MakeVector(names, sizeof(names) / sizeof(names[0])); +} + bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length, uint8_t version, const string& augmentation, unsigned return_address) { diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index 42b618d5b..19297db93 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -114,6 +114,9 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { // MIPS. static vector MIPS(); + // RISC-V. + static vector RISCV(); + private: // Given STRINGS, an array of C strings with SIZE elements, return an // equivalent vector. diff --git a/src/common/dwarf_cfi_to_module_unittest.cc b/src/common/dwarf_cfi_to_module_unittest.cc index 43b5e7c49..b407edd06 100644 --- a/src/common/dwarf_cfi_to_module_unittest.cc +++ b/src/common/dwarf_cfi_to_module_unittest.cc @@ -307,3 +307,15 @@ TEST(RegisterNames, X86_64) { EXPECT_EQ("$rsp", names[7]); EXPECT_EQ("$rip", names[16]); } + +TEST(RegisterNames, RISCV) { + vector names = DwarfCFIToModule::RegisterNames::RISCV(); + + EXPECT_EQ("x0", names[0]); + EXPECT_EQ("x31", names[31]); + EXPECT_EQ("f0", names[32]); + EXPECT_EQ("f31", names[63]); + EXPECT_EQ("v0", names[96]); + EXPECT_EQ("v31", names[127]); +} + diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 36687bf48..8179663bb 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -449,6 +449,9 @@ bool DwarfCFIRegisterNames(const typename ElfClass::Ehdr* elf_header, case EM_X86_64: *register_names = DwarfCFIToModule::RegisterNames::X86_64(); return true; + case EM_RISCV: + *register_names = DwarfCFIToModule::RegisterNames::RISCV(); + return true; default: return false; } From f6e42357d412e6d24a6a637752ae126c15819c9b Mon Sep 17 00:00:00 2001 From: Alex Gough Date: Tue, 28 Mar 2023 22:47:20 +0000 Subject: [PATCH 179/195] Add maxsize for xstate areas Breakpad skips the xstate area in x64 contexts but allowed this area to be of unconstrained size. This hits problems if the size is greater than Chrome's maximum allocation size, so we change to skipping a maximum size. The maximum is chosen to allow the full set of states today, plus some slack for the future: Based on Intel x64 manual 13.5 XSAVE-MANAGED STATE * => further bytes might be reserved | Size | Region | | 576 | Legacy + header | | 384 | AVX State | | 80 | MPX State | | 1600 | AVX-512 State | | 72*| PT State | | 8 | pkru state | | 8 | pasid state | | 16 | CET state | | 8 | HDC State | | 96?| uintr state | | 808*| lbr state | | 8 | hwp state | | 16 | amx state | == 3680 so jump up a bit for the future to 2**12. Bug:1425631 Change-Id: Ie08555651977cdbfa1c351c661118f13238213c4 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4379497 Reviewed-by: Ivan Penkov --- src/processor/minidump.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 63f48ffe5..45e4a5246 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -76,6 +76,11 @@ using std::vector; namespace { +// Limit arrived at by adding up possible states in Intel Ch. 13.5 X-SAVE +// MANAGED STATE +// (~ 3680 bytes) plus some extra for the future. +const uint32_t kMaxXSaveAreaSize = 16384; + // Returns true iff |context_size| matches exactly one of the sizes of the // various MDRawContext* types. // TODO(blundell): This function can be removed once @@ -507,6 +512,10 @@ bool MinidumpContext::Read(uint32_t expected_size) { // sizeof(MDRawContextAMD64). For now we skip this extended data. if (expected_size > sizeof(MDRawContextAMD64)) { size_t bytes_left = expected_size - sizeof(MDRawContextAMD64); + if (bytes_left > kMaxXSaveAreaSize) { + BPLOG(ERROR) << "MinidumpContext oversized xstate area"; + return false; + } std::vector xstate(bytes_left); if (!minidump_->ReadBytes(xstate.data(), bytes_left)) { From b1775c56b253e8f3c19e4ae8cfd67f9fe1fe45b1 Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Tue, 11 Apr 2023 21:40:00 +0000 Subject: [PATCH 180/195] Convert RISC-V numeric identifiers to strings Printing the register values as part of the stack trace relies on the CPU architecture being "riscv" or "riscv64" rather than the numeric identifiers (0x8005 and 0x8006, respectively). Fixed: 1432306 Test: Run `minidump_stackwalk` on a RISC-V minidump Change-Id: I0009da687438d51047e2ee39ffa1c50d78798caa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4416399 Reviewed-by: Joshua Peraza --- src/processor/minidump_processor.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index d56a7d63e..5ba6ff4f8 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -633,6 +633,16 @@ bool MinidumpProcessor::GetCPUInfo(Minidump* dump, SystemInfo* info) { break; } + case MD_CPU_ARCHITECTURE_RISCV: { + info->cpu = "riscv"; + break; + } + + case MD_CPU_ARCHITECTURE_RISCV64: { + info->cpu = "riscv64"; + break; + } + default: { // Assign the numeric architecture ID into the CPU string. char cpu_string[7]; From bd9d94c70843620adeebcd73c243001237c6d426 Mon Sep 17 00:00:00 2001 From: Yuki Wang Date: Mon, 17 Apr 2023 13:58:52 -0700 Subject: [PATCH 181/195] Set O_NONBLOCK for opening file to prevent hanging when file unavailable. Bug: 277976345 Change-Id: Iddf55d8e172f98c76ae7167f609fb53c4c60fa48 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4437089 Reviewed-by: Joshua Peraza --- src/common/linux/memory_mapped_file.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc index 568312cf3..a7b96eb59 100644 --- a/src/common/linux/memory_mapped_file.cc +++ b/src/common/linux/memory_mapped_file.cc @@ -61,8 +61,11 @@ MemoryMappedFile::~MemoryMappedFile() { bool MemoryMappedFile::Map(const char* path, size_t offset) { Unmap(); - - int fd = sys_open(path, O_RDONLY, 0); + // Based on https://pubs.opengroup.org/onlinepubs/7908799/xsh/open.html + // If O_NONBLOCK is set: The open() function will return without blocking + // for the device to be ready or available. Setting this value will provent + // hanging if file is not avilable. + int fd = sys_open(path, O_RDONLY | O_NONBLOCK, 0); if (fd == -1) { return false; } From 16cee17997a52e200b38fbded8545bc76127d791 Mon Sep 17 00:00:00 2001 From: Ziad Youssef Date: Fri, 21 Apr 2023 12:47:56 +0000 Subject: [PATCH 182/195] Fix alignment of the brief output of minidump_stackwalk Bug: 1435239 Change-Id: I4ea6cbe89d5ef0907f7e07c454e4533995996521 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4459351 Reviewed-by: Joshua Peraza --- src/processor/stackwalk_common.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index 889931ea1..688b27823 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -301,7 +301,6 @@ static void PrintFrameHeader(const StackFrame* frame, int frame_index) { } else { printf("0x%" PRIx64, instruction_address); } - printf("\n "); } // PrintStack prints the call stack in |stack| to stdout, in a reasonably @@ -326,6 +325,7 @@ static void PrintStack(const CallStack* stack, for (int frame_index = 0; frame_index < frame_count; ++frame_index) { const StackFrame* frame = stack->frames()->at(frame_index); PrintFrameHeader(frame, frame_index); + printf("\n "); // Inlined frames don't have registers info. if (frame->trust != StackFrameAMD64::FRAME_TRUST_INLINE) { @@ -1297,6 +1297,7 @@ void PrintRequestingThreadBrief(const ProcessState& process_state) { int frame_count = stack->frames()->size(); for (int frame_index = 0; frame_index < frame_count; ++frame_index) { PrintFrameHeader(stack->frames()->at(frame_index), frame_index); + printf("\n"); } } From f548d75c9fa8bc062a580dbe5edb2fae2106d5c9 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Fri, 21 Apr 2023 12:02:42 -0600 Subject: [PATCH 183/195] [dump_syms/Mac] New -x option to prefer extern names when there's a mismatch When built with -gmlt, .dSYMs are (by design) missing the `DW_AT_linkage_name` which Breakpad uses to fill out the (name-mangled) function names. Thankfully, the .dSYM contains both the old-school LC_SYMTAB command containing the STABS-format symbols (which include the fully-qualified C++ symbol names we want, but no actual compilation unit data), as well as the LC_SEGMENT_64 containing the __DWARF segment with the minimal -gmlt debug information (which excludes the name-mangled C++ symbols). Unfortunately, since the .dSYM's STABS does not define compilation units, the usual path in `StabsReader` ignores all the fully-qualified C++ symbol names for the functions: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/stabs_reader.cc#100 Fortunately, when built for macOS platforms (`HAVE_MACH_O_NLIST_H`), `StabsReader` supports storing all the STABS-format symbols as `Extern`s, regardless of whether or not they're in a compilation unit: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/stabs_reader.cc#119 Currently, when there's both a `Function` and an `Extern` with the same address, `Module` discards the `Extern`: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/module.cc#161 This CL adds a new `-x` option to the Mac `dump_syms` which prefers the Extern function name if there's a mismatch. Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 Change-Id: I0d32adc64fbf567600b0a5ca63c71c422b7f0f8c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4453650 Reviewed-by: Joshua Peraza --- src/common/dwarf_cu_to_module.cc | 32 +++++++++++++++++++---- src/common/dwarf_cu_to_module_unittest.cc | 13 +++++++++ src/common/mac/dump_syms.cc | 2 +- src/common/mac/dump_syms.h | 15 +++++++++-- src/common/module.cc | 15 +++++++---- src/common/module.h | 16 +++++++++++- src/common/module_unittest.cc | 31 ++++++++++++++++++++++ src/tools/mac/dump_syms/dump_syms_tool.cc | 17 +++++++++--- 8 files changed, 123 insertions(+), 18 deletions(-) diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 43b468c19..708ed1431 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -330,7 +330,10 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { // Use this from EndAttributes member functions, not ProcessAttribute* // functions; only the former can be sure that all the DIE's attributes // have been seen. - StringView ComputeQualifiedName(); + // + // On return, if has_qualified_name is non-NULL, *has_qualified_name is set to + // true if the DIE includes a fully-qualified name, false otherwise. + StringView ComputeQualifiedName(bool* has_qualified_name); CUContext* cu_context_; DIEContext* parent_context_; @@ -466,7 +469,8 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( } } -StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { +StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName( + bool* has_qualified_name) { // Use the demangled name, if one is available. Demangled names are // preferable to those inferred from the DWARF structure because they // include argument types. @@ -482,6 +486,15 @@ StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { StringView* unqualified_name = nullptr; StringView* enclosing_name = nullptr; if (!qualified_name) { + if (has_qualified_name) { + // dSYMs built with -gmlt do not include the DW_AT_linkage_name + // with the unmangled symbol, but rather include it in the + // LC_SYMTAB STABS, which end up in the externs of the module. + // + // Remember this so the Module can copy over the extern name later. + *has_qualified_name = false; + } + // Find the unqualified name. If the DIE has its own DW_AT_name // attribute, then use that; otherwise, check the specification. if (!name_attribute_.empty()) { @@ -500,6 +513,10 @@ StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { } else if (parent_context_) { enclosing_name = &parent_context_->name; } + } else { + if (has_qualified_name) { + *has_qualified_name = true; + } } // Prepare the return value before upcoming mutations possibly invalidate the @@ -722,7 +739,8 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { ranges_form_(DW_FORM_sec_offset), ranges_data_(0), inline_(false), - handle_inline_(handle_inline) {} + handle_inline_(handle_inline), + has_qualified_name_(false) {} void ProcessAttributeUnsigned(enum DwarfAttribute attr, enum DwarfForm form, @@ -745,6 +763,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { bool inline_; vector> child_inlines_; bool handle_inline_; + bool has_qualified_name_; DIEContext child_context_; // A context for our children. }; @@ -808,7 +827,7 @@ DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler( bool DwarfCUToModule::FuncHandler::EndAttributes() { // Compute our name, and record a specification, if appropriate. - name_ = ComputeQualifiedName(); + name_ = ComputeQualifiedName(&has_qualified_name_); if (name_.empty() && abstract_origin_) { name_ = abstract_origin_->name; } @@ -881,6 +900,9 @@ void DwarfCUToModule::FuncHandler::Finish() { scoped_ptr func(new Module::Function(name, low_pc_)); func->ranges = ranges; func->parameter_size = 0; + // If the name was unqualified, prefer the Extern name if there's a mismatch + // (the Extern name will be fully-qualified in that case). + func->prefer_extern_name = !has_qualified_name_; if (func->address) { // If the function address is zero this is a sign that this function // description is just empty debug data and should just be discarded. @@ -915,7 +937,7 @@ void DwarfCUToModule::FuncHandler::Finish() { } bool DwarfCUToModule::NamedScopeHandler::EndAttributes() { - child_context_.name = ComputeQualifiedName(); + child_context_.name = ComputeQualifiedName(NULL); if (child_context_.name.empty() && no_specification) { cu_context_->reporter->UnknownSpecification(offset_, specification_offset_); } diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc index 7ab2f15cd..134b2c243 100644 --- a/src/common/dwarf_cu_to_module_unittest.cc +++ b/src/common/dwarf_cu_to_module_unittest.cc @@ -267,6 +267,10 @@ class CUFixtureBase { void TestFunction(int i, const string& name, Module::Address address, Module::Address size); + // Test that the I'th function (ordered by address) in the module + // this.module_ has the given prefer_extern_name. + void TestFunctionPreferExternName(int i, bool prefer_extern_name); + // Test that the number of source lines owned by the I'th function // in the module this.module_ is equal to EXPECTED. void TestLineCount(int i, size_t expected); @@ -615,6 +619,15 @@ void CUFixtureBase::TestFunction(int i, const string& name, EXPECT_EQ(0U, function->parameter_size); } +void CUFixtureBase::TestFunctionPreferExternName(int i, + bool prefer_extern_name) { + FillFunctions(); + ASSERT_LT((size_t)i, functions_.size()); + + Module::Function* function = functions_[i]; + EXPECT_EQ(prefer_extern_name, function->prefer_extern_name); +} + void CUFixtureBase::TestLineCount(int i, size_t expected) { FillFunctions(); ASSERT_LT((size_t) i, functions_.size()); diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 04ccae250..dd91196ae 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -420,7 +420,7 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr& module) { // Create a module to hold the debugging information. module.reset(new Module(module_name, "mac", selected_arch_name, identifier, - "", enable_multiple_)); + "", enable_multiple_, prefer_extern_name_)); return true; } diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index d5aa7185f..5bcb0b58f 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -57,7 +57,8 @@ class DumpSymbols { DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs, bool enable_multiple = false, - const std::string& module_name = "") + const std::string& module_name = "", + bool prefer_extern_name = false) : symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs), object_filename_(), @@ -68,7 +69,8 @@ class DumpSymbols { selected_object_file_(), selected_object_name_(), enable_multiple_(enable_multiple), - module_name_(module_name) {} + module_name_(module_name), + prefer_extern_name_(prefer_extern_name) {} ~DumpSymbols() = default; // Prepare to read debugging information from |filename|. |filename| may be @@ -205,6 +207,15 @@ class DumpSymbols { // If non-empty, used as the module name. Otherwise, the basename of // |object_filename_| is used as the module name. const std::string module_name_; + + // If a Function and an Extern share the same address but have a different + // name, prefer the name of the Extern. + // + // Use this when dumping Mach-O .dSYMs built with -gmlt (Minimum Line Tables), + // as the Function's fully-qualified name will only be present in the STABS + // (which are placed in the Extern), not in the DWARF symbols (which are + // placed in the Function). + bool prefer_extern_name_; }; } // namespace google_breakpad diff --git a/src/common/module.cc b/src/common/module.cc index a5c1b6ad0..e61c3b7aa 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -105,14 +105,16 @@ Module::Module(const string& name, const string& architecture, const string& id, const string& code_id /* = "" */, - bool enable_multiple_field /* = false*/) + bool enable_multiple_field /* = false*/, + bool prefer_extern_name /* = false*/) : name_(name), os_(os), architecture_(architecture), id_(id), code_id_(code_id), load_address_(0), - enable_multiple_field_(enable_multiple_field) {} + enable_multiple_field_(enable_multiple_field), + prefer_extern_name_(prefer_extern_name) {} Module::~Module() { for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it) @@ -152,11 +154,14 @@ bool Module::AddFunction(Function* function) { it_ext = externs_.find(&arm_thumb_ext); } if (it_ext != externs_.end()) { + Extern* found_ext = it_ext->get(); + bool name_mismatch = found_ext->name != function->name; if (enable_multiple_field_) { - Extern* found_ext = it_ext->get(); // If the PUBLIC is for the same symbol as the FUNC, don't mark multiple. - function->is_multiple |= - found_ext->name != function->name || found_ext->is_multiple; + function->is_multiple |= name_mismatch || found_ext->is_multiple; + } + if (name_mismatch && prefer_extern_name_) { + function->name = AddStringToPool(it_ext->get()->name); } externs_.erase(it_ext); } diff --git a/src/common/module.h b/src/common/module.h index c1fd9f59c..d736701ff 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -131,6 +131,10 @@ class Module { // If this symbol has been folded with other symbols in the linked binary. bool is_multiple = false; + + // If the function's name should be filled out from a matching Extern, + // should they not match. + bool prefer_extern_name = false; }; struct InlineOrigin { @@ -317,7 +321,8 @@ class Module { const string& architecture, const string& id, const string& code_id = "", - bool enable_multiple_field = false); + bool enable_multiple_field = false, + bool prefer_extern_name = false); ~Module(); // Set the module's load address to LOAD_ADDRESS; addresses given @@ -502,6 +507,15 @@ class Module { // at // https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md#records-3 bool enable_multiple_field_; + + // If a Function and an Extern share the same address but have a different + // name, prefer the name of the Extern. + // + // Use this when dumping Mach-O .dSYMs built with -gmlt (Minimum Line Tables), + // as the Function's fully-qualified name will only be present in the STABS + // (which are placed in the Extern), not in the DWARF symbols (which are + // placed in the Function). + bool prefer_extern_name_; }; } // namespace google_breakpad diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index 213b3154c..6a6762e53 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -640,6 +640,37 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddress) { contents.c_str()); } +// If there exists an extern and a function at the same address, only write +// out the FUNC entry. +TEST(Module, ConstructFunctionsAndExternsWithSameAddressPreferExternName) { + stringstream s; + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", false, true); + + // Two externs. + auto extern1 = std::make_unique(0xabc0); + extern1->name = "extern1"; + auto extern2 = std::make_unique(0xfff0); + extern2->name = "extern2"; + + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); + + Module::Function* function = new Module::Function("function2", 0xfff0); + Module::Range range(0xfff0, 0x10); + function->ranges.push_back(range); + function->parameter_size = 0; + m.AddFunction(function); + + m.Write(s, ALL_SYMBOL_DATA); + string contents = s.str(); + + EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " " MODULE_ID " " MODULE_NAME + "\n" + "FUNC fff0 10 0 extern2\n" + "PUBLIC abc0 0 extern1\n", + contents.c_str()); +} + // If there exists an extern and a function at the same address, only write // out the FUNC entry, and mark it with `m` if the multiple field is enabled. TEST(Module, ConstructFunctionsAndExternsWithSameAddressMultiple) { diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index ab36164f4..9fb8d13f2 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -64,7 +64,8 @@ struct Options { handle_inter_cu_refs(true), handle_inlines(false), enable_multiple(false), - module_name() {} + module_name(), + prefer_extern_name(false) {} string srcPath; string dsymPath; @@ -75,6 +76,7 @@ struct Options { bool handle_inlines; bool enable_multiple; string module_name; + bool prefer_extern_name; }; static bool StackFrameEntryComparator(const Module::StackFrameEntry* a, @@ -151,7 +153,8 @@ static bool Start(const Options& options) { (options.handle_inlines ? INLINES : NO_DATA) | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs, - options.enable_multiple, options.module_name); + options.enable_multiple, options.module_name, + options.prefer_extern_name); // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the // Mach-O file, which is not copied into the dSYM. Whereas in i386, the CFI @@ -244,7 +247,7 @@ static void Usage(int argc, const char *argv[]) { fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n"); fprintf(stderr, "Usage: %s [-a ARCHITECTURE] [-c] [-g dSYM path] " - "[-n MODULE] \n", + "[-n MODULE] [-x] \n", argv[0]); fprintf(stderr, "\t-i: Output module header information only.\n"); fprintf(stderr, "\t-a: Architecture type [default: native, or whatever is\n"); @@ -260,6 +263,9 @@ static void Usage(int argc, const char *argv[]) { fprintf(stderr, "\t-n: Use MODULE as the name of the module rather than \n" "the basename of the Mach-O file/dSYM.\n"); + fprintf(stderr, + "\t-x: Prefer the PUBLIC (extern) name over the FUNC if\n" + "they do not match.\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -269,7 +275,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; signed char ch; - while ((ch = getopt(argc, (char* const*)argv, "ia:g:crdm?hn:")) != -1) { + while ((ch = getopt(argc, (char* const*)argv, "ia:g:crdm?hn:x")) != -1) { switch (ch) { case 'i': options->header_only = true; @@ -302,6 +308,9 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { case 'n': options->module_name = optarg; break; + case 'x': + options->prefer_extern_name = true; + break; case '?': case 'h': Usage(argc, argv); From bfde407de559c10d6cef861b3873ff287c24e761 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 24 Apr 2023 13:53:09 -0600 Subject: [PATCH 184/195] [dump_syms] Relax name matching for marking symbols as multiple Previously, the logic to mark a symbol as "multiple" would always fire for C++ symbols for Apple `.dSYM`s built with `-gmlt`. This was because for a C++ symbol like `void foo::bar::Baz()`, the DWARF data would contain the truncated function name `Baz`, but the STABS would contain the fully-qualified name `void foo::bar::Baz()`. This CL relaxes the name matching to not mark as multiple: 1) Symbols which were missing names entirely in the DWARF (e.g, ")` 2) Symbols whose fully-qualified name includes the truncated name as a substring Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 Change-Id: I26ded7ca84d964aa4a73da19e4bdd7e686e2c998 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4470047 Reviewed-by: Joshua Peraza --- src/common/module.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/common/module.cc b/src/common/module.cc index e61c3b7aa..73c4a8b17 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -157,8 +157,22 @@ bool Module::AddFunction(Function* function) { Extern* found_ext = it_ext->get(); bool name_mismatch = found_ext->name != function->name; if (enable_multiple_field_) { + bool is_multiple_based_on_name; + // In the case of a .dSYM built with -gmlt, the external name will be the + // fully-qualified symbol name, but the function name will be the partial + // name (or omitted). + // + // Don't mark multiple in this case. + if (name_mismatch && + (function->name == "" || + found_ext->name.find(function->name.str()) != string::npos)) { + is_multiple_based_on_name = false; + } else { + is_multiple_based_on_name = name_mismatch; + } // If the PUBLIC is for the same symbol as the FUNC, don't mark multiple. - function->is_multiple |= name_mismatch || found_ext->is_multiple; + function->is_multiple |= + is_multiple_based_on_name || found_ext->is_multiple; } if (name_mismatch && prefer_extern_name_) { function->name = AddStringToPool(it_ext->get()->name); From 7b981b213550b08530ff17386c1c29c9771be40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Wed, 26 Apr 2023 13:20:27 -0700 Subject: [PATCH 185/195] Replace unsigned int with size_t for ModuleSerializer This is a speculative fix for a memory bug where our symbol files are looking like they've grown enough that serializing them will outgrow UINT_MAX. Before this change a size_t is implicitly cast to a size_t in unsigned int, allocate a buffer of that size and then continue to write module data out of bounds. I have not been able to reproduce the OOB write locally as the original uploaded symbol data is gone, but I have been able to reproduce builds where, if we enable inline frames and CFI dumping, the size grows to 3.6GB when serializing it, which is close enough to 4.2GB that the wrapping theory seems reasonable on another board or build. No effort is made here to prevent wrapping behavior on 32-bit systems. Bug: b/237242489, chromium:1410232 Change-Id: I3d7ec03c51c298f10df3d5b1e5306433875c7919 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4477821 Reviewed-by: Leonard Grey Reviewed-by: Mark Mentovai --- src/processor/module_comparer.cc | 2 +- src/processor/module_serializer.cc | 17 +++++++++-------- src/processor/module_serializer.h | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/processor/module_comparer.cc b/src/processor/module_comparer.cc index 1bf0b316d..a6413038a 100644 --- a/src/processor/module_comparer.cc +++ b/src/processor/module_comparer.cc @@ -68,7 +68,7 @@ bool ModuleComparer::Compare(const string& symbol_data) { buffer.reset(); // Serialize BasicSourceLineResolver::Module. - unsigned int serialized_size = 0; + size_t serialized_size = 0; scoped_array serialized_data( serializer_.Serialize(*(basic_module.get()), &serialized_size)); ASSERT_TRUE(serialized_data.get()); diff --git a/src/processor/module_serializer.cc b/src/processor/module_serializer.cc index 91d0006e6..05519958f 100644 --- a/src/processor/module_serializer.cc +++ b/src/processor/module_serializer.cc @@ -111,10 +111,10 @@ char* ModuleSerializer::Write(const BasicSourceLineResolver::Module& module, return dest; } -char* ModuleSerializer::Serialize( - const BasicSourceLineResolver::Module& module, unsigned int* size) { +char* ModuleSerializer::Serialize(const BasicSourceLineResolver::Module& module, + size_t* size) { // Compute size of memory to allocate. - unsigned int size_to_alloc = SizeOf(module); + const size_t size_to_alloc = SizeOf(module); // Allocate memory for serialized data. char* serialized_data = new char[size_to_alloc]; @@ -128,8 +128,8 @@ char* ModuleSerializer::Serialize( // Write serialized data to allocated memory chunk. char* end_address = Write(module, serialized_data); // Verify the allocated memory size is equal to the size of data been written. - unsigned int size_written = - static_cast(end_address - serialized_data); + const size_t size_written = + static_cast(end_address - serialized_data); if (size_to_alloc != size_written) { BPLOG(ERROR) << "size_to_alloc differs from size_written: " << size_to_alloc << " vs " << size_written; @@ -138,6 +138,7 @@ char* ModuleSerializer::Serialize( // Set size and return the start address of memory chunk. if (size) *size = size_to_alloc; + return serialized_data; } @@ -150,7 +151,7 @@ bool ModuleSerializer::SerializeModuleAndLoadIntoFastResolver( BasicSourceLineResolver::Module* basic_module = dynamic_cast(iter->second); - unsigned int size = 0; + size_t size = 0; scoped_array symbol_data(Serialize(*basic_module, &size)); if (!symbol_data.get()) { BPLOG(ERROR) << "Serialization failed for module: " << basic_module->name_; @@ -201,8 +202,8 @@ bool ModuleSerializer::ConvertOneModule( return SerializeModuleAndLoadIntoFastResolver(iter, fast_resolver); } -char* ModuleSerializer::SerializeSymbolFileData( - const string& symbol_data, unsigned int* size) { +char* ModuleSerializer::SerializeSymbolFileData(const string& symbol_data, + size_t* size) { scoped_ptr module( new BasicSourceLineResolver::Module("no name")); scoped_array buffer(new char[symbol_data.size() + 1]); diff --git a/src/processor/module_serializer.h b/src/processor/module_serializer.h index 4e365a417..fd387cbbc 100644 --- a/src/processor/module_serializer.h +++ b/src/processor/module_serializer.h @@ -72,13 +72,13 @@ class ModuleSerializer { // Caller takes the ownership of the memory chunk (allocated on heap), and // owner should call delete [] to free the memory after use. char* Serialize(const BasicSourceLineResolver::Module& module, - unsigned int* size = NULL); + size_t* size = nullptr); // Given the string format symbol_data, produces a chunk of serialized data. // Caller takes ownership of the serialized data (on heap), and owner should // call delete [] to free the memory after use. char* SerializeSymbolFileData(const string& symbol_data, - unsigned int* size = NULL); + size_t* size = nullptr); // Serializes one loaded module with given moduleid in the basic source line // resolver, and loads the serialized data into the fast source line resolver. From 652e7dac80f7a97c69818b928830850bfd1cf0f8 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 26 Apr 2023 21:08:39 +0000 Subject: [PATCH 186/195] Update Mac Headers These are reimported from Apple's Github source drops, see exact provenance in README. Most were imported as is, some were edited to match previous versions, and as noted below - Added arm headers where needed - Removed (now) unused `/mach/i386/vm_param.h` - Removed availability annotations - Removed `__kernel_ptr_semantics` - Added `defined(__aarch64__)` to all arm64 define guards Bug: chromium:1420654, google-breakpad:880, b/257505171 Change-Id: I17bd03fa871a8f1dc4285daafa3d7b26c2186e2b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4482294 Reviewed-by: Mark Mentovai --- Makefile.am | 4 +- Makefile.in | 4 +- src/third_party/mac_headers/README | 25 +- .../mac_headers/architecture/byte_order.h | 33 +- src/third_party/mac_headers/arm/_types.h | 16 + src/third_party/mac_headers/i386/_types.h | 22 +- src/third_party/mac_headers/mach-o/arch.h | 51 ++- src/third_party/mac_headers/mach-o/fat.h | 25 +- src/third_party/mac_headers/mach-o/loader.h | 236 +++++++++- src/third_party/mac_headers/mach-o/nlist.h | 20 +- .../mac_headers/mach/arm/boolean.h | 74 +++ .../mac_headers/mach/arm/vm_types.h | 159 +++++++ src/third_party/mac_headers/mach/boolean.h | 42 +- .../mac_headers/mach/i386/boolean.h | 32 +- .../mac_headers/mach/i386/vm_param.h | 157 ------- .../mac_headers/mach/i386/vm_types.h | 83 ++-- src/third_party/mac_headers/mach/machine.h | 424 +++++++++++------- .../mac_headers/mach/machine/boolean.h | 12 +- .../mac_headers/mach/machine/thread_state.h | 2 +- .../mac_headers/mach/machine/thread_status.h | 2 +- .../mac_headers/mach/machine/vm_types.h | 12 +- .../mac_headers/mach/thread_status.h | 42 +- src/third_party/mac_headers/mach/vm_prot.h | 109 +++-- 23 files changed, 1088 insertions(+), 498 deletions(-) create mode 100644 src/third_party/mac_headers/arm/_types.h create mode 100644 src/third_party/mac_headers/mach/arm/boolean.h create mode 100644 src/third_party/mac_headers/mach/arm/vm_types.h delete mode 100644 src/third_party/mac_headers/mach/i386/vm_param.h diff --git a/Makefile.am b/Makefile.am index 1d45f8e56..58e414831 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1732,10 +1732,12 @@ EXTRA_DIST = \ src/third_party/curl/typecheck-gcc.h \ src/third_party/curl/types.h \ src/third_party/mac_headers/architecture/byte_order.h \ + src/third_party/mac_headers/arm/_types.h \ src/third_party/mac_headers/i386/_types.h \ src/third_party/mac_headers/mach/boolean.h \ + src/third_party/mac_headers/mach/arm/boolean.h \ + src/third_party/mac_headers/mach/arm/vm_types.h \ src/third_party/mac_headers/mach/i386/boolean.h \ - src/third_party/mac_headers/mach/i386/vm_param.h \ src/third_party/mac_headers/mach/i386/vm_types.h \ src/third_party/mac_headers/mach/machine/boolean.h \ src/third_party/mac_headers/mach/machine.h \ diff --git a/Makefile.in b/Makefile.in index d790cac43..184563836 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3734,10 +3734,12 @@ EXTRA_DIST = \ src/third_party/curl/typecheck-gcc.h \ src/third_party/curl/types.h \ src/third_party/mac_headers/architecture/byte_order.h \ + src/third_party/mac_headers/arm/_types.h \ src/third_party/mac_headers/i386/_types.h \ src/third_party/mac_headers/mach/boolean.h \ + src/third_party/mac_headers/mach/arm/boolean.h \ + src/third_party/mac_headers/mach/arm/vm_types.h \ src/third_party/mac_headers/mach/i386/boolean.h \ - src/third_party/mac_headers/mach/i386/vm_param.h \ src/third_party/mac_headers/mach/i386/vm_types.h \ src/third_party/mac_headers/mach/machine/boolean.h \ src/third_party/mac_headers/mach/machine.h \ diff --git a/src/third_party/mac_headers/README b/src/third_party/mac_headers/README index c681bb3d6..3dccc49dd 100644 --- a/src/third_party/mac_headers/README +++ b/src/third_party/mac_headers/README @@ -1,2 +1,23 @@ -These headers were copied from the Mac OS X 10.7 SDK to enable building -the Mac dump_syms code that processes Mach-O files on Linux. +These headers were copied to enable building the Mac dump_syms code that +processes Mach-O files on Linux. + +From xnu-8792.41.9 (https://github.com/apple-oss-distributions/xnu at 5c2921b) +i386/_types.h +architecture/byte_order.h +arm/_types.h +mach/boolean.h +mach/machine.h +mach/thread_status.h +mach/vm_prot.h +mach/i386/boolean.h +mach/i386/vm_types.h +mach/arm/boolean.h +mach/arm/vm_types.h +mach/machine/boolean.h +mach/machine/vm_types.h + +From cctools-986 (https://github.com/apple-oss-distributions/cctools at cbe977a) +mach-o/arch.h +mach-o/fat.h +mach-o/loader.h +mach-o/nlist.h diff --git a/src/third_party/mac_headers/architecture/byte_order.h b/src/third_party/mac_headers/architecture/byte_order.h index b772d9f38..8fb7f7e9d 100644 --- a/src/third_party/mac_headers/architecture/byte_order.h +++ b/src/third_party/mac_headers/architecture/byte_order.h @@ -1,22 +1,23 @@ /* - * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License." * * @APPLE_LICENSE_HEADER_END@ */ @@ -26,20 +27,14 @@ * Byte ordering conversion. * */ -/* This file mostly left blank */ -#ifndef _ARCHITECTURE_BYTE_ORDER_H_ +#ifndef _ARCHITECTURE_BYTE_ORDER_H_ #define _ARCHITECTURE_BYTE_ORDER_H_ - -/* - * Identify the byte order - * of the current host. - */ - + enum NXByteOrder { NX_UnknownByteOrder, NX_LittleEndian, NX_BigEndian }; -#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */ +#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/arm/_types.h b/src/third_party/mac_headers/arm/_types.h new file mode 100644 index 000000000..f464d6bd6 --- /dev/null +++ b/src/third_party/mac_headers/arm/_types.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + */ +#ifndef _BSD_ARM__TYPES_H_ +#define _BSD_ARM__TYPES_H_ + +#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) + + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; + + +#endif /* defined (__arm__) || defined (__arm64__) || defined (__aarch64__) */ + +#endif /* _BSD_ARM__TYPES_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/i386/_types.h b/src/third_party/mac_headers/i386/_types.h index 2ed7fd675..c0478d3ff 100644 --- a/src/third_party/mac_headers/i386/_types.h +++ b/src/third_party/mac_headers/i386/_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,13 +22,17 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -#ifndef _BSD_I386__TYPES_H_ -#define _BSD_I386__TYPES_H_ +#ifndef _BSD_I386__TYPES_H_ +#define _BSD_I386__TYPES_H_ + +#if defined (__i386__) || defined (__x86_64__) + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; -typedef long __darwin_intptr_t; -typedef unsigned int __darwin_natural_t; +#endif /* defined (__i386__) || defined (__x86_64__) */ -#endif /* _BSD_I386__TYPES_H_ */ +#endif /* _BSD_I386__TYPES_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach-o/arch.h b/src/third_party/mac_headers/mach-o/arch.h index 526c10fc8..29b81c5ba 100644 --- a/src/third_party/mac_headers/mach-o/arch.h +++ b/src/third_party/mac_headers/mach-o/arch.h @@ -48,7 +48,7 @@ typedef struct { const char *description; } NXArchInfo; -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -72,6 +72,36 @@ extern const NXArchInfo *NXGetArchInfoFromName(const char *name); extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype, cpu_subtype_t cpusubtype); +/* The above interfaces that return pointers to NXArchInfo structs in normal + * cases returns a pointer from the array returned in NXGetAllArchInfos(). + * In some cases when the cputype is CPU_TYPE_I386 or CPU_TYPE_POWERPC it will + * retun malloc(3)'ed NXArchInfo struct which contains a string in the + * description field also a malloc(3)'ed pointer. To allow programs not to + * leak memory they can call NXFreeArchInfo() on pointers returned from the + * above interfaces. Since this is a new API on older systems can use the + * code below. Going forward the above interfaces will only return pointers + * from the array returned in NXGetAllArchInfos(). + */ +extern void NXFreeArchInfo(const NXArchInfo *x); + +/* The code that can be used for NXFreeArchInfo() when it is not available is: + * + * static void NXFreeArchInfo( + * const NXArchInfo *x) + * { + * const NXArchInfo *p; + * + * p = NXGetAllArchInfos(); + * while(p->name != NULL){ + * if(x == p) + * return; + * p++; + * } + * free((char *)x->description); + * free((NXArchInfo *)x); + * } + */ + /* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of * fat_arch structs and selects the best one that matches (if any) and returns * a pointer to that fat_arch struct (or NULL). The fat_arch structs must be @@ -86,6 +116,21 @@ extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype, struct fat_arch *fat_archs, uint32_t nfat_archs); +/* NXFindBestFatArch_64() is passed a cputype and cpusubtype and a set of + * fat_arch_64 structs and selects the best one that matches (if any) and + * returns a pointer to that fat_arch_64 struct (or NULL). The fat_arch_64 + * structs must be in the host byte order and correct such that the fat_archs64 + * really points to enough memory for nfat_arch structs. It is possible that + * this routine could fail if new cputypes or cpusubtypes are added and an old + * version of this routine is used. But if there is an exact match between the + * cputype and cpusubtype and one of the fat_arch_64 structs this routine will + * always succeed. + */ +extern struct fat_arch_64 *NXFindBestFatArch_64(cpu_type_t cputype, + cpu_subtype_t cpusubtype, + struct fat_arch_64 *fat_archs64, + uint32_t nfat_archs); + /* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two * different cpusubtypes for the specified cputype. If the two cpusubtypes * can't be combined (the specific subtypes are mutually exclusive) -1 is @@ -98,8 +143,8 @@ extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype, cpu_subtype_t cpusubtype1, cpu_subtype_t cpusubtype2); -#if __cplusplus +#ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* _MACH_O_ARCH_H_ */ +#endif /* _MACH_O_ARCH_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach-o/fat.h b/src/third_party/mac_headers/mach-o/fat.h index e2bcf433d..0e5927dc2 100644 --- a/src/third_party/mac_headers/mach-o/fat.h +++ b/src/third_party/mac_headers/mach-o/fat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2016 Apple, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -49,7 +49,7 @@ #define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */ struct fat_header { - uint32_t magic; /* FAT_MAGIC */ + uint32_t magic; /* FAT_MAGIC or FAT_MAGIC_64 */ uint32_t nfat_arch; /* number of structs that follow */ }; @@ -61,4 +61,23 @@ struct fat_arch { uint32_t align; /* alignment as a power of 2 */ }; -#endif /* _MACH_O_FAT_H_ */ +/* + * The support for the 64-bit fat file format described here is a work in + * progress and not yet fully supported in all the Apple Developer Tools. + * + * When a slice is greater than 4mb or an offset to a slice is greater than 4mb + * then the 64-bit fat file format is used. + */ +#define FAT_MAGIC_64 0xcafebabf +#define FAT_CIGAM_64 0xbfbafeca /* NXSwapLong(FAT_MAGIC_64) */ + +struct fat_arch_64 { + cpu_type_t cputype; /* cpu specifier (int) */ + cpu_subtype_t cpusubtype; /* machine specifier (int) */ + uint64_t offset; /* file offset to this object file */ + uint64_t size; /* size of this object file */ + uint32_t align; /* alignment as a power of 2 */ + uint32_t reserved; /* reserved */ +}; + +#endif /* _MACH_O_FAT_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach-o/loader.h b/src/third_party/mac_headers/mach-o/loader.h index ff18e29c7..2b03dfdc4 100644 --- a/src/third_party/mac_headers/mach-o/loader.h +++ b/src/third_party/mac_headers/mach-o/loader.h @@ -115,11 +115,14 @@ struct mach_header_64 { #define MH_DYLIB 0x6 /* dynamically bound shared library */ #define MH_DYLINKER 0x7 /* dynamic link editor */ #define MH_BUNDLE 0x8 /* dynamically bound bundle file */ -#define MH_DYLIB_STUB 0x9 /* shared library stub for static */ - /* linking only, no section contents */ -#define MH_DSYM 0xa /* companion file with only debug */ - /* sections */ +#define MH_DYLIB_STUB 0x9 /* shared library stub for static + linking only, no section contents */ +#define MH_DSYM 0xa /* companion file with only debug + sections */ #define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ +#define MH_FILESET 0xc /* a file composed of other Mach-Os to + be run in the same userspace sharing + a single linkedit. */ /* Constants for the flags field of the mach_header */ #define MH_NOUNDEFS 0x1 /* the object file has no undefined @@ -207,6 +210,25 @@ struct mach_header_64 { require it. Only used in MH_EXECUTE filetypes. */ +#define MH_APP_EXTENSION_SAFE 0x02000000 /* The code was linked for use in an + application extension. */ + +#define MH_NLIST_OUTOFSYNC_WITH_DYLDINFO 0x04000000 /* The external symbols + listed in the nlist symbol table do + not include all the symbols listed in + the dyld info. */ + +#define MH_SIM_SUPPORT 0x08000000 /* Allow LC_MIN_VERSION_MACOS and + LC_BUILD_VERSION load commands with + the platforms macOS, macCatalyst, + iOSSimulator, tvOSSimulator and + watchOSSimulator. */ + +#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit + is set, the dylib is part of the dyld + shared cache, rather than loose in + the filesystem. */ + /* * The load commands directly follow the mach_header. The total size of all * of the commands is given by the sizeofcmds field in the mach_header. All @@ -290,6 +312,20 @@ struct load_command { #define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ #define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat like environment variable */ +#define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */ +#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */ +#define LC_SOURCE_VERSION 0x2A /* source version used to build binary */ +#define LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */ +#define LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */ +#define LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */ +#define LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */ +#define LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */ +#define LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */ +#define LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */ +#define LC_BUILD_VERSION 0x32 /* build for platform min OS version */ +#define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */ +#define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */ +#define LC_FILESET_ENTRY (0x35 | LC_REQ_DYLD) /* used with fileset_entry_command */ /* * A variable length string in a load command is represented by an lc_str @@ -367,6 +403,9 @@ struct segment_command_64 { /* for 64-bit architectures */ first page of the segment is not protected. All other pages of the segment are protected. */ +#define SG_READ_ONLY 0x10 /* This segment is made read-only after fixups */ + + /* * A segment is made up of zero or more sections. Non-MH_OBJECT files have @@ -492,6 +531,8 @@ struct section_64 { /* for 64-bit architectures */ #define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call to initialize TLV values */ +#define S_INIT_FUNC_OFFSETS 0x16 /* 32-bit offsets to + initializers */ /* * Constants for the section attributes part of the flags field of a section @@ -753,14 +794,14 @@ struct dylinker_command { * Thread commands contain machine-specific data structures suitable for * use in the thread state primitives. The machine specific data structures * follow the struct thread_command as follows. - * Each flavor of machine specific data structure is preceded by an unsigned - * long constant for the flavor of that data structure, an uint32_t - * that is the count of longs of the size of the state data structure and then + * Each flavor of machine specific data structure is preceded by an uint32_t + * constant for the flavor of that data structure, an uint32_t that is the + * count of uint32_t's of the size of the state data structure and then * the state data structure follows. This triple may be repeated for many * flavors. The constants for the flavors, counts and state data structure * definitions are expected to be in the header file . * These machine specific data structures sizes must be multiples of - * 4 bytes The cmdsize reflects the total size of the thread_command + * 4 bytes. The cmdsize reflects the total size of the thread_command * and all of the sizes of the constants for the flavors, counts and state * data structures. * @@ -774,7 +815,7 @@ struct thread_command { uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */ uint32_t cmdsize; /* total size of this command */ /* uint32_t flavor flavor of thread state */ - /* uint32_t count count of longs in thread state */ + /* uint32_t count count of uint32_t's in thread state */ /* struct XXX_thread_state state thread state for this flavor */ /* ... */ }; @@ -1149,7 +1190,11 @@ struct rpath_command { */ struct linkedit_data_command { uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, - or LC_FUNCTION_STARTS */ + LC_FUNCTION_STARTS, LC_DATA_IN_CODE, + LC_DYLIB_CODE_SIGN_DRS, + LC_LINKER_OPTIMIZATION_HINT, + LC_DYLD_EXPORTS_TRIE, or + LC_DYLD_CHAINED_FIXUPS. */ uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */ uint32_t dataoff; /* file offset of data in __LINKEDIT segment */ uint32_t datasize; /* file size of data in __LINKEDIT segment */ @@ -1168,18 +1213,75 @@ struct encryption_info_command { 0 means not-encrypted yet */ }; +/* + * The encryption_info_command_64 contains the file offset and size of an + * of an encrypted segment (for use in x86_64 targets). + */ +struct encryption_info_command_64 { + uint32_t cmd; /* LC_ENCRYPTION_INFO_64 */ + uint32_t cmdsize; /* sizeof(struct encryption_info_command_64) */ + uint32_t cryptoff; /* file offset of encrypted range */ + uint32_t cryptsize; /* file size of encrypted range */ + uint32_t cryptid; /* which enryption system, + 0 means not-encrypted yet */ + uint32_t pad; /* padding to make this struct's size a multiple + of 8 bytes */ +}; + /* * The version_min_command contains the min OS version on which this * binary was built to run. */ struct version_min_command { uint32_t cmd; /* LC_VERSION_MIN_MACOSX or - LC_VERSION_MIN_IPHONEOS */ + LC_VERSION_MIN_IPHONEOS or + LC_VERSION_MIN_WATCHOS or + LC_VERSION_MIN_TVOS */ uint32_t cmdsize; /* sizeof(struct min_version_command) */ uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ - uint32_t reserved; /* zero */ + uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ +}; + +/* + * The build_version_command contains the min OS version on which this + * binary was built to run for its platform. The list of known platforms and + * tool values following it. + */ +struct build_version_command { + uint32_t cmd; /* LC_BUILD_VERSION */ + uint32_t cmdsize; /* sizeof(struct build_version_command) plus */ + /* ntools * sizeof(struct build_tool_version) */ + uint32_t platform; /* platform */ + uint32_t minos; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ + uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ + uint32_t ntools; /* number of tool entries following this */ +}; + +struct build_tool_version { + uint32_t tool; /* enum for the tool */ + uint32_t version; /* version number of the tool */ }; +/* Known values for the platform field above. */ +#define PLATFORM_MACOS 1 +#define PLATFORM_IOS 2 +#define PLATFORM_TVOS 3 +#define PLATFORM_WATCHOS 4 +#define PLATFORM_BRIDGEOS 5 +#define PLATFORM_MACCATALYST 6 +#define PLATFORM_IOSSIMULATOR 7 +#define PLATFORM_TVOSSIMULATOR 8 +#define PLATFORM_WATCHOSSIMULATOR 9 +#define PLATFORM_DRIVERKIT 10 + +#ifndef __APPLE_BLEACH_SDK__ +#endif /* __APPLE_BLEACH_SDK__ */ + +/* Known values for the tool field above. */ +#define TOOL_CLANG 1 +#define TOOL_SWIFT 2 +#define TOOL_LD 3 + /* * The dyld_info_command contains the file offsets and sizes of * the new compressed form of the information dyld needs to @@ -1265,14 +1367,19 @@ struct dyld_info_command { * Nodes for a symbol start with a uleb128 that is the length of * the exported symbol information for the string so far. * If there is no exported symbol, the node starts with a zero byte. - * If there is exported info, it follows the length. First is - * a uleb128 containing flags. Normally, it is followed by a - * uleb128 encoded offset which is location of the content named + * If there is exported info, it follows the length. + * + * First is a uleb128 containing flags. Normally, it is followed by + * a uleb128 encoded offset which is location of the content named * by the symbol from the mach_header for the image. If the flags * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is * a uleb128 encoded library ordinal, then a zero terminated * UTF8 string. If the string is zero length, then the symbol * is re-export from the specified dylib with the same name. + * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following + * the flags is two uleb128s: the stub offset and the resolver offset. + * The stub is used by non-lazy pointers. The resolver is used + * by lazy pointers and must be called to get the actual address to use. * * After the optional exported symbol information is a byte of * how many edges (0-255) that this node has leaving it, @@ -1316,6 +1423,7 @@ struct dyld_info_command { #define BIND_SPECIAL_DYLIB_SELF 0 #define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 #define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 +#define BIND_SPECIAL_DYLIB_WEAK_LOOKUP -3 #define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1 #define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8 @@ -1335,6 +1443,9 @@ struct dyld_info_command { #define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0 #define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0 #define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0 +#define BIND_OPCODE_THREADED 0xD0 +#define BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB 0x00 +#define BIND_SUBOPCODE_THREADED_APPLY 0x01 /* @@ -1344,9 +1455,23 @@ struct dyld_info_command { #define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 #define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 #define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 +#define EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE 0x02 #define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 #define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 #define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 +#define EXPORT_SYMBOL_FLAGS_STATIC_RESOLVER 0x20 + + +/* + * The linker_option_command contains linker options embedded in object files. + */ +struct linker_option_command { + uint32_t cmd; /* LC_LINKER_OPTION only used in MH_OBJECT filetypes */ + uint32_t cmdsize; + uint32_t count; /* number of strings */ + /* concatenation of zero terminated UTF8 strings. + Zero filled at end to align */ +}; /* * The symseg_command contains the offset and size of the GNU style @@ -1388,6 +1513,50 @@ struct fvmfile_command { uint32_t header_addr; /* files virtual address */ }; + +/* + * The entry_point_command is a replacement for thread_command. + * It is used for main executables to specify the location (file offset) + * of main(). If -stack_size was used at link time, the stacksize + * field will contain the stack size need for the main thread. + */ +struct entry_point_command { + uint32_t cmd; /* LC_MAIN only used in MH_EXECUTE filetypes */ + uint32_t cmdsize; /* 24 */ + uint64_t entryoff; /* file (__TEXT) offset of main() */ + uint64_t stacksize;/* if not zero, initial stack size */ +}; + + +/* + * The source_version_command is an optional load command containing + * the version of the sources used to build the binary. + */ +struct source_version_command { + uint32_t cmd; /* LC_SOURCE_VERSION */ + uint32_t cmdsize; /* 16 */ + uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */ +}; + + +/* + * The LC_DATA_IN_CODE load commands uses a linkedit_data_command + * to point to an array of data_in_code_entry entries. Each entry + * describes a range of data in a code section. + */ +struct data_in_code_entry { + uint32_t offset; /* from mach_header to start of data range*/ + uint16_t length; /* number of bytes in data range */ + uint16_t kind; /* a DICE_KIND_* value */ +}; +#define DICE_KIND_DATA 0x0001 +#define DICE_KIND_JUMP_TABLE8 0x0002 +#define DICE_KIND_JUMP_TABLE16 0x0003 +#define DICE_KIND_JUMP_TABLE32 0x0004 +#define DICE_KIND_ABS_JUMP_TABLE32 0x0005 + + + /* * Sections of type S_THREAD_LOCAL_VARIABLES contain an array * of tlv_descriptor structures. @@ -1399,4 +1568,39 @@ struct tlv_descriptor unsigned long offset; }; -#endif /* _MACHO_LOADER_H_ */ +/* + * LC_NOTE commands describe a region of arbitrary data included in a Mach-O + * file. Its initial use is to record extra data in MH_CORE files. + */ +struct note_command { + uint32_t cmd; /* LC_NOTE */ + uint32_t cmdsize; /* sizeof(struct note_command) */ + char data_owner[16]; /* owner name for this LC_NOTE */ + uint64_t offset; /* file offset of this data */ + uint64_t size; /* length of data region */ +}; + +/* + * LC_FILESET_ENTRY commands describe constituent Mach-O files that are part + * of a fileset. In one implementation, entries are dylibs with individual + * mach headers and repositionable text and data segments. Each entry is + * further described by its own mach header. + */ +struct fileset_entry_command { + uint32_t cmd; /* LC_FILESET_ENTRY */ + uint32_t cmdsize; /* includes entry_id string */ + uint64_t vmaddr; /* memory address of the entry */ + uint64_t fileoff; /* file offset of the entry */ + union lc_str entry_id; /* contained entry id */ + uint32_t reserved; /* reserved */ +}; + +/* + * These deprecated values may still be used within Apple but are mechanically + * removed from public API. The mechanical process may produce unusual results. + */ +#if (!defined(PLATFORM_IOSMAC)) +#define PLATFORM_IOSMAC PLATFORM_MACCATALYST +#endif + +#endif /* _MACHO_LOADER_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach-o/nlist.h b/src/third_party/mac_headers/mach-o/nlist.h index 1c1941012..7b979a52a 100644 --- a/src/third_party/mac_headers/mach-o/nlist.h +++ b/src/third_party/mac_headers/mach-o/nlist.h @@ -78,7 +78,7 @@ struct nlist { #ifndef __LP64__ char *n_name; /* for use when in-core */ #endif - int32_t n_strx; /* index into the string table */ + uint32_t n_strx; /* index into the string table */ } n_un; uint8_t n_type; /* type flag, see below */ uint8_t n_sect; /* section number or NO_SECT */ @@ -296,17 +296,29 @@ struct nlist_64 { */ #define N_SYMBOL_RESOLVER 0x0100 +/* + * The N_ALT_ENTRY bit of the n_desc field indicates that the + * symbol is pinned to the previous content. + */ +#define N_ALT_ENTRY 0x0200 + +/* + * The N_COLD_FUNC bit of the n_desc field indicates that the symbol is used + * infrequently and the linker should order it towards the end of the section. + */ +#define N_COLD_FUNC 0x0400 + #ifndef __STRICT_BSD__ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * The function nlist(3) from the C library. */ extern int nlist (const char *filename, struct nlist *list); -#if __cplusplus +#ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __STRICT_BSD__ */ -#endif /* _MACHO_LIST_H_ */ +#endif /* _MACHO_LIST_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/arm/boolean.h b/src/third_party/mac_headers/mach/arm/boolean.h new file mode 100644 index 000000000..d653a394c --- /dev/null +++ b/src/third_party/mac_headers/mach/arm/boolean.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: boolean.h + * + * Boolean type, for ARM. + */ + +#ifndef _MACH_ARM_BOOLEAN_H_ +#define _MACH_ARM_BOOLEAN_H_ + +#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) + +typedef int boolean_t; + +#endif /* defined (__arm__) || defined (__arm64__) */ + +#endif /* _MACH_ARM_BOOLEAN_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/arm/vm_types.h b/src/third_party/mac_headers/mach/arm/vm_types.h new file mode 100644 index 000000000..3650a8690 --- /dev/null +++ b/src/third_party/mac_headers/mach/arm/vm_types.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: vm_types.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Header file for VM data types. ARM version. + */ + +#ifndef _MACH_ARM_VM_TYPES_H_ +#define _MACH_ARM_VM_TYPES_H_ + +#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) + +#ifndef ASSEMBLER + +#include +#include +#include + +/* + * natural_t and integer_t are Mach's legacy types for machine- + * independent integer types (unsigned, and signed, respectively). + * Their original purpose was to define other types in a machine/ + * compiler independent way. + * + * They also had an implicit "same size as pointer" characteristic + * to them (i.e. Mach's traditional types are very ILP32 or ILP64 + * centric). We will likely support x86 ABIs that do not follow + * either ofthese models (specifically LP64). Therefore, we had to + * make a choice between making these types scale with pointers or stay + * tied to integers. Because their use is predominantly tied to + * to the size of an integer, we are keeping that association and + * breaking free from pointer size guarantees. + * + * New use of these types is discouraged. + */ +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +/* + * A vm_offset_t is a type-neutral pointer, + * e.g. an offset into a virtual memory space. + */ +#ifdef __LP64__ +typedef uintptr_t vm_offset_t ; +typedef uintptr_t vm_size_t; + +typedef uint64_t mach_vm_address_t ; +typedef uint64_t mach_vm_offset_t ; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t ; +typedef uint64_t vm_map_address_t ; +typedef uint64_t vm_map_size_t; +#else +typedef natural_t vm_offset_t ; +/* + * A vm_size_t is the proper type for e.g. + * expressing the difference between two + * vm_offset_t entities. + */ +typedef natural_t vm_size_t; + +/* + * This new type is independent of a particular vm map's + * implementation size - and represents appropriate types + * for all possible maps. This is used for interfaces + * where the size of the map is not known - or we don't + * want to have to distinguish. + */ +typedef uint64_t mach_vm_address_t ; +typedef uint64_t mach_vm_offset_t ; +typedef uint64_t mach_vm_size_t; + +typedef uint32_t vm_map_offset_t ; +typedef uint32_t vm_map_address_t ; +typedef uint32_t vm_map_size_t; +#endif /* __LP64__ */ + + +typedef uint32_t vm32_offset_t; +typedef uint32_t vm32_address_t; +typedef uint32_t vm32_size_t; + +typedef vm_offset_t mach_port_context_t; + +#ifdef MACH_KERNEL_PRIVATE +typedef vm32_offset_t mach_port_context32_t; +typedef mach_vm_offset_t mach_port_context64_t; +#endif + +#endif /* ASSEMBLER */ + +/* + * If composing messages by hand (please do not) + */ +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* defined (__arm__) || defined (__arm64__) || defined (__aarch64__) */ + +#endif /* _MACH_ARM_VM_TYPES_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/boolean.h b/src/third_party/mac_headers/mach/boolean.h index 641c3962d..ba8842934 100644 --- a/src/third_party/mac_headers/mach/boolean.h +++ b/src/third_party/mac_headers/mach/boolean.h @@ -2,7 +2,7 @@ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,34 +22,34 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -62,27 +62,27 @@ * */ -#ifndef _MACH_BOOLEAN_H_ -#define _MACH_BOOLEAN_H_ +#ifndef _MACH_BOOLEAN_H_ +#define _MACH_BOOLEAN_H_ /* * Pick up "boolean_t" type definition */ -#ifndef ASSEMBLER +#ifndef ASSEMBLER #include -#endif /* ASSEMBLER */ +#endif /* ASSEMBLER */ /* * Define TRUE and FALSE if not defined. */ -#ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ -#ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ -#endif /* _MACH_BOOLEAN_H_ */ +#endif /* _MACH_BOOLEAN_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/i386/boolean.h b/src/third_party/mac_headers/mach/i386/boolean.h index 100f7e7b5..b1d69a193 100644 --- a/src/third_party/mac_headers/mach/i386/boolean.h +++ b/src/third_party/mac_headers/mach/i386/boolean.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,34 +22,34 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -62,13 +62,17 @@ * Boolean type, for I386. */ -#ifndef _MACH_I386_BOOLEAN_H_ +#ifndef _MACH_I386_BOOLEAN_H_ #define _MACH_I386_BOOLEAN_H_ +#if defined (__i386__) || defined (__x86_64__) + #if defined(__x86_64__) && !defined(KERNEL) -typedef unsigned int boolean_t; +typedef unsigned int boolean_t; #else -typedef int boolean_t; +typedef int boolean_t; #endif -#endif /* _MACH_I386_BOOLEAN_H_ */ +#endif /* defined (__i386__) || defined (__x86_64__) */ + +#endif /* _MACH_I386_BOOLEAN_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/i386/vm_param.h b/src/third_party/mac_headers/mach/i386/vm_param.h deleted file mode 100644 index edcb83496..000000000 --- a/src/third_party/mac_headers/mach/i386/vm_param.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - -/* - * Copyright (c) 1994 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - */ - -/* - * File: vm_param.h - * Author: Avadis Tevanian, Jr. - * Date: 1985 - * - * I386 machine dependent virtual memory parameters. - * Most of the declarations are preceeded by I386_ (or i386_) - * which is OK because only I386 specific code will be using - * them. - */ - -#ifndef _MACH_I386_VM_PARAM_H_ -#define _MACH_I386_VM_PARAM_H_ - -#define BYTE_SIZE 8 /* byte size in bits */ - -#define I386_PGBYTES 4096 /* bytes per 80386 page */ -#define I386_PGSHIFT 12 /* bitshift for pages */ - -#define PAGE_SIZE I386_PGBYTES -#define PAGE_SHIFT I386_PGSHIFT -#define PAGE_MASK (PAGE_SIZE - 1) - -#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ -#define I386_LPGSHIFT 21 /* bitshift for large pages */ -#define I386_LPGMASK (I386_LPGBYTES-1) - -/* - * Convert bytes to pages and convert pages to bytes. - * No rounding is used. - */ - -#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT)) -#define machine_btop(x) i386_btop(x) -#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT) - -/* - * Round off or truncate to the nearest page. These will work - * for either addresses or counts. (i.e. 1 byte rounds to 1 page - * bytes. - */ - -#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \ - ~(I386_PGBYTES-1)) -#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1)) - - - -#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) -/* - * default top of user stack... it grows down from here - */ -#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL) -#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) -#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) -#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) -/* - * the end of the usable user address space , for now about 47 bits. - * the 64 bit commpage is past the end of this - */ -#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) -/* - * canonical end of user address space for limits checking - */ -#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) - - -/* system-wide values */ -#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) -#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) - -/* process-relative values (all 32-bit legacy only for now) */ -#define VM_MIN_ADDRESS ((vm_offset_t) 0) -#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) -#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) - - - -#endif /* _MACH_I386_VM_PARAM_H_ */ diff --git a/src/third_party/mac_headers/mach/i386/vm_types.h b/src/third_party/mac_headers/mach/i386/vm_types.h index 2c38fa2d7..0c3bb6ba4 100644 --- a/src/third_party/mac_headers/mach/i386/vm_types.h +++ b/src/third_party/mac_headers/mach/i386/vm_types.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,34 +22,34 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -64,14 +64,16 @@ * Header file for VM data types. I386 version. */ -#ifndef _MACH_I386_VM_TYPES_H_ +#ifndef _MACH_I386_VM_TYPES_H_ #define _MACH_I386_VM_TYPES_H_ -#ifndef ASSEMBLER +#if defined (__i386__) || defined (__x86_64__) + +#ifndef ASSEMBLER #include -#include #include +#include /* * natural_t and integer_t are Mach's legacy types for machine- @@ -90,18 +92,18 @@ * * New use of these types is discouraged. */ -typedef __darwin_natural_t natural_t; -typedef int integer_t; +typedef __darwin_natural_t natural_t; +typedef int integer_t; /* * A vm_offset_t is a type-neutral pointer, * e.g. an offset into a virtual memory space. */ #ifdef __LP64__ -typedef uintptr_t vm_offset_t; -#else /* __LP64__ */ -typedef natural_t vm_offset_t; -#endif /* __LP64__ */ +typedef uintptr_t vm_offset_t ; +#else /* __LP64__ */ +typedef natural_t vm_offset_t ; +#endif /* __LP64__ */ /* * A vm_size_t is the proper type for e.g. @@ -109,10 +111,10 @@ typedef natural_t vm_offset_t; * vm_offset_t entities. */ #ifdef __LP64__ -typedef uintptr_t vm_size_t; -#else /* __LP64__ */ -typedef natural_t vm_size_t; -#endif /* __LP64__ */ +typedef uintptr_t vm_size_t; +#else /* __LP64__ */ +typedef natural_t vm_size_t; +#endif /* __LP64__ */ /* * This new type is independent of a particular vm map's @@ -121,20 +123,35 @@ typedef natural_t vm_size_t; * where the size of the map is not known - or we don't * want to have to distinguish. */ -typedef uint64_t mach_vm_address_t; -typedef uint64_t mach_vm_offset_t; -typedef uint64_t mach_vm_size_t; +typedef uint64_t mach_vm_address_t ; +typedef uint64_t mach_vm_offset_t ; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t ; +typedef uint64_t vm_map_address_t ; +typedef uint64_t vm_map_size_t; + +typedef mach_vm_address_t mach_port_context_t; -typedef uint64_t vm_map_offset_t; -typedef uint64_t vm_map_address_t; -typedef uint64_t vm_map_size_t; +#ifdef MACH_KERNEL_PRIVATE +/* + * These are types used internal to Mach to implement the + * legacy 32-bit VM APIs published by the kernel. + */ +typedef uint32_t vm32_address_t; +typedef uint32_t vm32_offset_t; +typedef uint32_t vm32_size_t; -#endif /* ASSEMBLER */ +#endif /* MACH_KERNEL_PRIVATE */ + +#endif /* ASSEMBLER */ /* * If composing messages by hand (please do not) */ -#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* defined (__i386__) || defined (__x86_64__) */ -#endif /* _MACH_I386_VM_TYPES_H_ */ +#endif /* _MACH_I386_VM_TYPES_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/machine.h b/src/third_party/mac_headers/mach/machine.h index 5bb21e48b..53457cca7 100644 --- a/src/third_party/mac_headers/mach/machine.h +++ b/src/third_party/mac_headers/mach/machine.h @@ -1,8 +1,9 @@ /* - * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2007-2016 Apple, Inc. All rights reserved. + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +12,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,31 +23,31 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -57,60 +58,114 @@ * Machine independent machine abstraction. */ -#ifndef _MACH_MACHINE_H_ +#ifndef _MACH_MACHINE_H_ #define _MACH_MACHINE_H_ +#ifndef __ASSEMBLER__ + #include #include #include -typedef integer_t cpu_type_t; -typedef integer_t cpu_subtype_t; -typedef integer_t cpu_threadtype_t; +typedef integer_t cpu_type_t; +typedef integer_t cpu_subtype_t; +typedef integer_t cpu_threadtype_t; + +#define CPU_STATE_MAX 4 + +#define CPU_STATE_USER 0 +#define CPU_STATE_SYSTEM 1 +#define CPU_STATE_IDLE 2 +#define CPU_STATE_NICE 3 + +#ifdef KERNEL_PRIVATE + +#include + +__BEGIN_DECLS +cpu_type_t cpu_type(void); + +cpu_subtype_t cpu_subtype(void); + +cpu_threadtype_t cpu_threadtype(void); +__END_DECLS -#define CPU_STATE_MAX 4 +#ifdef MACH_KERNEL_PRIVATE -#define CPU_STATE_USER 0 -#define CPU_STATE_SYSTEM 1 -#define CPU_STATE_IDLE 2 -#define CPU_STATE_NICE 3 +struct machine_info { + integer_t major_version; /* kernel major version id */ + integer_t minor_version; /* kernel minor version id */ + integer_t max_cpus; /* max number of CPUs possible */ + uint32_t memory_size; /* size of memory in bytes, capped at 2 GB */ + uint64_t max_mem; /* actual size of physical memory */ + uint32_t physical_cpu; /* number of physical CPUs now available */ + integer_t physical_cpu_max; /* max number of physical CPUs possible */ + uint32_t logical_cpu; /* number of logical cpu now available */ + integer_t logical_cpu_max; /* max number of physical CPUs possible */ +}; +typedef struct machine_info *machine_info_t; +typedef struct machine_info machine_info_data_t; + +extern struct machine_info machine_info; + +__BEGIN_DECLS +cpu_type_t slot_type( + int slot_num); + +cpu_subtype_t slot_subtype( + int slot_num); + +cpu_threadtype_t slot_threadtype( + int slot_num); +__END_DECLS + +#endif /* MACH_KERNEL_PRIVATE */ +#endif /* KERNEL_PRIVATE */ /* * Capability bits used in the definition of cpu_type. */ -#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */ -#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */ +#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */ +#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */ +#define CPU_ARCH_ABI64_32 0x02000000 /* ABI for 64-bit hardware with 32-bit types; LP32 */ /* * Machine types known by all. */ - -#define CPU_TYPE_ANY ((cpu_type_t) -1) -#define CPU_TYPE_VAX ((cpu_type_t) 1) +#define CPU_TYPE_ANY ((cpu_type_t) -1) + +#define CPU_TYPE_VAX ((cpu_type_t) 1) /* skip ((cpu_type_t) 2) */ /* skip ((cpu_type_t) 3) */ /* skip ((cpu_type_t) 4) */ /* skip ((cpu_type_t) 5) */ -#define CPU_TYPE_MC680x0 ((cpu_type_t) 6) -#define CPU_TYPE_X86 ((cpu_type_t) 7) -#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */ -#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) +#define CPU_TYPE_MC680x0 ((cpu_type_t) 6) +#define CPU_TYPE_X86 ((cpu_type_t) 7) +#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */ +#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) /* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */ -/* skip ((cpu_type_t) 9) */ -#define CPU_TYPE_MC98000 ((cpu_type_t) 10) +/* skip ((cpu_type_t) 9) */ +#define CPU_TYPE_MC98000 ((cpu_type_t) 10) #define CPU_TYPE_HPPA ((cpu_type_t) 11) -#define CPU_TYPE_ARM ((cpu_type_t) 12) -#define CPU_TYPE_MC88000 ((cpu_type_t) 13) -#define CPU_TYPE_SPARC ((cpu_type_t) 14) -#define CPU_TYPE_I860 ((cpu_type_t) 15) +#define CPU_TYPE_ARM ((cpu_type_t) 12) +#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) +#define CPU_TYPE_ARM64_32 (CPU_TYPE_ARM | CPU_ARCH_ABI64_32) +#define CPU_TYPE_MC88000 ((cpu_type_t) 13) +#define CPU_TYPE_SPARC ((cpu_type_t) 14) +#define CPU_TYPE_I860 ((cpu_type_t) 15) /* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */ /* skip ((cpu_type_t) 17) */ -#define CPU_TYPE_POWERPC ((cpu_type_t) 18) -#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) +#define CPU_TYPE_POWERPC ((cpu_type_t) 18) +#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) +/* skip ((cpu_type_t) 19) */ +/* skip ((cpu_type_t) 20 */ +/* skip ((cpu_type_t) 21 */ +/* skip ((cpu_type_t) 22 */ +/* skip ((cpu_type_t) 23 */ /* * Machine subtypes (these are defined here, instead of in a machine @@ -121,9 +176,16 @@ typedef integer_t cpu_threadtype_t; /* * Capability bits used in the definition of cpu_subtype. */ -#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ -#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ +#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ +#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ +#define CPU_SUBTYPE_PTRAUTH_ABI 0x80000000 /* pointer authentication with versioned ABI */ +/* + * When selecting a slice, ANY will pick the slice with the best + * grading for the selected cpu_type_t, unlike the "ALL" subtypes, + * which are the slices that can run on any hardware for that cpu type. + */ +#define CPU_SUBTYPE_ANY ((cpu_subtype_t) -1) /* * Object files that are hand-crafted to run on any @@ -136,42 +198,42 @@ typedef integer_t cpu_threadtype_t; * It is the responsibility of the implementor to make sure the * software handles unsupported implementations elegantly. */ -#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) -#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) +#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) /* * Machine threadtypes. * This is none - not defined - for most machine types/subtypes. */ -#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0) +#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0) /* * VAX subtypes (these do *not* necessary conform to the actual cpu * ID assigned by DEC available via the SID register). */ -#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) -#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) -#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) -#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) -#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) -#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) -#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) -#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) -#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) -#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) -#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) -#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) +#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) /* - * 680x0 subtypes + * 680x0 subtypes * * The subtype definitions here are unusual for historical reasons. * NeXT used to consider 68030 code as generic 68000 code. For * backwards compatability: - * + * * CPU_SUBTYPE_MC68030 symbol has been preserved for source code * compatability. * @@ -182,119 +244,119 @@ typedef integer_t cpu_threadtype_t; * files to be tagged as containing 68030-specific instructions. */ -#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) -#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ -#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) -#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ +#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) /* * I386 subtypes */ -#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) - -#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0) -#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0) -#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0) -#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128 -#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0) -#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) -#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) -#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) -#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) -#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6) -#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7) -#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0) -#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1) -#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2) -#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0) -#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0) -#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1) -#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0) -#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1) -#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0) -#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1) - -#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) -#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 - -#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) -#define CPU_SUBTYPE_INTEL_MODEL_ALL 0 +#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) + +#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0) +#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128 +#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) +#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) +#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) +#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6) +#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7) +#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0) +#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1) +#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2) +#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0) +#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0) +#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1) +#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0) +#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1) +#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0) +#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1) + +#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) +#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 + +#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) +#define CPU_SUBTYPE_INTEL_MODEL_ALL 0 /* * X86 subtypes. */ -#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3) -#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3) -#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4) -#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell feature subset */ +#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4) +#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell feature subset */ -#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1) +#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1) /* * Mips subtypes. */ -#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) -#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) -#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) -#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ -#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) -#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ -#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ +#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ +#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) /* * MC98000 (PowerPC) subtypes */ -#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) /* * HPPA subtypes for Hewlett-Packard HP-PA family of - * risc processors. Port by NeXT to 700 series. + * risc processors. Port by NeXT to 700 series. */ -#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ -#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ +#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) /* * MC88000 subtypes. */ -#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) -#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) /* * SPARC subtypes */ -#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) /* * I860 subtypes */ -#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) /* * PowerPC subtypes */ -#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) -#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) -#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) -#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) -#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) -#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) -#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) -#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) -#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) -#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) -#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10) -#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11) -#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) +#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) /* * ARM subtypes @@ -303,8 +365,38 @@ typedef integer_t cpu_threadtype_t; #define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5) #define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6) #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7) -#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) -#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) /* ARMv7-A and ARMv7-R */ +#define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10) /* Cortex A9 */ +#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */ +#define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12) +#define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13) +#define CPU_SUBTYPE_ARM_V6M ((cpu_subtype_t) 14) /* Not meant to be run under xnu */ +#define CPU_SUBTYPE_ARM_V7M ((cpu_subtype_t) 15) /* Not meant to be run under xnu */ +#define CPU_SUBTYPE_ARM_V7EM ((cpu_subtype_t) 16) /* Not meant to be run under xnu */ +#define CPU_SUBTYPE_ARM_V8M ((cpu_subtype_t) 17) /* Not meant to be run under xnu */ + +/* + * ARM64 subtypes + */ +#define CPU_SUBTYPE_ARM64_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_ARM64E ((cpu_subtype_t) 2) + +/* CPU subtype feature flags for ptrauth on arm64e platforms */ +#define CPU_SUBTYPE_ARM64_PTR_AUTH_MASK 0x0f000000 +#define CPU_SUBTYPE_ARM64_PTR_AUTH_VERSION(x) (((x) & CPU_SUBTYPE_ARM64_PTR_AUTH_MASK) >> 24) +#ifdef PRIVATE +#define CPU_SUBTYPE_ARM64_PTR_AUTH_CURRENT_VERSION 0 +#endif /* PRIVATE */ + +/* + * ARM64_32 subtypes + */ +#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1) + +#endif /* !__ASSEMBLER__ */ /* * CPU families (sysctl hw.cpufamily) @@ -317,31 +409,53 @@ typedef integer_t cpu_threadtype_t; * Use feature flags (eg, hw.optional.altivec) to test for optional * functionality. */ -#define CPUFAMILY_UNKNOWN 0 -#define CPUFAMILY_POWERPC_G3 0xcee41549 -#define CPUFAMILY_POWERPC_G4 0x77c184ae -#define CPUFAMILY_POWERPC_G5 0xed76d8aa -#define CPUFAMILY_INTEL_6_13 0xaa33392b -#define CPUFAMILY_INTEL_YONAH 0x73d67300 -#define CPUFAMILY_INTEL_MEROM 0x426f69ef -#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc -#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2 -#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec -#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c -#define CPUFAMILY_ARM_9 0xe73283ae -#define CPUFAMILY_ARM_11 0x8ff620d8 -#define CPUFAMILY_ARM_XSCALE 0x53b005f5 -#define CPUFAMILY_ARM_13 0x0cc90e64 -#define CPUFAMILY_ARM_14 0x96077ef1 +#define CPUFAMILY_UNKNOWN 0 +#define CPUFAMILY_POWERPC_G3 0xcee41549 +#define CPUFAMILY_POWERPC_G4 0x77c184ae +#define CPUFAMILY_POWERPC_G5 0xed76d8aa +#define CPUFAMILY_INTEL_6_13 0xaa33392b +#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc +#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2 +#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec +#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c +#define CPUFAMILY_INTEL_IVYBRIDGE 0x1f65e835 +#define CPUFAMILY_INTEL_HASWELL 0x10b282dc +#define CPUFAMILY_INTEL_BROADWELL 0x582ed09c +#define CPUFAMILY_INTEL_SKYLAKE 0x37fc219f +#define CPUFAMILY_INTEL_KABYLAKE 0x0f817246 +#define CPUFAMILY_INTEL_ICELAKE 0x38435547 +#define CPUFAMILY_ARM_9 0xe73283ae +#define CPUFAMILY_ARM_11 0x8ff620d8 +#define CPUFAMILY_ARM_XSCALE 0x53b005f5 +#define CPUFAMILY_ARM_12 0xbd1b0ae9 +#define CPUFAMILY_ARM_13 0x0cc90e64 +#define CPUFAMILY_ARM_14 0x96077ef1 +#define CPUFAMILY_ARM_15 0xa8511bca +#define CPUFAMILY_ARM_SWIFT 0x1e2d6381 +#define CPUFAMILY_ARM_CYCLONE 0x37a09642 +#define CPUFAMILY_ARM_TYPHOON 0x2c91a47e +#define CPUFAMILY_ARM_TWISTER 0x92fb37c8 +#define CPUFAMILY_ARM_HURRICANE 0x67ceee93 +#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6 +#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f +#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2 +#ifndef RC_HIDE_XNU_FIRESTORM +#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3 +#endif /* !RC_HIDE_XNU_FIRESTORM */ + +/* Described in rdar://64125549 */ +#define CPUSUBFAMILY_UNKNOWN 0 +#define CPUSUBFAMILY_ARM_HP 1 +#define CPUSUBFAMILY_ARM_HG 2 +#define CPUSUBFAMILY_ARM_M 3 +#ifndef RC_HIDE_XNU_FIRESTORM +#define CPUSUBFAMILY_ARM_HS 4 +#define CPUSUBFAMILY_ARM_HC_HD 5 +#endif /* !RC_HIDE_XNU_FIRESTORM */ /* The following synonyms are deprecated: */ -#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH -#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM -#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN -#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM - -#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH -#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM +#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN +#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM -#endif /* _MACH_MACHINE_H_ */ +#endif /* _MACH_MACHINE_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/machine/boolean.h b/src/third_party/mac_headers/mach/machine/boolean.h index ffdc2390a..adca083dc 100644 --- a/src/third_party/mac_headers/mach/machine/boolean.h +++ b/src/third_party/mac_headers/mach/machine/boolean.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ @@ -31,10 +31,10 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/boolean.h" -#elif defined (__arm__) +#elif defined (__arm__) || defined (__arm64__) || defined(__aarch64__) #include "mach/arm/boolean.h" #else #error architecture not supported #endif -#endif /* _MACH_MACHINE_BOOLEAN_H_ */ +#endif /* _MACH_MACHINE_BOOLEAN_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/machine/thread_state.h b/src/third_party/mac_headers/mach/machine/thread_state.h index 1547acac7..fceb4279e 100644 --- a/src/third_party/mac_headers/mach/machine/thread_state.h +++ b/src/third_party/mac_headers/mach/machine/thread_state.h @@ -6,4 +6,4 @@ #define THREAD_STATE_MAX 1 -#endif /* _MACH_MACHINE_THREAD_STATE_H_ */ +#endif /* _MACH_MACHINE_THREAD_STATE_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/machine/thread_status.h b/src/third_party/mac_headers/mach/machine/thread_status.h index d1ab56ad5..4309afdc3 100644 --- a/src/third_party/mac_headers/mach/machine/thread_status.h +++ b/src/third_party/mac_headers/mach/machine/thread_status.h @@ -1 +1 @@ -/* This file intentionally left blank */ +/* This file intentionally left blank */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/machine/vm_types.h b/src/third_party/mac_headers/mach/machine/vm_types.h index 8ccd24be5..7ee7ac8e8 100644 --- a/src/third_party/mac_headers/mach/machine/vm_types.h +++ b/src/third_party/mac_headers/mach/machine/vm_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ @@ -31,10 +31,10 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/vm_types.h" -#elif defined (__arm__) +#elif defined (__arm__) || defined (__arm64__) || defined(__aarch64__) #include "mach/arm/vm_types.h" #else #error architecture not supported #endif -#endif /* _MACH_MACHINE_VM_TYPES_H_ */ +#endif /* _MACH_MACHINE_VM_TYPES_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/thread_status.h b/src/third_party/mac_headers/mach/thread_status.h index aead09bf9..f742500ca 100644 --- a/src/third_party/mac_headers/mach/thread_status.h +++ b/src/third_party/mac_headers/mach/thread_status.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* @@ -32,24 +32,24 @@ * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -65,8 +65,8 @@ * */ -#ifndef _MACH_THREAD_STATUS_H_ -#define _MACH_THREAD_STATUS_H_ +#ifndef _MACH_THREAD_STATUS_H_ +#define _MACH_THREAD_STATUS_H_ /* * The actual structure that comprises the thread state is defined @@ -80,15 +80,21 @@ * Generic definition for machine-dependent thread status. */ -typedef natural_t *thread_state_t; /* Variable-length array */ +typedef natural_t *thread_state_t; /* Variable-length array */ /* THREAD_STATE_MAX is now defined in */ -typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; +typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; + +#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */ +#define THREAD_STATE_FLAVOR_LIST_NEW 128 +#define THREAD_STATE_FLAVOR_LIST_10_9 129 +#define THREAD_STATE_FLAVOR_LIST_10_13 130 +#define THREAD_STATE_FLAVOR_LIST_10_15 131 -#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */ -#define THREAD_STATE_FLAVOR_LIST_NEW 128 +typedef int thread_state_flavor_t; +typedef thread_state_flavor_t *thread_state_flavor_array_t; -typedef int thread_state_flavor_t; -typedef thread_state_flavor_t *thread_state_flavor_array_t; +#define THREAD_CONVERT_THREAD_STATE_TO_SELF 1 +#define THREAD_CONVERT_THREAD_STATE_FROM_SELF 2 -#endif /* _MACH_THREAD_STATUS_H_ */ +#endif /* _MACH_THREAD_STATUS_H_ */ \ No newline at end of file diff --git a/src/third_party/mac_headers/mach/vm_prot.h b/src/third_party/mac_headers/mach/vm_prot.h index 07c2114e5..b19c8e247 100644 --- a/src/third_party/mac_headers/mach/vm_prot.h +++ b/src/third_party/mac_headers/mach/vm_prot.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2021 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,34 +22,34 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -63,8 +63,8 @@ * */ -#ifndef _MACH_VM_PROT_H_ -#define _MACH_VM_PROT_H_ +#ifndef _MACH_VM_PROT_H_ +#define _MACH_VM_PROT_H_ /* * Types defined: @@ -72,29 +72,36 @@ * vm_prot_t VM protection values. */ -typedef int vm_prot_t; +typedef int vm_prot_t; /* * Protection values, defined as bits within the vm_prot_t type */ -#define VM_PROT_NONE ((vm_prot_t) 0x00) +#define VM_PROT_NONE ((vm_prot_t) 0x00) -#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ -#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ -#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ +#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ +#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ +#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ /* * The default protection for newly-created virtual memory */ -#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) +#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) /* * The maximum privileges possible, for parameter checking. */ -#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) +#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) + +/* + * This is an alias to VM_PROT_EXECUTE to identify callers that + * want to allocate an hardware assisted Read-only/read-write + * trusted path in userland. + */ +#define VM_PROT_RORW_TP (VM_PROT_EXECUTE) /* * An invalid protection value. @@ -103,15 +110,16 @@ typedef int vm_prot_t; * looks like VM_PROT_ALL and then some. */ -#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08) +#define VM_PROT_NO_CHANGE_LEGACY ((vm_prot_t) 0x08) +#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x01000000) -/* +/* * When a caller finds that he cannot obtain write permission on a * mapped entry, the following flag can be used. The entry will * be made "needs copy" effectively copying the object (using COW), * and write permission will be added to the maximum protections - * for the associated entry. - */ + * for the associated entry. + */ #define VM_PROT_COPY ((vm_prot_t) 0x10) @@ -127,14 +135,59 @@ typedef int vm_prot_t; * walking down the shadow chain. */ -#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) +#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) +#ifdef PRIVATE +/* + * The caller wants this memory region treated as if it had a valid + * code signature. + */ + +#define VM_PROT_TRUSTED ((vm_prot_t) 0x20) +#endif /* PRIVATE */ /* - * Another invalid protection value. + * Another invalid protection value. * Indicates that the other protection bits are to be applied as a mask * against the actual protection bits of the map entry. */ -#define VM_PROT_IS_MASK ((vm_prot_t) 0x40) +#define VM_PROT_IS_MASK ((vm_prot_t) 0x40) + +/* + * Another invalid protection value to support execute-only protection. + * VM_PROT_STRIP_READ is a special marker that tells mprotect to not + * set VM_PROT_READ. We have to do it this way because existing code + * expects the system to set VM_PROT_READ if VM_PROT_EXECUTE is set. + * VM_PROT_EXECUTE_ONLY is just a convenience value to indicate that + * the memory should be executable and explicitly not readable. It will + * be ignored on platforms that do not support this type of protection. + */ +#define VM_PROT_STRIP_READ ((vm_prot_t) 0x80) +#define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ) + +#ifdef PRIVATE +/* + * When using VM_PROT_COPY, fail instead of copying an executable mapping, + * since that could cause code-signing violations. + */ +#define VM_PROT_COPY_FAIL_IF_EXECUTABLE ((vm_prot_t)0x100) +#endif /* PRIVATE */ + +#if defined(__x86_64__) +/* + * Another invalid protection value to support specifying different + * execute permissions for user- and supervisor- modes. When + * MBE is enabled in a VM, VM_PROT_EXECUTE is used to indicate + * supervisor-mode execute permission, and VM_PROT_UEXEC specifies + * user-mode execute permission. Currently only used by the + * x86 Hypervisor kext. + */ +#define VM_PROT_UEXEC ((vm_prot_t) 0x8) /* User-mode Execute Permission */ + +#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE | VM_PROT_UEXEC) +#else +#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE) +#endif /* defined(__x86_64__) */ + -#endif /* _MACH_VM_PROT_H_ */ +#endif /* _MACH_VM_PROT_H_ */ \ No newline at end of file From 57bed07ad46f46ae575d1e38bf07c4d3137bbf53 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Thu, 27 Apr 2023 12:38:54 -0400 Subject: [PATCH 187/195] Mac: update arch_utilities for macOS 13 The NXArch* family is deprecated in macOS 13. This change: - Uses the replacements where available - Silences deprecation warnings otherwise - Removes the Linux cross-compile shims in favor of having completely separate implementations for Mac and non-Mac. The logic of the Linux versions uses the same prepopulated data as before, but they no longer use NXArchInfo. clang diagnostic disables are necessary due to https://crbug.com/1406057 Bug: chromium:1420654, google-breakpad:880, b/257505171 Change-Id: Iad777915a5a058551cfb3a7d3cf681cce180dfea Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4437109 Reviewed-by: Mark Mentovai --- src/common/mac/arch_utilities.cc | 197 +++++++++++-------------------- 1 file changed, 72 insertions(+), 125 deletions(-) diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index febf8a222..15504b054 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -32,69 +32,16 @@ #include "common/mac/arch_utilities.h" +#include #include #include #include #include -#ifndef CPU_SUBTYPE_ARM_V7S -#define CPU_SUBTYPE_ARM_V7S (static_cast(11)) -#endif // CPU_SUBTYPE_ARM_V7S - -#ifndef CPU_TYPE_ARM64 -#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) -#endif // CPU_TYPE_ARM64 - -#ifndef CPU_SUBTYPE_ARM64_ALL -#define CPU_SUBTYPE_ARM64_ALL (static_cast(0)) -#endif // CPU_SUBTYPE_ARM64_ALL - -#ifndef CPU_SUBTYPE_ARM64_E -#define CPU_SUBTYPE_ARM64_E (static_cast(2)) -#endif // CPU_SUBTYPE_ARM64_E - -std::optional GetArchInfoFromName(const char* arch_name) { - // TODO: Remove this when the OS knows about arm64. - if (!strcmp("arm64", arch_name)) - return ArchInfo{CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_ALL}; - - if (!strcmp("arm64e", arch_name)) - return ArchInfo{CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_E}; - // TODO: Remove this when the OS knows about armv7s. - if (!strcmp("armv7s", arch_name)) - return ArchInfo{CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S}; - - const NXArchInfo* info = NXGetArchInfoFromName(arch_name); - if (info) - return ArchInfo{info->cputype, info->cpusubtype}; - return std::nullopt; -} - -const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - // TODO: Remove this when the OS knows about arm64. - if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_ALL) { - return "arm64"; - } - - if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_E) { - return "arm64e"; - } - - // TODO: Remove this when the OS knows about armv7s. - if (cpu_type == CPU_TYPE_ARM && cpu_subtype == CPU_SUBTYPE_ARM_V7S) { - return "armv7s"; - } - - const NXArchInfo* info = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype); - if (info) - return info->name; - return kUnknownArchName; -} +#ifdef __APPLE__ +#include +#endif -// TODO(crbug.com/1242776): The "#ifndef __APPLE__" should be here, but the -// system version of NXGetLocalArchInfo returns incorrect information on -// x86_64 machines (treating them as just x86), so use the Breakpad version -// all the time for now. namespace { enum Architecture { @@ -109,59 +56,21 @@ enum Architecture { kNumArchitectures }; +struct NamedArchInfo { + const char* name; + ArchInfo info; +}; + // enum Architecture above and kKnownArchitectures below // must be kept in sync. -const NXArchInfo kKnownArchitectures[] = { - { - "i386", - CPU_TYPE_I386, - CPU_SUBTYPE_I386_ALL, - NX_LittleEndian, - "Intel 80x86" - }, - { - "x86_64", - CPU_TYPE_X86_64, - CPU_SUBTYPE_X86_64_ALL, - NX_LittleEndian, - "Intel x86-64" - }, - { - "x86_64h", - CPU_TYPE_X86_64, - CPU_SUBTYPE_X86_64_H, - NX_LittleEndian, - "Intel x86-64h Haswell" - }, - { - "arm", - CPU_TYPE_ARM, - CPU_SUBTYPE_ARM_ALL, - NX_LittleEndian, - "ARM" - }, - { - "arm64", - CPU_TYPE_ARM64, - CPU_SUBTYPE_ARM64_ALL, - NX_LittleEndian, - "ARM64" - }, - { - "arm64e", - CPU_TYPE_ARM64, - CPU_SUBTYPE_ARM64_E, - NX_LittleEndian, - "ARM64e" - }, - { - "ppc", - CPU_TYPE_POWERPC, - CPU_SUBTYPE_POWERPC_ALL, - NX_BigEndian, - "PowerPC" - } -}; +constexpr NamedArchInfo kKnownArchitectures[] = { + {"i386", {CPU_TYPE_I386, CPU_SUBTYPE_I386_ALL}}, + {"x86_64", {CPU_TYPE_X86_64, CPU_SUBTYPE_X86_64_ALL}}, + {"x86_64h", {CPU_TYPE_X86_64, CPU_SUBTYPE_X86_64_H}}, + {"arm", {CPU_TYPE_ARM, CPU_SUBTYPE_ARM_ALL}}, + {"arm64", {CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_ALL}}, + {"arm64e", {CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64E}}, + {"ppc", {CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_ALL}}}; } // namespace @@ -171,7 +80,7 @@ ArchInfo GetLocalArchInfo(void) { arch = kArch_i386; #elif defined(__x86_64__) arch = kArch_x86_64; -#elif defined(__arm64) +#elif defined(__arm64__) || defined(__aarch64__) arch = kArch_arm64; #elif defined(__arm__) arch = kArch_arm; @@ -180,34 +89,72 @@ ArchInfo GetLocalArchInfo(void) { #else #error "Unsupported CPU architecture" #endif - NXArchInfo info = kKnownArchitectures[arch]; - return {info.cputype, info.cpusubtype}; + return kKnownArchitectures[arch].info; } -#ifndef __APPLE__ +#ifdef __APPLE__ -const NXArchInfo *NXGetArchInfoFromName(const char *name) { +std::optional GetArchInfoFromName(const char* arch_name) { + if (__builtin_available(macOS 13.0, *)) { + cpu_type_t type; + cpu_subtype_t subtype; + if (macho_cpu_type_for_arch_name(arch_name, &type, &subtype)) { + return ArchInfo{type, subtype}; + } + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + const NXArchInfo* info = NXGetArchInfoFromName(arch_name); +#pragma clang diagnostic pop + if (info) { + return ArchInfo{info->cputype, info->cpusubtype}; + } + } + return std::nullopt; +} + +const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { + if (__builtin_available(macOS 13.0, *)) { + const char* name = macho_arch_name_for_cpu_type(cpu_type, cpu_subtype); + if (name) { + return name; + } + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + const NXArchInfo* info = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype); +#pragma clang diagnostic pop + if (info) { + return info->name; + } + } + + return kUnknownArchName; +} + +#else + +std::optional GetArchInfoFromName(const char* arch_name) { for (int arch = 0; arch < kNumArchitectures; ++arch) { - if (!strcmp(name, kKnownArchitectures[arch].name)) { - return &kKnownArchitectures[arch]; + if (!strcmp(arch_name, kKnownArchitectures[arch].name)) { + return kKnownArchitectures[arch].info; } } - return NULL; + return std::nullopt; } -const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype, - cpu_subtype_t cpusubtype) { - const NXArchInfo *candidate = NULL; +const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { + const char* candidate = kUnknownArchName; for (int arch = 0; arch < kNumArchitectures; ++arch) { - if (kKnownArchitectures[arch].cputype == cputype) { - if (kKnownArchitectures[arch].cpusubtype == cpusubtype) { - return &kKnownArchitectures[arch]; + if (kKnownArchitectures[arch].info.cputype == cpu_type) { + if (kKnownArchitectures[arch].info.cpusubtype == cpu_subtype) { + return kKnownArchitectures[arch].name; } - if (!candidate) { - candidate = &kKnownArchitectures[arch]; + if (!strcmp(candidate, kUnknownArchName)) { + candidate = kKnownArchitectures[arch].name; } } } return candidate; } -#endif // !__APPLE__ +#endif // __APPLE__ From 68f5a4d11a2703f76b9c4312a4a3df699cef41d8 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 26 Apr 2023 11:08:05 -0400 Subject: [PATCH 188/195] Fix AMD64/X86 typo in MD_CONTEXT_AMD64_ALL Use MD_CONTEXT_AMD64_DEBUG_REGISTERS instead of MD_CONTEXT_AMD64_DEBUG_REGISTERS in the definition of MD_CONTEXT_AMD64_ALL. This previously happened to work because the two flags happened to have the same values and every includer of minidump_cpu_amd64.h also happened to previously include minidump_cpu_x86.h. Change-Id: If8b422d3623936f4a0b57a4cf6dac4f348daa024 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4480251 Reviewed-by: Joshua Peraza --- src/google_breakpad/common/minidump_cpu_amd64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google_breakpad/common/minidump_cpu_amd64.h b/src/google_breakpad/common/minidump_cpu_amd64.h index 308f21ecb..be209801a 100644 --- a/src/google_breakpad/common/minidump_cpu_amd64.h +++ b/src/google_breakpad/common/minidump_cpu_amd64.h @@ -227,7 +227,7 @@ typedef struct { #define MD_CONTEXT_AMD64_ALL (MD_CONTEXT_AMD64_FULL | \ MD_CONTEXT_AMD64_SEGMENTS | \ - MD_CONTEXT_X86_DEBUG_REGISTERS) + MD_CONTEXT_AMD64_DEBUG_REGISTERS) /* CONTEXT_ALL */ From de040fa25de948e71cef9c035ba152fa75bfe0ec Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 24 Apr 2023 23:41:28 -0400 Subject: [PATCH 189/195] minidump-2-core: Use exception context for crashed thread Use the exception record's context for the crashed thread instead of the thread's own context. For the crashed thread the thread's own context is the state inside the exception handler. Using it would not result in the expected stack trace from the time of the crash. This change aligns the behavior of minidump-2-core with the behavior of minidump_stackwalk. Bug: google-breakpad:885 Change-Id: I5cd3e9d39807308491b64fcd335f5f85b1dcd084 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4473128 Reviewed-by: Joshua Peraza Reviewed-by: Joshua Peraza --- src/tools/linux/md2core/minidump-2-core.cc | 42 ++++++++++++++++------ 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index f12f2841a..9d5e5e3f9 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -282,7 +282,7 @@ typedef struct prpsinfo { /* Information about process */ // We parse the minidump file and keep the parsed information in this structure struct CrashedProcess { CrashedProcess() - : crashing_tid(-1), + : exception{-1}, auxv(NULL), auxv_length(0) { memset(&prps, 0, sizeof(prps)); @@ -306,7 +306,6 @@ struct CrashedProcess { }; std::map mappings; - pid_t crashing_tid; int fatal_signal; struct Thread { @@ -330,6 +329,7 @@ struct CrashedProcess { size_t stack_length; }; std::vector threads; + Thread exception; const uint8_t* auxv; size_t auxv_length; @@ -999,10 +999,25 @@ ParseDSODebugInfo(const Options& options, CrashedProcess* crashinfo, static void ParseExceptionStream(const Options& options, CrashedProcess* crashinfo, - const MinidumpMemoryRange& range) { + const MinidumpMemoryRange& range, + const MinidumpMemoryRange& full_file) { const MDRawExceptionStream* exp = range.GetData(0); - crashinfo->crashing_tid = exp->thread_id; + if (!exp) { + return; + } + if (options.verbose) { + fprintf(stderr, + "MD_EXCEPTION_STREAM:\n" + "Found exception thread %" PRIu32 " \n" + "\n\n", + exp->thread_id); + } crashinfo->fatal_signal = (int) exp->exception_record.exception_code; + crashinfo->exception = {}; + crashinfo->exception.tid = exp->thread_id; + // crashinfo->threads[].tid == crashinfo->exception.tid provides the stack. + ParseThreadRegisters(&crashinfo->exception, + full_file.Subrange(exp->thread_context)); } static bool @@ -1365,7 +1380,7 @@ main(int argc, const char* argv[]) { break; case MD_EXCEPTION_STREAM: ParseExceptionStream(options, &crashinfo, - dump.Subrange(dirent->location)); + dump.Subrange(dirent->location), dump); break; case MD_MODULE_LIST_STREAM: ParseModuleStream(options, &crashinfo, dump.Subrange(dirent->location), @@ -1481,16 +1496,21 @@ main(int argc, const char* argv[]) { return 1; } - for (unsigned i = 0; i < crashinfo.threads.size(); ++i) { - if (crashinfo.threads[i].tid == crashinfo.crashing_tid) { - WriteThread(options, crashinfo.threads[i], crashinfo.fatal_signal); + for (const auto& current_thread : crashinfo.threads) { + if (current_thread.tid == crashinfo.exception.tid) { + // Use the exception record's context for the crashed thread instead of + // the thread's own context. For the crashed thread the thread's own + // context is the state inside the exception handler. Using it would not + // result in the expected stack trace from the time of the crash. + // The stack memory has already been provided by current_thread. + WriteThread(options, crashinfo.exception, crashinfo.fatal_signal); break; } } - for (unsigned i = 0; i < crashinfo.threads.size(); ++i) { - if (crashinfo.threads[i].tid != crashinfo.crashing_tid) - WriteThread(options, crashinfo.threads[i], 0); + for (const auto& current_thread : crashinfo.threads) { + if (current_thread.tid != crashinfo.exception.tid) + WriteThread(options, current_thread, 0); } if (note_align) { From 99cd657eec78e330a1f0d4184dd6d0e163209c70 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Mon, 1 May 2023 17:13:08 -0400 Subject: [PATCH 190/195] Reimport architecture/byte_order.h from canonical repo Bug: b/257505171 Change-Id: I210b6689683ff2cf561997584924fd9b568943cb Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4494631 Reviewed-by: Mark Mentovai --- src/third_party/mac_headers/README | 4 ++- .../mac_headers/architecture/byte_order.h | 29 +++++++++---------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/third_party/mac_headers/README b/src/third_party/mac_headers/README index 3dccc49dd..2b855b60c 100644 --- a/src/third_party/mac_headers/README +++ b/src/third_party/mac_headers/README @@ -3,7 +3,6 @@ processes Mach-O files on Linux. From xnu-8792.41.9 (https://github.com/apple-oss-distributions/xnu at 5c2921b) i386/_types.h -architecture/byte_order.h arm/_types.h mach/boolean.h mach/machine.h @@ -21,3 +20,6 @@ mach-o/arch.h mach-o/fat.h mach-o/loader.h mach-o/nlist.h + +From architecture-282 (https://github.com/apple-oss-distributions/architecture at fe86900) +architecture/byte_order.h diff --git a/src/third_party/mac_headers/architecture/byte_order.h b/src/third_party/mac_headers/architecture/byte_order.h index 8fb7f7e9d..1f723ae14 100644 --- a/src/third_party/mac_headers/architecture/byte_order.h +++ b/src/third_party/mac_headers/architecture/byte_order.h @@ -1,24 +1,23 @@ /* - * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ - * - * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.0 (the 'License'). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License." - * + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * * @APPLE_LICENSE_HEADER_END@ */ /* @@ -30,7 +29,7 @@ #ifndef _ARCHITECTURE_BYTE_ORDER_H_ #define _ARCHITECTURE_BYTE_ORDER_H_ - + enum NXByteOrder { NX_UnknownByteOrder, NX_LittleEndian, From e9eb843f421bcde49914aaf711fbd745aae24904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Tue, 2 May 2023 13:19:34 -0700 Subject: [PATCH 191/195] Fix dump_syms help typo on Linux Bug: None Change-Id: I0409a0c2ab8e60b1f84f72b50a1fd400b5a41cbd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4500379 Reviewed-by: Mark Mentovai --- src/tools/linux/dump_syms/dump_syms.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index 531a60bae..2fce23c2a 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -60,7 +60,7 @@ int usage(const char* self) { fprintf(stderr, " -n Use specified name for name of the object\n"); fprintf(stderr, " -o Use specified name for the " "operating system\n"); - fprintf(stderr, " -m Enable writing the optional 'm' field on FUNC" + fprintf(stderr, " -m Enable writing the optional 'm' field on FUNC " "and PUBLIC, denoting multiple symbols for " "the address.\n"); return 1; From 3ea3af42d3ea0a61dfb2688a4466318ce5649afa Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Tue, 2 May 2023 16:05:18 -0400 Subject: [PATCH 192/195] Include iOS in availability checks for mach-o/util.h calls Bug: chromium:1420654 Change-Id: Id0281089962147040b6332223bf4593bf4fc60cd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4500259 Reviewed-by: Mark Mentovai --- src/common/mac/arch_utilities.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index 15504b054..96340d544 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -95,7 +95,7 @@ ArchInfo GetLocalArchInfo(void) { #ifdef __APPLE__ std::optional GetArchInfoFromName(const char* arch_name) { - if (__builtin_available(macOS 13.0, *)) { + if (__builtin_available(macOS 13.0, iOS 16.0, *)) { cpu_type_t type; cpu_subtype_t subtype; if (macho_cpu_type_for_arch_name(arch_name, &type, &subtype)) { @@ -114,7 +114,7 @@ std::optional GetArchInfoFromName(const char* arch_name) { } const char* GetNameFromCPUType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - if (__builtin_available(macOS 13.0, *)) { + if (__builtin_available(macOS 13.0, iOS 16.0, *)) { const char* name = macho_arch_name_for_cpu_type(cpu_type, cpu_subtype); if (name) { return name; From 6e319cac57ef30f98a5c79c54efee1584f018491 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 3 May 2023 15:08:23 -0400 Subject: [PATCH 193/195] Fix MDRawModuleCrashpadInfoList::modules type MDRawModuleCrashpadInfoList::modules is a flexible array of MDRawModuleCrashpadInfoLink and not MDLocationDescriptor. Breakpad does not currently use the MDRawModuleCrashpadInfoList type, but its definition should be updated to reflect the correct type to avoid confusion. Change-Id: If97f490db8d41529b59a225a275a37116746c2b7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4504150 Reviewed-by: Joshua Peraza --- src/google_breakpad/common/minidump_format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 1526afcea..802cc7e3f 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1122,7 +1122,7 @@ typedef struct { typedef struct { uint32_t count; - MDLocationDescriptor modules[0]; /* MDRawModuleCrashpadInfoLink */ + MDRawModuleCrashpadInfoLink modules[0]; } MDRawModuleCrashpadInfoList; typedef struct { From 837b0f5d52701df4a88b94eaa8b0a093e33ff45d Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 3 May 2023 16:25:52 -0400 Subject: [PATCH 194/195] Fix MDRawCrashpadAnnotationList::objects type MDRawCrashpadAnnotationList::objects is a flexible array of MDRawCrashpadAnnotation and not MDLocationDescriptor. Breakpad does not currently use the MDRawCrashpadAnnotationList type, but its definition should be updated to reflect the correct type to avoid confusion. Change-Id: I58b5b0e4f7f95bc003b103e2750e3759c3e31292 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4503630 Reviewed-by: Joshua Peraza --- src/google_breakpad/common/minidump_format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 802cc7e3f..959d15ba2 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1105,7 +1105,7 @@ typedef struct { typedef struct { uint32_t count; - MDLocationDescriptor objects[0]; /* MDRawCrashpadAnnotation */ + MDRawCrashpadAnnotation objects[0]; } MDRawCrashpadAnnotationList; typedef struct { From 5b101544cafe22267a2ede256b9ac24d6131fcf2 Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Thu, 4 May 2023 23:07:34 +0000 Subject: [PATCH 195/195] [dump_syms][riscv] Fix register name mismatch dump_syms was using x0...x31 notation, while the rest of Breakpad was using the ABI names. This mismatch was causing stackwalking to not fully succeed. Fixed: 1432426 Change-Id: I0713e76e65ff6dad492b51bc3607e94e25dc2c3a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4505156 Reviewed-by: Joshua Peraza --- src/common/dwarf_cfi_to_module.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index 7e04d3c55..4c594175e 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -149,10 +149,10 @@ vector DwarfCFIToModule::RegisterNames::MIPS() { vector DwarfCFIToModule::RegisterNames::RISCV() { static const char *const names[] = { - "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", - "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", - "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", + "pc", "ra", "sp", "gp", "tp", "t0", "t1", "t2", + "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5", + "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7", + "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",