diff --git a/lldb/include/lldb/Core/LoadedModuleInfoList.h b/lldb/include/lldb/Core/LoadedModuleInfoList.h --- a/lldb/include/lldb/Core/LoadedModuleInfoList.h +++ b/lldb/include/lldb/Core/LoadedModuleInfoList.h @@ -95,10 +95,10 @@ protected: bool m_has[e_num]; std::string m_name; - lldb::addr_t m_link_map; - lldb::addr_t m_base; - bool m_base_is_offset; - lldb::addr_t m_dynamic; + lldb::addr_t m_link_map = LLDB_INVALID_ADDRESS; + lldb::addr_t m_base = LLDB_INVALID_ADDRESS; + bool m_base_is_offset = false; + lldb::addr_t m_dynamic = LLDB_INVALID_ADDRESS; }; LoadedModuleInfoList() = default; diff --git a/lldb/include/lldb/DataFormatters/TypeSummary.h b/lldb/include/lldb/DataFormatters/TypeSummary.h --- a/lldb/include/lldb/DataFormatters/TypeSummary.h +++ b/lldb/include/lldb/DataFormatters/TypeSummary.h @@ -263,7 +263,7 @@ typedef std::shared_ptr SharedPointer; protected: - uint32_t m_my_revision; + uint32_t m_my_revision = 0; Flags m_flags; TypeSummaryImpl(Kind kind, const TypeSummaryImpl::Flags &flags); diff --git a/lldb/include/lldb/Symbol/DebugMacros.h b/lldb/include/lldb/Symbol/DebugMacros.h --- a/lldb/include/lldb/Symbol/DebugMacros.h +++ b/lldb/include/lldb/Symbol/DebugMacros.h @@ -39,7 +39,7 @@ static DebugMacroEntry CreateIndirectEntry(const DebugMacrosSP &debug_macros_sp); - DebugMacroEntry() : m_type(INVALID) {} + DebugMacroEntry() : m_type(INVALID), m_line(0), m_debug_line_file_idx(0) {} ~DebugMacroEntry() = default; diff --git a/lldb/include/lldb/Target/ProcessStructReader.h b/lldb/include/lldb/Target/ProcessStructReader.h --- a/lldb/include/lldb/Target/ProcessStructReader.h +++ b/lldb/include/lldb/Target/ProcessStructReader.h @@ -39,7 +39,8 @@ public: ProcessStructReader(Process *process, lldb::addr_t base_addr, - CompilerType struct_type) { + CompilerType struct_type) + : m_byte_order(lldb::eByteOrderInvalid), m_addr_byte_size(0) { if (!process) return; if (base_addr == 0 || base_addr == LLDB_INVALID_ADDRESS) diff --git a/lldb/include/lldb/Utility/Args.h b/lldb/include/lldb/Utility/Args.h --- a/lldb/include/lldb/Utility/Args.h +++ b/lldb/include/lldb/Utility/Args.h @@ -39,7 +39,7 @@ friend struct llvm::yaml::MappingTraits; std::unique_ptr ptr; - char quote; + char quote = '\0'; char *data() { return ptr.get(); } @@ -395,7 +395,7 @@ return lldb_private::Args::ArgEntry(value, quote); } StringRef value; - uint8_t quote; + uint8_t quote = '\0'; }; static void mapping(IO &io, lldb_private::Args::ArgEntry &v); }; diff --git a/lldb/include/lldb/Utility/RegisterValue.h b/lldb/include/lldb/Utility/RegisterValue.h --- a/lldb/include/lldb/Utility/RegisterValue.h +++ b/lldb/include/lldb/Utility/RegisterValue.h @@ -263,8 +263,8 @@ mutable uint8_t bytes[kMaxRegisterByteSize]; // This must be big enough to hold any // register for any supported target. - uint16_t length; - lldb::ByteOrder byte_order; + uint16_t length = 0; + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid; } buffer; }; diff --git a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h --- a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h +++ b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h @@ -215,7 +215,7 @@ protected: ResponseValidatorCallback m_validator = nullptr; - void *m_validator_baton; + void *m_validator_baton = nullptr; }; #endif // LLDB_UTILITY_STRINGEXTRACTORGDBREMOTE_H diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -115,7 +115,8 @@ : m_callback(BreakpointOptions::NullCallback), m_baton_is_command_baton(false), m_callback_is_synchronous(false), m_enabled(true), m_one_shot(false), m_ignore_count(0), - m_condition_text_hash(0), m_auto_continue(false), m_set_flags(0) { + m_condition_text_hash(0), m_inject_condition(false), + m_auto_continue(false), m_set_flags(0) { if (all_flags_set) m_set_flags.Set(~((Flags::ValueType)0)); } @@ -125,11 +126,9 @@ bool auto_continue) : m_callback(nullptr), m_baton_is_command_baton(false), m_callback_is_synchronous(false), m_enabled(enabled), - m_one_shot(one_shot), m_ignore_count(ignore), - m_condition_text_hash(0), m_auto_continue(auto_continue) -{ - m_set_flags.Set(eEnabled | eIgnoreCount | eOneShot - | eAutoContinue); + m_one_shot(one_shot), m_ignore_count(ignore), m_condition_text_hash(0), + m_inject_condition(false), m_auto_continue(auto_continue) { + m_set_flags.Set(eEnabled | eIgnoreCount | eOneShot | eAutoContinue); if (condition && *condition != '\0') { SetCondition(condition); } @@ -141,8 +140,8 @@ m_baton_is_command_baton(rhs.m_baton_is_command_baton), m_callback_is_synchronous(rhs.m_callback_is_synchronous), m_enabled(rhs.m_enabled), m_one_shot(rhs.m_one_shot), - m_ignore_count(rhs.m_ignore_count), m_auto_continue(rhs.m_auto_continue), - m_set_flags(rhs.m_set_flags) { + m_ignore_count(rhs.m_ignore_count), m_inject_condition(false), + m_auto_continue(rhs.m_auto_continue), m_set_flags(rhs.m_set_flags) { if (rhs.m_thread_spec_up != nullptr) m_thread_spec_up = std::make_unique(*rhs.m_thread_spec_up); m_condition_text = rhs.m_condition_text; @@ -163,6 +162,7 @@ m_thread_spec_up = std::make_unique(*rhs.m_thread_spec_up); m_condition_text = rhs.m_condition_text; m_condition_text_hash = rhs.m_condition_text_hash; + m_inject_condition = rhs.m_inject_condition; m_auto_continue = rhs.m_auto_continue; m_set_flags = rhs.m_set_flags; return *this; diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -201,7 +201,7 @@ } TargetSP target_sp; - LoadScriptFromSymFile load_script_old_value; + LoadScriptFromSymFile load_script_old_value = eLoadScriptFromSymFileFalse; if (is_load_script && exe_ctx->GetTargetSP()) { target_sp = exe_ctx->GetTargetSP(); load_script_old_value = diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp --- a/lldb/source/Core/IOHandlerCursesGUI.cpp +++ b/lldb/source/Core/IOHandlerCursesGUI.cpp @@ -588,9 +588,10 @@ } Window(const char *name, const Rect &bounds) - : Surface(Surface::Type::Window), m_name(name), m_parent(nullptr), - m_subwindows(), m_delegate_sp(), m_curr_active_window_idx(UINT32_MAX), - m_prev_active_window_idx(UINT32_MAX), m_delete(true), + : Surface(Surface::Type::Window), m_name(name), m_panel(nullptr), + m_parent(nullptr), m_subwindows(), m_delegate_sp(), + m_curr_active_window_idx(UINT32_MAX), + m_prev_active_window_idx(UINT32_MAX), m_delete(false), m_needs_update(true), m_can_activate(true), m_is_subwin(false) { Reset(::newwin(bounds.size.height, bounds.size.width, bounds.origin.y, bounds.origin.y)); @@ -5702,8 +5703,8 @@ uint32_t m_selected_row_idx = 0; uint32_t m_first_visible_row = 0; uint32_t m_num_rows = 0; - int m_min_x; - int m_min_y; + int m_min_x = 0; + int m_min_y = 0; int m_max_x = 0; int m_max_y = 0; diff --git a/lldb/source/Expression/FunctionCaller.cpp b/lldb/source/Expression/FunctionCaller.cpp --- a/lldb/source/Expression/FunctionCaller.cpp +++ b/lldb/source/Expression/FunctionCaller.cpp @@ -44,7 +44,8 @@ m_function_return_type(return_type), m_wrapper_function_name("__lldb_caller_function"), m_wrapper_struct_name("__lldb_caller_struct"), m_wrapper_args_addrs(), - m_struct_valid(false), m_arg_values(arg_value_list), m_compiled(false), + m_struct_valid(false), m_struct_size(0), m_return_size(0), + m_return_offset(0), m_arg_values(arg_value_list), m_compiled(false), m_JITted(false) { m_jit_process_wp = lldb::ProcessWP(exe_scope.CalculateProcess()); // Can't make a FunctionCaller without a process. diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp --- a/lldb/source/Expression/LLVMUserExpression.cpp +++ b/lldb/source/Expression/LLVMUserExpression.cpp @@ -48,8 +48,8 @@ m_stack_frame_bottom(LLDB_INVALID_ADDRESS), m_stack_frame_top(LLDB_INVALID_ADDRESS), m_allow_cxx(false), m_allow_objc(false), m_transformed_text(), m_execution_unit_sp(), - m_materializer_up(), m_jit_module_wp(), m_can_interpret(false), - m_materialized_address(LLDB_INVALID_ADDRESS) {} + m_materializer_up(), m_jit_module_wp(), m_target(nullptr), + m_can_interpret(false), m_materialized_address(LLDB_INVALID_ADDRESS) {} LLVMUserExpression::~LLVMUserExpression() { if (m_target) { diff --git a/lldb/source/Host/common/MainLoop.cpp b/lldb/source/Host/common/MainLoop.cpp --- a/lldb/source/Host/common/MainLoop.cpp +++ b/lldb/source/Host/common/MainLoop.cpp @@ -255,7 +255,7 @@ } #endif -MainLoop::MainLoop() { +MainLoop::MainLoop() : m_terminate_request(false) { #if HAVE_SYS_EVENT_H m_kqueue = kqueue(); assert(m_kqueue >= 0); diff --git a/lldb/source/Interpreter/OptionGroupFormat.cpp b/lldb/source/Interpreter/OptionGroupFormat.cpp --- a/lldb/source/Interpreter/OptionGroupFormat.cpp +++ b/lldb/source/Interpreter/OptionGroupFormat.cpp @@ -37,7 +37,7 @@ : m_format(default_format, default_format), m_byte_size(default_byte_size, default_byte_size), m_count(default_count, default_count), m_prev_gdb_format('x'), - m_prev_gdb_size('w') { + m_prev_gdb_size('w'), m_has_gdb_format(false) { // Copy the default option definitions. std::copy(std::begin(g_default_option_definitions), std::end(g_default_option_definitions), diff --git a/lldb/source/Interpreter/OptionGroupVariable.cpp b/lldb/source/Interpreter/OptionGroupVariable.cpp --- a/lldb/source/Interpreter/OptionGroupVariable.cpp +++ b/lldb/source/Interpreter/OptionGroupVariable.cpp @@ -67,8 +67,10 @@ } OptionGroupVariable::OptionGroupVariable(bool show_frame_options) - : include_frame_options(show_frame_options), summary(ValidateNamedSummary), - summary_string(ValidateSummaryString) {} + : include_frame_options(show_frame_options), show_args(false), + show_recognized_args(false), show_locals(false), show_globals(false), + use_regex(false), show_scope(false), show_decl(false), + summary(ValidateNamedSummary), summary_string(ValidateSummaryString) {} Status OptionGroupVariable::SetOptionValue(uint32_t option_idx,