diff --git a/lldb/include/lldb/Core/EmulateInstruction.h b/lldb/include/lldb/Core/EmulateInstruction.h --- a/lldb/include/lldb/Core/EmulateInstruction.h +++ b/lldb/include/lldb/Core/EmulateInstruction.h @@ -179,7 +179,7 @@ eInfoTypeISAAndImmediateSigned, eInfoTypeISA, eInfoTypeNoArgs - } InfoType; + }; struct Context { ContextType type = eContextInvalid; diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h --- a/lldb/include/lldb/DataFormatters/TypeCategory.h +++ b/lldb/include/lldb/DataFormatters/TypeCategory.h @@ -331,7 +331,7 @@ std::vector m_languages; - uint32_t m_enabled_position; + uint32_t m_enabled_position = 0; void Enable(bool value, uint32_t position); diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h b/lldb/include/lldb/DataFormatters/TypeSynthetic.h --- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h +++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h @@ -239,8 +239,10 @@ bool SkipsReferences() const { return m_flags.GetSkipReferences(); } bool NonCacheable() const { return m_flags.GetNonCacheable(); } - - bool WantsDereference() const { return m_flags.GetFrontEndWantsDereference();} + + bool WantsDereference() const { + return m_flags.GetFrontEndWantsDereference(); + } void SetCascades(bool value) { m_flags.SetCascades(value); } @@ -266,7 +268,7 @@ uint32_t &GetRevision() { return m_my_revision; } protected: - uint32_t m_my_revision; + uint32_t m_my_revision = 0; Flags m_flags; private: diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -275,7 +275,7 @@ OptionValueUInt64 m_num_per_line; bool m_output_as_binary = false; OptionValueString m_view_as_type; - bool m_force; + bool m_force = false; OptionValueUInt64 m_offset; OptionValueLanguage m_language_for_type; }; diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -4637,23 +4637,23 @@ std::string m_class_name; std::string m_function_name; uint32_t m_line_start = 0; - uint32_t m_line_end; + uint32_t m_line_end = UINT_MAX; std::string m_file_name; std::string m_module_name; uint32_t m_func_name_type_mask = eFunctionNameTypeAuto; // A pick from lldb::FunctionNameType. - lldb::tid_t m_thread_id; - uint32_t m_thread_index; + lldb::tid_t m_thread_id = LLDB_INVALID_THREAD_ID; + uint32_t m_thread_index = UINT32_MAX; std::string m_thread_name; std::string m_queue_name; bool m_sym_ctx_specified = false; - bool m_no_inlines; + bool m_no_inlines = false; bool m_thread_specified = false; // Instance variables to hold the values for one_liner options. bool m_use_one_liner = false; std::vector m_one_liner; - bool m_auto_continue; + bool m_auto_continue = false; }; CommandObjectTargetStopHookAdd(CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -877,8 +877,8 @@ return llvm::makeArrayRef(g_thread_until_options); } - uint32_t m_step_thread_idx; - bool m_stop_others; + uint32_t m_step_thread_idx = LLDB_INVALID_THREAD_ID; + bool m_stop_others = false; std::vector m_until_addrs; // Instance variables to hold the values for command options. diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -120,12 +120,12 @@ // Instance variables to hold the values for command options. TypeSummaryImpl::Flags m_flags; - bool m_regex; + bool m_regex = false; std::string m_format_string; ConstString m_name; std::string m_python_script; std::string m_python_function; - bool m_is_add_script; + bool m_is_add_script = false; std::string m_category; }; diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -49,6 +49,10 @@ : m_process(process), m_rendezvous_addr(LLDB_INVALID_ADDRESS), m_current(), m_previous(), m_soentries(), m_added_soentries(), m_removed_soentries() { m_thread_info.valid = false; + m_thread_info.dtv_offset = 0; + m_thread_info.dtv_slot_size = 0; + m_thread_info.modid_offset = 0; + m_thread_info.tls_offset = 0; // Cache a copy of the executable path if (m_process) { diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h @@ -91,7 +91,8 @@ EmulateInstructionARM(const ArchSpec &arch) : EmulateInstruction(arch), m_arm_isa(0), m_opcode_mode(eModeInvalid), - m_opcode_cpsr(0), m_it_session(), m_ignore_conditions(false) { + m_opcode_cpsr(0), m_new_inst_cpsr(0), m_it_session(), + m_ignore_conditions(false) { SetArchitecture(arch); } diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -274,14 +274,12 @@ // If we can't parse the incoming name, then just check that it contains path. if (m_parse_error) return m_full.GetStringRef().contains(path); - + llvm::StringRef identifier; llvm::StringRef context; std::string path_str = path.str(); - bool success - = CPlusPlusLanguage::ExtractContextAndIdentifier(path_str.c_str(), - context, - identifier); + bool success = CPlusPlusLanguage::ExtractContextAndIdentifier( + path_str.c_str(), context, identifier); if (!success) return m_full.GetStringRef().contains(path); @@ -299,7 +297,7 @@ return false; if (haystack.empty() || !isalnum(haystack.back())) return true; - + return false; } @@ -315,7 +313,7 @@ return true; } -bool CPlusPlusLanguage::DemangledNameContainsPath(llvm::StringRef path, +bool CPlusPlusLanguage::DemangledNameContainsPath(llvm::StringRef path, ConstString demangled) const { MethodName demangled_name(demangled); return demangled_name.ContainsPath(path); @@ -409,12 +407,12 @@ private: /// Input character until which we have constructed the respective output /// already. - const char *Written; + const char *Written = ""; llvm::SmallString<128> Result; /// Whether we have performed any substitutions. - bool Substituted; + bool Substituted = false; const char *currentParserPos() const { return this->First; } diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp @@ -119,16 +119,16 @@ AbstractListFrontEnd(ValueObject &valobj) : SyntheticChildrenFrontEnd(valobj) {} - size_t m_count; - ValueObject *m_head; + size_t m_count = 0; + ValueObject *m_head = nullptr; static constexpr bool g_use_loop_detect = true; - size_t m_loop_detected; // The number of elements that have had loop detection - // run over them. + size_t m_loop_detected = 0; // The number of elements that have had loop + // detection run over them. ListEntry m_slow_runner; // Used for loop detection ListEntry m_fast_runner; // Used for loop detection - size_t m_list_capping_size; + size_t m_list_capping_size = 0; CompilerType m_element_type; std::map m_iterators; diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp @@ -165,8 +165,8 @@ } MapEntry m_entry; - size_t m_max_depth; - bool m_error; + size_t m_max_depth = 0; + bool m_error = false; }; namespace lldb_private { diff --git a/lldb/source/Plugins/Language/ObjC/CFBasicHash.h b/lldb/source/Plugins/Language/ObjC/CFBasicHash.h --- a/lldb/source/Plugins/Language/ObjC/CFBasicHash.h +++ b/lldb/source/Plugins/Language/ObjC/CFBasicHash.h @@ -68,7 +68,7 @@ ExecutionContextRef m_exe_ctx_ref; bool m_mutable = true; bool m_multi = false; - HashType m_type; + HashType m_type = HashType::set; }; } // namespace lldb_private diff --git a/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp b/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp --- a/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp +++ b/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp @@ -137,7 +137,7 @@ lldb::ByteOrder m_order = lldb::eByteOrderInvalid; DataDescriptor_32 *m_data_32 = nullptr; DataDescriptor_64 *m_data_64 = nullptr; - lldb::addr_t m_data_ptr; + lldb::addr_t m_data_ptr = LLDB_INVALID_ADDRESS; CompilerType m_pair_type; std::vector m_children; }; @@ -257,24 +257,24 @@ CompilerType m_pair_type; std::vector m_children; }; - + namespace Foundation1100 { class NSDictionaryMSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); - + ~NSDictionaryMSyntheticFrontEnd() override; - + size_t CalculateNumChildren() override; - + lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; - + bool Update() override; - + bool MightHaveChildren() override; - + size_t GetIndexOfChildWithName(ConstString name) override; - + private: struct DataDescriptor_32 { uint32_t _used : 26; @@ -284,7 +284,7 @@ uint32_t _objs_addr; uint32_t _keys_addr; }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint32_t _kvo : 1; @@ -293,13 +293,13 @@ uint64_t _objs_addr; uint64_t _keys_addr; }; - + struct DictionaryItemDescriptor { lldb::addr_t key_ptr; lldb::addr_t val_ptr; lldb::ValueObjectSP valobj_sp; }; - + ExecutionContextRef m_exe_ctx_ref; uint8_t m_ptr_size = 8; lldb::ByteOrder m_order = lldb::eByteOrderInvalid; @@ -309,7 +309,7 @@ std::vector m_children; }; } - + namespace Foundation1428 { namespace { struct DataDescriptor_32 { @@ -319,7 +319,7 @@ uint32_t _buffer; uint64_t GetSize() { return _size; } }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint32_t _kvo : 1; @@ -332,7 +332,7 @@ using NSDictionaryMSyntheticFrontEnd = GenericNSDictionaryMSyntheticFrontEnd; } - + namespace Foundation1437 { static const uint64_t NSDictionaryCapacities[] = { 0, 3, 7, 13, 23, 41, 71, 127, 191, 251, 383, 631, 1087, 1723, @@ -341,7 +341,7 @@ 6221311, 10066421, 16287743, 26354171, 42641881, 68996069, 111638519, 180634607, 292272623, 472907251 }; - + static const size_t NSDictionaryNumSizeBuckets = sizeof(NSDictionaryCapacities) / sizeof(uint64_t); @@ -358,7 +358,7 @@ 0 : NSDictionaryCapacities[_szidx]; } }; - + struct DataDescriptor_64 { uint64_t _buffer; uint32_t _muts; @@ -375,7 +375,7 @@ using NSDictionaryMSyntheticFrontEnd = GenericNSDictionaryMSyntheticFrontEnd; - + template uint64_t __NSDictionaryMSize_Impl(lldb_private::Process &process, @@ -390,7 +390,7 @@ } return descriptor._used; } - + uint64_t __NSDictionaryMSize(lldb_private::Process &process, lldb::addr_t valobj_addr, Status &error) { diff --git a/lldb/source/Plugins/Language/ObjC/NSError.cpp b/lldb/source/Plugins/Language/ObjC/NSError.cpp --- a/lldb/source/Plugins/Language/ObjC/NSError.cpp +++ b/lldb/source/Plugins/Language/ObjC/NSError.cpp @@ -177,7 +177,7 @@ // values to leak if the latter, then I need to store a SharedPointer to it - // so that it only goes away when everyone else in the cluster goes away oh // joy! - ValueObject *m_child_ptr; + ValueObject *m_child_ptr = nullptr; ValueObjectSP m_child_sp; }; diff --git a/lldb/source/Plugins/Language/ObjC/NSSet.cpp b/lldb/source/Plugins/Language/ObjC/NSSet.cpp --- a/lldb/source/Plugins/Language/ObjC/NSSet.cpp +++ b/lldb/source/Plugins/Language/ObjC/NSSet.cpp @@ -76,7 +76,7 @@ uint8_t m_ptr_size = 8; DataDescriptor_32 *m_data_32 = nullptr; DataDescriptor_64 *m_data_64 = nullptr; - lldb::addr_t m_data_ptr; + lldb::addr_t m_data_ptr = LLDB_INVALID_ADDRESS; std::vector m_children; }; @@ -140,7 +140,7 @@ D64 *m_data_64; std::vector m_children; }; - + namespace Foundation1300 { struct DataDescriptor_32 { uint32_t _used : 26; @@ -148,18 +148,18 @@ uint32_t _mutations; uint32_t _objs_addr; }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint64_t _size; uint64_t _mutations; uint64_t _objs_addr; }; - + using NSSetMSyntheticFrontEnd = GenericNSSetMSyntheticFrontEnd; } - + namespace Foundation1428 { struct DataDescriptor_32 { uint32_t _used : 26; @@ -167,18 +167,18 @@ uint32_t _objs_addr; uint32_t _mutations; }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint64_t _size; uint64_t _objs_addr; uint64_t _mutations; }; - + using NSSetMSyntheticFrontEnd = GenericNSSetMSyntheticFrontEnd; } - + namespace Foundation1437 { struct DataDescriptor_32 { uint32_t _cow; @@ -188,7 +188,7 @@ uint32_t _used : 26; uint32_t _szidx : 6; }; - + struct DataDescriptor_64 { uint64_t _cow; // __Table storage @@ -197,10 +197,10 @@ uint32_t _used : 26; uint32_t _szidx : 6; }; - + using NSSetMSyntheticFrontEnd = GenericNSSetMSyntheticFrontEnd; - + template uint64_t __NSSetMSize_Impl(lldb_private::Process &process, lldb::addr_t valobj_addr, @@ -215,7 +215,7 @@ } return descriptor._used; } - + uint64_t __NSSetMSize(lldb_private::Process &process, lldb::addr_t valobj_addr, Status &error) { @@ -226,7 +226,7 @@ } } } - + class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSSetCodeRunningSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h @@ -347,12 +347,12 @@ private: ConstString m_name; - uint8_t m_pointer_size; - bool m_valid; - uint64_t m_info_bits; - uint64_t m_value_bits; - int64_t m_value_bits_signed; - uint64_t m_payload; + uint8_t m_pointer_size = 0; + bool m_valid = false; + uint64_t m_info_bits = 0; + uint64_t m_value_bits = 0; + int64_t m_value_bits_signed = 0; + uint64_t m_payload = 0; }; } // namespace lldb_private diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h @@ -48,8 +48,8 @@ lldb::addr_t SetupDispatchFunction(Thread &thread, ValueList &dispatch_values); const DispatchFunction *FindDispatchFunction(lldb::addr_t addr); - void ForEachDispatchFunction(std::function); + void ForEachDispatchFunction( + std::function); private: /// These hold the code for the function that finds the implementation of diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -88,7 +88,7 @@ extern void * sel_getUid(char *name); extern int printf(const char *format, ...); } -extern "C" void * +extern "C" void * __lldb_objc_find_implementation_for_selector (void *object, void *sel, int is_str_ptr, @@ -119,7 +119,7 @@ }; struct __lldb_imp_return_struct return_struct; - + if (debug) printf ("\n*** Called with obj: %p sel: %p is_str_ptr: %d " "is_stret: %d is_super: %d, " @@ -136,7 +136,7 @@ } if (is_super) { if (is_super2) { - return_struct.class_addr + return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr->super_ptr; } else { return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr; @@ -145,11 +145,11 @@ printf("*** Super, class addr: %p\n", return_struct.class_addr); } else { // This code seems a little funny, but has its reasons... - // The call to [object class] is here because if this is a class, and has - // not been called into yet, we need to do something to force the class to + // The call to [object class] is here because if this is a class, and has + // not been called into yet, we need to do something to force the class to // initialize itself. - // Then the call to object_getClass will actually return the correct class, - // either the class if object is a class instance, or the meta-class if it + // Then the call to object_getClass will actually return the correct class, + // either the class if object is a class instance, or the meta-class if it // is a class pointer. void *class_ptr = (void *) [(id) object class]; return_struct.class_addr = (id) object_getClass((id) object); @@ -555,8 +555,8 @@ // This is the table of ObjC "accelerated dispatch" functions. They are a set // of objc methods that are "seldom overridden" and so the compiler replaces the // objc_msgSend with a call to one of the dispatch functions. That will check -// whether the method has been overridden, and directly call the Foundation -// implementation if not. +// whether the method has been overridden, and directly call the Foundation +// implementation if not. // This table is supposed to be complete. If ones get added in the future, we // will have to add them to the table. const char *AppleObjCTrampolineHandler::g_opt_dispatch_names[] = { @@ -578,7 +578,8 @@ : m_process_wp(), m_objc_module_sp(objc_module_sp), m_impl_fn_addr(LLDB_INVALID_ADDRESS), m_impl_stret_fn_addr(LLDB_INVALID_ADDRESS), - m_msg_forward_addr(LLDB_INVALID_ADDRESS) { + m_msg_forward_addr(LLDB_INVALID_ADDRESS), + m_msg_forward_stret_addr(LLDB_INVALID_ADDRESS) { if (process_sp) m_process_wp = process_sp; // Look up the known resolution functions: @@ -629,7 +630,7 @@ } return; } - + // We will either set the implementation to the _stret or non_stret version, // so either way it's safe to start filling the m_lookup_..._code here. m_lookup_implementation_function_code.assign( @@ -673,7 +674,7 @@ m_msgSend_map.insert(std::pair(sym_addr, i)); } } - + // Similarly, cache the addresses of the "optimized dispatch" function. for (size_t i = 0; i != llvm::array_lengthof(g_opt_dispatch_names); i++) { ConstString name_const_str(g_opt_dispatch_names[i]); @@ -780,10 +781,8 @@ return nullptr; } -void -AppleObjCTrampolineHandler::ForEachDispatchFunction( - std::function callback) { +void AppleObjCTrampolineHandler::ForEachDispatchFunction( + std::function callback) { for (auto elem : m_msgSend_map) { callback(elem.first, g_dispatch_functions[elem.second]); } @@ -1155,12 +1154,12 @@ } } } - + // Finally, check if we have hit an "optimized dispatch" function. This will // either directly call the base implementation or dispatch an objc_msgSend // if the method has been overridden. So we just do a "step in/step out", - // setting a breakpoint on objc_msgSend, and if we hit the msgSend, we - // will automatically step in again. That's the job of the + // setting a breakpoint on objc_msgSend, and if we hit the msgSend, we + // will automatically step in again. That's the job of the // AppleThreadPlanStepThroughDirectDispatch. if (!this_dispatch && !ret_plan_sp) { MsgsendMap::iterator pos; diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -171,7 +171,8 @@ llvm::StringRef halter_name = ".") : m_module(module), m_reduce_name(name), m_init_name(init_name), m_accum_name(accum_name), m_comb_name(comb_name), - m_outc_name(outc_name), m_halter_name(halter_name) { + m_outc_name(outc_name), m_halter_name(halter_name), m_accum_sig(0), + m_accum_data_size(0), m_comb_name_generated(false) { // TODO Check whether the combiner is an autogenerated name, and track // this } diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -577,7 +577,7 @@ array_size; // Number of items in array, only needed for structs ConstString type_name; // Name of type, only needed for structs - static ConstString + static ConstString GetFallbackStructName(); // Print this as the type name of a struct Element // If we can't resolve the actual struct name @@ -4163,7 +4163,7 @@ int m_kernel_types = RSReduceBreakpointResolver::eKernelTypeAll; llvm::StringRef m_reduce_name; RSCoordinate m_coord; - bool m_have_coord; + bool m_have_coord = false; }; Options *GetOptions() override { return &m_options; } @@ -4268,7 +4268,7 @@ } RSCoordinate m_coord; - bool m_have_coord; + bool m_have_coord = false; }; bool DoExecute(Args &command, CommandReturnObject &result) override { diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -271,8 +271,8 @@ typedef lldb_private::RangeVector FileRangeArray; lldb_private::Address m_entry_point_address; FileRangeArray m_thread_context_offsets; - lldb::offset_t m_linkedit_original_offset; - lldb::addr_t m_text_address; + lldb::offset_t m_linkedit_original_offset = 0; + lldb::addr_t m_text_address = LLDB_INVALID_ADDRESS; bool m_thread_context_offsets_valid; lldb_private::FileSpecList m_reexported_dylibs; bool m_allow_assembly_emulation_unwind_plans; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1302,7 +1302,7 @@ for (uint32_t i = 0; i < m_header.ncmds; ++i) { const lldb::offset_t load_cmd_offset = offset; - llvm::MachO::load_command lc; + llvm::MachO::load_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == LC_DYSYMTAB) { @@ -5421,7 +5421,7 @@ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic); for (uint32_t i = 0; i < m_header.ncmds; ++i) { const uint32_t cmd_offset = offset; - llvm::MachO::load_command lc; + llvm::MachO::load_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == LC_NOTE) { @@ -5488,7 +5488,7 @@ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic); for (uint32_t i = 0; i < m_header.ncmds; ++i) { const uint32_t cmd_offset = offset; - llvm::MachO::load_command lc; + llvm::MachO::load_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == LC_NOTE) { @@ -5535,7 +5535,7 @@ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic); for (uint32_t i = 0; i < m_header.ncmds; ++i) { const uint32_t cmd_offset = offset; - llvm::MachO::load_command lc; + llvm::MachO::load_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == LC_NOTE) { @@ -5945,7 +5945,7 @@ for (uint32_t i = 0; i < m_header.ncmds; ++i) { const lldb::offset_t load_cmd_offset = offset; - llvm::MachO::version_min_command lc; + llvm::MachO::version_min_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX || @@ -6006,7 +6006,7 @@ for (uint32_t i = 0; i < m_header.ncmds; ++i) { const lldb::offset_t load_cmd_offset = offset; - llvm::MachO::version_min_command lc; + llvm::MachO::version_min_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX || @@ -6035,7 +6035,7 @@ for (uint32_t i = 0; i < m_header.ncmds; ++i) { const lldb::offset_t load_cmd_offset = offset; - llvm::MachO::version_min_command lc; + llvm::MachO::version_min_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == llvm::MachO::LC_BUILD_VERSION) { @@ -6864,7 +6864,7 @@ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic); for (uint32_t i = 0; i < m_header.ncmds; ++i) { const uint32_t cmd_offset = offset; - llvm::MachO::load_command lc; + llvm::MachO::load_command lc = {}; if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr) break; if (lc.cmd == LC_NOTE) { diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp --- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp +++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp @@ -349,6 +349,7 @@ lldb_private::minidump::MinidumpContext_x86_64 GetThreadContext_64(RegisterContext *reg_ctx) { lldb_private::minidump::MinidumpContext_x86_64 thread_context; + thread_context.p1_home = {}; thread_context.context_flags = static_cast( lldb_private::minidump::MinidumpContext_x86_64_Flags::x86_64_Flag | lldb_private::minidump::MinidumpContext_x86_64_Flags::Control | diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -414,7 +414,7 @@ lldb::offset_t file_offset, lldb::offset_t length) : ObjectFile(module_sp, file, file_offset, length, data_sp, data_offset), - m_dos_header(), m_coff_header(), m_sect_headers(), + m_dos_header(), m_coff_header(), m_sect_headers(), m_image_base(), m_entry_point_address(), m_deps_filespec() { ::memset(&m_dos_header, 0, sizeof(m_dos_header)); ::memset(&m_coff_header, 0, sizeof(m_coff_header)); @@ -425,7 +425,7 @@ const lldb::ProcessSP &process_sp, addr_t header_addr) : ObjectFile(module_sp, process_sp, header_addr, header_data_sp), - m_dos_header(), m_coff_header(), m_sect_headers(), + m_dos_header(), m_coff_header(), m_sect_headers(), m_image_base(), m_entry_point_address(), m_deps_filespec() { ::memset(&m_dos_header, 0, sizeof(m_dos_header)); ::memset(&m_coff_header, 0, sizeof(m_coff_header)); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp @@ -444,6 +444,7 @@ } ::memset(&m_fpr, 0, sizeof(FPR)); + ::memset(&m_ymm_set, 0, sizeof(YMM)); m_fpr_type = eNotValid; } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -67,8 +67,8 @@ m_packet_timeout(1), #endif m_echo_number(0), m_supports_qEcho(eLazyBoolCalculate), m_history(512), - m_send_acks(true), m_compression_type(CompressionType::None), - m_listen_url() { + m_send_acks(true), m_is_platform(false), + m_compression_type(CompressionType::None), m_listen_url() { } // Destructor @@ -1266,7 +1266,7 @@ GDBRemoteCommunication::ScopedTimeout::ScopedTimeout( GDBRemoteCommunication &gdb_comm, std::chrono::seconds timeout) - : m_gdb_comm(gdb_comm), m_timeout_modified(false) { + : m_gdb_comm(gdb_comm), m_saved_timeout(0), m_timeout_modified(false) { auto curr_timeout = gdb_comm.GetPacketTimeout(); // Only update the timeout if the timeout is greater than the current // timeout. If the current timeout is larger, then just use that. diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -174,6 +174,14 @@ dqo_target_queue = UINT16_MAX; dqo_target_queue = UINT16_MAX; dqo_priority = UINT16_MAX; + dqo_label_size = 0; + dqo_flags_size = 0; + dqo_serialnum_size = 0; + dqo_width_size = 0; + dqo_running_size = 0; + dqo_suspend_cnt_size = 0; + dqo_target_queue_size = 0; + dqo_priority_size = 0; } bool IsValid() { return dqo_version != UINT16_MAX; } diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -64,8 +64,8 @@ lldb_private::EmulateInstruction *inst_emulator) : UnwindAssembly(arch), m_inst_emulator_up(inst_emulator), m_range_ptr(nullptr), m_unwind_plan_ptr(nullptr), m_curr_row(), - m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(), - m_pushed_regs(), m_curr_row_modified(false), + m_initial_sp(0), m_cfa_reg_info(), m_fp_is_cfa(false), + m_register_values(), m_pushed_regs(), m_curr_row_modified(false), m_forward_branch_offset(0) { if (m_inst_emulator_up.get()) { m_inst_emulator_up->SetBaton(this); diff --git a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp --- a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp @@ -24,11 +24,12 @@ : m_cur_insn(nullptr), m_machine_ip_regnum(LLDB_INVALID_REGNUM), m_machine_sp_regnum(LLDB_INVALID_REGNUM), m_machine_fp_regnum(LLDB_INVALID_REGNUM), + m_machine_alt_fp_regnum(LLDB_INVALID_REGNUM), m_lldb_ip_regnum(LLDB_INVALID_REGNUM), m_lldb_sp_regnum(LLDB_INVALID_REGNUM), m_lldb_fp_regnum(LLDB_INVALID_REGNUM), - - m_reg_map(), m_arch(arch), m_cpu(k_cpu_unspecified), m_wordsize(-1), + m_lldb_alt_fp_regnum(LLDB_INVALID_REGNUM), m_reg_map(), m_arch(arch), + m_cpu(k_cpu_unspecified), m_wordsize(-1), m_register_map_initialized(false), m_disasm_context() { m_disasm_context = ::LLVMCreateDisasm(arch.GetTriple().getTriple().c_str(), nullptr, @@ -668,7 +669,7 @@ } // Returns true if this is a jmp instruction where we can't -// know the destination address statically. +// know the destination address statically. // // ff e0 jmpq *%rax // ff e1 jmpq *%rcx @@ -720,13 +721,13 @@ // that may be branch/jumped to. // // Cannot determine the offset of a JMP that jumps to the address in -// a register ("jmpq *%rax") or offset from a register value +// a register ("jmpq *%rax") or offset from a register value // ("jmpq *0x28(%rax)"), this method will return false on those // instructions. // // These instructions all end in either a relative 8/16/32 bit value // depending on the instruction and the current execution mode of the -// inferior process. Once we know the size of the opcode instruction, +// inferior process. Once we know the size of the opcode instruction, // we can use the total instruction length to determine the size of // the relative offset without having to compute it correctly. @@ -884,10 +885,8 @@ return v; } - -bool x86AssemblyInspectionEngine::instruction_length(uint8_t *insn_p, - int &length, - uint32_t buffer_remaining_bytes) { +bool x86AssemblyInspectionEngine::instruction_length( + uint8_t *insn_p, int &length, uint32_t buffer_remaining_bytes) { uint32_t max_op_byte_size = std::min(buffer_remaining_bytes, m_arch.GetMaximumOpcodeByteSize()); llvm::SmallVector opcode_data; @@ -980,9 +979,9 @@ bool row_updated = false; // The UnwindPlan::Row 'row' has been updated m_cur_insn = data + current_func_text_offset; - if (!instruction_length(m_cur_insn, insn_len, size - current_func_text_offset) - || insn_len == 0 - || insn_len > kMaxInstructionByteSize) { + if (!instruction_length(m_cur_insn, insn_len, + size - current_func_text_offset) || + insn_len == 0 || insn_len > kMaxInstructionByteSize) { // An unrecognized/junk instruction break; } @@ -1233,17 +1232,18 @@ } } - else if (prologue_completed_row.get() && + else if (prologue_completed_row.get() && (ret_pattern_p() || - non_local_branch_p (current_func_text_offset, func_range, insn_len) || + non_local_branch_p(current_func_text_offset, func_range, + insn_len) || jmp_to_reg_p())) { // Check if the current instruction is the end of an epilogue sequence, // and if so, re-instate the prologue-completed unwind state. - // The current instruction is a branch/jump outside this function, - // a ret, or a jump through a register value which we cannot - // determine the effcts of. Verify that the stack frame state - // has been unwound to the same as it was at function entry to avoid + // The current instruction is a branch/jump outside this function, + // a ret, or a jump through a register value which we cannot + // determine the effcts of. Verify that the stack frame state + // has been unwound to the same as it was at function entry to avoid // mis-identifying a JMP instruction as an epilogue. UnwindPlan::Row::RegisterLocation sp, pc; if (row->GetRegisterInfo(m_lldb_sp_regnum, sp) && @@ -1590,9 +1590,8 @@ int scratch; m_cur_insn = data + offset; - if (!instruction_length(m_cur_insn, insn_len, size - offset) - || insn_len > kMaxInstructionByteSize - || insn_len == 0) { + if (!instruction_length(m_cur_insn, insn_len, size - offset) || + insn_len > kMaxInstructionByteSize || insn_len == 0) { // An error parsing the instruction, i.e. probably data/garbage - stop // scanning break;