[LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB

Applied modernize-use-default-member-init clang-tidy check over LLDB.
It appears in many files we had already switched to in class member init but
never updated the constructors to reflect that. This check is already present in
the lldb/.clang-tidy config.

Differential Revision: https://reviews.llvm.org/D121481
This commit is contained in:
Shafik Yaghmour 2022-03-14 13:32:03 -07:00
parent c79ab1065e
commit 28c878aeb2
59 changed files with 256 additions and 338 deletions

View File

@ -19,7 +19,7 @@ using namespace lldb_private;
SBBroadcaster::SBBroadcaster() { LLDB_INSTRUMENT_VA(this); } SBBroadcaster::SBBroadcaster() { LLDB_INSTRUMENT_VA(this); }
SBBroadcaster::SBBroadcaster(const char *name) SBBroadcaster::SBBroadcaster(const char *name)
: m_opaque_sp(new Broadcaster(nullptr, name)), m_opaque_ptr(nullptr) { : m_opaque_sp(new Broadcaster(nullptr, name)) {
LLDB_INSTRUMENT_VA(this, name); LLDB_INSTRUMENT_VA(this, name);
m_opaque_ptr = m_opaque_sp.get(); m_opaque_ptr = m_opaque_sp.get();

View File

@ -23,12 +23,11 @@ using namespace lldb_private;
SBListener::SBListener() { LLDB_INSTRUMENT_VA(this); } SBListener::SBListener() { LLDB_INSTRUMENT_VA(this); }
SBListener::SBListener(const char *name) SBListener::SBListener(const char *name)
: m_opaque_sp(Listener::MakeListener(name)), m_unused_ptr(nullptr) { : m_opaque_sp(Listener::MakeListener(name)) {
LLDB_INSTRUMENT_VA(this, name); LLDB_INSTRUMENT_VA(this, name);
} }
SBListener::SBListener(const SBListener &rhs) SBListener::SBListener(const SBListener &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
: m_opaque_sp(rhs.m_opaque_sp), m_unused_ptr(nullptr) {
LLDB_INSTRUMENT_VA(this, rhs); LLDB_INSTRUMENT_VA(this, rhs);
} }
@ -43,7 +42,7 @@ const lldb::SBListener &SBListener::operator=(const lldb::SBListener &rhs) {
} }
SBListener::SBListener(const lldb::ListenerSP &listener_sp) SBListener::SBListener(const lldb::ListenerSP &listener_sp)
: m_opaque_sp(listener_sp), m_unused_ptr(nullptr) {} : m_opaque_sp(listener_sp) {}
SBListener::~SBListener() = default; SBListener::~SBListener() = default;

View File

@ -48,8 +48,7 @@ struct PlatformConnectOptions {
// PlatformShellCommand // PlatformShellCommand
struct PlatformShellCommand { struct PlatformShellCommand {
PlatformShellCommand(llvm::StringRef shell_interpreter, PlatformShellCommand(llvm::StringRef shell_interpreter,
llvm::StringRef shell_command) llvm::StringRef shell_command) {
: m_status(0), m_signo(0) {
if (!shell_interpreter.empty()) if (!shell_interpreter.empty())
m_shell = shell_interpreter.str(); m_shell = shell_interpreter.str();

View File

@ -29,10 +29,7 @@ class QueueImpl {
public: public:
QueueImpl() {} QueueImpl() {}
QueueImpl(const lldb::QueueSP &queue_sp) QueueImpl(const lldb::QueueSP &queue_sp) { m_queue_wp = queue_sp; }
: m_thread_list_fetched(false), m_pending_items_fetched(false) {
m_queue_wp = queue_sp;
}
QueueImpl(const QueueImpl &rhs) { QueueImpl(const QueueImpl &rhs) {
if (&rhs == this) if (&rhs == this)

View File

@ -1076,7 +1076,7 @@ public:
std::string funct, std::string help, std::string funct, std::string help,
ScriptedCommandSynchronicity synch) ScriptedCommandSynchronicity synch)
: CommandObjectRaw(interpreter, name), m_function_name(funct), : CommandObjectRaw(interpreter, name), m_function_name(funct),
m_synchro(synch), m_fetched_help_long(false) { m_synchro(synch) {
if (!help.empty()) if (!help.empty())
SetHelp(help); SetHelp(help);
else { else {
@ -1139,7 +1139,7 @@ protected:
private: private:
std::string m_function_name; std::string m_function_name;
ScriptedCommandSynchronicity m_synchro; ScriptedCommandSynchronicity m_synchro;
bool m_fetched_help_long; bool m_fetched_help_long = false;
}; };
class CommandObjectScriptingObject : public CommandObjectRaw { class CommandObjectScriptingObject : public CommandObjectRaw {

View File

@ -295,7 +295,6 @@ public:
eCommandRequiresTarget | eCommandProcessMustBePaused), eCommandRequiresTarget | eCommandProcessMustBePaused),
m_format_options(eFormatBytesWithASCII, 1, 8), m_format_options(eFormatBytesWithASCII, 1, 8),
m_next_addr(LLDB_INVALID_ADDRESS), m_prev_byte_size(0),
m_prev_format_options(eFormatBytesWithASCII, 1, 8) { m_prev_format_options(eFormatBytesWithASCII, 1, 8) {
CommandArgumentEntry arg1; CommandArgumentEntry arg1;
CommandArgumentEntry arg2; CommandArgumentEntry arg2;
@ -877,8 +876,8 @@ protected:
OptionGroupReadMemory m_memory_options; OptionGroupReadMemory m_memory_options;
OptionGroupOutputFile m_outfile_options; OptionGroupOutputFile m_outfile_options;
OptionGroupValueObjectDisplay m_varobj_options; OptionGroupValueObjectDisplay m_varobj_options;
lldb::addr_t m_next_addr; lldb::addr_t m_next_addr = LLDB_INVALID_ADDRESS;
lldb::addr_t m_prev_byte_size; lldb::addr_t m_prev_byte_size = 0;
OptionGroupFormat m_prev_format_options; OptionGroupFormat m_prev_format_options;
OptionGroupReadMemory m_prev_memory_options; OptionGroupReadMemory m_prev_memory_options;
OptionGroupOutputFile m_prev_outfile_options; OptionGroupOutputFile m_prev_outfile_options;
@ -986,7 +985,7 @@ protected:
class ProcessMemoryIterator { class ProcessMemoryIterator {
public: public:
ProcessMemoryIterator(ProcessSP process_sp, lldb::addr_t base) ProcessMemoryIterator(ProcessSP process_sp, lldb::addr_t base)
: m_process_sp(process_sp), m_base_addr(base), m_is_valid(true) { : m_process_sp(process_sp), m_base_addr(base) {
lldbassert(process_sp.get() != nullptr); lldbassert(process_sp.get() != nullptr);
} }
@ -1010,7 +1009,7 @@ protected:
private: private:
ProcessSP m_process_sp; ProcessSP m_process_sp;
lldb::addr_t m_base_addr; lldb::addr_t m_base_addr;
bool m_is_valid; bool m_is_valid = true;
}; };
bool DoExecute(Args &command, CommandReturnObject &result) override { bool DoExecute(Args &command, CommandReturnObject &result) override {
// No need to check "process" for validity as eCommandRequiresProcess // No need to check "process" for validity as eCommandRequiresProcess
@ -1646,8 +1645,7 @@ public:
"an address in the current target process.", "an address in the current target process.",
"memory region ADDR", "memory region ADDR",
eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandRequiresProcess | eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched), eCommandProcessMustBeLaunched) {}
m_prev_end_addr(LLDB_INVALID_ADDRESS) {}
~CommandObjectMemoryRegion() override = default; ~CommandObjectMemoryRegion() override = default;
@ -1757,7 +1755,7 @@ protected:
return m_cmd_name; return m_cmd_name;
} }
lldb::addr_t m_prev_end_addr; lldb::addr_t m_prev_end_addr = LLDB_INVALID_ADDRESS;
}; };
// CommandObjectMemory // CommandObjectMemory

View File

@ -138,7 +138,7 @@ class CommandObjectMemoryTagWrite : public CommandObjectParsed {
public: public:
class OptionGroupTagWrite : public OptionGroup { class OptionGroupTagWrite : public OptionGroup {
public: public:
OptionGroupTagWrite() : m_end_addr(LLDB_INVALID_ADDRESS) {} OptionGroupTagWrite() {}
~OptionGroupTagWrite() override = default; ~OptionGroupTagWrite() override = default;
@ -168,7 +168,7 @@ public:
m_end_addr = LLDB_INVALID_ADDRESS; m_end_addr = LLDB_INVALID_ADDRESS;
} }
lldb::addr_t m_end_addr; lldb::addr_t m_end_addr = LLDB_INVALID_ADDRESS;
}; };
CommandObjectMemoryTagWrite(CommandInterpreter &interpreter) CommandObjectMemoryTagWrite(CommandInterpreter &interpreter)

View File

@ -1214,7 +1214,7 @@ public:
class CommandOptions : public Options { class CommandOptions : public Options {
public: public:
CommandOptions() : m_requested_save_core_style(eSaveCoreUnspecified) {} CommandOptions() {}
~CommandOptions() override = default; ~CommandOptions() override = default;
@ -1250,7 +1250,7 @@ public:
} }
// Instance variables to hold the values for command options. // Instance variables to hold the values for command options.
SaveCoreStyle m_requested_save_core_style; SaveCoreStyle m_requested_save_core_style = eSaveCoreUnspecified;
std::string m_requested_plugin_name; std::string m_requested_plugin_name;
}; };

View File

@ -2184,8 +2184,7 @@ public:
nullptr, nullptr,
eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandRequiresProcess | eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched | eCommandProcessMustBePaused | eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
eCommandProcessMustBeTraced), eCommandProcessMustBeTraced) {}
m_create_repeat_command_just_invoked(false) {}
~CommandObjectTraceDumpInstructions() override = default; ~CommandObjectTraceDumpInstructions() override = default;
@ -2253,7 +2252,7 @@ protected:
// Repeat command helpers // Repeat command helpers
std::string m_repeat_command; std::string m_repeat_command;
bool m_create_repeat_command_just_invoked; bool m_create_repeat_command_just_invoked = false;
std::map<lldb::tid_t, std::unique_ptr<TraceInstructionDumper>> m_dumpers; std::map<lldb::tid_t, std::unique_ptr<TraceInstructionDumper>> m_dumpers;
}; };

View File

@ -233,7 +233,7 @@ static size_t ReadCStringFromMemory(ExecutionContextScope *exe_scope,
Address::Address(lldb::addr_t abs_addr) : m_section_wp(), m_offset(abs_addr) {} Address::Address(lldb::addr_t abs_addr) : m_section_wp(), m_offset(abs_addr) {}
Address::Address(addr_t address, const SectionList *section_list) Address::Address(addr_t address, const SectionList *section_list)
: m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) { : m_section_wp() {
ResolveAddressUsingFileSections(address, section_list); ResolveAddressUsingFileSections(address, section_list);
} }

View File

@ -263,11 +263,10 @@ constexpr Definition g_root = Entry::DefinitionWithChildren(
FormatEntity::Entry::Entry(llvm::StringRef s) FormatEntity::Entry::Entry(llvm::StringRef s)
: string(s.data(), s.size()), printf_format(), children(), : string(s.data(), s.size()), printf_format(), children(),
type(Type::String), fmt(lldb::eFormatDefault), number(0), deref(false) {} type(Type::String) {}
FormatEntity::Entry::Entry(char ch) FormatEntity::Entry::Entry(char ch)
: string(1, ch), printf_format(), children(), type(Type::String), : string(1, ch), printf_format(), children(), type(Type::String) {}
fmt(lldb::eFormatDefault), number(0), deref(false) {}
void FormatEntity::Entry::AppendChar(char ch) { void FormatEntity::Entry::AppendChar(char ch) {
if (children.empty() || children.back().type != Entry::Type::String) if (children.empty() || children.back().type != Entry::Type::String)

View File

@ -341,7 +341,7 @@ public:
protected: protected:
StringList m_text; StringList m_text;
int m_first_visible_line; int m_first_visible_line = 0;
}; };
// A surface is an abstraction for something than can be drawn on. The surface // A surface is an abstraction for something than can be drawn on. The surface
@ -352,7 +352,7 @@ class Surface {
public: public:
enum class Type { Window, Pad }; enum class Type { Window, Pad };
Surface(Surface::Type type) : m_type(type), m_window(nullptr) {} Surface(Surface::Type type) : m_type(type) {}
WINDOW *get() { return m_window; } WINDOW *get() { return m_window; }
@ -555,7 +555,7 @@ public:
protected: protected:
Type m_type; Type m_type;
WINDOW *m_window; WINDOW *m_window = nullptr;
}; };
class Pad : public Surface { class Pad : public Surface {
@ -1076,8 +1076,7 @@ typedef std::unique_ptr<FieldDelegate> FieldDelegateUP;
class TextFieldDelegate : public FieldDelegate { class TextFieldDelegate : public FieldDelegate {
public: public:
TextFieldDelegate(const char *label, const char *content, bool required) TextFieldDelegate(const char *label, const char *content, bool required)
: m_label(label), m_required(required), m_cursor_position(0), : m_label(label), m_required(required) {
m_first_visibile_char(0) {
if (content) if (content)
m_content = content; m_content = content;
} }
@ -1325,9 +1324,9 @@ protected:
std::string m_content; std::string m_content;
// The cursor position in the content string itself. Can be in the range // The cursor position in the content string itself. Can be in the range
// [0, GetContentLength()]. // [0, GetContentLength()].
int m_cursor_position; int m_cursor_position = 0;
// The index of the first visible character in the content. // The index of the first visible character in the content.
int m_first_visibile_char; int m_first_visibile_char = 0;
// Optional error message. If empty, field is considered to have no error. // Optional error message. If empty, field is considered to have no error.
std::string m_error; std::string m_error;
}; };
@ -1515,7 +1514,7 @@ public:
ChoicesFieldDelegate(const char *label, int number_of_visible_choices, ChoicesFieldDelegate(const char *label, int number_of_visible_choices,
std::vector<std::string> choices) std::vector<std::string> choices)
: m_label(label), m_number_of_visible_choices(number_of_visible_choices), : m_label(label), m_number_of_visible_choices(number_of_visible_choices),
m_choices(choices), m_choice(0), m_first_visibile_choice(0) {} m_choices(choices) {}
// Choices fields are drawn as titles boxses of a number of visible choices. // Choices fields are drawn as titles boxses of a number of visible choices.
// The rest of the choices become visible as the user scroll. The selected // The rest of the choices become visible as the user scroll. The selected
@ -1623,9 +1622,9 @@ protected:
int m_number_of_visible_choices; int m_number_of_visible_choices;
std::vector<std::string> m_choices; std::vector<std::string> m_choices;
// The index of the selected choice. // The index of the selected choice.
int m_choice; int m_choice = 0;
// The index of the first visible choice in the field. // The index of the first visible choice in the field.
int m_first_visibile_choice; int m_first_visibile_choice = 0;
}; };
class PlatformPluginFieldDelegate : public ChoicesFieldDelegate { class PlatformPluginFieldDelegate : public ChoicesFieldDelegate {
@ -1707,7 +1706,7 @@ public:
template <class T> class ListFieldDelegate : public FieldDelegate { template <class T> class ListFieldDelegate : public FieldDelegate {
public: public:
ListFieldDelegate(const char *label, T default_field) ListFieldDelegate(const char *label, T default_field)
: m_label(label), m_default_field(default_field), m_selection_index(0), : m_label(label), m_default_field(default_field),
m_selection_type(SelectionType::NewButton) {} m_selection_type(SelectionType::NewButton) {}
// Signify which element is selected. If a field or a remove button is // Signify which element is selected. If a field or a remove button is
@ -2011,7 +2010,7 @@ protected:
// created though a copy. // created though a copy.
T m_default_field; T m_default_field;
std::vector<T> m_fields; std::vector<T> m_fields;
int m_selection_index; int m_selection_index = 0;
// See SelectionType class enum. // See SelectionType class enum.
SelectionType m_selection_type; SelectionType m_selection_type;
}; };
@ -2465,9 +2464,7 @@ typedef std::shared_ptr<FormDelegate> FormDelegateSP;
class FormWindowDelegate : public WindowDelegate { class FormWindowDelegate : public WindowDelegate {
public: public:
FormWindowDelegate(FormDelegateSP &delegate_sp) FormWindowDelegate(FormDelegateSP &delegate_sp) : m_delegate_sp(delegate_sp) {
: m_delegate_sp(delegate_sp), m_selection_index(0),
m_first_visible_line(0) {
assert(m_delegate_sp->GetNumberOfActions() > 0); assert(m_delegate_sp->GetNumberOfActions() > 0);
if (m_delegate_sp->GetNumberOfFields() > 0) if (m_delegate_sp->GetNumberOfFields() > 0)
m_selection_type = SelectionType::Field; m_selection_type = SelectionType::Field;
@ -2856,11 +2853,11 @@ public:
protected: protected:
FormDelegateSP m_delegate_sp; FormDelegateSP m_delegate_sp;
// The index of the currently selected SelectionType. // The index of the currently selected SelectionType.
int m_selection_index; int m_selection_index = 0;
// See SelectionType class enum. // See SelectionType class enum.
SelectionType m_selection_type; SelectionType m_selection_type;
// The first visible line from the pad. // The first visible line from the pad.
int m_first_visible_line; int m_first_visible_line = 0;
}; };
/////////////////////////// ///////////////////////////
@ -3670,8 +3667,7 @@ typedef std::shared_ptr<SearcherDelegate> SearcherDelegateSP;
class SearcherWindowDelegate : public WindowDelegate { class SearcherWindowDelegate : public WindowDelegate {
public: public:
SearcherWindowDelegate(SearcherDelegateSP &delegate_sp) SearcherWindowDelegate(SearcherDelegateSP &delegate_sp)
: m_delegate_sp(delegate_sp), m_text_field("Search", "", false), : m_delegate_sp(delegate_sp), m_text_field("Search", "", false) {
m_selected_match(0), m_first_visible_match(0) {
; ;
} }
@ -3811,9 +3807,9 @@ protected:
SearcherDelegateSP m_delegate_sp; SearcherDelegateSP m_delegate_sp;
TextFieldDelegate m_text_field; TextFieldDelegate m_text_field;
// The index of the currently selected match. // The index of the currently selected match.
int m_selected_match; int m_selected_match = 0;
// The index of the first visible match. // The index of the first visible match.
int m_first_visible_match; int m_first_visible_match = 0;
}; };
////////////////////////////// //////////////////////////////
@ -4266,8 +4262,7 @@ HandleCharResult Menu::WindowDelegateHandleChar(Window &window, int key) {
class Application { class Application {
public: public:
Application(FILE *in, FILE *out) Application(FILE *in, FILE *out) : m_window_sp(), m_in(in), m_out(out) {}
: m_window_sp(), m_screen(nullptr), m_in(in), m_out(out) {}
~Application() { ~Application() {
m_window_delegates.clear(); m_window_delegates.clear();
@ -4475,7 +4470,7 @@ public:
protected: protected:
WindowSP m_window_sp; WindowSP m_window_sp;
WindowDelegates m_window_delegates; WindowDelegates m_window_delegates;
SCREEN *m_screen; SCREEN *m_screen = nullptr;
FILE *m_in; FILE *m_in;
FILE *m_out; FILE *m_out;
bool m_update_screen = false; bool m_update_screen = false;
@ -4619,9 +4614,8 @@ typedef std::shared_ptr<TreeDelegate> TreeDelegateSP;
class TreeItem { class TreeItem {
public: public:
TreeItem(TreeItem *parent, TreeDelegate &delegate, bool might_have_children) TreeItem(TreeItem *parent, TreeDelegate &delegate, bool might_have_children)
: m_parent(parent), m_delegate(delegate), m_user_data(nullptr), : m_parent(parent), m_delegate(delegate), m_children(),
m_identifier(0), m_row_idx(-1), m_children(), m_might_have_children(might_have_children) {
m_might_have_children(might_have_children), m_is_expanded(false) {
if (m_parent == nullptr) if (m_parent == nullptr)
m_is_expanded = m_delegate.TreeDelegateExpandRootByDefault(); m_is_expanded = m_delegate.TreeDelegateExpandRootByDefault();
} }
@ -4816,23 +4810,21 @@ public:
protected: protected:
TreeItem *m_parent; TreeItem *m_parent;
TreeDelegate &m_delegate; TreeDelegate &m_delegate;
void *m_user_data; void *m_user_data = nullptr;
uint64_t m_identifier; uint64_t m_identifier = 0;
std::string m_text; std::string m_text;
int m_row_idx; // Zero based visible row index, -1 if not visible or for the int m_row_idx = -1; // Zero based visible row index, -1 if not visible or for
// root item // the root item
std::vector<TreeItem> m_children; std::vector<TreeItem> m_children;
bool m_might_have_children; bool m_might_have_children;
bool m_is_expanded; bool m_is_expanded = false;
}; };
class TreeWindowDelegate : public WindowDelegate { class TreeWindowDelegate : public WindowDelegate {
public: public:
TreeWindowDelegate(Debugger &debugger, const TreeDelegateSP &delegate_sp) TreeWindowDelegate(Debugger &debugger, const TreeDelegateSP &delegate_sp)
: m_debugger(debugger), m_delegate_sp(delegate_sp), : m_debugger(debugger), m_delegate_sp(delegate_sp),
m_root(nullptr, *delegate_sp, true), m_selected_item(nullptr), m_root(nullptr, *delegate_sp, true) {}
m_num_rows(0), m_selected_row_idx(0), m_first_visible_row(0),
m_min_x(0), m_min_y(0), m_max_x(0), m_max_y(0) {}
int NumVisibleRows() const { return m_max_y - m_min_y; } int NumVisibleRows() const { return m_max_y - m_min_y; }
@ -4992,14 +4984,14 @@ protected:
Debugger &m_debugger; Debugger &m_debugger;
TreeDelegateSP m_delegate_sp; TreeDelegateSP m_delegate_sp;
TreeItem m_root; TreeItem m_root;
TreeItem *m_selected_item; TreeItem *m_selected_item = nullptr;
int m_num_rows; int m_num_rows = 0;
int m_selected_row_idx; int m_selected_row_idx = 0;
int m_first_visible_row; int m_first_visible_row = 0;
int m_min_x; int m_min_x = 0;
int m_min_y; int m_min_y = 0;
int m_max_x; int m_max_x = 0;
int m_max_y; int m_max_y = 0;
}; };
// A tree delegate that just draws the text member of the tree item, it doesn't // A tree delegate that just draws the text member of the tree item, it doesn't
@ -5071,8 +5063,7 @@ protected:
class ThreadTreeDelegate : public TreeDelegate { class ThreadTreeDelegate : public TreeDelegate {
public: public:
ThreadTreeDelegate(Debugger &debugger) ThreadTreeDelegate(Debugger &debugger)
: TreeDelegate(), m_debugger(debugger), m_tid(LLDB_INVALID_THREAD_ID), : TreeDelegate(), m_debugger(debugger) {
m_stop_id(UINT32_MAX) {
FormatEntity::Parse("thread #${thread.index}: tid = ${thread.id}{, stop " FormatEntity::Parse("thread #${thread.index}: tid = ${thread.id}{, stop "
"reason = ${thread.stop-reason}}", "reason = ${thread.stop-reason}}",
m_format); m_format);
@ -5161,16 +5152,15 @@ public:
protected: protected:
Debugger &m_debugger; Debugger &m_debugger;
std::shared_ptr<FrameTreeDelegate> m_frame_delegate_sp; std::shared_ptr<FrameTreeDelegate> m_frame_delegate_sp;
lldb::user_id_t m_tid; lldb::user_id_t m_tid = LLDB_INVALID_THREAD_ID;
uint32_t m_stop_id; uint32_t m_stop_id = UINT32_MAX;
FormatEntity::Entry m_format; FormatEntity::Entry m_format;
}; };
class ThreadsTreeDelegate : public TreeDelegate { class ThreadsTreeDelegate : public TreeDelegate {
public: public:
ThreadsTreeDelegate(Debugger &debugger) ThreadsTreeDelegate(Debugger &debugger)
: TreeDelegate(), m_thread_delegate_sp(), m_debugger(debugger), : TreeDelegate(), m_thread_delegate_sp(), m_debugger(debugger) {
m_stop_id(UINT32_MAX), m_update_selection(false) {
FormatEntity::Parse("process ${process.id}{, name = ${process.name}}", FormatEntity::Parse("process ${process.id}{, name = ${process.name}}",
m_format); m_format);
} }
@ -5280,8 +5270,8 @@ public:
protected: protected:
std::shared_ptr<ThreadTreeDelegate> m_thread_delegate_sp; std::shared_ptr<ThreadTreeDelegate> m_thread_delegate_sp;
Debugger &m_debugger; Debugger &m_debugger;
uint32_t m_stop_id; uint32_t m_stop_id = UINT32_MAX;
bool m_update_selection; bool m_update_selection = false;
FormatEntity::Entry m_format; FormatEntity::Entry m_format;
}; };
@ -5523,9 +5513,7 @@ class ValueObjectListDelegate : public WindowDelegate {
public: public:
ValueObjectListDelegate() : m_rows() {} ValueObjectListDelegate() : m_rows() {}
ValueObjectListDelegate(ValueObjectList &valobj_list) ValueObjectListDelegate(ValueObjectList &valobj_list) : m_rows() {
: m_rows(), m_selected_row(nullptr), m_selected_row_idx(0),
m_first_visible_row(0), m_num_rows(0), m_max_x(0), m_max_y(0) {
SetValues(valobj_list); SetValues(valobj_list);
} }
@ -5882,8 +5870,7 @@ protected:
class FrameVariablesWindowDelegate : public ValueObjectListDelegate { class FrameVariablesWindowDelegate : public ValueObjectListDelegate {
public: public:
FrameVariablesWindowDelegate(Debugger &debugger) FrameVariablesWindowDelegate(Debugger &debugger)
: ValueObjectListDelegate(), m_debugger(debugger), : ValueObjectListDelegate(), m_debugger(debugger) {}
m_frame_block(nullptr) {}
~FrameVariablesWindowDelegate() override = default; ~FrameVariablesWindowDelegate() override = default;
@ -5944,7 +5931,7 @@ public:
protected: protected:
Debugger &m_debugger; Debugger &m_debugger;
Block *m_frame_block; Block *m_frame_block = nullptr;
}; };
class RegistersWindowDelegate : public ValueObjectListDelegate { class RegistersWindowDelegate : public ValueObjectListDelegate {
@ -6198,7 +6185,7 @@ static const char *CursesKeyToCString(int ch) {
HelpDialogDelegate::HelpDialogDelegate(const char *text, HelpDialogDelegate::HelpDialogDelegate(const char *text,
KeyHelp *key_help_array) KeyHelp *key_help_array)
: m_text(), m_first_visible_line(0) { : m_text() {
if (text && text[0]) { if (text && text[0]) {
m_text.SplitIntoLines(text); m_text.SplitIntoLines(text);
m_text.AppendString(""); m_text.AppendString("");
@ -6762,11 +6749,7 @@ class SourceFileWindowDelegate : public WindowDelegate {
public: public:
SourceFileWindowDelegate(Debugger &debugger) SourceFileWindowDelegate(Debugger &debugger)
: WindowDelegate(), m_debugger(debugger), m_sc(), m_file_sp(), : WindowDelegate(), m_debugger(debugger), m_sc(), m_file_sp(),
m_disassembly_scope(nullptr), m_disassembly_sp(), m_disassembly_range(), m_disassembly_sp(), m_disassembly_range(), m_title() {}
m_title(), m_tid(LLDB_INVALID_THREAD_ID), m_line_width(4),
m_selected_line(0), m_pc_line(0), m_stop_id(0), m_frame_idx(UINT32_MAX),
m_first_visible_line(0), m_first_visible_column(0), m_min_x(0),
m_min_y(0), m_max_x(0), m_max_y(0) {}
~SourceFileWindowDelegate() override = default; ~SourceFileWindowDelegate() override = default;
@ -7524,22 +7507,22 @@ protected:
Debugger &m_debugger; Debugger &m_debugger;
SymbolContext m_sc; SymbolContext m_sc;
SourceManager::FileSP m_file_sp; SourceManager::FileSP m_file_sp;
SymbolContextScope *m_disassembly_scope; SymbolContextScope *m_disassembly_scope = nullptr;
lldb::DisassemblerSP m_disassembly_sp; lldb::DisassemblerSP m_disassembly_sp;
AddressRange m_disassembly_range; AddressRange m_disassembly_range;
StreamString m_title; StreamString m_title;
lldb::user_id_t m_tid; lldb::user_id_t m_tid = LLDB_INVALID_THREAD_ID;
int m_line_width; int m_line_width = 4;
uint32_t m_selected_line; // The selected line uint32_t m_selected_line = 0; // The selected line
uint32_t m_pc_line; // The line with the PC uint32_t m_pc_line = 0; // The line with the PC
uint32_t m_stop_id; uint32_t m_stop_id = 0;
uint32_t m_frame_idx; uint32_t m_frame_idx = UINT32_MAX;
int m_first_visible_line; int m_first_visible_line = 0;
int m_first_visible_column; int m_first_visible_column = 0;
int m_min_x; int m_min_x = 0;
int m_min_y; int m_min_y = 0;
int m_max_x; int m_max_x = 0;
int m_max_y; int m_max_y = 0;
}; };
DisplayOptions ValueObjectListDelegate::g_options = {true}; DisplayOptions ValueObjectListDelegate::g_options = {true};

View File

@ -129,8 +129,7 @@ Module *Module::GetAllocatedModuleAtIndex(size_t idx) {
} }
Module::Module(const ModuleSpec &module_spec) Module::Module(const ModuleSpec &module_spec)
: m_object_offset(0), m_file_has_changed(false), : m_file_has_changed(false), m_first_file_changed_log(false) {
m_first_file_changed_log(false) {
// Scope for locker below... // Scope for locker below...
{ {
std::lock_guard<std::recursive_mutex> guard( std::lock_guard<std::recursive_mutex> guard(
@ -636,9 +635,7 @@ void Module::FindCompileUnits(const FileSpec &path,
Module::LookupInfo::LookupInfo(ConstString name, Module::LookupInfo::LookupInfo(ConstString name,
FunctionNameType name_type_mask, FunctionNameType name_type_mask,
LanguageType language) LanguageType language)
: m_name(name), m_lookup_name(), m_language(language), : m_name(name), m_lookup_name(), m_language(language) {
m_name_type_mask(eFunctionNameTypeNone),
m_match_name_after_lookup(false) {
const char *name_cstr = name.GetCString(); const char *name_cstr = name.GetCString();
llvm::StringRef basename; llvm::StringRef basename;
llvm::StringRef context; llvm::StringRef context;

View File

@ -182,8 +182,7 @@ PathMappingList ModuleListProperties::GetSymlinkMappings() const {
ModuleList::ModuleList() : m_modules(), m_modules_mutex() {} ModuleList::ModuleList() : m_modules(), m_modules_mutex() {}
ModuleList::ModuleList(const ModuleList &rhs) ModuleList::ModuleList(const ModuleList &rhs) : m_modules(), m_modules_mutex() {
: m_modules(), m_modules_mutex(), m_notifier(nullptr) {
std::lock_guard<std::recursive_mutex> lhs_guard(m_modules_mutex); std::lock_guard<std::recursive_mutex> lhs_guard(m_modules_mutex);
std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_modules_mutex); std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_modules_mutex);
m_modules = rhs.m_modules; m_modules = rhs.m_modules;

View File

@ -41,13 +41,10 @@ using namespace lldb_private;
Value::Value() : m_value(), m_compiler_type(), m_data_buffer() {} Value::Value() : m_value(), m_compiler_type(), m_data_buffer() {}
Value::Value(const Scalar &scalar) Value::Value(const Scalar &scalar)
: m_value(scalar), m_compiler_type(), m_context(nullptr), : m_value(scalar), m_compiler_type(), m_data_buffer() {}
m_value_type(ValueType::Scalar), m_context_type(ContextType::Invalid),
m_data_buffer() {}
Value::Value(const void *bytes, int len) Value::Value(const void *bytes, int len)
: m_value(), m_compiler_type(), m_context(nullptr), : m_value(), m_compiler_type(), m_value_type(ValueType::HostAddress),
m_value_type(ValueType::HostAddress), m_context_type(ContextType::Invalid),
m_data_buffer() { m_data_buffer() {
SetBytes(bytes, len); SetBytes(bytes, len);
} }

View File

@ -2803,7 +2803,7 @@ ValueObject::EvaluationPoint::EvaluationPoint() : m_mod_id(), m_exe_ctx_ref() {}
ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope, ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope,
bool use_selected) bool use_selected)
: m_mod_id(), m_exe_ctx_ref(), m_needs_update(true) { : m_mod_id(), m_exe_ctx_ref() {
ExecutionContext exe_ctx(exe_scope); ExecutionContext exe_ctx(exe_scope);
TargetSP target_sp(exe_ctx.GetTargetSP()); TargetSP target_sp(exe_ctx.GetTargetSP());
if (target_sp) { if (target_sp) {
@ -2840,7 +2840,7 @@ ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope,
ValueObject::EvaluationPoint::EvaluationPoint( ValueObject::EvaluationPoint::EvaluationPoint(
const ValueObject::EvaluationPoint &rhs) const ValueObject::EvaluationPoint &rhs)
: m_mod_id(), m_exe_ctx_ref(rhs.m_exe_ctx_ref), m_needs_update(true) {} : m_mod_id(), m_exe_ctx_ref(rhs.m_exe_ctx_ref) {}
ValueObject::EvaluationPoint::~EvaluationPoint() = default; ValueObject::EvaluationPoint::~EvaluationPoint() = default;

View File

@ -189,8 +189,7 @@ namespace formatters {
class VectorTypeSyntheticFrontEnd : public SyntheticChildrenFrontEnd { class VectorTypeSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
public: public:
VectorTypeSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) VectorTypeSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_parent_format(eFormatInvalid), : SyntheticChildrenFrontEnd(*valobj_sp), m_child_type() {}
m_item_format(eFormatInvalid), m_child_type(), m_num_children(0) {}
~VectorTypeSyntheticFrontEnd() override = default; ~VectorTypeSyntheticFrontEnd() override = default;
@ -238,10 +237,10 @@ public:
} }
private: private:
lldb::Format m_parent_format; lldb::Format m_parent_format = eFormatInvalid;
lldb::Format m_item_format; lldb::Format m_item_format = eFormatInvalid;
CompilerType m_child_type; CompilerType m_child_type;
size_t m_num_children; size_t m_num_children = 0;
}; };
} // namespace formatters } // namespace formatters

View File

@ -64,8 +64,7 @@ DWARFExpression::DWARFExpression() : m_module_wp(), m_data() {}
DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp, DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp,
const DataExtractor &data, const DataExtractor &data,
const DWARFUnit *dwarf_cu) const DWARFUnit *dwarf_cu)
: m_module_wp(), m_data(data), m_dwarf_cu(dwarf_cu), : m_module_wp(), m_data(data), m_dwarf_cu(dwarf_cu) {
m_reg_kind(eRegisterKindDWARF) {
if (module_sp) if (module_sp)
m_module_wp = module_sp; m_module_wp = module_sp;
} }

View File

@ -97,8 +97,8 @@ public:
ValueMap m_values; ValueMap m_values;
DataLayout &m_target_data; DataLayout &m_target_data;
lldb_private::IRExecutionUnit &m_execution_unit; lldb_private::IRExecutionUnit &m_execution_unit;
const BasicBlock *m_bb; const BasicBlock *m_bb = nullptr;
const BasicBlock *m_prev_bb; const BasicBlock *m_prev_bb = nullptr;
BasicBlock::const_iterator m_ii; BasicBlock::const_iterator m_ii;
BasicBlock::const_iterator m_ie; BasicBlock::const_iterator m_ie;
@ -113,8 +113,7 @@ public:
lldb_private::IRExecutionUnit &execution_unit, lldb_private::IRExecutionUnit &execution_unit,
lldb::addr_t stack_frame_bottom, lldb::addr_t stack_frame_bottom,
lldb::addr_t stack_frame_top) lldb::addr_t stack_frame_top)
: m_target_data(target_data), m_execution_unit(execution_unit), : m_target_data(target_data), m_execution_unit(execution_unit) {
m_bb(nullptr), m_prev_bb(nullptr) {
m_byte_order = (target_data.isLittleEndian() ? lldb::eByteOrderLittle m_byte_order = (target_data.isLittleEndian() ? lldb::eByteOrderLittle
: lldb::eByteOrderBig); : lldb::eByteOrderBig);
m_addr_byte_size = (target_data.getPointerSize(0)); m_addr_byte_size = (target_data.getPointerSize(0));

View File

@ -413,9 +413,7 @@ uint32_t Materializer::AddPersistentVariable(
class EntityVariable : public Materializer::Entity { class EntityVariable : public Materializer::Entity {
public: public:
EntityVariable(lldb::VariableSP &variable_sp) EntityVariable(lldb::VariableSP &variable_sp)
: Entity(), m_variable_sp(variable_sp), m_is_reference(false), : Entity(), m_variable_sp(variable_sp) {
m_temporary_allocation(LLDB_INVALID_ADDRESS),
m_temporary_allocation_size(0) {
// Hard-coding to maximum size of a pointer since all variables are // Hard-coding to maximum size of a pointer since all variables are
// materialized by reference // materialized by reference
m_size = 8; m_size = 8;
@ -749,9 +747,9 @@ public:
private: private:
lldb::VariableSP m_variable_sp; lldb::VariableSP m_variable_sp;
bool m_is_reference; bool m_is_reference = false;
lldb::addr_t m_temporary_allocation; lldb::addr_t m_temporary_allocation = LLDB_INVALID_ADDRESS;
size_t m_temporary_allocation_size; size_t m_temporary_allocation_size = 0;
lldb::DataBufferSP m_original_data; lldb::DataBufferSP m_original_data;
}; };
@ -769,9 +767,7 @@ public:
bool keep_in_memory, bool keep_in_memory,
Materializer::PersistentVariableDelegate *delegate) Materializer::PersistentVariableDelegate *delegate)
: Entity(), m_type(type), m_is_program_reference(is_program_reference), : Entity(), m_type(type), m_is_program_reference(is_program_reference),
m_keep_in_memory(keep_in_memory), m_keep_in_memory(keep_in_memory), m_delegate(delegate) {
m_temporary_allocation(LLDB_INVALID_ADDRESS),
m_temporary_allocation_size(0), m_delegate(delegate) {
// Hard-coding to maximum size of a pointer since all results are // Hard-coding to maximum size of a pointer since all results are
// materialized by reference // materialized by reference
m_size = 8; m_size = 8;
@ -1030,8 +1026,8 @@ private:
bool m_is_program_reference; bool m_is_program_reference;
bool m_keep_in_memory; bool m_keep_in_memory;
lldb::addr_t m_temporary_allocation; lldb::addr_t m_temporary_allocation = LLDB_INVALID_ADDRESS;
size_t m_temporary_allocation_size; size_t m_temporary_allocation_size = 0;
Materializer::PersistentVariableDelegate *m_delegate; Materializer::PersistentVariableDelegate *m_delegate;
}; };

View File

@ -19,7 +19,7 @@ using namespace lldb;
using namespace lldb_private; using namespace lldb_private;
HostNativeThreadBase::HostNativeThreadBase(thread_t thread) HostNativeThreadBase::HostNativeThreadBase(thread_t thread)
: m_thread(thread), m_result(0) {} // NOLINT(modernize-use-nullptr) : m_thread(thread) {}
lldb::thread_t HostNativeThreadBase::GetSystemHandle() const { lldb::thread_t HostNativeThreadBase::GetSystemHandle() const {
return m_thread; return m_thread;

View File

@ -41,7 +41,7 @@ ProcessLaunchInfo::ProcessLaunchInfo(const FileSpec &stdin_file_spec,
const FileSpec &working_directory, const FileSpec &working_directory,
uint32_t launch_flags) uint32_t launch_flags)
: ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(launch_flags), : ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(launch_flags),
m_file_actions(), m_pty(new PseudoTerminal), m_resume_count(0), m_file_actions(), m_pty(new PseudoTerminal),
m_scripted_process_class_name(), m_scripted_process_dictionary_sp() { m_scripted_process_class_name(), m_scripted_process_dictionary_sp() {
if (stdin_file_spec) { if (stdin_file_spec) {
FileAction file_action; FileAction file_action;

View File

@ -24,9 +24,8 @@ using namespace lldb_private;
OptionValueFileColonLine::OptionValueFileColonLine() = default; OptionValueFileColonLine::OptionValueFileColonLine() = default;
OptionValueFileColonLine::OptionValueFileColonLine(llvm::StringRef input) OptionValueFileColonLine::OptionValueFileColonLine(llvm::StringRef input)
: m_line_number(LLDB_INVALID_LINE_NUMBER),
m_column_number(LLDB_INVALID_COLUMN_NUMBER), {
m_completion_mask(CommandCompletions::eSourceFileCompletion) {
SetValueFromString(input, eVarSetOperationAssign); SetValueFromString(input, eVarSetOperationAssign);
} }

View File

@ -22,14 +22,14 @@ OptionValueFileSpec::OptionValueFileSpec(bool resolve) : m_resolve(resolve) {}
OptionValueFileSpec::OptionValueFileSpec(const FileSpec &value, bool resolve) OptionValueFileSpec::OptionValueFileSpec(const FileSpec &value, bool resolve)
: m_current_value(value), m_default_value(value), : m_current_value(value), m_default_value(value),
m_completion_mask(CommandCompletions::eDiskFileCompletion),
m_resolve(resolve) {} m_resolve(resolve) {}
OptionValueFileSpec::OptionValueFileSpec(const FileSpec &current_value, OptionValueFileSpec::OptionValueFileSpec(const FileSpec &current_value,
const FileSpec &default_value, const FileSpec &default_value,
bool resolve) bool resolve)
: m_current_value(current_value), m_default_value(default_value), : m_current_value(current_value), m_default_value(default_value),
m_completion_mask(CommandCompletions::eDiskFileCompletion),
m_resolve(resolve) {} m_resolve(resolve) {}
void OptionValueFileSpec::DumpValue(const ExecutionContext *exe_ctx, void OptionValueFileSpec::DumpValue(const ExecutionContext *exe_ctx,

View File

@ -90,8 +90,7 @@ public:
AddressClass addr_class) AddressClass addr_class)
: Instruction(address, addr_class), : Instruction(address, addr_class),
m_disasm_wp(std::static_pointer_cast<DisassemblerLLVMC>( m_disasm_wp(std::static_pointer_cast<DisassemblerLLVMC>(
disasm.shared_from_this())), disasm.shared_from_this())) {}
m_using_file_addr(false) {}
~InstructionLLVMC() override = default; ~InstructionLLVMC() override = default;
@ -822,7 +821,7 @@ protected:
std::weak_ptr<DisassemblerLLVMC> m_disasm_wp; std::weak_ptr<DisassemblerLLVMC> m_disasm_wp;
bool m_is_valid = false; bool m_is_valid = false;
bool m_using_file_addr; bool m_using_file_addr = false;
bool m_has_visited_instruction = false; bool m_has_visited_instruction = false;
// Be conservative. If we didn't understand the instruction, say it: // Be conservative. If we didn't understand the instruction, say it:

View File

@ -88,8 +88,7 @@ class AddMacroState {
public: public:
AddMacroState(const FileSpec &current_file, const uint32_t current_file_line) AddMacroState(const FileSpec &current_file, const uint32_t current_file_line)
: m_state(CURRENT_FILE_NOT_YET_PUSHED), m_current_file(current_file), : m_current_file(current_file), m_current_file_line(current_file_line) {}
m_current_file_line(current_file_line) {}
void StartFile(const FileSpec &file) { void StartFile(const FileSpec &file) {
m_file_stack.push_back(file); m_file_stack.push_back(file);
@ -127,7 +126,7 @@ public:
private: private:
std::vector<FileSpec> m_file_stack; std::vector<FileSpec> m_file_stack;
State m_state; State m_state = CURRENT_FILE_NOT_YET_PUSHED;
FileSpec m_current_file; FileSpec m_current_file;
uint32_t m_current_file_line; uint32_t m_current_file_line;
}; };

View File

@ -137,8 +137,7 @@ public:
/// The module being instrumented. /// The module being instrumented.
Instrumenter(llvm::Module &module, Instrumenter(llvm::Module &module,
std::shared_ptr<UtilityFunction> checker_function) std::shared_ptr<UtilityFunction> checker_function)
: m_module(module), m_checker_function(checker_function), : m_module(module), m_checker_function(checker_function) {}
m_i8ptr_ty(nullptr), m_intptr_ty(nullptr) {}
virtual ~Instrumenter() = default; virtual ~Instrumenter() = default;
@ -302,8 +301,8 @@ protected:
m_checker_function; ///< The dynamic checker function for the process m_checker_function; ///< The dynamic checker function for the process
private: private:
PointerType *m_i8ptr_ty; PointerType *m_i8ptr_ty = nullptr;
IntegerType *m_intptr_ty; IntegerType *m_intptr_ty = nullptr;
}; };
class ValidPointerChecker : public Instrumenter { class ValidPointerChecker : public Instrumenter {

View File

@ -102,14 +102,14 @@ public:
size_t GetIndexOfChildWithName(ConstString name) override; size_t GetIndexOfChildWithName(ConstString name) override;
private: private:
ValueObject *m_real_child; ValueObject *m_real_child = nullptr;
}; };
} // namespace formatters } // namespace formatters
} // namespace lldb_private } // namespace lldb_private
lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd:: lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::
LibcxxStdAtomicSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxStdAtomicSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_real_child(nullptr) {} : SyntheticChildrenFrontEnd(*valobj_sp) {}
bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() { bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() {
ValueObjectSP atomic_value = GetLibCxxAtomicValue(m_backend); ValueObjectSP atomic_value = GetLibCxxAtomicValue(m_backend);

View File

@ -36,18 +36,17 @@ public:
size_t GetIndexOfChildWithName(ConstString name) override; size_t GetIndexOfChildWithName(ConstString name) override;
private: private:
ValueObject *m_start; ValueObject *m_start = nullptr;
CompilerType m_element_type; CompilerType m_element_type;
uint32_t m_element_size; uint32_t m_element_size = 0;
size_t m_num_elements; size_t m_num_elements = 0;
}; };
} // namespace formatters } // namespace formatters
} // namespace lldb_private } // namespace lldb_private
lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd:: lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
LibcxxInitializerListSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxInitializerListSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_start(nullptr), m_element_type(), : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type() {
m_element_size(0), m_num_elements(0) {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }

View File

@ -158,8 +158,8 @@ public:
bool Update() override; bool Update() override;
private: private:
lldb::addr_t m_node_address; lldb::addr_t m_node_address = 0;
ValueObject *m_tail; ValueObject *m_tail = nullptr;
}; };
} // end anonymous namespace } // end anonymous namespace
@ -308,7 +308,7 @@ bool ForwardListFrontEnd::Update() {
} }
ListFrontEnd::ListFrontEnd(lldb::ValueObjectSP valobj_sp) ListFrontEnd::ListFrontEnd(lldb::ValueObjectSP valobj_sp)
: AbstractListFrontEnd(*valobj_sp), m_node_address(), m_tail(nullptr) { : AbstractListFrontEnd(*valobj_sp) {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }

View File

@ -192,11 +192,11 @@ private:
void GetValueOffset(const lldb::ValueObjectSP &node); void GetValueOffset(const lldb::ValueObjectSP &node);
ValueObject *m_tree; ValueObject *m_tree = nullptr;
ValueObject *m_root_node; ValueObject *m_root_node = nullptr;
CompilerType m_element_type; CompilerType m_element_type;
uint32_t m_skip_size; uint32_t m_skip_size = UINT32_MAX;
size_t m_count; size_t m_count = UINT32_MAX;
std::map<size_t, MapIterator> m_iterators; std::map<size_t, MapIterator> m_iterators;
}; };
} // namespace formatters } // namespace formatters
@ -204,9 +204,7 @@ private:
lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd:: lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
LibcxxStdMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxStdMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_tree(nullptr), : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(), m_iterators() {
m_root_node(nullptr), m_element_type(), m_skip_size(UINT32_MAX),
m_count(UINT32_MAX), m_iterators() {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }

View File

@ -44,9 +44,9 @@ public:
private: private:
CompilerType m_element_type; CompilerType m_element_type;
CompilerType m_node_type; CompilerType m_node_type;
ValueObject *m_tree; ValueObject *m_tree = nullptr;
size_t m_num_elements; size_t m_num_elements = 0;
ValueObject *m_next_element; ValueObject *m_next_element = nullptr;
std::vector<std::pair<ValueObject *, uint64_t>> m_elements_cache; std::vector<std::pair<ValueObject *, uint64_t>> m_elements_cache;
}; };
} // namespace formatters } // namespace formatters
@ -54,8 +54,8 @@ private:
lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd:: lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
LibcxxStdUnorderedMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxStdUnorderedMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(), m_tree(nullptr), : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(),
m_num_elements(0), m_next_element(nullptr), m_elements_cache() { m_elements_cache() {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }

View File

@ -35,10 +35,10 @@ public:
size_t GetIndexOfChildWithName(ConstString name) override; size_t GetIndexOfChildWithName(ConstString name) override;
private: private:
ValueObject *m_start; ValueObject *m_start = nullptr;
ValueObject *m_finish; ValueObject *m_finish = nullptr;
CompilerType m_element_type; CompilerType m_element_type;
uint32_t m_element_size; uint32_t m_element_size = 0;
}; };
class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd { class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
@ -58,8 +58,8 @@ public:
private: private:
CompilerType m_bool_type; CompilerType m_bool_type;
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint64_t m_count; uint64_t m_count = 0;
lldb::addr_t m_base_data_address; lldb::addr_t m_base_data_address = 0;
std::map<size_t, lldb::ValueObjectSP> m_children; std::map<size_t, lldb::ValueObjectSP> m_children;
}; };
@ -68,8 +68,7 @@ private:
lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd:: lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::
LibcxxStdVectorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxStdVectorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_start(nullptr), : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type() {
m_finish(nullptr), m_element_type(), m_element_size(0) {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }
@ -173,7 +172,7 @@ size_t lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::
lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd:: lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(), : SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(),
m_count(0), m_base_data_address(0), m_children() { m_children() {
if (valobj_sp) { if (valobj_sp) {
Update(); Update();
m_bool_type = m_bool_type =

View File

@ -53,7 +53,7 @@ public:
private: private:
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
lldb::addr_t m_pair_address; lldb::addr_t m_pair_address = 0;
CompilerType m_pair_type; CompilerType m_pair_type;
lldb::ValueObjectSP m_pair_sp; lldb::ValueObjectSP m_pair_sp;
}; };
@ -77,8 +77,8 @@ public:
LibstdcppMapIteratorSyntheticFrontEnd::LibstdcppMapIteratorSyntheticFrontEnd( LibstdcppMapIteratorSyntheticFrontEnd::LibstdcppMapIteratorSyntheticFrontEnd(
lldb::ValueObjectSP valobj_sp) lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_address(0), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type(),
m_pair_type(), m_pair_sp() { m_pair_sp() {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }

View File

@ -70,7 +70,7 @@ protected:
virtual uint64_t GetSize() = 0; virtual uint64_t GetSize() = 0;
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
CompilerType m_id_type; CompilerType m_id_type;
}; };
@ -226,7 +226,7 @@ public:
private: private:
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
D32 *m_data_32; D32 *m_data_32;
D64 *m_data_64; D64 *m_data_64;
@ -459,10 +459,9 @@ bool lldb_private::formatters::NSArraySummaryProvider(
return true; return true;
} }
lldb_private::formatters::NSArrayMSyntheticFrontEndBase::NSArrayMSyntheticFrontEndBase( lldb_private::formatters::NSArrayMSyntheticFrontEndBase::
lldb::ValueObjectSP valobj_sp) NSArrayMSyntheticFrontEndBase(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_id_type() {
m_id_type() {
if (valobj_sp) { if (valobj_sp) {
auto *clang_ast_context = ScratchTypeSystemClang::GetForTarget( auto *clang_ast_context = ScratchTypeSystemClang::GetForTarget(
*valobj_sp->GetExecutionContextRef().GetTargetSP()); *valobj_sp->GetExecutionContextRef().GetTargetSP());
@ -605,9 +604,8 @@ lldb_private::formatters::
template <typename D32, typename D64, bool Inline> template <typename D32, typename D64, bool Inline>
lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>:: lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>::
GenericNSArrayISyntheticFrontEnd( GenericNSArrayISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
lldb::ValueObjectSP valobj_sp) : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
m_data_32(nullptr), m_data_64(nullptr) { m_data_32(nullptr), m_data_64(nullptr) {
if (valobj_sp) { if (valobj_sp) {
CompilerType type = valobj_sp->GetCompilerType(); CompilerType type = valobj_sp->GetCompilerType();

View File

@ -133,10 +133,10 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
lldb::ByteOrder m_order; lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
DataDescriptor_32 *m_data_32; DataDescriptor_32 *m_data_32 = nullptr;
DataDescriptor_64 *m_data_64; DataDescriptor_64 *m_data_64 = nullptr;
lldb::addr_t m_data_ptr; lldb::addr_t m_data_ptr;
CompilerType m_pair_type; CompilerType m_pair_type;
std::vector<DictionaryItemDescriptor> m_children; std::vector<DictionaryItemDescriptor> m_children;
@ -196,8 +196,8 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
lldb::ByteOrder m_order; lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
CFBasicHash m_hashtable; CFBasicHash m_hashtable;
@ -250,8 +250,8 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
lldb::ByteOrder m_order; lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
D32 *m_data_32; D32 *m_data_32;
D64 *m_data_64; D64 *m_data_64;
CompilerType m_pair_type; CompilerType m_pair_type;
@ -301,10 +301,10 @@ namespace Foundation1100 {
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
lldb::ByteOrder m_order; lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
DataDescriptor_32 *m_data_32; DataDescriptor_32 *m_data_32 = nullptr;
DataDescriptor_64 *m_data_64; DataDescriptor_64 *m_data_64 = nullptr;
CompilerType m_pair_type; CompilerType m_pair_type;
std::vector<DictionaryItemDescriptor> m_children; std::vector<DictionaryItemDescriptor> m_children;
}; };
@ -592,9 +592,7 @@ lldb_private::formatters::NSDictionarySyntheticFrontEndCreator(
lldb_private::formatters::NSDictionaryISyntheticFrontEnd:: lldb_private::formatters::NSDictionaryISyntheticFrontEnd::
NSDictionaryISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) NSDictionaryISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type() {}
m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr),
m_pair_type() {}
lldb_private::formatters::NSDictionaryISyntheticFrontEnd:: lldb_private::formatters::NSDictionaryISyntheticFrontEnd::
~NSDictionaryISyntheticFrontEnd() { ~NSDictionaryISyntheticFrontEnd() {
@ -738,8 +736,8 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex(
lldb_private::formatters::NSCFDictionarySyntheticFrontEnd:: lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::
NSCFDictionarySyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) NSCFDictionarySyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_hashtable(),
m_order(lldb::eByteOrderInvalid), m_hashtable(), m_pair_type() {} m_pair_type() {}
size_t lldb_private::formatters::NSCFDictionarySyntheticFrontEnd:: size_t lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::
GetIndexOfChildWithName(ConstString name) { GetIndexOfChildWithName(ConstString name) {
@ -1060,11 +1058,10 @@ lldb_private::formatters::NSDictionary1SyntheticFrontEnd::GetChildAtIndex(
} }
template <typename D32, typename D64> template <typename D32, typename D64>
lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>:: lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32, D64>::
GenericNSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) GenericNSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr), m_data_32(nullptr), m_data_64(nullptr), m_pair_type() {}
m_pair_type() {}
template <typename D32, typename D64> template <typename D32, typename D64>
lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>:: lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>::
@ -1227,12 +1224,9 @@ lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<
return dict_item.valobj_sp; return dict_item.valobj_sp;
} }
lldb_private::formatters::Foundation1100:: lldb_private::formatters::Foundation1100::NSDictionaryMSyntheticFrontEnd::
NSDictionaryMSyntheticFrontEnd::
NSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) NSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type() {}
m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr),
m_pair_type() {}
lldb_private::formatters::Foundation1100:: lldb_private::formatters::Foundation1100::
NSDictionaryMSyntheticFrontEnd::~NSDictionaryMSyntheticFrontEnd() { NSDictionaryMSyntheticFrontEnd::~NSDictionaryMSyntheticFrontEnd() {

View File

@ -33,7 +33,7 @@ class NSIndexPathSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
public: public:
NSIndexPathSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) NSIndexPathSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp.get()), m_descriptor_sp(nullptr), : SyntheticChildrenFrontEnd(*valobj_sp.get()), m_descriptor_sp(nullptr),
m_impl(), m_ptr_size(0), m_uint_star_type() { m_impl(), m_uint_star_type() {
m_ptr_size = m_ptr_size =
m_backend.GetTargetSP()->GetArchitecture().GetAddressByteSize(); m_backend.GetTargetSP()->GetArchitecture().GetAddressByteSize();
} }
@ -292,7 +292,7 @@ protected:
Mode m_mode = Mode::Invalid; Mode m_mode = Mode::Invalid;
} m_impl; } m_impl;
uint32_t m_ptr_size; uint32_t m_ptr_size = 0;
CompilerType m_uint_star_type; CompilerType m_uint_star_type;
}; };

View File

@ -73,9 +73,9 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
DataDescriptor_32 *m_data_32; DataDescriptor_32 *m_data_32 = nullptr;
DataDescriptor_64 *m_data_64; DataDescriptor_64 *m_data_64 = nullptr;
lldb::addr_t m_data_ptr; lldb::addr_t m_data_ptr;
std::vector<SetItemDescriptor> m_children; std::vector<SetItemDescriptor> m_children;
}; };
@ -101,8 +101,8 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
lldb::ByteOrder m_order; lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
CFBasicHash m_hashtable; CFBasicHash m_hashtable;
@ -135,7 +135,7 @@ private:
}; };
ExecutionContextRef m_exe_ctx_ref; ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size; uint8_t m_ptr_size = 8;
D32 *m_data_32; D32 *m_data_32;
D64 *m_data_64; D64 *m_data_64;
std::vector<SetItemDescriptor> m_children; std::vector<SetItemDescriptor> m_children;
@ -401,8 +401,7 @@ lldb_private::formatters::NSSetSyntheticFrontEndCreator(
lldb_private::formatters::NSSetISyntheticFrontEnd::NSSetISyntheticFrontEnd( lldb_private::formatters::NSSetISyntheticFrontEnd::NSSetISyntheticFrontEnd(
lldb::ValueObjectSP valobj_sp) lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref() {
m_data_32(nullptr), m_data_64(nullptr) {
if (valobj_sp) if (valobj_sp)
Update(); Update();
} }
@ -546,8 +545,8 @@ lldb_private::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(size_t idx) {
lldb_private::formatters::NSCFSetSyntheticFrontEnd::NSCFSetSyntheticFrontEnd( lldb_private::formatters::NSCFSetSyntheticFrontEnd::NSCFSetSyntheticFrontEnd(
lldb::ValueObjectSP valobj_sp) lldb::ValueObjectSP valobj_sp)
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_hashtable(),
m_order(lldb::eByteOrderInvalid), m_hashtable(), m_pair_type() {} m_pair_type() {}
size_t size_t
lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetIndexOfChildWithName( lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetIndexOfChildWithName(
@ -667,10 +666,9 @@ lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetChildAtIndex(
} }
template <typename D32, typename D64> template <typename D32, typename D64>
lldb_private::formatters:: lldb_private::formatters::GenericNSSetMSyntheticFrontEnd<
GenericNSSetMSyntheticFrontEnd<D32, D64>::GenericNSSetMSyntheticFrontEnd( D32, D64>::GenericNSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
lldb::ValueObjectSP valobj_sp) : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
: SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
m_data_32(nullptr), m_data_64(nullptr) { m_data_32(nullptr), m_data_64(nullptr) {
if (valobj_sp) if (valobj_sp)
Update(); Update();

View File

@ -181,7 +181,7 @@ AppleObjCDeclVendor::GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa) {
class ObjCRuntimeMethodType { class ObjCRuntimeMethodType {
public: public:
ObjCRuntimeMethodType(const char *types) : m_is_valid(false) { ObjCRuntimeMethodType(const char *types) {
const char *cursor = types; const char *cursor = types;
enum ParserState { Start = 0, InType, InPos } state = Start; enum ParserState { Start = 0, InType, InPos } state = Start;
const char *type = nullptr; const char *type = nullptr;
@ -391,7 +391,7 @@ private:
typedef std::vector<std::string> TypeVector; typedef std::vector<std::string> TypeVector;
TypeVector m_type_vector; TypeVector m_type_vector;
bool m_is_valid; bool m_is_valid = false;
}; };
bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) { bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {

View File

@ -281,8 +281,7 @@ extern \"C\" void * __lldb_objc_find_implementation_for_selector (void *object,
AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::VTableRegion( AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::VTableRegion(
AppleObjCVTables *owner, lldb::addr_t header_addr) AppleObjCVTables *owner, lldb::addr_t header_addr)
: m_valid(true), m_owner(owner), m_header_addr(header_addr), : m_valid(true), m_owner(owner), m_header_addr(header_addr) {
m_code_start_addr(0), m_code_end_addr(0), m_next_region(0) {
SetUpRegion(); SetUpRegion();
} }

View File

@ -46,25 +46,23 @@ public:
private: private:
ObjectFilePECOFF &m_object_file; ObjectFilePECOFF &m_object_file;
bool m_error; bool m_error = false;
uint32_t m_unwind_info_rva; uint32_t m_unwind_info_rva;
DataExtractor m_unwind_info_data; DataExtractor m_unwind_info_data;
const UnwindInfo *m_unwind_info; const UnwindInfo *m_unwind_info = nullptr;
DataExtractor m_unwind_code_data; DataExtractor m_unwind_code_data;
offset_t m_unwind_code_offset; offset_t m_unwind_code_offset;
const UnwindCode *m_unwind_code; const UnwindCode *m_unwind_code = nullptr;
bool m_chained; bool m_chained = false;
}; };
UnwindCodesIterator::UnwindCodesIterator(ObjectFilePECOFF &object_file, UnwindCodesIterator::UnwindCodesIterator(ObjectFilePECOFF &object_file,
uint32_t unwind_info_rva) uint32_t unwind_info_rva)
: m_object_file(object_file), m_error(false), : m_object_file(object_file),
m_unwind_info_rva(unwind_info_rva), m_unwind_info_rva(unwind_info_rva), m_unwind_code_offset{} {}
m_unwind_info(nullptr), m_unwind_code_offset{}, m_unwind_code(nullptr),
m_chained(false) {}
bool UnwindCodesIterator::GetNext() { bool UnwindCodesIterator::GetNext() {
static constexpr int UNWIND_INFO_SIZE = 4; static constexpr int UNWIND_INFO_SIZE = 4;

View File

@ -22,8 +22,7 @@ DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration() : m_attributes() {}
DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag, DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag,
uint8_t has_children) uint8_t has_children)
: m_code(InvalidCode), m_tag(tag), m_has_children(has_children), : m_tag(tag), m_has_children(has_children), m_attributes() {}
m_attributes() {}
llvm::Expected<DWARFEnumState> llvm::Expected<DWARFEnumState>
DWARFAbbreviationDeclaration::extract(const DWARFDataExtractor &data, DWARFAbbreviationDeclaration::extract(const DWARFDataExtractor &data,

View File

@ -31,19 +31,18 @@ Symbol::Symbol()
m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(), m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(),
m_addr_range() {} m_addr_range() {}
Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type, bool external, Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type,
bool is_debug, bool is_trampoline, bool is_artificial, bool external, bool is_debug, bool is_trampoline,
const lldb::SectionSP &section_sp, addr_t offset, addr_t size, bool is_artificial, const lldb::SectionSP &section_sp,
bool size_is_valid, bool contains_linker_annotations, addr_t offset, addr_t size, bool size_is_valid,
uint32_t flags) bool contains_linker_annotations, uint32_t flags)
: SymbolContextScope(), m_uid(symID), m_type_data(0), : SymbolContextScope(), m_uid(symID), m_type_data_resolved(false),
m_type_data_resolved(false), m_is_synthetic(is_artificial), m_is_synthetic(is_artificial), m_is_debug(is_debug),
m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false), m_is_external(external), m_size_is_sibling(false),
m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0), m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0),
m_demangled_is_synthesized(false), m_demangled_is_synthesized(false),
m_contains_linker_annotations(contains_linker_annotations), m_contains_linker_annotations(contains_linker_annotations),
m_is_weak(false), m_type(type), m_is_weak(false), m_type(type), m_mangled(name),
m_mangled(name),
m_addr_range(section_sp, offset, size), m_flags(flags) {} m_addr_range(section_sp, offset, size), m_flags(flags) {}
Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type, Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type,
@ -51,9 +50,9 @@ Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type,
bool is_artificial, const AddressRange &range, bool is_artificial, const AddressRange &range,
bool size_is_valid, bool contains_linker_annotations, bool size_is_valid, bool contains_linker_annotations,
uint32_t flags) uint32_t flags)
: SymbolContextScope(), m_uid(symID), m_type_data(0), : SymbolContextScope(), m_uid(symID), m_type_data_resolved(false),
m_type_data_resolved(false), m_is_synthetic(is_artificial), m_is_synthetic(is_artificial), m_is_debug(is_debug),
m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false), m_is_external(external), m_size_is_sibling(false),
m_size_is_synthesized(false), m_size_is_synthesized(false),
m_size_is_valid(size_is_valid || range.GetByteSize() > 0), m_size_is_valid(size_is_valid || range.GetByteSize() > 0),
m_demangled_is_synthesized(false), m_demangled_is_synthesized(false),

View File

@ -31,7 +31,7 @@ SymbolContext::SymbolContext() : target_sp(), module_sp(), line_entry() {}
SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f, SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f,
Block *b, LineEntry *le, Symbol *s) Block *b, LineEntry *le, Symbol *s)
: target_sp(), module_sp(m), comp_unit(cu), function(f), block(b), : target_sp(), module_sp(m), comp_unit(cu), function(f), block(b),
line_entry(), symbol(s), variable(nullptr) { line_entry(), symbol(s) {
if (le) if (le)
line_entry = *le; line_entry = *le;
} }
@ -40,14 +40,13 @@ SymbolContext::SymbolContext(const TargetSP &t, const ModuleSP &m,
CompileUnit *cu, Function *f, Block *b, CompileUnit *cu, Function *f, Block *b,
LineEntry *le, Symbol *s) LineEntry *le, Symbol *s)
: target_sp(t), module_sp(m), comp_unit(cu), function(f), block(b), : target_sp(t), module_sp(m), comp_unit(cu), function(f), block(b),
line_entry(), symbol(s), variable(nullptr) { line_entry(), symbol(s) {
if (le) if (le)
line_entry = *le; line_entry = *le;
} }
SymbolContext::SymbolContext(SymbolContextScope *sc_scope) SymbolContext::SymbolContext(SymbolContextScope *sc_scope)
: target_sp(), module_sp(), comp_unit(nullptr), function(nullptr), : target_sp(), module_sp(), line_entry() {
block(nullptr), line_entry(), symbol(nullptr), variable(nullptr) {
sc_scope->CalculateSymbolContext(this); sc_scope->CalculateSymbolContext(this);
} }

View File

@ -146,7 +146,7 @@ Type::Type(lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name,
const Declaration &decl, const CompilerType &compiler_type, const Declaration &decl, const CompilerType &compiler_type,
ResolveState compiler_type_resolve_state, uint32_t opaque_payload) ResolveState compiler_type_resolve_state, uint32_t opaque_payload)
: std::enable_shared_from_this<Type>(), UserID(uid), m_name(name), : std::enable_shared_from_this<Type>(), UserID(uid), m_name(name),
m_symbol_file(symbol_file), m_context(context), m_encoding_type(nullptr), m_symbol_file(symbol_file), m_context(context),
m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type), m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
m_decl(decl), m_compiler_type(compiler_type), m_decl(decl), m_compiler_type(compiler_type),
m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state

View File

@ -398,21 +398,18 @@ ExecutionContextRef::ExecutionContextRef()
: m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {} : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {}
ExecutionContextRef::ExecutionContextRef(const ExecutionContext *exe_ctx) ExecutionContextRef::ExecutionContextRef(const ExecutionContext *exe_ctx)
: m_target_wp(), m_process_wp(), m_thread_wp(), : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
if (exe_ctx) if (exe_ctx)
*this = *exe_ctx; *this = *exe_ctx;
} }
ExecutionContextRef::ExecutionContextRef(const ExecutionContext &exe_ctx) ExecutionContextRef::ExecutionContextRef(const ExecutionContext &exe_ctx)
: m_target_wp(), m_process_wp(), m_thread_wp(), : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
*this = exe_ctx; *this = exe_ctx;
} }
ExecutionContextRef::ExecutionContextRef(Target *target, bool adopt_selected) ExecutionContextRef::ExecutionContextRef(Target *target, bool adopt_selected)
: m_target_wp(), m_process_wp(), m_thread_wp(), : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
SetTargetPtr(target, adopt_selected); SetTargetPtr(target, adopt_selected);
} }

View File

@ -104,8 +104,7 @@ public:
ExceptionBreakpointResolver(lldb::LanguageType language, bool catch_bp, ExceptionBreakpointResolver(lldb::LanguageType language, bool catch_bp,
bool throw_bp) bool throw_bp)
: BreakpointResolver(nullptr, BreakpointResolver::ExceptionResolver), : BreakpointResolver(nullptr, BreakpointResolver::ExceptionResolver),
m_language(language), m_language_runtime(nullptr), m_catch_bp(catch_bp), m_language(language), m_catch_bp(catch_bp), m_throw_bp(throw_bp) {}
m_throw_bp(throw_bp) {}
~ExceptionBreakpointResolver() override = default; ~ExceptionBreakpointResolver() override = default;
@ -195,7 +194,7 @@ protected:
lldb::BreakpointResolverSP m_actual_resolver_sp; lldb::BreakpointResolverSP m_actual_resolver_sp;
lldb::LanguageType m_language; lldb::LanguageType m_language;
LanguageRuntime *m_language_runtime; LanguageRuntime *m_language_runtime = nullptr;
bool m_catch_bp; bool m_catch_bp;
bool m_throw_bp; bool m_throw_bp;
}; };

View File

@ -40,12 +40,10 @@ std::string NormalizePath(llvm::StringRef path) {
PathMappingList::PathMappingList() : m_pairs() {} PathMappingList::PathMappingList() : m_pairs() {}
PathMappingList::PathMappingList(ChangedCallback callback, void *callback_baton) PathMappingList::PathMappingList(ChangedCallback callback, void *callback_baton)
: m_pairs(), m_callback(callback), m_callback_baton(callback_baton), : m_pairs(), m_callback(callback), m_callback_baton(callback_baton) {}
m_mod_id(0) {}
PathMappingList::PathMappingList(const PathMappingList &rhs) PathMappingList::PathMappingList(const PathMappingList &rhs)
: m_pairs(rhs.m_pairs), m_callback(nullptr), m_callback_baton(nullptr), : m_pairs(rhs.m_pairs) {}
m_mod_id(0) {}
const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) { const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) {
if (this != &rhs) { if (this != &rhs) {

View File

@ -3862,8 +3862,7 @@ Process::ProcessEventData::ProcessEventData() : EventData(), m_process_wp() {}
Process::ProcessEventData::ProcessEventData(const ProcessSP &process_sp, Process::ProcessEventData::ProcessEventData(const ProcessSP &process_sp,
StateType state) StateType state)
: EventData(), m_process_wp(), m_state(state), m_restarted(false), : EventData(), m_process_wp(), m_state(state) {
m_update_state(0), m_interrupted(false) {
if (process_sp) if (process_sp)
m_process_wp = process_sp; m_process_wp = process_sp;
} }
@ -4507,7 +4506,7 @@ namespace {
class RestorePlanState { class RestorePlanState {
public: public:
RestorePlanState(lldb::ThreadPlanSP thread_plan_sp) RestorePlanState(lldb::ThreadPlanSP thread_plan_sp)
: m_thread_plan_sp(thread_plan_sp), m_already_reset(false) { : m_thread_plan_sp(thread_plan_sp) {
if (m_thread_plan_sp) { if (m_thread_plan_sp) {
m_private = m_thread_plan_sp->GetPrivate(); m_private = m_thread_plan_sp->GetPrivate();
m_is_controlling = m_thread_plan_sp->IsControllingPlan(); m_is_controlling = m_thread_plan_sp->IsControllingPlan();
@ -4528,7 +4527,7 @@ public:
private: private:
lldb::ThreadPlanSP m_thread_plan_sp; lldb::ThreadPlanSP m_thread_plan_sp;
bool m_already_reset; bool m_already_reset = false;
bool m_private; bool m_private;
bool m_is_controlling; bool m_is_controlling;
bool m_okay_to_discard; bool m_okay_to_discard;

View File

@ -656,8 +656,7 @@ public:
StopInfoWatchpoint(Thread &thread, break_id_t watch_id, StopInfoWatchpoint(Thread &thread, break_id_t watch_id,
lldb::addr_t watch_hit_addr) lldb::addr_t watch_hit_addr)
: StopInfo(thread, watch_id), m_should_stop(false), : StopInfo(thread, watch_id), m_watch_hit_addr(watch_hit_addr) {}
m_should_stop_is_valid(false), m_watch_hit_addr(watch_hit_addr) {}
~StopInfoWatchpoint() override = default; ~StopInfoWatchpoint() override = default;
@ -931,8 +930,8 @@ protected:
} }
private: private:
bool m_should_stop; bool m_should_stop = false;
bool m_should_stop_is_valid; bool m_should_stop_is_valid = false;
lldb::addr_t m_watch_hit_addr; lldb::addr_t m_watch_hit_addr;
}; };
@ -1122,8 +1121,7 @@ private:
class StopInfoExec : public StopInfo { class StopInfoExec : public StopInfo {
public: public:
StopInfoExec(Thread &thread) StopInfoExec(Thread &thread) : StopInfo(thread, LLDB_INVALID_UID) {}
: StopInfo(thread, LLDB_INVALID_UID), m_performed_action(false) {}
~StopInfoExec() override = default; ~StopInfoExec() override = default;
@ -1149,7 +1147,7 @@ protected:
thread_sp->GetProcess()->DidExec(); thread_sp->GetProcess()->DidExec();
} }
bool m_performed_action; bool m_performed_action = false;
}; };
// StopInfoFork // StopInfoFork
@ -1157,8 +1155,8 @@ protected:
class StopInfoFork : public StopInfo { class StopInfoFork : public StopInfo {
public: public:
StopInfoFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid) StopInfoFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid)
: StopInfo(thread, child_pid), m_performed_action(false), : StopInfo(thread, child_pid), m_child_pid(child_pid),
m_child_pid(child_pid), m_child_tid(child_tid) {} m_child_tid(child_tid) {}
~StopInfoFork() override = default; ~StopInfoFork() override = default;
@ -1179,7 +1177,7 @@ protected:
thread_sp->GetProcess()->DidFork(m_child_pid, m_child_tid); thread_sp->GetProcess()->DidFork(m_child_pid, m_child_tid);
} }
bool m_performed_action; bool m_performed_action = false;
private: private:
lldb::pid_t m_child_pid; lldb::pid_t m_child_pid;
@ -1191,8 +1189,8 @@ private:
class StopInfoVFork : public StopInfo { class StopInfoVFork : public StopInfo {
public: public:
StopInfoVFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid) StopInfoVFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid)
: StopInfo(thread, child_pid), m_performed_action(false), : StopInfo(thread, child_pid), m_child_pid(child_pid),
m_child_pid(child_pid), m_child_tid(child_tid) {} m_child_tid(child_tid) {}
~StopInfoVFork() override = default; ~StopInfoVFork() override = default;
@ -1213,7 +1211,7 @@ protected:
thread_sp->GetProcess()->DidVFork(m_child_pid, m_child_tid); thread_sp->GetProcess()->DidVFork(m_child_pid, m_child_tid);
} }
bool m_performed_action; bool m_performed_action = false;
private: private:
lldb::pid_t m_child_pid; lldb::pid_t m_child_pid;
@ -1224,8 +1222,7 @@ private:
class StopInfoVForkDone : public StopInfo { class StopInfoVForkDone : public StopInfo {
public: public:
StopInfoVForkDone(Thread &thread) StopInfoVForkDone(Thread &thread) : StopInfo(thread, 0) {}
: StopInfo(thread, 0), m_performed_action(false) {}
~StopInfoVForkDone() override = default; ~StopInfoVForkDone() override = default;
@ -1246,7 +1243,7 @@ protected:
thread_sp->GetProcess()->DidVForkDone(); thread_sp->GetProcess()->DidVForkDone();
} }
bool m_performed_action; bool m_performed_action = false;
}; };
} // namespace lldb_private } // namespace lldb_private

View File

@ -142,8 +142,7 @@ DataExtractor::DataExtractor(const void *data, offset_t length,
DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian, DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
uint32_t addr_size, uint32_t addr_size,
uint32_t target_byte_size /*=1*/) uint32_t target_byte_size /*=1*/)
: m_start(nullptr), m_end(nullptr), m_byte_order(endian), : m_byte_order(endian), m_addr_size(addr_size), m_data_sp(),
m_addr_size(addr_size), m_data_sp(),
m_target_byte_size(target_byte_size) { m_target_byte_size(target_byte_size) {
assert(addr_size >= 1 && addr_size <= 8); assert(addr_size >= 1 && addr_size <= 8);
SetData(data_sp); SetData(data_sp);
@ -156,9 +155,8 @@ DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
// "data". // "data".
DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset, DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset,
offset_t length, uint32_t target_byte_size /*=1*/) offset_t length, uint32_t target_byte_size /*=1*/)
: m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order), : m_byte_order(data.m_byte_order), m_addr_size(data.m_addr_size),
m_addr_size(data.m_addr_size), m_data_sp(), m_data_sp(), m_target_byte_size(target_byte_size) {
m_target_byte_size(target_byte_size) {
assert(m_addr_size >= 1 && m_addr_size <= 8); assert(m_addr_size >= 1 && m_addr_size <= 8);
if (data.ValidOffset(offset)) { if (data.ValidOffset(offset)) {
offset_t bytes_available = data.GetByteSize() - offset; offset_t bytes_available = data.GetByteSize() - offset;

View File

@ -25,7 +25,7 @@ static llvm::ManagedStatic<llvm::SignpostEmitter> g_api_signposts;
Instrumenter::Instrumenter(llvm::StringRef pretty_func, Instrumenter::Instrumenter(llvm::StringRef pretty_func,
std::string &&pretty_args) std::string &&pretty_args)
: m_pretty_func(pretty_func), m_local_boundary(false) { : m_pretty_func(pretty_func) {
if (!g_global_boundary) { if (!g_global_boundary) {
g_global_boundary = true; g_global_boundary = true;
m_local_boundary = true; m_local_boundary = true;

View File

@ -26,8 +26,8 @@ ProcessInfo::ProcessInfo()
ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch, ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
lldb::pid_t pid) lldb::pid_t pid)
: m_executable(name), m_arguments(), m_environment(), m_uid(UINT32_MAX), : m_executable(name), m_arguments(), m_environment(), m_arch(arch),
m_gid(UINT32_MAX), m_arch(arch), m_pid(pid) {} m_pid(pid) {}
void ProcessInfo::Clear() { void ProcessInfo::Clear() {
m_executable.Clear(); m_executable.Clear();

View File

@ -51,8 +51,7 @@ Status::Status(std::error_code EC)
: eErrorTypeGeneric), : eErrorTypeGeneric),
m_string(EC.message()) {} m_string(EC.message()) {}
Status::Status(const char *format, ...) Status::Status(const char *format, ...) : m_string() {
: m_code(0), m_type(eErrorTypeInvalid), m_string() {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
SetErrorToGenericError(); SetErrorToGenericError();

View File

@ -25,7 +25,7 @@ using namespace lldb_private;
Stream::Stream(uint32_t flags, uint32_t addr_size, ByteOrder byte_order, Stream::Stream(uint32_t flags, uint32_t addr_size, ByteOrder byte_order,
bool colors) bool colors)
: m_flags(flags), m_addr_size(addr_size), m_byte_order(byte_order), : m_flags(flags), m_addr_size(addr_size), m_byte_order(byte_order),
m_indent_level(0), m_forwarder(*this, colors) {} m_forwarder(*this, colors) {}
Stream::Stream(bool colors) Stream::Stream(bool colors)
: m_flags(0), m_byte_order(endian::InlHostByteOrder()), : m_flags(0), m_byte_order(endian::InlHostByteOrder()),

View File

@ -28,13 +28,11 @@ static inline int xdigit_to_sint(char ch) {
// StringExtractor constructor // StringExtractor constructor
StringExtractor::StringExtractor() : m_packet() {} StringExtractor::StringExtractor() : m_packet() {}
StringExtractor::StringExtractor(llvm::StringRef packet_str) StringExtractor::StringExtractor(llvm::StringRef packet_str) : m_packet() {
: m_packet(), m_index(0) {
m_packet.assign(packet_str.begin(), packet_str.end()); m_packet.assign(packet_str.begin(), packet_str.end());
} }
StringExtractor::StringExtractor(const char *packet_cstr) StringExtractor::StringExtractor(const char *packet_cstr) : m_packet() {
: m_packet(), m_index(0) {
if (packet_cstr) if (packet_cstr)
m_packet.assign(packet_cstr); m_packet.assign(packet_cstr);
} }

View File

@ -87,15 +87,14 @@ private:
std::unique_ptr<lldb_private::Editline> _editline_sp; std::unique_ptr<lldb_private::Editline> _editline_sp;
PseudoTerminal _pty; PseudoTerminal _pty;
int _pty_primary_fd; int _pty_primary_fd = -1;
int _pty_secondary_fd; int _pty_secondary_fd = -1;
std::unique_ptr<FilePointer> _el_secondary_file; std::unique_ptr<FilePointer> _el_secondary_file;
}; };
EditlineAdapter::EditlineAdapter() EditlineAdapter::EditlineAdapter()
: _editline_sp(), _pty(), _pty_primary_fd(-1), _pty_secondary_fd(-1), : _editline_sp(), _pty(), _el_secondary_file() {
_el_secondary_file() {
lldb_private::Status error; lldb_private::Status error;
// Open the first primary pty available. // Open the first primary pty available.

View File

@ -34,7 +34,7 @@ struct DummyFile : public vfs::File {
class DummyFileSystem : public vfs::FileSystem { class DummyFileSystem : public vfs::FileSystem {
int FSID; // used to produce UniqueIDs int FSID; // used to produce UniqueIDs
int FileID; // used to produce UniqueIDs int FileID = 0; // used to produce UniqueIDs
std::string cwd; std::string cwd;
std::map<std::string, vfs::Status> FilesAndDirs; std::map<std::string, vfs::Status> FilesAndDirs;
@ -44,7 +44,7 @@ class DummyFileSystem : public vfs::FileSystem {
} }
public: public:
DummyFileSystem() : FSID(getNextFSID()), FileID(0) {} DummyFileSystem() : FSID(getNextFSID()) {}
ErrorOr<vfs::Status> status(const Twine &Path) override { ErrorOr<vfs::Status> status(const Twine &Path) override {
std::map<std::string, vfs::Status>::iterator I = std::map<std::string, vfs::Status>::iterator I =

View File

@ -82,28 +82,26 @@ public:
class DummyStopInfo : public StopInfo { class DummyStopInfo : public StopInfo {
public: public:
DummyStopInfo(Thread &thread, uint64_t value) DummyStopInfo(Thread &thread, uint64_t value) : StopInfo(thread, value) {}
: StopInfo(thread, value), m_should_stop(true),
m_stop_reason(eStopReasonBreakpoint) {}
bool ShouldStop(Event *event_ptr) override { return m_should_stop; } bool ShouldStop(Event *event_ptr) override { return m_should_stop; }
StopReason GetStopReason() const override { return m_stop_reason; } StopReason GetStopReason() const override { return m_stop_reason; }
bool m_should_stop; bool m_should_stop = true;
StopReason m_stop_reason; StopReason m_stop_reason = eStopReasonBreakpoint;
}; };
class DummyProcessEventData : public Process::ProcessEventData { class DummyProcessEventData : public Process::ProcessEventData {
public: public:
DummyProcessEventData(ProcessSP &process_sp, StateType state) DummyProcessEventData(ProcessSP &process_sp, StateType state)
: ProcessEventData(process_sp, state), m_should_stop_hit_count(0) {} : ProcessEventData(process_sp, state) {}
bool ShouldStop(Event *event_ptr, bool &found_valid_stopinfo) override { bool ShouldStop(Event *event_ptr, bool &found_valid_stopinfo) override {
m_should_stop_hit_count++; m_should_stop_hit_count++;
return false; return false;
} }
int m_should_stop_hit_count; int m_should_stop_hit_count = 0;
}; };
} // namespace } // namespace