-Checks: '-readability-identifier-naming'
+Checks: '-readability-identifier-naming,modernize-use-default-member-init'
InheritParentConfig: true
+CheckOptions:
+ - key: modernize-use-default-member-init.IgnoreMacros
+ value: '1'
+ - key: modernize-use-default-member-init.UseAssignment
+ value: '1'
void AppendVariables(bool can_create, bool get_parent_variables,
lldb_private::VariableList *var_list);
- lldb_private::Block *m_opaque_ptr;
+ lldb_private::Block *m_opaque_ptr = nullptr;
};
} // namespace lldb
private:
lldb::BroadcasterSP m_opaque_sp;
- lldb_private::Broadcaster *m_opaque_ptr;
+ lldb_private::Broadcaster *m_opaque_ptr = nullptr;
};
} // namespace lldb
SBCommunication(const SBCommunication &) = delete;
const SBCommunication &operator=(const SBCommunication &) = delete;
- lldb_private::Communication *m_opaque;
- bool m_opaque_owned;
+ lldb_private::Communication *m_opaque = nullptr;
+ bool m_opaque_owned = false;
};
} // namespace lldb
void reset(lldb_private::CompileUnit *lldb_object_ptr);
- lldb_private::CompileUnit *m_opaque_ptr;
+ lldb_private::CompileUnit *m_opaque_ptr = nullptr;
};
} // namespace lldb
private:
mutable lldb::EventSP m_event_sp;
- mutable lldb_private::Event *m_opaque_ptr;
+ mutable lldb_private::Event *m_opaque_ptr = nullptr;
};
} // namespace lldb
SBFunction(lldb_private::Function *lldb_object_ptr);
- lldb_private::Function *m_opaque_ptr;
+ lldb_private::Function *m_opaque_ptr = nullptr;
};
} // namespace lldb
void reset(lldb::ListenerSP listener_sp);
lldb::ListenerSP m_opaque_sp;
- lldb_private::Listener *m_unused_ptr;
+ lldb_private::Listener *m_unused_ptr = nullptr;
};
} // namespace lldb
SBStream(const SBStream &) = delete;
const SBStream &operator=(const SBStream &) = delete;
std::unique_ptr<lldb_private::Stream> m_opaque_up;
- bool m_is_file;
+ bool m_is_file = false;
};
} // namespace lldb
void SetSymbol(lldb_private::Symbol *lldb_object_ptr);
- lldb_private::Symbol *m_opaque_ptr;
+ lldb_private::Symbol *m_opaque_ptr = nullptr;
};
} // namespace lldb
| eCondition | eAutoContinue)
};
struct CommandData {
- CommandData()
- : user_source(), script_source(),
- interpreter(lldb::eScriptLanguageNone), stop_on_error(true) {}
+ CommandData() : user_source(), script_source() {}
CommandData(const StringList &user_source, lldb::ScriptLanguage interp)
: user_source(user_source), script_source(), interpreter(interp),
StringList user_source;
std::string script_source;
- enum lldb::ScriptLanguage
- interpreter; // eScriptLanguageNone means command interpreter.
- bool stop_on_error;
+ enum lldb::ScriptLanguage interpreter =
+ lldb::eScriptLanguageNone; // eScriptLanguageNone means command
+ // interpreter.
+ bool stop_on_error = true;
private:
enum class OptionNames : uint32_t {
void SetID(lldb::break_id_t bid);
protected:
- lldb::break_id_t m_bid;
+ lldb::break_id_t m_bid = LLDB_INVALID_BREAK_ID;
private:
// For Stoppoint only
void Clear();
// Member variables
- Event *event; // This is the event, the callback can modify this to indicate
- // the meaning of the breakpoint hit
+ Event *event = nullptr; // This is the event, the callback can modify this to
+ // indicate the meaning of the breakpoint hit
ExecutionContextRef
exe_ctx_ref; // This tells us where we have stopped, what thread.
- bool is_synchronous; // Is the callback being executed synchronously with the
- // breakpoint,
- // or asynchronously as the event is retrieved?
+ bool is_synchronous =
+ false; // Is the callback being executed synchronously with the
+ // breakpoint,
+ // or asynchronously as the event is retrieved?
};
} // namespace lldb_private
wp_collection m_watchpoints;
mutable std::recursive_mutex m_mutex;
- lldb::watch_id_t m_next_wp_id;
+ lldb::watch_id_t m_next_wp_id = 0;
};
} // namespace lldb_private
lldb::user_id_t watch_id);
struct CommandData {
- CommandData() : user_source(), script_source(), stop_on_error(true) {}
+ CommandData() : user_source(), script_source() {}
~CommandData() = default;
StringList user_source;
std::string script_source;
- bool stop_on_error;
+ bool stop_on_error = true;
};
class CommandBaton : public TypedBaton<CommandData> {
// For WatchpointOptions only
WatchpointHitCallback m_callback; // This is the callback function pointer
lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback
- bool m_callback_is_synchronous;
+ bool m_callback_is_synchronous = false;
std::unique_ptr<ThreadSpec>
m_thread_spec_up; // Thread for which this watchpoint will take
};
///
/// Initialize with a invalid section (NULL) and an invalid offset
/// (LLDB_INVALID_ADDRESS).
- Address() : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {}
+ Address() : m_section_wp() {}
/// Copy constructor
///
protected:
// Member variables.
lldb::SectionWP m_section_wp; ///< The section for the address, can be NULL.
- lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid...
+ lldb::addr_t m_offset = LLDB_INVALID_ADDRESS; ///< Offset into section if \a
+ ///< m_section_wp is valid...
// Returns true if the m_section_wp once had a reference to a valid section
// shared pointer, but no longer does. This can happen if we have an address
protected:
// Member variables
Address m_base_addr; ///< The section offset base address of this range.
- lldb::addr_t m_byte_size; ///< The size in bytes of this address range.
+ lldb::addr_t m_byte_size = 0; ///< The size in bytes of this address range.
};
// bool operator== (const AddressRange& lhs, const AddressRange& rhs);
class Declaration {
public:
/// Default constructor.
- Declaration() : m_file(), m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) {}
+ Declaration() : m_file() {}
/// Construct with file specification, and optional line and column.
///
FileSpec m_file;
/// Non-zero values indicates a valid line number, zero indicates no line
/// number information is available.
- uint32_t m_line;
+ uint32_t m_line = 0;
/// Non-zero values indicates a valid column number, zero indicates no column
/// information is available.
- uint16_t m_column;
+ uint16_t m_column = LLDB_INVALID_COLUMN_NUMBER;
};
bool operator==(const Declaration &lhs, const Declaration &rhs);
struct SourceLine {
FileSpec file;
- uint32_t line;
- uint32_t column;
+ uint32_t line = LLDB_INVALID_LINE_NUMBER;
+ uint32_t column = 0;
- SourceLine() : file(), line(LLDB_INVALID_LINE_NUMBER), column(0) {}
+ SourceLine() : file() {}
bool operator==(const SourceLine &rhs) const {
return file == rhs.file && line == rhs.line && rhs.column == column;
// index of the "current" source line, if we want to highlight that when
// displaying the source lines. (as opposed to the surrounding source
// lines provided to give context)
- size_t current_source_line;
+ size_t current_source_line = -1;
// Whether to print a blank line at the end of the source lines.
- bool print_source_context_end_eol;
+ bool print_source_context_end_eol = true;
- SourceLinesToDisplay()
- : lines(), current_source_line(-1), print_source_context_end_eol(true) {
- }
+ SourceLinesToDisplay() : lines() {}
};
// Get the function's declaration line number, hopefully a line number
} InfoType;
struct Context {
- ContextType type;
- enum InfoType info_type;
+ ContextType type = eContextInvalid;
+ enum InfoType info_type = eInfoTypeNoArgs;
union {
struct RegisterPlusOffset {
RegisterInfo reg; // base register
uint32_t isa;
} info;
- Context() : type(eContextInvalid), info_type(eInfoTypeNoArgs) {}
+ Context() {}
void SetRegisterPlusOffset(RegisterInfo base_reg, int64_t signed_offset) {
info_type = eInfoTypeRegisterPlusOffset;
public:
FileLineResolver()
: m_file_spec(),
- m_line_number(UINT32_MAX), // Set this to zero for all lines in a file
- m_sc_list(), m_inlines(true) {}
+ // Set this to zero for all lines in a file
+ m_sc_list() {}
FileLineResolver(const FileSpec &resolver, uint32_t line_no,
bool check_inlines);
protected:
FileSpec m_file_spec; // This is the file spec we are looking for.
- uint32_t m_line_number; // This is the line number that we are looking for.
+ uint32_t m_line_number =
+ UINT32_MAX; // This is the line number that we are looking for.
SymbolContextList m_sc_list;
- bool m_inlines; // This determines whether the resolver looks for inlined
- // functions or not.
+ bool m_inlines = true; // This determines whether the resolver looks for
+ // inlined functions or not.
private:
FileLineResolver(const FileLineResolver &) = delete;
constexpr Definition(const char *name, const FormatEntity::Entry::Type t,
const uint64_t data)
- : name(name), string(nullptr), type(t), data(data) {}
+ : name(name), type(t), data(data) {}
constexpr Definition(const char *name, const FormatEntity::Entry::Type t,
const uint64_t num_children,
Entry(Type t = Type::Invalid, const char *s = nullptr,
const char *f = nullptr)
- : string(s ? s : ""), printf_format(f ? f : ""), children(), type(t),
- fmt(lldb::eFormatDefault), number(0), deref(false) {}
+ : string(s ? s : ""), printf_format(f ? f : ""), children(), type(t) {}
Entry(llvm::StringRef s);
Entry(char ch);
std::string printf_format;
std::vector<Entry> children;
Type type;
- lldb::Format fmt;
- lldb::addr_t number;
- bool deref;
+ lldb::Format fmt = lldb::eFormatDefault;
+ lldb::addr_t number = 0;
+ bool deref = false;
};
static bool Format(const Entry &entry, Stream &s, const SymbolContext *sc,
lldb::addr_t m_dynamic;
};
- LoadedModuleInfoList() : m_list(), m_link_map(LLDB_INVALID_ADDRESS) {}
+ LoadedModuleInfoList() : m_list() {}
void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); }
void clear() { m_list.clear(); }
std::vector<LoadedModuleInfo> m_list;
- lldb::addr_t m_link_map;
+ lldb::addr_t m_link_map = LLDB_INVALID_ADDRESS;
};
} // namespace lldb_private
uint32_t
magic; // HASH_MAGIC or HASH_CIGAM magic value to allow endian detection
- uint16_t version; // Version number
- uint16_t hash_function; // The hash function enumeration that was used
- uint32_t bucket_count; // The number of buckets in this hash table
- uint32_t hashes_count; // The total number of unique hash values and hash
- // data offsets in this table
+ uint16_t version = 1; // Version number
+ uint16_t hash_function =
+ eHashFunctionDJB; // The hash function enumeration that was used
+ uint32_t bucket_count = 0; // The number of buckets in this hash table
+ uint32_t hashes_count = 0; // The total number of unique hash values and
+ // hash data offsets in this table
uint32_t header_data_len; // The size in bytes of the "header_data" template
// member below
HeaderData header_data; //
- Header()
- : magic(HASH_MAGIC), version(1), hash_function(eHashFunctionDJB),
- bucket_count(0), hashes_count(0), header_data_len(sizeof(T)),
- header_data() {}
+ Header() : magic(HASH_MAGIC), header_data_len(sizeof(T)), header_data() {}
virtual ~Header() = default;
/// correctly.
class LookupInfo {
public:
- LookupInfo()
- : m_name(), m_lookup_name(), m_language(lldb::eLanguageTypeUnknown),
- m_name_type_mask(lldb::eFunctionNameTypeNone),
- m_match_name_after_lookup(false) {}
+ LookupInfo() : m_name(), m_lookup_name() {}
LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask,
lldb::LanguageType language);
ConstString m_lookup_name;
/// Limit matches to only be for this language
- lldb::LanguageType m_language;
+ lldb::LanguageType m_language = lldb::eLanguageTypeUnknown;
/// One or more bits from lldb::FunctionNameType that indicate what kind of
/// names we are looking for
- lldb::FunctionNameType m_name_type_mask;
+ lldb::FunctionNameType m_name_type_mask = lldb::eFunctionNameTypeNone;
///< If \b true, then demangled names that match will need to contain
///< "m_name" in order to be considered a match
- bool m_match_name_after_lookup;
+ bool m_match_name_after_lookup = false;
};
protected:
ConstString m_object_name; ///< The name an object within this module that is
///selected, or empty of the module is represented
///by \a m_file.
- uint64_t m_object_offset;
+ uint64_t m_object_offset = 0;
llvm::sys::TimePoint<> m_object_mod_time;
/// DataBuffer containing the module image, if it was provided at
collection m_modules; ///< The collection of modules.
mutable std::recursive_mutex m_modules_mutex;
- Notifier *m_notifier;
+ Notifier *m_notifier = nullptr;
public:
typedef LockingAdaptedIterable<collection, lldb::ModuleSP, vector_adapter,
public:
ModuleSpec()
: m_file(), m_platform_file(), m_symbol_file(), m_arch(), m_uuid(),
- m_object_name(), m_object_offset(0), m_object_size(0),
- m_source_mappings() {}
+ m_object_name(), m_source_mappings() {}
/// If the \c data argument is passed, its contents will be used
/// as the module contents instead of trying to read them from
ArchSpec m_arch;
UUID m_uuid;
ConstString m_object_name;
- uint64_t m_object_offset;
- uint64_t m_object_size;
+ uint64_t m_object_offset = 0;
+ uint64_t m_object_size = 0;
llvm::sys::TimePoint<> m_object_mod_time;
mutable PathMappingList m_source_mappings;
lldb::DataBufferSP m_data = {};
eTypeBytes
};
- Opcode() : m_byte_order(lldb::eByteOrderInvalid), m_type(eTypeInvalid) {}
+ Opcode() {}
Opcode(uint8_t inst, lldb::ByteOrder order)
: m_byte_order(order), m_type(eType8) {
endian::InlHostByteOrder() == lldb::eByteOrderBig);
}
- lldb::ByteOrder m_byte_order;
+ lldb::ByteOrder m_byte_order = lldb::eByteOrderInvalid;
- Opcode::Type m_type;
+ Opcode::Type m_type = eTypeInvalid;
union {
uint8_t inst8;
uint16_t inst16;
/// providers. See Mangled::DemangleWithRichManglingInfo()
class RichManglingContext {
public:
- RichManglingContext() : m_provider(None), m_ipd_buf_size(2048) {
+ RichManglingContext() {
m_ipd_buf = static_cast<char *>(std::malloc(m_ipd_buf_size));
m_ipd_buf[0] = '\0';
}
enum InfoProvider { None, ItaniumPartialDemangler, PluginCxxLanguage };
/// Selects the rich mangling info provider.
- InfoProvider m_provider;
+ InfoProvider m_provider = None;
/// Reference to the buffer used for results of ParseXy() operations.
llvm::StringRef m_buffer;
/// ItaniumPartialDemangler. It should be managed with malloc/free, not
/// new/delete.
char *m_ipd_buf;
- size_t m_ipd_buf_size;
+ size_t m_ipd_buf_size = 2048;
/// Members for PluginCxxLanguage
/// Cannot forward declare inner class CPlusPlusLanguage::MethodName. The
protected:
Scalar m_value;
CompilerType m_compiler_type;
- void *m_context;
- ValueType m_value_type;
- ContextType m_context_type;
+ void *m_context = nullptr;
+ ValueType m_value_type = ValueType::Scalar;
+ ContextType m_context_type = ContextType::Invalid;
DataBufferHeap m_data_buffer;
};
ProcessModID m_mod_id; // This is the stop id when this ValueObject was last
// evaluated.
ExecutionContextRef m_exe_ctx_ref;
- bool m_needs_update;
+ bool m_needs_update = true;
};
virtual ~ValueObject();
class ChildrenManager {
public:
- ChildrenManager() : m_mutex(), m_children(), m_children_count(0) {}
+ ChildrenManager() : m_mutex(), m_children() {}
bool HasChildAtIndex(size_t idx) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
typedef ChildrenMap::value_type ChildrenPair;
std::recursive_mutex m_mutex;
ChildrenMap m_children;
- size_t m_children_count;
+ size_t m_children_count = 0;
};
// Classes that inherit from ValueObject can see and modify these
};
struct PointerAsArraySettings {
- size_t m_element_count;
- size_t m_base_element;
- size_t m_stride;
+ size_t m_element_count = 0;
+ size_t m_base_element = 0;
+ size_t m_stride = 0;
- PointerAsArraySettings()
- : m_element_count(0), m_base_element(0), m_stride() {}
+ PointerAsArraySettings() {}
PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
size_t stride = 1)
class TypeNameSpecifierImpl {
public:
- TypeNameSpecifierImpl() : m_is_regex(false), m_type() {}
+ TypeNameSpecifierImpl() : m_type() {}
TypeNameSpecifierImpl(llvm::StringRef name, bool is_regex)
: m_is_regex(is_regex), m_type() {
bool IsRegex() { return m_is_regex; }
private:
- bool m_is_regex;
+ bool m_is_regex = false;
// TODO: Replace this with TypeAndOrName.
struct TypeOrName {
std::string m_type_name;
public:
class Flags {
public:
- Flags() : m_flags(lldb::eTypeOptionCascade) {}
+ Flags() {}
Flags(const Flags &other) : m_flags(other.m_flags) {}
void SetValue(uint32_t value) { m_flags = value; }
private:
- uint32_t m_flags;
+ uint32_t m_flags = lldb::eTypeOptionCascade;
};
TypeFormatImpl(const Flags &flags = Flags());
protected:
Flags m_flags;
- uint32_t m_my_revision;
+ uint32_t m_my_revision = 0;
private:
TypeFormatImpl(const TypeFormatImpl &) = delete;
TypeSummaryOptions &SetCapping(lldb::TypeSummaryCapping);
private:
- lldb::LanguageType m_lang;
- lldb::TypeSummaryCapping m_capping;
+ lldb::LanguageType m_lang = lldb::eLanguageTypeUnknown;
+ lldb::TypeSummaryCapping m_capping = lldb::eTypeSummaryCapped;
};
class TypeSummaryImpl {
class Flags {
public:
- Flags() : m_flags(lldb::eTypeOptionCascade) {}
+ Flags() {}
Flags(const Flags &other) : m_flags(other.m_flags) {}
void SetValue(uint32_t value) { m_flags = value; }
private:
- uint32_t m_flags;
+ uint32_t m_flags = lldb::eTypeOptionCascade;
};
bool Cascades() const { return m_flags.GetCascades(); }
public:
class Flags {
public:
- Flags() : m_flags(lldb::eTypeOptionCascade) {}
+ Flags() {}
Flags(const Flags &other) : m_flags(other.m_flags) {}
void SetValue(uint32_t value) { m_flags = value; }
private:
- uint32_t m_flags;
+ uint32_t m_flags = lldb::eTypeOptionCascade;
};
SyntheticChildren(const Flags &flags) : m_flags(flags) {}
/// The DWARF compile unit this expression belongs to. It is used to evaluate
/// values indexing into the .debug_addr section (e.g. DW_OP_GNU_addr_index,
/// DW_OP_GNU_const_index)
- const DWARFUnit *m_dwarf_cu;
+ const DWARFUnit *m_dwarf_cu = nullptr;
/// One of the defines that starts with LLDB_REGKIND_
- lldb::RegisterKind m_reg_kind;
+ lldb::RegisterKind m_reg_kind = lldb::eRegisterKindDWARF;
struct LoclistAddresses {
lldb::addr_t cu_file_addr;
class Entity {
public:
- Entity() : m_alignment(1), m_size(0), m_offset(0) {}
+ Entity() {}
virtual ~Entity() = default;
void SetOffset(uint32_t offset) { m_offset = offset; }
protected:
- uint32_t m_alignment;
- uint32_t m_size;
- uint32_t m_offset;
+ uint32_t m_alignment = 1;
+ uint32_t m_size = 0;
+ uint32_t m_offset = 0;
};
private:
static llvm::Expected<const char *>
GetStreamOpenModeFromOptions(OpenOptions options);
- File()
- : IOObject(eFDTypeFile), m_is_interactive(eLazyBoolCalculate),
- m_is_real_terminal(eLazyBoolCalculate),
- m_supports_colors(eLazyBoolCalculate){};
+ File() : IOObject(eFDTypeFile){};
/// Read bytes from a file from the current file position into buf.
///
static bool classof(const File *file) { return file->isA(&ID); }
protected:
- LazyBool m_is_interactive;
- LazyBool m_is_real_terminal;
- LazyBool m_supports_colors;
+ LazyBool m_is_interactive = eLazyBoolCalculate;
+ LazyBool m_is_real_terminal = eLazyBoolCalculate;
+ LazyBool m_supports_colors = eLazyBoolCalculate;
void CalculateInteractiveAndTerminal();
class NativeFile : public File {
public:
- NativeFile()
- : m_descriptor(kInvalidDescriptor), m_own_descriptor(false),
- m_stream(kInvalidStream), m_options(), m_own_stream(false) {}
+ NativeFile() : m_descriptor(kInvalidDescriptor), m_stream(kInvalidStream) {}
NativeFile(FILE *fh, bool transfer_ownership)
: m_descriptor(kInvalidDescriptor), m_own_descriptor(false), m_stream(fh),
// Member variables
int m_descriptor;
- bool m_own_descriptor;
+ bool m_own_descriptor = false;
FILE *m_stream;
- OpenOptions m_options;
- bool m_own_stream;
+ OpenOptions m_options{};
+ bool m_own_stream = false;
std::mutex offset_access_mutex;
private:
void Dump(Stream &stream) const;
protected:
- Action m_action; // The action for this file
- int m_fd; // An existing file descriptor
- int m_arg; // oflag for eFileActionOpen*, dup_fd for eFileActionDuplicate
+ Action m_action = eFileActionNone; // The action for this file
+ int m_fd = -1; // An existing file descriptor
+ int m_arg = -1; // oflag for eFileActionOpen*, dup_fd for eFileActionDuplicate
FileSpec
m_file_spec; // A file spec to use for opening after fork or posix_spawn
};
FileSystem()
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr),
- m_home_directory(), m_mapped(false) {}
+ m_home_directory() {}
FileSystem(std::shared_ptr<llvm::FileCollectorBase> collector)
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(std::move(collector)),
m_home_directory(), m_mapped(false) {}
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> m_fs;
std::shared_ptr<llvm::FileCollectorBase> m_collector;
std::string m_home_directory;
- bool m_mapped;
+ bool m_mapped = false;
};
} // namespace lldb_private
ThreadCreateTrampoline(lldb::thread_arg_t arg);
lldb::thread_t m_thread;
- lldb::thread_result_t m_result;
+ lldb::thread_result_t m_result = 0;
};
}
Flags m_flags; // Bitwise OR of bits from lldb::LaunchFlags
std::vector<FileAction> m_file_actions; // File actions for any other files
std::shared_ptr<PseudoTerminal> m_pty;
- uint32_t m_resume_count; // How many times do we resume after launching
+ uint32_t m_resume_count = 0; // How many times do we resume after launching
Host::MonitorChildProcessCallback m_monitor_callback;
- void *m_monitor_callback_baton;
- bool m_monitor_signals;
+ void *m_monitor_callback_baton = nullptr;
+ bool m_monitor_signals = false;
std::string m_event_data; // A string passed to the plugin launch, having no
// meaning to the upper levels of lldb.
lldb::ListenerSP m_listener_sp;
class ProcessRunLocker {
public:
- ProcessRunLocker() : m_lock(nullptr) {}
+ ProcessRunLocker() {}
~ProcessRunLocker() { Unlock(); }
}
}
- ProcessRunLock *m_lock;
+ ProcessRunLock *m_lock = nullptr;
private:
ProcessRunLocker(const ProcessRunLocker &) = delete;
protected:
lldb::rwlock_t m_rwlock;
- bool m_running;
+ bool m_running = false;
private:
ProcessRunLock(const ProcessRunLock &) = delete;
protected:
// Member variables
- int m_primary_fd; ///< The file descriptor for the primary.
- int m_secondary_fd; ///< The file descriptor for the secondary.
+ int m_primary_fd = invalid_fd; ///< The file descriptor for the primary.
+ int m_secondary_fd = invalid_fd; ///< The file descriptor for the secondary.
private:
PseudoTerminal(const PseudoTerminal &) = delete;
// Member variables
Terminal m_tty; ///< A terminal
- int m_tflags; ///< Cached tflags information.
+ int m_tflags = -1; ///< Cached tflags information.
#if LLDB_ENABLE_TERMIOS
std::unique_ptr<struct termios>
m_termios_up; ///< Cached terminal state information.
#endif
- lldb::pid_t m_process_group; ///< Cached process group information.
+ lldb::pid_t m_process_group = -1; ///< Cached process group information.
};
/// \class TerminalStateSwitcher Terminal.h "lldb/Host/Terminal.h"
protected:
// Member variables
- mutable uint32_t m_currentState; ///< The currently active TTY state index.
+ mutable uint32_t m_currentState =
+ UINT32_MAX; ///< The currently active TTY state index.
TerminalState
m_ttystates[2]; ///< The array of TTY states that holds saved TTY info.
};
void ForEachAttribute(AttributeCallback const &callback) const;
protected:
- XMLNodeImpl m_node;
+ XMLNodeImpl m_node = nullptr;
};
class XMLDocument {
static bool XMLEnabled();
protected:
- XMLDocumentImpl m_document;
+ XMLDocumentImpl m_document = nullptr;
StreamString m_errors;
};
std::atomic<bool> m_shutting_down; // This marks that we are shutting down so
// if we get woken up from
// BytesAvailable to disconnect, we won't try to read again.
- bool m_waiting_for_accept;
+ bool m_waiting_for_accept = false;
bool m_child_processes_inherit;
std::string m_uri;
private:
std::recursive_mutex m_mutex;
std::unique_ptr<SystemInitializer> m_initializer;
- bool m_initialized;
+ bool m_initialized = false;
// Noncopyable.
SystemLifetimeManager(const SystemLifetimeManager &other) = delete;
class CommandInterpreterRunResult {
public:
- CommandInterpreterRunResult()
- : m_num_errors(0), m_result(lldb::eCommandInterpreterResultSuccess) {}
+ CommandInterpreterRunResult() {}
uint32_t GetNumErrors() const { return m_num_errors; }
void SetResult(lldb::CommandInterpreterResult result) { m_result = result; }
private:
- int m_num_errors;
- lldb::CommandInterpreterResult m_result;
+ int m_num_errors = 0;
+ lldb::CommandInterpreterResult m_result =
+ lldb::eCommandInterpreterResultSuccess;
};
class CommandInterpreterRunOptions {
m_print_errors(print_errors), m_add_to_history(add_to_history) {}
CommandInterpreterRunOptions()
- : m_stop_on_continue(eLazyBoolCalculate),
- m_stop_on_error(eLazyBoolCalculate),
- m_stop_on_crash(eLazyBoolCalculate),
- m_echo_commands(eLazyBoolCalculate),
- m_echo_comment_commands(eLazyBoolCalculate),
- m_print_results(eLazyBoolCalculate), m_print_errors(eLazyBoolCalculate),
- m_add_to_history(eLazyBoolCalculate) {}
+
+ {}
void SetSilent(bool silent) {
LazyBool value = silent ? eLazyBoolNo : eLazyBoolYes;
m_spawn_thread = spawn_thread ? eLazyBoolYes : eLazyBoolNo;
}
- LazyBool m_stop_on_continue;
- LazyBool m_stop_on_error;
- LazyBool m_stop_on_crash;
- LazyBool m_echo_commands;
- LazyBool m_echo_comment_commands;
- LazyBool m_print_results;
- LazyBool m_print_errors;
- LazyBool m_add_to_history;
+ LazyBool m_stop_on_continue = eLazyBoolCalculate;
+ LazyBool m_stop_on_error = eLazyBoolCalculate;
+ LazyBool m_stop_on_crash = eLazyBoolCalculate;
+ LazyBool m_echo_commands = eLazyBoolCalculate;
+ LazyBool m_echo_comment_commands = eLazyBoolCalculate;
+ LazyBool m_print_results = eLazyBoolCalculate;
+ LazyBool m_print_errors = eLazyBoolCalculate;
+ LazyBool m_add_to_history = eLazyBoolCalculate;
LazyBool m_auto_handle_events;
LazyBool m_spawn_thread;
eDumpGroupExport = (eDumpOptionCommand | eDumpOptionName | eDumpOptionValue)
};
- OptionValue() : m_value_was_set(false) {}
+ OptionValue() {}
virtual ~OptionValue() = default;
lldb::OptionValueWP m_parent_wp;
std::function<void()> m_callback;
- bool m_value_was_set; // This can be used to see if a value has been set
- // by a call to SetValueFromCString(). It is often
- // handy to know if an option value was set from the
- // command line or as a setting, versus if we just have
- // the default value that was already populated in the
- // option value.
+ bool m_value_was_set = false; // This can be used to see if a value has been
+ // set by a call to SetValueFromCString(). It is
+ // often handy to know if an option value was
+ // set from the command line or as a setting,
+ // versus if we just have the default value that
+ // was already populated in the option value.
};
} // namespace lldb_private
#ifndef LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H
#define LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H
+#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/OptionValue.h"
-
#include "lldb/Utility/FileSpec.h"
#include "llvm/Support/Chrono.h"
protected:
FileSpec m_file_spec;
- uint32_t m_line_number;
- uint32_t m_column_number;
- uint32_t m_completion_mask;
+ uint32_t m_line_number = LLDB_INVALID_LINE_NUMBER;
+ uint32_t m_column_number = LLDB_INVALID_COLUMN_NUMBER;
+ uint32_t m_completion_mask = CommandCompletions::eSourceFileCompletion;
};
} // namespace lldb_private
#ifndef LLDB_INTERPRETER_OPTIONVALUEFILESPEC_H
#define LLDB_INTERPRETER_OPTIONVALUEFILESPEC_H
+#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/FileSpec.h"
FileSpec m_default_value;
lldb::DataBufferSP m_data_sp;
llvm::sys::TimePoint<> m_data_mod_time;
- uint32_t m_completion_mask;
+ uint32_t m_completion_mask = CommandCompletions::eDiskFileCompletion;
bool m_resolve;
};
class OptionGroupOptions : public Options {
public:
- OptionGroupOptions() : m_did_finalize(false) {}
+ OptionGroupOptions() {}
~OptionGroupOptions() override = default;
std::vector<OptionDefinition> m_option_defs;
OptionInfos m_option_infos;
- bool m_did_finalize;
+ bool m_did_finalize = false;
};
} // namespace lldb_private
struct ExecuteScriptOptions {
public:
- ExecuteScriptOptions()
- : m_enable_io(true), m_set_lldb_globals(true), m_maskout_errors(true) {}
+ ExecuteScriptOptions() {}
bool GetEnableIO() const { return m_enable_io; }
}
private:
- bool m_enable_io;
- bool m_set_lldb_globals;
- bool m_maskout_errors;
+ bool m_enable_io = true;
+ bool m_set_lldb_globals = true;
+ bool m_maskout_errors = true;
};
virtual bool Interrupt() { return false; }
// There are relatively few of these (one per 500/1000 functions, depending
// on format) so creating them on first scan will not be too costly.
struct UnwindIndex {
- uint32_t function_offset; // The offset of the first function covered by
- // this index
- uint32_t second_level; // The offset (inside unwind_info sect) to the second
- // level page for this index
+ uint32_t function_offset = 0; // The offset of the first function covered by
+ // this index
+ uint32_t second_level = 0; // The offset (inside unwind_info sect) to the
+ // second level page for this index
// (either UNWIND_SECOND_LEVEL_REGULAR or UNWIND_SECOND_LEVEL_COMPRESSED)
- uint32_t lsda_array_start; // The offset (inside unwind_info sect) LSDA
- // array for this index
- uint32_t lsda_array_end; // The offset to the LSDA array for the NEXT index
- bool sentinal_entry; // There is an empty index at the end which provides
- // the upper bound of
+ uint32_t lsda_array_start = 0; // The offset (inside unwind_info sect) LSDA
+ // array for this index
+ uint32_t lsda_array_end =
+ 0; // The offset to the LSDA array for the NEXT index
+ bool sentinal_entry = false; // There is an empty index at the end which
+ // provides the upper bound of
// function addresses that are described
- UnwindIndex()
- : function_offset(0), second_level(0), lsda_array_start(0),
- lsda_array_end(0), sentinal_entry(false) {}
+ UnwindIndex() {}
bool operator<(const CompactUnwindInfo::UnwindIndex &rhs) const {
return function_offset < rhs.function_offset;
// An internal object used to store the information we retrieve about a
// function -- the encoding bits and possibly the LSDA/personality function.
struct FunctionInfo {
- uint32_t encoding; // compact encoding 32-bit value for this function
+ uint32_t encoding = 0; // compact encoding 32-bit value for this function
Address lsda_address; // the address of the LSDA data for this function
Address personality_ptr_address; // the address where the personality
// routine addr can be found
- uint32_t valid_range_offset_start; // first offset that this encoding is
- // valid for (start of the function)
- uint32_t
- valid_range_offset_end; // the offset of the start of the next function
- FunctionInfo()
- : encoding(0), lsda_address(), personality_ptr_address(),
- valid_range_offset_start(0), valid_range_offset_end(0) {}
+ uint32_t valid_range_offset_start = 0; // first offset that this encoding is
+ // valid for (start of the function)
+ uint32_t valid_range_offset_end =
+ 0; // the offset of the start of the next function
+ FunctionInfo() : lsda_address(), personality_ptr_address() {}
};
struct UnwindHeader {
uint32_t version;
- uint32_t common_encodings_array_offset;
- uint32_t common_encodings_array_count;
- uint32_t personality_array_offset;
- uint32_t personality_array_count;
-
- UnwindHeader()
- : common_encodings_array_offset(0), common_encodings_array_count(0),
- personality_array_offset(0), personality_array_count(0) {}
+ uint32_t common_encodings_array_offset = 0;
+ uint32_t common_encodings_array_count = 0;
+ uint32_t personality_array_offset = 0;
+ uint32_t personality_array_count = 0;
+
+ UnwindHeader() {}
};
void ScanIndex(const lldb::ProcessSP &process_sp);
FileSpec file; ///< The source file, possibly mapped by the target.source-map
///setting
FileSpec original_file; ///< The original source file, from debug info.
- uint32_t line; ///< The source line number, or zero if there is no line number
- ///information.
- uint16_t column; ///< The column number of the source line, or zero if there
- ///is no column information.
+ uint32_t line = LLDB_INVALID_LINE_NUMBER; ///< The source line number, or zero
+ ///< if there is no line number
+ /// information.
+ uint16_t column =
+ 0; ///< The column number of the source line, or zero if there
+ /// is no column information.
uint16_t is_start_of_statement : 1, ///< Indicates this entry is the beginning
///of a statement.
is_start_of_basic_block : 1, ///< Indicates this entry is the beginning of
protected:
struct Entry {
Entry()
- : file_addr(LLDB_INVALID_ADDRESS), line(0),
- is_start_of_statement(false), is_start_of_basic_block(false),
+ : line(0), is_start_of_statement(false), is_start_of_basic_block(false),
is_prologue_end(false), is_epilogue_begin(false),
- is_terminal_entry(false), column(0), file_idx(0) {}
+ is_terminal_entry(false) {}
Entry(lldb::addr_t _file_addr, uint32_t _line, uint16_t _column,
uint16_t _file_idx, bool _is_start_of_statement,
// Member variables.
/// The file address for this line entry.
- lldb::addr_t file_addr;
+ lldb::addr_t file_addr = LLDB_INVALID_ADDRESS;
/// The source line number, or zero if there is no line number
/// information.
uint32_t line : 27;
uint32_t is_terminal_entry : 1;
/// The column number of the source line, or zero if there is no
/// column information.
- uint16_t column;
+ uint16_t column = 0;
/// The file index into CompileUnit's file table, or zero if there
/// is no file information.
- uint16_t file_idx;
+ uint16_t file_idx = 0;
};
struct EntrySearchInfo {
lldb_private::ModuleSpec &module_spec,
lldb_private::ModuleList &seen_modules) const;
- uint32_t m_uid; // User ID (usually the original symbol table index)
- uint16_t m_type_data; // data specific to m_type
+ uint32_t m_uid =
+ UINT32_MAX; // User ID (usually the original symbol table index)
+ uint16_t m_type_data = 0; // data specific to m_type
uint16_t m_type_data_resolved : 1, // True if the data in m_type_data has
// already been calculated
m_is_synthetic : 1, // non-zero if this symbol is not actually in the
AddressRange m_addr_range; // Contains the value, or the section offset
// address when the value is an address in a
// section, and the size (if any)
- uint32_t m_flags; // A copy of the flags from the original symbol table, the
- // ObjectFile plug-in can interpret these
+ uint32_t m_flags = 0; // A copy of the flags from the original symbol table,
+ // the ObjectFile plug-in can interpret these
};
} // namespace lldb_private
// Member variables
lldb::TargetSP target_sp; ///< The Target for a given query
lldb::ModuleSP module_sp; ///< The Module for a given query
- CompileUnit *comp_unit; ///< The CompileUnit for a given query
- Function *function; ///< The Function for a given query
- Block *block; ///< The Block for a given query
+ CompileUnit *comp_unit = nullptr; ///< The CompileUnit for a given query
+ Function *function = nullptr; ///< The Function for a given query
+ Block *block = nullptr; ///< The Block for a given query
LineEntry line_entry; ///< The LineEntry for a given query
- Symbol *symbol; ///< The Symbol for a given query
- Variable *variable; ///< The global variable matching the given query
+ Symbol *symbol = nullptr; ///< The Symbol for a given query
+ Variable *variable =
+ nullptr; ///< The global variable matching the given query
};
class SymbolContextSpecifier {
protected:
ConstString m_name;
- SymbolFile *m_symbol_file;
+ SymbolFile *m_symbol_file = nullptr;
/// The symbol context in which this type is defined.
- SymbolContextScope *m_context;
- Type *m_encoding_type;
- lldb::user_id_t m_encoding_uid;
- EncodingDataType m_encoding_uid_type;
+ SymbolContextScope *m_context = nullptr;
+ Type *m_encoding_type = nullptr;
+ lldb::user_id_t m_encoding_uid = LLDB_INVALID_UID;
+ EncodingDataType m_encoding_uid_type = eEncodingInvalid;
uint64_t m_byte_size : 63;
uint64_t m_byte_size_has_value : 1;
Declaration m_decl;
CompilerType m_compiler_type;
- ResolveState m_compiler_type_resolve_state;
+ ResolveState m_compiler_type_resolve_state = ResolveState::Unresolved;
/// Language-specific flags.
Payload m_payload;
class TypeMemberImpl {
public:
TypeMemberImpl()
- : m_type_impl_sp(), m_bit_offset(0), m_name(), m_bitfield_bit_size(0),
- m_is_bitfield(false)
+ : m_type_impl_sp(), m_name()
{}
protected:
lldb::TypeImplSP m_type_impl_sp;
- uint64_t m_bit_offset;
+ uint64_t m_bit_offset = 0;
ConstString m_name;
- uint32_t m_bitfield_bit_size; // Bit size for bitfield members only
- bool m_is_bitfield;
+ uint32_t m_bitfield_bit_size = 0; // Bit size for bitfield members only
+ bool m_is_bitfield = false;
};
///
class TypeMemberFunctionImpl {
public:
- TypeMemberFunctionImpl()
- : m_type(), m_decl(), m_name(), m_kind(lldb::eMemberFunctionKindUnknown) {
- }
+ TypeMemberFunctionImpl() : m_type(), m_decl(), m_name() {}
TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl,
const std::string &name,
CompilerType m_type;
CompilerDecl m_decl;
ConstString m_name;
- lldb::MemberFunctionKind m_kind;
+ lldb::MemberFunctionKind m_kind = lldb::eMemberFunctionKindUnknown;
};
class TypeEnumMemberImpl {
public:
- TypeEnumMemberImpl()
- : m_integer_type_sp(), m_name("<invalid>"), m_value(), m_valid(false) {}
+ TypeEnumMemberImpl() : m_integer_type_sp(), m_name("<invalid>"), m_value() {}
TypeEnumMemberImpl(const lldb::TypeImplSP &integer_type_sp,
ConstString name, const llvm::APSInt &value);
lldb::TypeImplSP m_integer_type_sp;
ConstString m_name;
llvm::APSInt m_value;
- bool m_valid;
+ bool m_valid = false;
};
class TypeEnumMemberListImpl {
mutable std::mutex m_mutex; ///< A mutex to keep this object happy in
///multi-threaded environments.
collection m_map;
- bool m_clear_in_progress;
+ bool m_clear_in_progress = false;
private:
typedef llvm::function_ref<lldb::TypeSystemSP()> CreateCallback;
isDWARFExpression // reg = eval(dwarf_expr)
};
- RegisterLocation() : m_type(unspecified), m_location() {}
+ RegisterLocation() : m_location() {}
bool operator==(const RegisterLocation &rhs) const;
const UnwindPlan::Row *row, Thread *thread, bool verbose) const;
private:
- RestoreType m_type; // How do we locate this register?
+ RestoreType m_type = unspecified; // How do we locate this register?
union {
// For m_type == atCFAPlusOffset or m_type == isCFAPlusOffset
int32_t offset;
isRaSearch, // FA = SP + offset + ???
};
- FAValue() : m_type(unspecified), m_value() {}
+ FAValue() : m_value() {}
bool operator==(const FAValue &rhs) const;
void Dump(Stream &s, const UnwindPlan *unwind_plan, Thread *thread) const;
private:
- ValueType m_type; // How do we compute CFA value?
+ ValueType m_type = unspecified; // How do we compute CFA value?
union {
struct {
// For m_type == isRegisterPlusOffset or m_type ==
protected:
typedef std::map<uint32_t, RegisterLocation> collection;
- lldb::addr_t m_offset; // Offset into the function for this row
+ lldb::addr_t m_offset = 0; // Offset into the function for this row
FAValue m_cfa_value;
FAValue m_afa_value;
collection m_register_locations;
- bool m_unspecified_registers_are_undefined;
+ bool m_unspecified_registers_are_undefined = false;
}; // class Row
typedef std::shared_ptr<Row> RowSP;
lldb::TargetWP m_target_wp; ///< A weak reference to a target
lldb::ProcessWP m_process_wp; ///< A weak reference to a process
mutable lldb::ThreadWP m_thread_wp; ///< A weak reference to a thread
- lldb::tid_t m_tid; ///< The thread ID that this object refers to in case the
- ///backing object changes
+ lldb::tid_t m_tid = LLDB_INVALID_THREAD_ID; ///< The thread ID that this
+ ///< object refers to in case the
+ /// backing object changes
StackID m_stack_id; ///< The stack ID that this object refers to in case the
///backing object changes
};
const_iterator FindIteratorForPath(ConstString path) const;
collection m_pairs;
- ChangedCallback m_callback;
- void *m_callback_baton;
- uint32_t m_mod_id; // Incremented anytime anything is added or removed.
+ ChangedCallback m_callback = nullptr;
+ void *m_callback_baton = nullptr;
+ uint32_t m_mod_id = 0; // Incremented anytime anything is added or removed.
};
} // namespace lldb_private
public:
ProcessAttachInfo()
: ProcessInstanceInfo(), m_listener_sp(), m_hijack_listener_sp(),
- m_plugin_name(), m_resume_count(0), m_wait_for_launch(false),
- m_ignore_existing(true), m_continue_once_attached(false),
- m_detach_on_error(true), m_async(false) {}
+ m_plugin_name() {}
ProcessAttachInfo(const ProcessLaunchInfo &launch_info)
: ProcessInstanceInfo(), m_listener_sp(), m_hijack_listener_sp(),
lldb::ListenerSP m_listener_sp;
lldb::ListenerSP m_hijack_listener_sp;
std::string m_plugin_name;
- uint32_t m_resume_count; // How many times do we resume after launching
- bool m_wait_for_launch;
- bool m_ignore_existing;
- bool m_continue_once_attached; // Supports the use-case scenario of
- // immediately continuing the process once
- // attached.
- bool m_detach_on_error; // If we are debugging remotely, instruct the stub to
- // detach rather than killing the target on error.
- bool m_async; // Use an async attach where we start the attach and return
- // immediately (used by GUI programs with --waitfor so they can
- // call SBProcess::Stop() to cancel attach)
+ uint32_t m_resume_count = 0; // How many times do we resume after launching
+ bool m_wait_for_launch = false;
+ bool m_ignore_existing = true;
+ bool m_continue_once_attached = false; // Supports the use-case scenario of
+ // immediately continuing the process
+ // once attached.
+ bool m_detach_on_error =
+ true; // If we are debugging remotely, instruct the stub to
+ // detach rather than killing the target on error.
+ bool m_async =
+ false; // Use an async attach where we start the attach and return
+ // immediately (used by GUI programs with --waitfor so they can
+ // call SBProcess::Stop() to cancel attach)
};
// This class tracks the Modification state of the process. Things that can
public:
ProcessModID()
- : m_stop_id(0), m_last_natural_stop_id(0), m_resume_id(0), m_memory_id(0),
- m_last_user_expression_resume(0), m_running_user_expression(false),
- m_running_utility_function(0) {}
+
+ {}
ProcessModID(const ProcessModID &rhs)
: m_stop_id(rhs.m_stop_id), m_memory_id(rhs.m_memory_id) {}
}
private:
- uint32_t m_stop_id;
- uint32_t m_last_natural_stop_id;
- uint32_t m_resume_id;
- uint32_t m_memory_id;
- uint32_t m_last_user_expression_resume;
- uint32_t m_running_user_expression;
- uint32_t m_running_utility_function;
+ uint32_t m_stop_id = 0;
+ uint32_t m_last_natural_stop_id = 0;
+ uint32_t m_resume_id = 0;
+ uint32_t m_memory_id = 0;
+ uint32_t m_last_user_expression_resume = 0;
+ uint32_t m_running_user_expression = false;
+ uint32_t m_running_utility_function = 0;
lldb::EventSP m_last_natural_stop_event;
};
}
lldb::ProcessWP m_process_wp;
- lldb::StateType m_state;
+ lldb::StateType m_state = lldb::eStateInvalid;
std::vector<std::string> m_restarted_reasons;
- bool m_restarted; // For "eStateStopped" events, this is true if the target
- // was automatically restarted.
- int m_update_state;
- bool m_interrupted;
+ bool m_restarted = false; // For "eStateStopped" events, this is true if the
+ // target was automatically restarted.
+ int m_update_state = 0;
+ bool m_interrupted = false;
ProcessEventData(const ProcessEventData &) = delete;
const ProcessEventData &operator=(const ProcessEventData &) = delete;
typedef std::map<lldb::RegisterKind, uint32_t> Collection;
lldb::RegisterContextSP m_reg_ctx_sp;
- uint32_t m_regnum;
- lldb::RegisterKind m_kind;
+ uint32_t m_regnum = LLDB_INVALID_REGNUM;
+ lldb::RegisterKind m_kind = lldb::kNumRegisterKinds;
Collection m_kind_regnum_map;
- const char *m_name;
+ const char *m_name = nullptr;
};
#endif // LLDB_TARGET_REGISTERNUMBER_H
public:
// Constructors and Destructors
StackID()
- : m_pc(LLDB_INVALID_ADDRESS), m_cfa(LLDB_INVALID_ADDRESS),
- m_symbol_scope(nullptr) {}
+
+ {}
explicit StackID(lldb::addr_t pc, lldb::addr_t cfa,
SymbolContextScope *symbol_scope)
void SetCFA(lldb::addr_t cfa) { m_cfa = cfa; }
- lldb::addr_t
- m_pc; // The pc value for the function/symbol for this frame. This will
+ lldb::addr_t m_pc =
+ LLDB_INVALID_ADDRESS; // The pc value for the function/symbol for this
+ // frame. This will
// only get used if the symbol scope is nullptr (the code where we are
// stopped is not represented by any function or symbol in any shared
// library).
- lldb::addr_t m_cfa; // The call frame address (stack pointer) value
- // at the beginning of the function that uniquely
- // identifies this frame (along with m_symbol_scope
- // below)
- SymbolContextScope *
- m_symbol_scope; // If nullptr, there is no block or symbol for this frame.
- // If not nullptr, this will either be the scope for the
- // lexical block for the frame, or the scope for the
- // symbol. Symbol context scopes are always be unique
- // pointers since the are part of the Block and Symbol
- // objects and can easily be used to tell if a stack ID
- // is the same as another.
+ lldb::addr_t m_cfa =
+ LLDB_INVALID_ADDRESS; // The call frame address (stack pointer) value
+ // at the beginning of the function that uniquely
+ // identifies this frame (along with m_symbol_scope
+ // below)
+ SymbolContextScope *m_symbol_scope =
+ nullptr; // If nullptr, there is no block or symbol for this frame.
+ // If not nullptr, this will either be the scope for the
+ // lexical block for the frame, or the scope for the
+ // symbol. Symbol context scopes are always be unique
+ // pointers since the are part of the Block and Symbol
+ // objects and can easily be used to tell if a stack ID
+ // is the same as another.
};
bool operator==(const StackID &lhs, const StackID &rhs);
return g_option_names[(size_t) enum_value];
}
- uint32_t m_index;
- lldb::tid_t m_tid;
+ uint32_t m_index = UINT32_MAX;
+ lldb::tid_t m_tid = LLDB_INVALID_THREAD_ID;
std::string m_name;
std::string m_queue_name;
};
private:
struct Cursor {
- lldb::addr_t start_pc; // The start address of the function/symbol for this
- // frame - current pc if unknown
- lldb::addr_t cfa; // The canonical frame address for this stack frame
+ lldb::addr_t start_pc =
+ LLDB_INVALID_ADDRESS; // The start address of the function/symbol for
+ // this frame - current pc if unknown
+ lldb::addr_t cfa = LLDB_INVALID_ADDRESS; // The canonical frame address for
+ // this stack frame
lldb_private::SymbolContext sctx; // A symbol context we'll contribute to &
// provide to the StackFrame creation
RegisterContextLLDBSP
reg_ctx_lldb_sp; // These are all RegisterContextUnwind's
- Cursor()
- : start_pc(LLDB_INVALID_ADDRESS), cfa(LLDB_INVALID_ADDRESS), sctx(),
- reg_ctx_lldb_sp() {}
+ Cursor() : sctx(), reg_ctx_lldb_sp() {}
private:
Cursor(const Cursor &) = delete;
size_t GetByteSize() const { return m_end - m_start; }
/// A pointer to the first byte of data.
- uint8_t *m_start;
+ uint8_t *m_start = nullptr;
/// A pointer to the byte that is past the end of the data.
- uint8_t *m_end;
+ uint8_t *m_end = nullptr;
/// The byte order of the data we are extracting from.
lldb::ByteOrder m_byte_order;
}
// Member variables
- const uint8_t *m_start; ///< A pointer to the first byte of data.
- const uint8_t
- *m_end; ///< A pointer to the byte that is past the end of the data.
+ const uint8_t *m_start = nullptr; ///< A pointer to the first byte of data.
+ const uint8_t *m_end =
+ nullptr; ///< A pointer to the byte that is past the end of the data.
lldb::ByteOrder
m_byte_order; ///< The byte order of the data we are extracting from.
uint32_t m_addr_size; ///< The address size to use when extracting addresses.
/// The shared pointer to data that can be shared among multiple instances
lldb::DataBufferSP m_data_sp;
- const uint32_t m_target_byte_size;
+ const uint32_t m_target_byte_size = 1;
};
} // namespace lldb_private
enum Type { ePacketTypeInvalid = 0, ePacketTypeSend, ePacketTypeRecv };
- GDBRemotePacket()
- : packet(), type(ePacketTypeInvalid), bytes_transmitted(0), packet_idx(0),
- tid(LLDB_INVALID_THREAD_ID) {}
+ GDBRemotePacket() : packet() {}
void Clear() {
packet.data.clear();
void Dump(Stream &strm) const;
BinaryData packet;
- Type type;
- uint32_t bytes_transmitted;
- uint32_t packet_idx;
- lldb::tid_t tid;
+ Type type = ePacketTypeInvalid;
+ uint32_t bytes_transmitted = 0;
+ uint32_t packet_idx = 0;
+ lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
private:
llvm::StringRef GetTypeStr() const;
// the resolved platform executable (which is in m_executable)
Args m_arguments; // All program arguments except argv[0]
Environment m_environment;
- uint32_t m_uid;
- uint32_t m_gid;
+ uint32_t m_uid = UINT32_MAX;
+ uint32_t m_gid = UINT32_MAX;
ArchSpec m_arch;
- lldb::pid_t m_pid;
+ lldb::pid_t m_pid = LLDB_INVALID_PROCESS_ID;
};
// ProcessInstanceInfo
// to that process.
class ProcessInstanceInfo : public ProcessInfo {
public:
- ProcessInstanceInfo()
- : ProcessInfo(), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
- m_parent_pid(LLDB_INVALID_PROCESS_ID) {}
+ ProcessInstanceInfo() : ProcessInfo() {}
ProcessInstanceInfo(const char *name, const ArchSpec &arch, lldb::pid_t pid)
: ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
protected:
friend struct llvm::yaml::MappingTraits<ProcessInstanceInfo>;
- uint32_t m_euid;
- uint32_t m_egid;
- lldb::pid_t m_parent_pid;
+ uint32_t m_euid = UINT32_MAX;
+ uint32_t m_egid = UINT32_MAX;
+ lldb::pid_t m_parent_pid = LLDB_INVALID_PROCESS_ID;
};
typedef std::vector<ProcessInstanceInfo> ProcessInstanceInfoList;
class ProcessInstanceInfoMatch {
public:
- ProcessInstanceInfoMatch()
- : m_match_info(), m_name_match_type(NameMatch::Ignore),
- m_match_all_users(false) {}
+ ProcessInstanceInfoMatch() : m_match_info() {}
ProcessInstanceInfoMatch(const char *process_name,
NameMatch process_name_match_type)
protected:
ProcessInstanceInfo m_match_info;
- NameMatch m_name_match_type;
- bool m_match_all_users;
+ NameMatch m_name_match_type = NameMatch::Ignore;
+ bool m_match_all_users = false;
};
namespace repro {
eTypeBytes
};
- RegisterValue()
- : m_type(eTypeInvalid), m_scalar(static_cast<unsigned long>(0)) {}
+ RegisterValue() : m_scalar(static_cast<unsigned long>(0)) {}
explicit RegisterValue(uint8_t inst) : m_type(eTypeUInt8) { m_scalar = inst; }
void Clear();
protected:
- RegisterValue::Type m_type;
+ RegisterValue::Type m_type = eTypeInvalid;
Scalar m_scalar;
struct {
friend llvm::optional_detail::OptionalStorage<InstrumentationData, true>;
friend llvm::Optional<InstrumentationData>;
- InstrumentationData()
- : m_serializer(nullptr), m_deserializer(nullptr), m_registry(nullptr) {}
+ InstrumentationData() {}
InstrumentationData(Serializer &serializer, Registry ®istry)
: m_serializer(&serializer), m_deserializer(nullptr),
m_registry(®istry) {}
private:
static llvm::Optional<InstrumentationData> &InstanceImpl();
- Serializer *m_serializer;
- Deserializer *m_deserializer;
- Registry *m_registry;
+ Serializer *m_serializer = nullptr;
+ Deserializer *m_deserializer = nullptr;
+ Registry *m_registry = nullptr;
};
struct EmptyArg {};
}
#endif
- Serializer *m_serializer;
+ Serializer *m_serializer = nullptr;
/// Pretty function for logging.
llvm::StringRef m_pretty_func;
std::string m_pretty_args;
/// Whether this function call was the one crossing the API boundary.
- bool m_local_boundary;
+ bool m_local_boundary = false;
/// Whether the return value was recorded explicitly.
- bool m_result_recorded;
+ bool m_result_recorded = true;
/// The sequence number for this pair of function and result.
unsigned m_sequence;
};
// Constructors and Destructors
- Scalar() : m_type(e_void), m_float(0.0f) {}
+ Scalar() : m_float(0.0f) {}
Scalar(int v) : m_type(e_int), m_integer(MakeAPSInt(v)), m_float(0.0f) {}
Scalar(unsigned int v)
: m_type(e_int), m_integer(MakeAPSInt(v)), m_float(0.0f) {}
size_t byte_size);
protected:
- Scalar::Type m_type;
+ Scalar::Type m_type = e_void;
llvm::APSInt m_integer;
llvm::APFloat m_float;
protected:
/// Member variables
- ValueType m_code; ///< Status code as an integer value.
- lldb::ErrorType m_type; ///< The type of the above error code.
+ ValueType m_code = 0; ///< Status code as an integer value.
+ lldb::ErrorType m_type =
+ lldb::eErrorTypeInvalid; ///< The type of the above error code.
mutable std::string m_string; ///< A string representation of the error code.
};
protected:
// Member variables
Flags m_flags; ///< Dump flags.
- uint32_t m_addr_size; ///< Size of an address in bytes.
+ uint32_t m_addr_size = 4; ///< Size of an address in bytes.
lldb::ByteOrder
m_byte_order; ///< Byte order to use when encoding scalar types.
- unsigned m_indent_level; ///< Indention level.
+ unsigned m_indent_level = 0; ///< Indention level.
std::size_t m_bytes_written = 0; ///< Number of bytes written so far.
void _PutHex8(uint8_t uvalue, bool add_prefix);
/// When extracting data from a packet, this index will march along as things
/// get extracted. If set to UINT64_MAX the end of the packet data was
/// reached when decoding information.
- uint64_t m_index;
+ uint64_t m_index = 0;
};
#endif // LLDB_UTILITY_STRINGEXTRACTOR_H
typedef bool (*ResponseValidatorCallback)(
void *baton, const StringExtractorGDBRemote &response);
- StringExtractorGDBRemote() : StringExtractor(), m_validator(nullptr) {}
+ StringExtractorGDBRemote() : StringExtractor() {}
StringExtractorGDBRemote(llvm::StringRef str)
: StringExtractor(str), m_validator(nullptr) {}
GetPidTid(lldb::pid_t default_pid);
protected:
- ResponseValidatorCallback m_validator;
+ ResponseValidatorCallback m_validator = nullptr;
void *m_validator_baton;
};
typedef collection::iterator iterator;
typedef collection::const_iterator const_iterator;
- VMRange() : m_base_addr(0), m_byte_size(0) {}
+ VMRange() {}
VMRange(lldb::addr_t start_addr, lldb::addr_t end_addr)
: m_base_addr(start_addr),
const VMRange &range);
protected:
- lldb::addr_t m_base_addr;
- lldb::addr_t m_byte_size;
+ lldb::addr_t m_base_addr = 0;
+ lldb::addr_t m_byte_size = 0;
};
bool operator==(const VMRange &lhs, const VMRange &rhs);
using namespace lldb;
using namespace lldb_private;
-SBBlock::SBBlock() : m_opaque_ptr(nullptr) {
- LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBlock);
-}
+SBBlock::SBBlock() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBlock); }
SBBlock::SBBlock(lldb_private::Block *lldb_object_ptr)
: m_opaque_ptr(lldb_object_ptr) {}
using namespace lldb;
using namespace lldb_private;
-SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(nullptr) {
+SBBroadcaster::SBBroadcaster() : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBroadcaster);
}
class lldb_private::SBCommandReturnObjectImpl {
public:
- SBCommandReturnObjectImpl()
- : m_ptr(new CommandReturnObject(false)), m_owned(true) {}
+ SBCommandReturnObjectImpl() : m_ptr(new CommandReturnObject(false)) {}
SBCommandReturnObjectImpl(CommandReturnObject &ref)
: m_ptr(&ref), m_owned(false) {}
SBCommandReturnObjectImpl(const SBCommandReturnObjectImpl &rhs)
private:
CommandReturnObject *m_ptr;
- bool m_owned;
+ bool m_owned = true;
};
SBCommandReturnObject::SBCommandReturnObject()
using namespace lldb;
using namespace lldb_private;
-SBCommunication::SBCommunication() : m_opaque(nullptr), m_opaque_owned(false) {
+SBCommunication::SBCommunication() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommunication);
}
using namespace lldb;
using namespace lldb_private;
-SBCompileUnit::SBCompileUnit() : m_opaque_ptr(nullptr) {
+SBCompileUnit::SBCompileUnit() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCompileUnit);
}
using namespace lldb;
using namespace lldb_private;
-SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(nullptr) {
- LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent);
-}
+SBEvent::SBEvent() : m_event_sp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent); }
SBEvent::SBEvent(uint32_t event_type, const char *cstr, uint32_t cstr_len)
: m_event_sp(new Event(event_type, new EventDataBytes(cstr, cstr_len))),
using namespace lldb;
using namespace lldb_private;
-SBFunction::SBFunction() : m_opaque_ptr(nullptr) {
- LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFunction);
-}
+SBFunction::SBFunction() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFunction); }
SBFunction::SBFunction(lldb_private::Function *lldb_object_ptr)
: m_opaque_ptr(lldb_object_ptr) {}
using namespace lldb;
using namespace lldb_private;
-SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(nullptr) {
+SBListener::SBListener() : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener);
}
struct PlatformConnectOptions {
PlatformConnectOptions(const char *url = nullptr)
: m_url(), m_rsync_options(), m_rsync_remote_path_prefix(),
- m_rsync_enabled(false), m_rsync_omit_hostname_from_remote_path(false),
+
m_local_cache_directory() {
if (url && url[0])
m_url = url;
std::string m_url;
std::string m_rsync_options;
std::string m_rsync_remote_path_prefix;
- bool m_rsync_enabled;
- bool m_rsync_omit_hostname_from_remote_path;
+ bool m_rsync_enabled = false;
+ bool m_rsync_omit_hostname_from_remote_path = false;
ConstString m_local_cache_directory;
};
}
PlatformShellCommand(llvm::StringRef shell_command = llvm::StringRef())
- : m_shell(), m_command(), m_working_dir(), m_status(0), m_signo(0) {
+ : m_shell(), m_command(), m_working_dir() {
if (!shell_command.empty())
m_command = shell_command.str();
}
std::string m_command;
std::string m_working_dir;
std::string m_output;
- int m_status;
- int m_signo;
+ int m_status = 0;
+ int m_signo = 0;
Timeout<std::ratio<1>> m_timeout = llvm::None;
};
// SBPlatformConnectOptions
class QueueImpl {
public:
- QueueImpl()
- : m_queue_wp(), m_threads(), m_thread_list_fetched(false),
- m_pending_items(), m_pending_items_fetched(false) {}
+ QueueImpl() : m_queue_wp(), m_threads(), m_pending_items() {}
QueueImpl(const lldb::QueueSP &queue_sp)
: m_queue_wp(), m_threads(), m_thread_list_fetched(false),
lldb::QueueWP m_queue_wp;
std::vector<lldb::ThreadWP>
m_threads; // threads currently executing this queue's items
- bool
- m_thread_list_fetched; // have we tried to fetch the threads list already?
+ bool m_thread_list_fetched =
+ false; // have we tried to fetch the threads list already?
std::vector<lldb::QueueItemSP> m_pending_items; // items currently enqueued
- bool m_pending_items_fetched; // have we tried to fetch the item list already?
+ bool m_pending_items_fetched =
+ false; // have we tried to fetch the item list already?
};
}
using namespace lldb;
using namespace lldb_private;
-SBStream::SBStream() : m_opaque_up(new StreamString()), m_is_file(false) {
+SBStream::SBStream() : m_opaque_up(new StreamString()) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBStream);
}
using namespace lldb;
using namespace lldb_private;
-SBSymbol::SBSymbol() : m_opaque_ptr(nullptr) {
- LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSymbol);
-}
+SBSymbol::SBSymbol() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSymbol); }
SBSymbol::SBSymbol(lldb_private::Symbol *lldb_object_ptr)
: m_opaque_ptr(lldb_object_ptr) {}
VariablesOptionsImpl()
: m_include_arguments(false), m_include_locals(false),
m_include_statics(false), m_in_scope_only(false),
- m_include_runtime_support_values(false),
- m_include_recognized_arguments(eLazyBoolCalculate),
- m_use_dynamic(lldb::eNoDynamicValues) {}
+ m_include_runtime_support_values(false) {}
VariablesOptionsImpl(const VariablesOptionsImpl &) = default;
bool m_include_statics : 1;
bool m_in_scope_only : 1;
bool m_include_runtime_support_values : 1;
- LazyBool m_include_recognized_arguments; // can be overridden with a setting
- lldb::DynamicValueType m_use_dynamic;
+ LazyBool m_include_recognized_arguments =
+ eLazyBoolCalculate; // can be overridden with a setting
+ lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
};
SBVariablesOptions::SBVariablesOptions()
using namespace lldb_private;
// Stoppoint constructor
-Stoppoint::Stoppoint() : m_bid(LLDB_INVALID_BREAK_ID) {}
+Stoppoint::Stoppoint() {}
// Destructor
Stoppoint::~Stoppoint() {}
using namespace lldb_private;
-StoppointCallbackContext::StoppointCallbackContext()
- : event(nullptr), exe_ctx_ref(), is_synchronous(false) {}
+StoppointCallbackContext::StoppointCallbackContext() : exe_ctx_ref() {}
StoppointCallbackContext::StoppointCallbackContext(
Event *e, const ExecutionContext &exe_ctx, bool synchronously)
using namespace lldb;
using namespace lldb_private;
-WatchpointList::WatchpointList()
- : m_watchpoints(), m_mutex(), m_next_wp_id(0) {}
+WatchpointList::WatchpointList() : m_watchpoints(), m_mutex() {}
WatchpointList::~WatchpointList() {}
// WatchpointOptions constructor
WatchpointOptions::WatchpointOptions()
: m_callback(WatchpointOptions::NullCallback), m_callback_baton_sp(),
- m_callback_is_synchronous(false), m_thread_spec_up() {}
+ m_thread_spec_up() {}
// WatchpointOptions copy constructor
WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs)
class CommandOptions : public OptionGroup {
public:
CommandOptions()
- : OptionGroup(), m_condition(), m_filenames(), m_line_num(0),
- m_column(0), m_func_names(),
- m_func_name_type_mask(eFunctionNameTypeNone), m_func_regexp(),
- m_source_text_regexp(), m_modules(), m_load_addr(), m_catch_bp(false),
- m_throw_bp(true), m_hardware(false),
- m_exception_language(eLanguageTypeUnknown),
- m_language(lldb::eLanguageTypeUnknown),
- m_skip_prologue(eLazyBoolCalculate), m_all_files(false),
- m_move_to_nearest_code(eLazyBoolCalculate) {}
+ : OptionGroup(), m_condition(), m_filenames(), m_func_names(),
+ m_func_regexp(), m_source_text_regexp(), m_modules() {}
~CommandOptions() override = default;
std::string m_condition;
FileSpecList m_filenames;
- uint32_t m_line_num;
- uint32_t m_column;
+ uint32_t m_line_num = 0;
+ uint32_t m_column = 0;
std::vector<std::string> m_func_names;
std::vector<std::string> m_breakpoint_names;
- lldb::FunctionNameType m_func_name_type_mask;
+ lldb::FunctionNameType m_func_name_type_mask = eFunctionNameTypeNone;
std::string m_func_regexp;
std::string m_source_text_regexp;
FileSpecList m_modules;
- lldb::addr_t m_load_addr;
+ lldb::addr_t m_load_addr = 0;
lldb::addr_t m_offset_addr;
- bool m_catch_bp;
- bool m_throw_bp;
- bool m_hardware; // Request to use hardware breakpoints
- lldb::LanguageType m_exception_language;
- lldb::LanguageType m_language;
- LazyBool m_skip_prologue;
- bool m_all_files;
+ bool m_catch_bp = false;
+ bool m_throw_bp = true;
+ bool m_hardware = false; // Request to use hardware breakpoints
+ lldb::LanguageType m_exception_language = eLanguageTypeUnknown;
+ lldb::LanguageType m_language = lldb::eLanguageTypeUnknown;
+ LazyBool m_skip_prologue = eLazyBoolCalculate;
+ bool m_all_files = false;
Args m_exception_extra_args;
- LazyBool m_move_to_nearest_code;
+ LazyBool m_move_to_nearest_code = eLazyBoolCalculate;
std::unordered_set<std::string> m_source_regex_func_names;
std::string m_current_key;
};
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(), m_level(lldb::eDescriptionLevelBrief), m_use_dummy(false) {
- }
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- lldb::DescriptionLevel m_level;
+ lldb::DescriptionLevel m_level = lldb::eDescriptionLevelBrief;
bool m_internal;
- bool m_use_dummy;
+ bool m_use_dummy = false;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_filename(), m_line_num(0) {}
+ CommandOptions() : Options(), m_filename() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
std::string m_filename;
- uint32_t m_line_num;
+ uint32_t m_line_num = 0;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_use_dummy(false), m_force(false),
- m_delete_disabled(false) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
}
// Instance variables to hold the values for command options.
- bool m_use_dummy;
- bool m_force;
- bool m_delete_disabled;
+ bool m_use_dummy = false;
+ bool m_force = false;
+ bool m_delete_disabled = false;
};
protected:
class CommandOptions : public OptionGroup {
public:
- CommandOptions()
- : OptionGroup(), m_use_commands(false), m_use_script_language(false),
- m_script_language(eScriptLanguageNone), m_use_one_liner(false),
- m_one_liner() {}
+ CommandOptions() : OptionGroup(), m_one_liner() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- bool m_use_commands;
- bool m_use_script_language;
- lldb::ScriptLanguage m_script_language;
+ bool m_use_commands = false;
+ bool m_use_script_language = false;
+ lldb::ScriptLanguage m_script_language = eScriptLanguageNone;
// Instance variables to hold the values for one_liner options.
- bool m_use_one_liner;
+ bool m_use_one_liner = false;
std::string m_one_liner;
bool m_stop_on_error;
bool m_use_dummy;
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_use_dummy(false) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
}
// Instance variables to hold the values for command options.
- bool m_use_dummy;
+ bool m_use_dummy = false;
};
protected:
class CommandOptions : public Options {
public:
CommandOptions()
- : Options(), m_class_name(), m_funct_name(), m_short_help(),
- m_synchronicity(eScriptedCommandSynchronicitySynchronous) {}
+ : Options(), m_class_name(), m_funct_name(), m_short_help() {}
~CommandOptions() override = default;
std::string m_class_name;
std::string m_funct_name;
std::string m_short_help;
- ScriptedCommandSynchronicity m_synchronicity;
+ ScriptedCommandSynchronicity m_synchronicity =
+ eScriptedCommandSynchronicitySynchronous;
};
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override {
#include "CommandOptions.inc"
CommandObjectDisassemble::CommandOptions::CommandOptions()
- : Options(), num_lines_context(0), num_instructions(0), func_name(),
- current_function(false), start_addr(), end_addr(), at_pc(false),
- frame_line(false), plugin_name(), flavor_string(), arch(),
- some_location_specified(false), symbol_containing_addr() {
+ : Options(), func_name(), plugin_name(), flavor_string(), arch() {
OptionParsingStarting(nullptr);
}
bool show_mixed; // Show mixed source/assembly
bool show_bytes;
- uint32_t num_lines_context;
- uint32_t num_instructions;
+ uint32_t num_lines_context = 0;
+ uint32_t num_instructions = 0;
bool raw;
std::string func_name;
- bool current_function;
- lldb::addr_t start_addr;
- lldb::addr_t end_addr;
- bool at_pc;
- bool frame_line;
+ bool current_function = false;
+ lldb::addr_t start_addr = 0;
+ lldb::addr_t end_addr = 0;
+ bool at_pc = false;
+ bool frame_line = false;
std::string plugin_name;
std::string flavor_string;
ArchSpec arch;
- bool some_location_specified; // If no location was specified, we'll select
- // "at_pc". This should be set
+ bool some_location_specified = false; // If no location was specified, we'll
+ // select "at_pc". This should be set
// in SetOptionValue if anything the selects a location is set.
- lldb::addr_t symbol_containing_addr;
+ lldb::addr_t symbol_containing_addr = 0;
bool force = false;
};
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), log_file(), log_options(0) {}
+ CommandOptions() : Options(), log_file() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
FileSpec log_file;
- uint32_t log_options;
+ uint32_t log_options = 0;
};
void
class OptionGroupReadMemory : public OptionGroup {
public:
OptionGroupReadMemory()
- : m_num_per_line(1, 1), m_output_as_binary(false), m_view_as_type(),
- m_offset(0, 0), m_language_for_type(eLanguageTypeUnknown) {}
+ : m_num_per_line(1, 1), m_view_as_type(), m_offset(0, 0),
+ m_language_for_type(eLanguageTypeUnknown) {}
~OptionGroupReadMemory() override = default;
}
OptionValueUInt64 m_num_per_line;
- bool m_output_as_binary;
+ bool m_output_as_binary = false;
OptionValueString m_view_as_type;
bool m_force;
OptionValueUInt64 m_offset;
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(), match_info(), show_args(false), verbose(false) {}
+ CommandOptions() : Options(), match_info() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
ProcessInstanceInfoMatch match_info;
- bool show_args;
- bool verbose;
+ bool show_args = false;
+ bool verbose = false;
};
CommandOptions m_options;
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_verbose(false) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
}
// Instance variables to hold the values for command options.
- bool m_verbose;
+ bool m_verbose = false;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_global(false) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
}
// Instance variables to hold the values for command options.
- bool m_global;
+ bool m_global = false;
bool m_force;
};
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_sort_order(eSortOrderNone) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
return llvm::makeArrayRef(g_target_modules_dump_symtab_options);
}
- SortOrder m_sort_order;
+ SortOrder m_sort_order = eSortOrderNone;
OptionValueBoolean m_prefer_mangled = {false, false};
};
public:
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(), m_format_array(), m_use_global_module_list(false),
- m_module_addr(LLDB_INVALID_ADDRESS) {}
+ CommandOptions() : Options(), m_format_array() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
typedef std::vector<std::pair<char, uint32_t>> FormatWidthCollection;
FormatWidthCollection m_format_array;
- bool m_use_global_module_list;
- lldb::addr_t m_module_addr;
+ bool m_use_global_module_list = false;
+ lldb::addr_t m_module_addr = LLDB_INVALID_ADDRESS;
};
CommandObjectTargetModulesList(CommandInterpreter &interpreter)
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(), m_type(eLookupTypeInvalid), m_str(),
- m_addr(LLDB_INVALID_ADDRESS) {}
+ CommandOptions() : Options(), m_str() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- int m_type; // Should be a eLookupTypeXXX enum after parsing options
+ int m_type = eLookupTypeInvalid; // Should be a eLookupTypeXXX enum after
+ // parsing options
std::string m_str; // Holds name lookup
- lldb::addr_t m_addr; // Holds the address to lookup
+ lldb::addr_t m_addr = LLDB_INVALID_ADDRESS; // Holds the address to lookup
};
CommandObjectTargetModulesShowUnwind(CommandInterpreter &interpreter)
public:
class CommandOptions : public OptionGroup {
public:
- CommandOptions()
- : OptionGroup(), m_line_start(0), m_line_end(UINT_MAX),
- m_func_name_type_mask(eFunctionNameTypeAuto),
- m_sym_ctx_specified(false), m_thread_specified(false),
- m_use_one_liner(false), m_one_liner() {}
+ CommandOptions() : OptionGroup(), m_line_end(UINT_MAX), m_one_liner() {}
~CommandOptions() override = default;
std::string m_class_name;
std::string m_function_name;
- uint32_t m_line_start;
+ uint32_t m_line_start = 0;
uint32_t m_line_end;
std::string m_file_name;
std::string m_module_name;
- uint32_t m_func_name_type_mask; // A pick from lldb::FunctionNameType.
+ uint32_t m_func_name_type_mask =
+ eFunctionNameTypeAuto; // A pick from lldb::FunctionNameType.
lldb::tid_t m_thread_id;
uint32_t m_thread_index;
std::string m_thread_name;
std::string m_queue_name;
- bool m_sym_ctx_specified;
+ bool m_sym_ctx_specified = false;
bool m_no_inlines;
- bool m_thread_specified;
+ bool m_thread_specified = false;
// Instance variables to hold the values for one_liner options.
- bool m_use_one_liner;
+ bool m_use_one_liner = false;
std::vector<std::string> m_one_liner;
bool m_auto_continue;
public:
class CommandOptions : public Options {
public:
- uint32_t m_thread_idx;
- uint32_t m_frame_idx;
+ uint32_t m_thread_idx = LLDB_INVALID_THREAD_ID;
+ uint32_t m_frame_idx = LLDB_INVALID_FRAME_ID;
- CommandOptions()
- : Options(), m_thread_idx(LLDB_INVALID_THREAD_ID),
- m_frame_idx(LLDB_INVALID_FRAME_ID) {
+ CommandOptions() : Options() {
// Keep default values of all options in one place: OptionParsingStarting
// ()
OptionParsingStarting(nullptr);
public:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_from_expression(false) {
+ CommandOptions() : Options() {
// Keep default values of all options in one place: OptionParsingStarting
// ()
OptionParsingStarting(nullptr);
return llvm::makeArrayRef(g_thread_return_options);
}
- bool m_from_expression;
+ bool m_from_expression = false;
// Instance variables to hold the values for command options.
};
class CommandOptions : public OptionGroup {
public:
- CommandOptions()
- : OptionGroup(), m_show_help(false), m_language(eLanguageTypeUnknown) {}
+ CommandOptions() : OptionGroup() {}
~CommandOptions() override = default;
// Options table: Required for subclasses of Options.
- bool m_show_help;
- lldb::LanguageType m_language;
+ bool m_show_help = false;
+ lldb::LanguageType m_language = eLanguageTypeUnknown;
};
OptionGroupOptions m_option_group;
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(),
- m_level(lldb::eDescriptionLevelBrief) // Watchpoint List defaults to
- // brief descriptions
- {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- lldb::DescriptionLevel m_level;
+ lldb::DescriptionLevel m_level = lldb::eDescriptionLevelBrief;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_force(false) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
}
// Instance variables to hold the values for command options.
- bool m_force;
+ bool m_force = false;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_ignore_count(0) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- uint32_t m_ignore_count;
+ uint32_t m_ignore_count = 0;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_condition(), m_condition_passed(false) {}
+ CommandOptions() : Options(), m_condition() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
std::string m_condition;
- bool m_condition_passed;
+ bool m_condition_passed = false;
};
protected:
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(), m_use_commands(false), m_use_script_language(false),
- m_script_language(eScriptLanguageNone), m_use_one_liner(false),
- m_one_liner(), m_function_name() {}
+ CommandOptions() : Options(), m_one_liner(), m_function_name() {}
~CommandOptions() override = default;
// Instance variables to hold the values for command options.
- bool m_use_commands;
- bool m_use_script_language;
- lldb::ScriptLanguage m_script_language;
+ bool m_use_commands = false;
+ bool m_use_script_language = false;
+ lldb::ScriptLanguage m_script_language = eScriptLanguageNone;
// Instance variables to hold the values for one_liner options.
- bool m_use_one_liner;
+ bool m_use_one_liner = false;
std::string m_one_liner;
bool m_stop_on_error;
std::string m_function_name;
using namespace lldb;
using namespace lldb_private;
-AddressRange::AddressRange() : m_base_addr(), m_byte_size(0) {}
+AddressRange::AddressRange() : m_base_addr() {}
AddressRange::AddressRange(addr_t file_addr, addr_t byte_size,
const SectionList *section_list)
class ValueObjectListDelegate : public WindowDelegate {
public:
- ValueObjectListDelegate()
- : 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) {}
+ ValueObjectListDelegate() : m_rows() {}
ValueObjectListDelegate(ValueObjectList &valobj_list)
: m_rows(), m_selected_row(nullptr), m_selected_row_idx(0),
protected:
std::vector<Row> m_rows;
- Row *m_selected_row;
- uint32_t m_selected_row_idx;
- uint32_t m_first_visible_row;
- uint32_t m_num_rows;
+ Row *m_selected_row = nullptr;
+ 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_max_x;
- int m_max_y;
+ int m_max_x = 0;
+ int m_max_y = 0;
static Format FormatForChar(int c) {
switch (c) {
m_object_name.IsEmpty() ? "" : ")");
}
-Module::Module()
- : m_object_offset(0), m_file_has_changed(false),
- m_first_file_changed_log(false) {
+Module::Module() : m_file_has_changed(false), m_first_file_changed_log(false) {
std::lock_guard<std::recursive_mutex> guard(
GetAllocationModuleCollectionMutex());
GetModuleCollection().push_back(this);
return m_symlink_paths;
}
-ModuleList::ModuleList()
- : m_modules(), m_modules_mutex(), m_notifier(nullptr) {}
+ModuleList::ModuleList() : m_modules(), m_modules_mutex() {}
ModuleList::ModuleList(const ModuleList &rhs)
: m_modules(), m_modules_mutex(), m_notifier(nullptr) {
typedef void (*PluginTermCallback)();
struct PluginInfo {
- PluginInfo() : plugin_init_callback(nullptr), plugin_term_callback(nullptr) {}
+ PluginInfo() {}
llvm::sys::DynamicLibrary library;
- PluginInitCallback plugin_init_callback;
- PluginTermCallback plugin_term_callback;
+ PluginInitCallback plugin_init_callback = nullptr;
+ PluginTermCallback plugin_term_callback = nullptr;
};
typedef std::map<FileSpec, PluginInfo> PluginTerminateMap;
using namespace lldb;
using namespace lldb_private;
-Value::Value()
- : m_value(), m_compiler_type(), m_context(nullptr),
- m_value_type(ValueType::Scalar), m_context_type(ContextType::Invalid),
- m_data_buffer() {}
+Value::Value() : m_value(), m_compiler_type(), m_data_buffer() {}
Value::Value(const Scalar &scalar)
: m_value(scalar), m_compiler_type(), m_context(nullptr),
return valobj_sp;
}
-ValueObject::EvaluationPoint::EvaluationPoint()
- : m_mod_id(), m_exe_ctx_ref(), m_needs_update(true) {}
+ValueObject::EvaluationPoint::EvaluationPoint() : m_mod_id(), m_exe_ctx_ref() {}
ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope,
bool use_selected)
using namespace lldb;
using namespace lldb_private;
-TypeFormatImpl::TypeFormatImpl(const Flags &flags)
- : m_flags(flags), m_my_revision(0) {}
+TypeFormatImpl::TypeFormatImpl(const Flags &flags) : m_flags(flags) {}
TypeFormatImpl::~TypeFormatImpl() {}
using namespace lldb;
using namespace lldb_private;
-TypeSummaryOptions::TypeSummaryOptions()
- : m_lang(eLanguageTypeUnknown), m_capping(eTypeSummaryCapped) {}
+TypeSummaryOptions::TypeSummaryOptions() {}
lldb::LanguageType TypeSummaryOptions::GetLanguage() const { return m_lang; }
}
// DWARFExpression constructor
-DWARFExpression::DWARFExpression()
- : m_module_wp(), m_data(), m_dwarf_cu(nullptr),
- m_reg_kind(eRegisterKindDWARF) {}
+DWARFExpression::DWARFExpression() : m_module_wp(), m_data() {}
DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp,
const DataExtractor &data,
// FileAction member functions
-FileAction::FileAction()
- : m_action(eFileActionNone), m_fd(-1), m_arg(-1), m_file_spec() {}
+FileAction::FileAction() : m_file_spec() {}
void FileAction::Clear() {
m_action = eFileActionNone;
#endif
struct ShellInfo {
- ShellInfo()
- : process_reaped(false), pid(LLDB_INVALID_PROCESS_ID), signo(-1),
- status(-1) {}
+ ShellInfo() : process_reaped(false) {}
lldb_private::Predicate<bool> process_reaped;
- lldb::pid_t pid;
- int signo;
- int status;
+ lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
+ int signo = -1;
+ int status = -1;
};
static bool
using namespace lldb_private;
HostNativeThreadBase::HostNativeThreadBase()
- : m_thread(LLDB_INVALID_HOST_THREAD), m_result(0) {}
+ : m_thread(LLDB_INVALID_HOST_THREAD) {}
HostNativeThreadBase::HostNativeThreadBase(thread_t thread)
: m_thread(thread), m_result(0) {}
ProcessLaunchInfo::ProcessLaunchInfo()
: ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(0),
- m_file_actions(), m_pty(new PseudoTerminal), m_resume_count(0),
- m_monitor_callback(nullptr), m_monitor_callback_baton(nullptr),
- m_monitor_signals(false), m_listener_sp(), m_hijack_listener_sp(),
- m_scripted_process_class_name(), m_scripted_process_dictionary_sp() {}
+ m_file_actions(), m_pty(new PseudoTerminal), m_monitor_callback(nullptr),
+ m_listener_sp(), m_hijack_listener_sp(), m_scripted_process_class_name(),
+ m_scripted_process_dictionary_sp() {}
ProcessLaunchInfo::ProcessLaunchInfo(const FileSpec &stdin_file_spec,
const FileSpec &stdout_file_spec,
namespace lldb_private {
-ProcessRunLock::ProcessRunLock() : m_running(false) {
+ProcessRunLock::ProcessRunLock() {
int err = ::pthread_rwlock_init(&m_rwlock, nullptr);
(void)err;
}
using namespace lldb_private;
// PseudoTerminal constructor
-PseudoTerminal::PseudoTerminal()
- : m_primary_fd(invalid_fd), m_secondary_fd(invalid_fd) {}
+PseudoTerminal::PseudoTerminal() {}
// Destructor
//
// Default constructor
TerminalState::TerminalState()
- : m_tty(), m_tflags(-1),
+ : m_tty()
#if LLDB_ENABLE_TERMIOS
- m_termios_up(),
+ ,
+ m_termios_up()
#endif
- m_process_group(-1) {
+{
}
// Destructor
}
// Constructor
-TerminalStateSwitcher::TerminalStateSwitcher() : m_currentState(UINT32_MAX) {}
+TerminalStateSwitcher::TerminalStateSwitcher() {}
// Destructor
TerminalStateSwitcher::~TerminalStateSwitcher() {}
#pragma mark-- XMLDocument
-XMLDocument::XMLDocument() : m_document(nullptr) {}
+XMLDocument::XMLDocument() {}
XMLDocument::~XMLDocument() { Clear(); }
#pragma mark-- XMLNode
-XMLNode::XMLNode() : m_node(nullptr) {}
+XMLNode::XMLNode() {}
XMLNode::XMLNode(XMLNodeImpl node) : m_node(node) {}
class MacOSXDarwinThread {
public:
- MacOSXDarwinThread() : m_pool(nil) {
- m_pool = [[NSAutoreleasePool alloc] init];
- }
+ MacOSXDarwinThread() { m_pool = [[NSAutoreleasePool alloc] init]; }
~MacOSXDarwinThread() {
if (m_pool) {
}
protected:
- NSAutoreleasePool *m_pool;
+ NSAutoreleasePool *m_pool = nil;
private:
MacOSXDarwinThread(const MacOSXDarwinThread &) = delete;
ConnectionFileDescriptor::ConnectionFileDescriptor(bool child_processes_inherit)
: Connection(), m_pipe(), m_mutex(), m_shutting_down(false),
- m_waiting_for_accept(false),
+
m_child_processes_inherit(child_processes_inherit) {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION |
LIBLLDB_LOG_OBJECT));
using namespace lldb_private;
-SystemLifetimeManager::SystemLifetimeManager()
- : m_mutex(), m_initialized(false) {}
+SystemLifetimeManager::SystemLifetimeManager() : m_mutex() {}
SystemLifetimeManager::~SystemLifetimeManager() {
assert(!m_initialized &&
// only usefully complete in the file name part of it so it should be good
// enough.
OptionValueFileColonLine::OptionValueFileColonLine()
- : m_line_number(LLDB_INVALID_LINE_NUMBER),
- m_column_number(LLDB_INVALID_COLUMN_NUMBER),
- m_completion_mask(CommandCompletions::eSourceFileCompletion) {}
+
+{}
OptionValueFileColonLine::OptionValueFileColonLine(llvm::StringRef input)
: m_line_number(LLDB_INVALID_LINE_NUMBER),
using namespace lldb;
using namespace lldb_private;
-OptionValueFileSpec::OptionValueFileSpec(bool resolve)
- : m_completion_mask(CommandCompletions::eDiskFileCompletion),
- m_resolve(resolve) {}
+OptionValueFileSpec::OptionValueFileSpec(bool resolve) : m_resolve(resolve) {}
OptionValueFileSpec::OptionValueFileSpec(const FileSpec &value, bool resolve)
: m_current_value(value), m_default_value(value),
class KextImageInfo {
public:
- KextImageInfo()
- : m_name(), m_module_sp(), m_memory_module_sp(),
- m_load_process_stop_id(UINT32_MAX), m_uuid(),
- m_load_address(LLDB_INVALID_ADDRESS), m_size(0),
- m_kernel_image(false) {}
+ KextImageInfo() : m_name(), m_module_sp(), m_memory_module_sp(), m_uuid() {}
void Clear() {
m_load_address = LLDB_INVALID_ADDRESS;
std::string m_name;
lldb::ModuleSP m_module_sp;
lldb::ModuleSP m_memory_module_sp;
- uint32_t m_load_process_stop_id; // the stop-id when this module was added
- // to the Target
+ uint32_t m_load_process_stop_id =
+ UINT32_MAX; // the stop-id when this module was added
+ // to the Target
lldb_private::UUID
m_uuid; // UUID for this dylib if it has one, else all zeros
- lldb::addr_t m_load_address;
- uint64_t m_size;
- bool m_kernel_image; // true if this is the kernel, false if this is a kext
+ lldb::addr_t m_load_address = LLDB_INVALID_ADDRESS;
+ uint64_t m_size = 0;
+ bool m_kernel_image =
+ false; // true if this is the kernel, false if this is a kext
};
struct OSKextLoadedKextSummaryHeader {
- uint32_t version;
- uint32_t entry_size;
- uint32_t entry_count;
- lldb::addr_t image_infos_addr;
+ uint32_t version = 0;
+ uint32_t entry_size = 0;
+ uint32_t entry_count = 0;
+ lldb::addr_t image_infos_addr = LLDB_INVALID_ADDRESS;
OSKextLoadedKextSummaryHeader()
- : version(0), entry_size(0), entry_count(0),
- image_infos_addr(LLDB_INVALID_ADDRESS) {}
+
+ {}
uint32_t GetSize() {
switch (version) {
// the layout of this struct is not binary compatible, it is simply large
// enough to hold the information on both 32 and 64 bit platforms.
struct Rendezvous {
- uint64_t version;
- lldb::addr_t map_addr;
- lldb::addr_t brk;
- uint64_t state;
- lldb::addr_t ldbase;
-
- Rendezvous()
- : version(0), map_addr(LLDB_INVALID_ADDRESS), brk(LLDB_INVALID_ADDRESS),
- state(0), ldbase(0) {}
+ uint64_t version = 0;
+ lldb::addr_t map_addr = LLDB_INVALID_ADDRESS;
+ lldb::addr_t brk = LLDB_INVALID_ADDRESS;
+ uint64_t state = 0;
+ lldb::addr_t ldbase = 0;
+
+ Rendezvous() {}
};
public:
class Segment {
public:
- Segment()
- : name(), vmaddr(LLDB_INVALID_ADDRESS), vmsize(0), fileoff(0),
- filesize(0), maxprot(0), initprot(0), nsects(0), flags(0) {}
+ Segment() : name() {}
lldb_private::ConstString name;
- lldb::addr_t vmaddr;
- lldb::addr_t vmsize;
- lldb::addr_t fileoff;
- lldb::addr_t filesize;
- uint32_t maxprot;
- uint32_t initprot;
- uint32_t nsects;
- uint32_t flags;
+ lldb::addr_t vmaddr = LLDB_INVALID_ADDRESS;
+ lldb::addr_t vmsize = 0;
+ lldb::addr_t fileoff = 0;
+ lldb::addr_t filesize = 0;
+ uint32_t maxprot = 0;
+ uint32_t initprot = 0;
+ uint32_t nsects = 0;
+ uint32_t flags = 0;
bool operator==(const Segment &rhs) const {
return name == rhs.name && vmaddr == rhs.vmaddr && vmsize == rhs.vmsize;
lldb_private::FileSpec *lc_id_dylinker);
struct DYLDAllImageInfos {
- uint32_t version;
- uint32_t dylib_info_count; // Version >= 1
- lldb::addr_t dylib_info_addr; // Version >= 1
- lldb::addr_t notification; // Version >= 1
- bool processDetachedFromSharedRegion; // Version >= 1
- bool libSystemInitialized; // Version >= 2
- lldb::addr_t dyldImageLoadAddress; // Version >= 2
+ uint32_t version = 0;
+ uint32_t dylib_info_count = 0; // Version >= 1
+ lldb::addr_t dylib_info_addr = LLDB_INVALID_ADDRESS; // Version >= 1
+ lldb::addr_t notification = LLDB_INVALID_ADDRESS; // Version >= 1
+ bool processDetachedFromSharedRegion = false; // Version >= 1
+ bool libSystemInitialized = false; // Version >= 2
+ lldb::addr_t dyldImageLoadAddress = LLDB_INVALID_ADDRESS; // Version >= 2
DYLDAllImageInfos()
- : version(0), dylib_info_count(0),
- dylib_info_addr(LLDB_INVALID_ADDRESS),
- notification(LLDB_INVALID_ADDRESS),
- processDetachedFromSharedRegion(false), libSystemInitialized(false),
- dyldImageLoadAddress(LLDB_INVALID_ADDRESS) {}
+
+ {}
void Clear() {
version = 0;
// the layout of this struct is not binary compatible, it is simply large
// enough to hold the information on both 32 and 64 bit platforms.
struct Rendezvous {
- uint64_t version;
- lldb::addr_t map_addr;
- lldb::addr_t brk;
- uint64_t state;
- lldb::addr_t ldbase;
+ uint64_t version = 0;
+ lldb::addr_t map_addr = 0;
+ lldb::addr_t brk = 0;
+ uint64_t state = 0;
+ lldb::addr_t ldbase = 0;
- Rendezvous() : version(0), map_addr(0), brk(0), state(0), ldbase(0) {}
+ Rendezvous() {}
};
public:
void ForgetSource(clang::ASTContext *dst_ctx, clang::ASTContext *src_ctx);
struct DeclOrigin {
- DeclOrigin() : ctx(nullptr), decl(nullptr) {}
+ DeclOrigin() {}
DeclOrigin(clang::ASTContext *_ctx, clang::Decl *_decl)
: ctx(_ctx), decl(_decl) {
bool Valid() const { return (ctx != nullptr || decl != nullptr); }
- clang::ASTContext *ctx;
- clang::Decl *decl;
+ clang::ASTContext *ctx = nullptr;
+ clang::Decl *decl = nullptr;
};
/// Listener interface used by the ASTImporterDelegate to inform other code
lldb::SymbolType symbol_type);
struct TargetInfo {
- lldb::ByteOrder byte_order;
- size_t address_byte_size;
+ lldb::ByteOrder byte_order = lldb::eByteOrderInvalid;
+ size_t address_byte_size = 0;
- TargetInfo() : byte_order(lldb::eByteOrderInvalid), address_byte_size(0) {}
+ TargetInfo() {}
bool IsValid() {
return (byte_order != lldb::eByteOrderInvalid && address_byte_size != 0);
/// The following values contain layout information for the materialized
/// struct, but are not specific to a single materialization
struct StructVars {
- StructVars()
- : m_struct_alignment(0), m_struct_size(0), m_struct_laid_out(false),
- m_result_name(), m_object_pointer_type(nullptr, nullptr) {}
-
- lldb::offset_t
- m_struct_alignment; ///< The alignment of the struct in bytes.
- size_t m_struct_size; ///< The size of the struct in bytes.
- bool m_struct_laid_out; ///< True if the struct has been laid out and the
- ///layout is valid (that is, no new fields have been
- ///added since).
+ StructVars() : m_result_name(), m_object_pointer_type(nullptr, nullptr) {}
+
+ lldb::offset_t m_struct_alignment =
+ 0; ///< The alignment of the struct in bytes.
+ size_t m_struct_size = 0; ///< The size of the struct in bytes.
+ bool m_struct_laid_out =
+ false; ///< True if the struct has been laid out and the
+ /// layout is valid (that is, no new fields have been
+ /// added since).
ConstString
m_result_name; ///< The name of the result variable ($1, for example)
TypeFromUser m_object_pointer_type; ///< The type of the "this" variable, if
/// The following values should not live beyond parsing
class ParserVars {
public:
- ParserVars()
- : m_named_decl(nullptr), m_llvm_value(nullptr),
- m_lldb_value(), m_lldb_var(), m_lldb_sym(nullptr) {}
-
- const clang::NamedDecl
- *m_named_decl; ///< The Decl corresponding to this variable
- llvm::Value *m_llvm_value; ///< The IR value corresponding to this variable;
- ///usually a GlobalValue
+ ParserVars() : m_lldb_value(), m_lldb_var() {}
+
+ const clang::NamedDecl *m_named_decl =
+ nullptr; ///< The Decl corresponding to this variable
+ llvm::Value *m_llvm_value =
+ nullptr; ///< The IR value corresponding to this variable;
+ /// usually a GlobalValue
lldb_private::Value
m_lldb_value; ///< The value found in LLDB for this variable
lldb::VariableSP m_lldb_var; ///< The original variable for this variable
- const lldb_private::Symbol *m_lldb_sym; ///< The original symbol for this
- ///variable, if it was a symbol
+ const lldb_private::Symbol *m_lldb_sym =
+ nullptr; ///< The original symbol for this
+ /// variable, if it was a symbol
};
private:
/// The following values are valid if the variable is used by JIT code
struct JITVars {
- JITVars() : m_alignment(0), m_size(0), m_offset(0) {}
+ JITVars() {}
- lldb::offset_t
- m_alignment; ///< The required alignment of the variable, in bytes
- size_t m_size; ///< The space required for the variable, in bytes
- lldb::offset_t
- m_offset; ///< The offset of the variable in the struct, in bytes
+ lldb::offset_t m_alignment =
+ 0; ///< The required alignment of the variable, in bytes
+ size_t m_size = 0; ///< The space required for the variable, in bytes
+ lldb::offset_t m_offset =
+ 0; ///< The offset of the variable in the struct, in bytes
};
private:
// ITSession - Keep track of the IT Block progression.
class ITSession {
public:
- ITSession() : ITCounter(0), ITState(0) {}
+ ITSession() {}
~ITSession() {}
// InitIT - Initializes ITCounter/ITState.
uint32_t GetCond();
private:
- uint32_t ITCounter; // Possible values: 0, 1, 2, 3, 4.
- uint32_t ITState; // A2.5.2 Consists of IT[7:5] and IT[4:0] initially.
+ uint32_t ITCounter = 0; // Possible values: 0, 1, 2, 3, 4.
+ uint32_t ITState = 0; // A2.5.2 Consists of IT[7:5] and IT[4:0] initially.
};
class EmulateInstructionARM : public EmulateInstruction {
using namespace lldb;
using namespace lldb_private;
-EmulationStateARM::EmulationStateARM() : m_gpr(), m_vfp_regs(), m_memory() {
+EmulationStateARM::EmulationStateARM() : m_vfp_regs(), m_memory() {
ClearPseudoRegisters();
}
const lldb_private::RegisterValue ®_value);
private:
- uint32_t m_gpr[17];
+ uint32_t m_gpr[17] = {0};
struct _sd_regs {
uint32_t s_regs[32]; // sregs 0 - 31 & dregs 0 - 15
class MethodName {
public:
MethodName()
- : m_full(), m_basename(), m_context(), m_arguments(), m_qualifiers(),
- m_parsed(false), m_parse_error(false) {}
+ : m_full(), m_basename(), m_context(), m_arguments(), m_qualifiers() {}
MethodName(ConstString s)
: m_full(s), m_basename(), m_context(), m_arguments(), m_qualifiers(),
llvm::StringRef m_context; // Decl context: "lldb::SBTarget"
llvm::StringRef m_arguments; // Arguments: "(unsigned int)"
llvm::StringRef m_qualifiers; // Qualifiers: "const"
- bool m_parsed;
- bool m_parse_error;
+ bool m_parsed = false;
+ bool m_parse_error = false;
};
CPlusPlusLanguage() = default;
m_process = nullptr;
}
- InlinedIndexes()
- : m_indexes(0), m_count(0), m_ptr_size(0), m_process(nullptr) {}
+ InlinedIndexes() {}
private:
- uint64_t m_indexes;
- size_t m_count;
- uint32_t m_ptr_size;
- Process *m_process;
+ uint64_t m_indexes = 0;
+ size_t m_count = 0;
+ uint32_t m_ptr_size = 0;
+ Process *m_process = nullptr;
// cfr. Foundation for the details of this code
size_t _lengthForInlinePayload(uint32_t ptr_size) {
m_count = 0;
}
- OutsourcedIndexes() : m_indexes(nullptr), m_count(0) {}
+ OutsourcedIndexes() {}
- ValueObject *m_indexes;
- size_t m_count;
+ ValueObject *m_indexes = nullptr;
+ size_t m_count = 0;
};
union {
m_outsourced.Clear();
}
- Impl() : m_mode(Mode::Invalid) {}
+ Impl() {}
- Mode m_mode;
+ Mode m_mode = Mode::Invalid;
} m_impl;
uint32_t m_ptr_size;
public:
enum Type { eTypeUnspecified, eTypeClassMethod, eTypeInstanceMethod };
- MethodName()
- : m_full(), m_class(), m_category(), m_selector(),
- m_type(eTypeUnspecified), m_category_is_valid(false) {}
+ MethodName() : m_full(), m_class(), m_category(), m_selector() {}
MethodName(const char *name, bool strict)
: m_full(), m_class(), m_category(), m_selector(),
m_class_category; // Class with category: "NSString(my_additions)"
ConstString m_category; // Category: "my_additions"
ConstString m_selector; // Selector: "myStringWithCString:"
- Type m_type;
- bool m_category_is_valid;
+ Type m_type = eTypeUnspecified;
+ bool m_category_is_valid = false;
};
ObjCLanguage() = default;
return 0;
}
-ClassDescriptorV2::iVarsStorage::iVarsStorage()
- : m_filled(false), m_ivars(), m_mutex() {}
+ClassDescriptorV2::iVarsStorage::iVarsStorage() : m_ivars(), m_mutex() {}
size_t ClassDescriptorV2::iVarsStorage::size() { return m_ivars.size(); }
static const uint32_t RW_REALIZED = (1 << 31);
struct objc_class_t {
- ObjCLanguageRuntime::ObjCISA m_isa; // The class's metaclass.
- ObjCLanguageRuntime::ObjCISA m_superclass;
- lldb::addr_t m_cache_ptr;
- lldb::addr_t m_vtable_ptr;
- lldb::addr_t m_data_ptr;
- uint8_t m_flags;
+ ObjCLanguageRuntime::ObjCISA m_isa = 0; // The class's metaclass.
+ ObjCLanguageRuntime::ObjCISA m_superclass = 0;
+ lldb::addr_t m_cache_ptr = 0;
+ lldb::addr_t m_vtable_ptr = 0;
+ lldb::addr_t m_data_ptr = 0;
+ uint8_t m_flags = 0;
- objc_class_t()
- : m_isa(0), m_superclass(0), m_cache_ptr(0), m_vtable_ptr(0),
- m_data_ptr(0), m_flags(0) {}
+ objc_class_t() {}
void Clear() {
m_isa = 0;
void fill(AppleObjCRuntimeV2 &runtime, ClassDescriptorV2 &descriptor);
private:
- bool m_filled;
+ bool m_filled = false;
std::vector<iVarDescriptor> m_ivars;
std::recursive_mutex m_mutex;
};
class HashTableSignature {
public:
- HashTableSignature()
- : m_count(0), m_num_buckets(0), m_buckets_ptr(LLDB_INVALID_ADDRESS) {}
+ HashTableSignature() {}
bool NeedsUpdate(uint32_t count, uint32_t num_buckets,
lldb::addr_t buckets_ptr) {
}
protected:
- uint32_t m_count;
- uint32_t m_num_buckets;
- lldb::addr_t m_buckets_ptr;
+ uint32_t m_count = 0;
+ uint32_t m_num_buckets = 0;
+ lldb::addr_t m_buckets_ptr = LLDB_INVALID_ADDRESS;
};
lldb::addr_t GetISAHashTablePointer();
class RemoteNXMapTable {
public:
- RemoteNXMapTable()
- : m_count(0), m_num_buckets_minus_one(0),
- m_buckets_ptr(LLDB_INVALID_ADDRESS), m_process(nullptr),
- m_end_iterator(*this, -1), m_load_addr(LLDB_INVALID_ADDRESS),
- m_map_pair_size(0), m_invalid_key(0) {}
+ RemoteNXMapTable() : m_end_iterator(*this, -1) {}
void Dump() {
printf("RemoteNXMapTable.m_load_addr = 0x%" PRIx64 "\n", m_load_addr);
private:
// contents of _NXMapTable struct
- uint32_t m_count;
- uint32_t m_num_buckets_minus_one;
- lldb::addr_t m_buckets_ptr;
- lldb_private::Process *m_process;
+ uint32_t m_count = 0;
+ uint32_t m_num_buckets_minus_one = 0;
+ lldb::addr_t m_buckets_ptr = LLDB_INVALID_ADDRESS;
+ lldb_private::Process *m_process = nullptr;
const_iterator m_end_iterator;
- lldb::addr_t m_load_addr;
- size_t m_map_pair_size;
- lldb::addr_t m_invalid_key;
+ lldb::addr_t m_load_addr = LLDB_INVALID_ADDRESS;
+ size_t m_map_pair_size = 0;
+ lldb::addr_t m_invalid_key = 0;
};
-AppleObjCRuntimeV2::HashTableSignature::HashTableSignature()
- : m_count(0), m_num_buckets(0), m_buckets_ptr(0) {}
+AppleObjCRuntimeV2::HashTableSignature::HashTableSignature() {}
void AppleObjCRuntimeV2::HashTableSignature::UpdateSignature(
const RemoteNXMapTable &hash_table) {
void UpdateSignature(const RemoteNXMapTable &hash_table);
protected:
- uint32_t m_count;
- uint32_t m_num_buckets;
- lldb::addr_t m_buckets_ptr;
+ uint32_t m_count = 0;
+ uint32_t m_num_buckets = 0;
+ lldb::addr_t m_buckets_ptr = 0;
};
class NonPointerISACache {
class VTableRegion {
public:
- VTableRegion()
- : m_valid(false), m_owner(nullptr),
- m_header_addr(LLDB_INVALID_ADDRESS), m_code_start_addr(0),
- m_code_end_addr(0), m_next_region(0) {}
+ VTableRegion() {}
VTableRegion(AppleObjCVTables *owner, lldb::addr_t header_addr);
void Dump(Stream &s);
- bool m_valid;
- AppleObjCVTables *m_owner;
- lldb::addr_t m_header_addr;
- lldb::addr_t m_code_start_addr;
- lldb::addr_t m_code_end_addr;
+ bool m_valid = false;
+ AppleObjCVTables *m_owner = nullptr;
+ lldb::addr_t m_header_addr = LLDB_INVALID_ADDRESS;
+ lldb::addr_t m_code_start_addr = 0;
+ lldb::addr_t m_code_end_addr = 0;
std::vector<VTableDescriptor> m_descriptors;
- lldb::addr_t m_next_region;
+ lldb::addr_t m_next_region = 0;
};
public:
// "{CGRect=\"origin\"{CGPoint=\"x\"d\"y\"d}\"size\"{CGSize=\"width\"d\"height\"d}}"
AppleObjCTypeEncodingParser::StructElement::StructElement()
- : name(""), type(clang::QualType()), bitfield(0) {}
+ : name(""), type(clang::QualType()) {}
AppleObjCTypeEncodingParser::StructElement
AppleObjCTypeEncodingParser::ReadStructElement(TypeSystemClang &ast_ctx,
struct StructElement {
std::string name;
clang::QualType type;
- uint32_t bitfield;
+ uint32_t bitfield = 0;
StructElement();
~StructElement() = default;
// implementations of the runtime, and more might come
class ClassDescriptor {
public:
- ClassDescriptor()
- : m_is_kvo(eLazyBoolCalculate), m_is_cf(eLazyBoolCalculate),
- m_type_wp() {}
+ ClassDescriptor() : m_type_wp() {}
virtual ~ClassDescriptor() = default;
bool check_version_specific = false) const;
private:
- LazyBool m_is_kvo;
- LazyBool m_is_cf;
+ LazyBool m_is_kvo = eLazyBoolCalculate;
+ LazyBool m_is_cf = eLazyBoolCalculate;
lldb::TypeWP m_type_wp;
};
template <typename type_t> class empirical_type {
public:
// Ctor. Contents is invalid when constructed.
- empirical_type() : valid(false) {}
+ empirical_type() {}
// Return true and copy contents to out if valid, else return false.
bool get(type_t &out) const {
}
protected:
- bool valid;
+ bool valid = false;
type_t data;
};
class CommandOptions : public Options {
public:
- CommandOptions()
- : Options(),
- m_kernel_types(RSReduceBreakpointResolver::eKernelTypeAll) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
return true;
}
- int m_kernel_types;
+ int m_kernel_types = RSReduceBreakpointResolver::eKernelTypeAll;
llvm::StringRef m_reduce_name;
RSCoordinate m_coord;
bool m_have_coord;
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), m_id(0) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
return llvm::makeArrayRef(g_renderscript_runtime_alloc_list_options);
}
- uint32_t m_id;
+ uint32_t m_id = 0;
};
bool DoExecute(Args &command, CommandReturnObject &result) override {
typedef std::shared_ptr<RSScriptGroupDescriptor> RSScriptGroupDescriptorSP;
struct RSCoordinate {
- uint32_t x, y, z;
+ uint32_t x = 0, y = 0, z = 0;
- RSCoordinate() : x(), y(), z(){};
+ RSCoordinate(){};
bool operator==(const lldb_renderscript::RSCoordinate &rhs) {
return x == rhs.x && y == rhs.y && z == rhs.z;
LLDB_PLUGIN_DEFINE(ObjectContainerBSDArchive)
-ObjectContainerBSDArchive::Object::Object()
- : ar_name(), modification_time(0), uid(0), gid(0), mode(0), size(0),
- file_offset(0), file_size(0) {}
+ObjectContainerBSDArchive::Object::Object() : ar_name() {}
void ObjectContainerBSDArchive::Object::Clear() {
ar_name.Clear();
lldb_private::ConstString ar_name;
/// Object modification time in the archive.
- uint32_t modification_time;
+ uint32_t modification_time = 0;
/// Object user id in the archive.
- uint16_t uid;
+ uint16_t uid = 0;
/// Object group id in the archive.
- uint16_t gid;
+ uint16_t gid = 0;
/// Object octal file permissions in the archive.
- uint16_t mode;
+ uint16_t mode = 0;
/// Object size in bytes in the archive.
- uint32_t size;
+ uint32_t size = 0;
/// File offset in bytes from the beginning of the file of the object data.
- lldb::offset_t file_offset;
+ lldb::offset_t file_offset = 0;
/// Length of the object data.
- lldb::offset_t file_size;
+ lldb::offset_t file_size = 0;
};
class Archive {
#include "ELFHeader.h"
struct ELFNote {
- elf::elf_word n_namesz;
- elf::elf_word n_descsz;
- elf::elf_word n_type;
+ elf::elf_word n_namesz = 0;
+ elf::elf_word n_descsz = 0;
+ elf::elf_word n_type = 0;
std::string n_name;
- ELFNote() : n_namesz(0), n_descsz(0), n_type(0) {}
+ ELFNote() {}
/// Parse an ELFNote entry from the given DataExtractor starting at position
/// \p offset.
PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice()
: PlatformDarwin(false), // This is a remote platform
m_sdk_directory_infos(), m_device_support_directory(),
- m_device_support_directory_for_os_version(), m_build_update(),
- m_last_module_sdk_idx(UINT32_MAX),
- m_connected_module_sdk_idx(UINT32_MAX) {}
+ m_device_support_directory_for_os_version(), m_build_update() {}
/// Destructor.
///
std::string m_device_support_directory;
std::string m_device_support_directory_for_os_version;
std::string m_build_update;
- uint32_t m_last_module_sdk_idx;
- uint32_t m_connected_module_sdk_idx;
+ uint32_t m_last_module_sdk_idx = UINT32_MAX;
+ uint32_t m_connected_module_sdk_idx = UINT32_MAX;
bool UpdateSDKDirectoryInfosIfNeeded();
ProductFamilyID GetProductFamilyID();
private:
- id m_dev;
+ id m_dev = nullptr;
llvm::Optional<ModelIdentifier> m_model_identifier;
};
bool IsAvailable();
private:
- id m_dev;
+ id m_dev = nullptr;
llvm::Optional<OSVersion> m_os_version;
};
Process Spawn(lldb_private::ProcessLaunchInfo &launch_info);
private:
- id m_dev;
+ id m_dev = nullptr;
llvm::Optional<DeviceType> m_dev_type;
llvm::Optional<DeviceRuntime> m_dev_runtime;
CoreSimulatorSupport::Process::Process(lldb::pid_t p, Status error)
: m_pid(p), m_error(error) {}
-CoreSimulatorSupport::DeviceType::DeviceType()
- : m_dev(nil), m_model_identifier() {}
+CoreSimulatorSupport::DeviceType::DeviceType() : m_model_identifier() {}
CoreSimulatorSupport::DeviceType::DeviceType(id d)
: m_dev(d), m_model_identifier() {}
return ProductFamilyID([m_dev productFamilyID]);
}
-CoreSimulatorSupport::DeviceRuntime::DeviceRuntime()
- : m_dev(nil), m_os_version() {}
+CoreSimulatorSupport::DeviceRuntime::DeviceRuntime() : m_os_version() {}
CoreSimulatorSupport::DeviceRuntime::DeviceRuntime(id d)
: m_dev(d), m_os_version() {}
return [m_dev available];
}
-CoreSimulatorSupport::Device::Device()
- : m_dev(nil), m_dev_type(), m_dev_runtime() {}
+CoreSimulatorSupport::Device::Device() : m_dev_type(), m_dev_runtime() {}
CoreSimulatorSupport::Device::Device(id d)
: m_dev(d), m_dev_type(), m_dev_runtime() {}
// GDBRemoteCommunicationClient constructor
GDBRemoteCommunicationClient::GDBRemoteCommunicationClient()
: GDBRemoteClientBase("gdb-remote.client", "gdb-remote.client.rx_packet"),
- m_supports_not_sending_acks(eLazyBoolCalculate),
- m_supports_thread_suffix(eLazyBoolCalculate),
- m_supports_threads_in_stop_reply(eLazyBoolCalculate),
- m_supports_vCont_all(eLazyBoolCalculate),
- m_supports_vCont_any(eLazyBoolCalculate),
- m_supports_vCont_c(eLazyBoolCalculate),
- m_supports_vCont_C(eLazyBoolCalculate),
- m_supports_vCont_s(eLazyBoolCalculate),
- m_supports_vCont_S(eLazyBoolCalculate),
- m_qHostInfo_is_valid(eLazyBoolCalculate),
- m_curr_pid_is_valid(eLazyBoolCalculate),
- m_qProcessInfo_is_valid(eLazyBoolCalculate),
- m_qGDBServerVersion_is_valid(eLazyBoolCalculate),
- m_supports_alloc_dealloc_memory(eLazyBoolCalculate),
- m_supports_memory_region_info(eLazyBoolCalculate),
- m_supports_watchpoint_support_info(eLazyBoolCalculate),
- m_supports_detach_stay_stopped(eLazyBoolCalculate),
- m_watchpoints_trigger_after_instruction(eLazyBoolCalculate),
- m_attach_or_wait_reply(eLazyBoolCalculate),
- m_prepare_for_reg_writing_reply(eLazyBoolCalculate),
- m_supports_p(eLazyBoolCalculate), m_supports_x(eLazyBoolCalculate),
- m_avoid_g_packets(eLazyBoolCalculate),
- m_supports_QSaveRegisterState(eLazyBoolCalculate),
- m_supports_qXfer_auxv_read(eLazyBoolCalculate),
- m_supports_qXfer_libraries_read(eLazyBoolCalculate),
- m_supports_qXfer_libraries_svr4_read(eLazyBoolCalculate),
- m_supports_qXfer_features_read(eLazyBoolCalculate),
- m_supports_qXfer_memory_map_read(eLazyBoolCalculate),
- m_supports_augmented_libraries_svr4_read(eLazyBoolCalculate),
- m_supports_jThreadExtendedInfo(eLazyBoolCalculate),
- m_supports_jLoadedDynamicLibrariesInfos(eLazyBoolCalculate),
- m_supports_jGetSharedCacheInfo(eLazyBoolCalculate),
- m_supports_QPassSignals(eLazyBoolCalculate),
- m_supports_error_string_reply(eLazyBoolCalculate),
- m_supports_multiprocess(eLazyBoolCalculate),
+
m_supports_qProcessInfoPID(true), m_supports_qfProcessInfo(true),
m_supports_qUserName(true), m_supports_qGroupName(true),
m_supports_qThreadStopInfo(true), m_supports_z0(true),
m_supports_QEnvironmentHexEncoded(true), m_supports_qSymbol(true),
m_qSymbol_requests_done(false), m_supports_qModuleInfo(true),
m_supports_jThreadsInfo(true), m_supports_jModulesInfo(true),
- m_curr_pid(LLDB_INVALID_PROCESS_ID), m_curr_tid(LLDB_INVALID_THREAD_ID),
- m_curr_tid_run(LLDB_INVALID_THREAD_ID),
- m_num_supported_hardware_watchpoints(0), m_addressing_bits(0),
+
m_host_arch(), m_process_arch(), m_os_build(), m_os_kernel(),
- m_hostname(), m_gdb_server_name(), m_gdb_server_version(UINT32_MAX),
- m_default_packet_timeout(0), m_max_packet_size(0),
- m_qSupported_response(), m_supported_async_json_packets_is_valid(false),
- m_supported_async_json_packets_sp(), m_qXfer_memory_map(),
- m_qXfer_memory_map_loaded(false) {}
+ m_hostname(), m_gdb_server_name(), m_default_packet_timeout(0),
+ m_qSupported_response(), m_supported_async_json_packets_sp(),
+ m_qXfer_memory_map() {}
// Destructor
GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient() {
SendTraceGetBinaryData(const TraceGetBinaryDataRequest &request);
protected:
- LazyBool m_supports_not_sending_acks;
- LazyBool m_supports_thread_suffix;
- LazyBool m_supports_threads_in_stop_reply;
- LazyBool m_supports_vCont_all;
- LazyBool m_supports_vCont_any;
- LazyBool m_supports_vCont_c;
- LazyBool m_supports_vCont_C;
- LazyBool m_supports_vCont_s;
- LazyBool m_supports_vCont_S;
- LazyBool m_qHostInfo_is_valid;
- LazyBool m_curr_pid_is_valid;
- LazyBool m_qProcessInfo_is_valid;
- LazyBool m_qGDBServerVersion_is_valid;
- LazyBool m_supports_alloc_dealloc_memory;
- LazyBool m_supports_memory_region_info;
- LazyBool m_supports_watchpoint_support_info;
- LazyBool m_supports_detach_stay_stopped;
- LazyBool m_watchpoints_trigger_after_instruction;
- LazyBool m_attach_or_wait_reply;
- LazyBool m_prepare_for_reg_writing_reply;
- LazyBool m_supports_p;
- LazyBool m_supports_x;
- LazyBool m_avoid_g_packets;
- LazyBool m_supports_QSaveRegisterState;
- LazyBool m_supports_qXfer_auxv_read;
- LazyBool m_supports_qXfer_libraries_read;
- LazyBool m_supports_qXfer_libraries_svr4_read;
- LazyBool m_supports_qXfer_features_read;
- LazyBool m_supports_qXfer_memory_map_read;
- LazyBool m_supports_augmented_libraries_svr4_read;
- LazyBool m_supports_jThreadExtendedInfo;
- LazyBool m_supports_jLoadedDynamicLibrariesInfos;
- LazyBool m_supports_jGetSharedCacheInfo;
- LazyBool m_supports_QPassSignals;
- LazyBool m_supports_error_string_reply;
- LazyBool m_supports_multiprocess;
+ LazyBool m_supports_not_sending_acks = eLazyBoolCalculate;
+ LazyBool m_supports_thread_suffix = eLazyBoolCalculate;
+ LazyBool m_supports_threads_in_stop_reply = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_all = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_any = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_c = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_C = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_s = eLazyBoolCalculate;
+ LazyBool m_supports_vCont_S = eLazyBoolCalculate;
+ LazyBool m_qHostInfo_is_valid = eLazyBoolCalculate;
+ LazyBool m_curr_pid_is_valid = eLazyBoolCalculate;
+ LazyBool m_qProcessInfo_is_valid = eLazyBoolCalculate;
+ LazyBool m_qGDBServerVersion_is_valid = eLazyBoolCalculate;
+ LazyBool m_supports_alloc_dealloc_memory = eLazyBoolCalculate;
+ LazyBool m_supports_memory_region_info = eLazyBoolCalculate;
+ LazyBool m_supports_watchpoint_support_info = eLazyBoolCalculate;
+ LazyBool m_supports_detach_stay_stopped = eLazyBoolCalculate;
+ LazyBool m_watchpoints_trigger_after_instruction = eLazyBoolCalculate;
+ LazyBool m_attach_or_wait_reply = eLazyBoolCalculate;
+ LazyBool m_prepare_for_reg_writing_reply = eLazyBoolCalculate;
+ LazyBool m_supports_p = eLazyBoolCalculate;
+ LazyBool m_supports_x = eLazyBoolCalculate;
+ LazyBool m_avoid_g_packets = eLazyBoolCalculate;
+ LazyBool m_supports_QSaveRegisterState = eLazyBoolCalculate;
+ LazyBool m_supports_qXfer_auxv_read = eLazyBoolCalculate;
+ LazyBool m_supports_qXfer_libraries_read = eLazyBoolCalculate;
+ LazyBool m_supports_qXfer_libraries_svr4_read = eLazyBoolCalculate;
+ LazyBool m_supports_qXfer_features_read = eLazyBoolCalculate;
+ LazyBool m_supports_qXfer_memory_map_read = eLazyBoolCalculate;
+ LazyBool m_supports_augmented_libraries_svr4_read = eLazyBoolCalculate;
+ LazyBool m_supports_jThreadExtendedInfo = eLazyBoolCalculate;
+ LazyBool m_supports_jLoadedDynamicLibrariesInfos = eLazyBoolCalculate;
+ LazyBool m_supports_jGetSharedCacheInfo = eLazyBoolCalculate;
+ LazyBool m_supports_QPassSignals = eLazyBoolCalculate;
+ LazyBool m_supports_error_string_reply = eLazyBoolCalculate;
+ LazyBool m_supports_multiprocess = eLazyBoolCalculate;
bool m_supports_qProcessInfoPID : 1, m_supports_qfProcessInfo : 1,
m_supports_qUserName : 1, m_supports_qGroupName : 1,
m_supports_qModuleInfo : 1, m_supports_jThreadsInfo : 1,
m_supports_jModulesInfo : 1;
- lldb::pid_t m_curr_pid;
- lldb::tid_t m_curr_tid; // Current gdb remote protocol thread index for all
- // other operations
- lldb::tid_t m_curr_tid_run; // Current gdb remote protocol thread index for
+ lldb::pid_t m_curr_pid = LLDB_INVALID_PROCESS_ID;
+ lldb::tid_t m_curr_tid =
+ LLDB_INVALID_THREAD_ID; // Current gdb remote protocol thread index for
+ // all other operations
+ lldb::tid_t m_curr_tid_run =
+ LLDB_INVALID_THREAD_ID; // Current gdb remote protocol thread index for
// continue, step, etc
- uint32_t m_num_supported_hardware_watchpoints;
- uint32_t m_addressing_bits;
+ uint32_t m_num_supported_hardware_watchpoints = 0;
+ uint32_t m_addressing_bits = 0;
ArchSpec m_host_arch;
ArchSpec m_process_arch;
std::string m_hostname;
std::string m_gdb_server_name; // from reply to qGDBServerVersion, empty if
// qGDBServerVersion is not supported
- uint32_t m_gdb_server_version; // from reply to qGDBServerVersion, zero if
- // qGDBServerVersion is not supported
+ uint32_t m_gdb_server_version =
+ UINT32_MAX; // from reply to qGDBServerVersion, zero if
+ // qGDBServerVersion is not supported
std::chrono::seconds m_default_packet_timeout;
- uint64_t m_max_packet_size; // as returned by qSupported
+ uint64_t m_max_packet_size = 0; // as returned by qSupported
std::string m_qSupported_response; // the complete response to qSupported
- bool m_supported_async_json_packets_is_valid;
+ bool m_supported_async_json_packets_is_valid = false;
lldb_private::StructuredData::ObjectSP m_supported_async_json_packets_sp;
std::vector<MemoryRegionInfo> m_qXfer_memory_map;
- bool m_qXfer_memory_map_loaded;
+ bool m_qXfer_memory_map_loaded = false;
bool GetCurrentProcessInfo(bool allow_lazy_pid = true);
using namespace lldb_private::process_gdb_remote;
GDBRemoteCommunicationHistory::GDBRemoteCommunicationHistory(uint32_t size)
- : m_packets(), m_curr_idx(0), m_total_packet_count(0),
- m_dumped_to_log(false) {
+ : m_packets() {
if (size)
m_packets.resize(size);
}
}
std::vector<GDBRemotePacket> m_packets;
- uint32_t m_curr_idx;
- uint32_t m_total_packet_count;
- mutable bool m_dumped_to_log;
+ uint32_t m_curr_idx = 0;
+ uint32_t m_total_packet_count = 0;
+ mutable bool m_dumped_to_log = false;
repro::PacketRecorder *m_recorder = nullptr;
};
m_async_broadcaster(nullptr, "lldb.gdb-replay.async-broadcaster"),
m_async_listener_sp(
Listener::MakeListener("lldb.gdb-replay.async-listener")),
- m_async_thread_state_mutex(), m_skip_acks(false) {
+ m_async_thread_state_mutex() {
m_async_broadcaster.SetEventName(eBroadcastBitAsyncContinue,
"async thread continue");
m_async_broadcaster.SetEventName(eBroadcastBitAsyncThreadShouldExit,
HostThread m_async_thread;
std::recursive_mutex m_async_thread_state_mutex;
- bool m_skip_acks;
+ bool m_skip_acks = false;
private:
GDBRemoteCommunicationReplayServer(
class PythonObject {
public:
- PythonObject() : m_py_obj(nullptr) {}
+ PythonObject() {}
PythonObject(PyRefType type, PyObject *py_obj) {
m_py_obj = py_obj;
}
protected:
- PyObject *m_py_obj;
+ PyObject *m_py_obj = nullptr;
};
// save off initial state at the beginning, and restore it at the end
struct InitializePythonRAII {
public:
- InitializePythonRAII()
- : m_gil_state(PyGILState_UNLOCKED), m_was_already_initialized(false) {
+ InitializePythonRAII() {
InitializePythonHome();
#ifdef LLDB_USE_LIBEDIT_READLINE_COMPAT_MODULE
}
TerminalState m_stdin_tty_state;
- PyGILState_STATE m_gil_state;
- bool m_was_already_initialized;
+ PyGILState_STATE m_gil_state = PyGILState_UNLOCKED;
+ bool m_was_already_initialized = false;
};
} // namespace
class EnableOptions : public Options {
public:
EnableOptions()
- : Options(), m_include_debug_level(false), m_include_info_level(false),
- m_include_any_process(false),
+ : Options(),
m_filter_fall_through_accepts(DEFAULT_FILTER_FALLTHROUGH_ACCEPTS),
- m_echo_to_stderr(false), m_display_timestamp_relative(false),
- m_display_subsystem(false), m_display_category(false),
- m_display_activity_chain(false), m_broadcast_events(true),
- m_live_stream(true), m_filter_rules() {}
+ m_filter_rules() {}
void OptionParsingStarting(ExecutionContext *execution_context) override {
m_include_debug_level = false;
return -1;
}
- bool m_include_debug_level;
- bool m_include_info_level;
- bool m_include_any_process;
+ bool m_include_debug_level = false;
+ bool m_include_info_level = false;
+ bool m_include_any_process = false;
bool m_filter_fall_through_accepts;
- bool m_echo_to_stderr;
- bool m_display_timestamp_relative;
- bool m_display_subsystem;
- bool m_display_category;
- bool m_display_activity_chain;
- bool m_broadcast_events;
- bool m_live_stream;
+ bool m_echo_to_stderr = false;
+ bool m_display_timestamp_relative = false;
+ bool m_display_subsystem = false;
+ bool m_display_category = false;
+ bool m_display_activity_chain = false;
+ bool m_broadcast_events = true;
+ bool m_live_stream = true;
FilterRules m_filter_rules;
};
using namespace lldb_private;
-DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration()
- : m_code(InvalidCode), m_tag(llvm::dwarf::DW_TAG_null), m_has_children(0),
- m_attributes() {}
+DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration() : m_attributes() {}
DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag,
uint8_t has_children)
bool IsValid();
protected:
- dw_uleb128_t m_code;
- dw_tag_t m_tag;
- uint8_t m_has_children;
+ dw_uleb128_t m_code = InvalidCode;
+ dw_tag_t m_tag = llvm::dwarf::DW_TAG_null;
+ uint8_t m_has_children = 0;
DWARFAttribute::collection m_attributes;
};
class DWARFBaseDIE {
public:
- DWARFBaseDIE() : m_cu(nullptr), m_die(nullptr) {}
+ DWARFBaseDIE() {}
DWARFBaseDIE(DWARFUnit *cu, DWARFDebugInfoEntry *die)
: m_cu(cu), m_die(die) {}
Recurse recurse = Recurse::yes) const;
protected:
- DWARFUnit *m_cu;
- DWARFDebugInfoEntry *m_die;
+ DWARFUnit *m_cu = nullptr;
+ DWARFDebugInfoEntry *m_die = nullptr;
};
bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs);
class DWARFAbbreviationDeclarationSet {
public:
- DWARFAbbreviationDeclarationSet()
- : m_offset(DW_INVALID_OFFSET), m_idx_offset(0), m_decls() {}
+ DWARFAbbreviationDeclarationSet() : m_offset(DW_INVALID_OFFSET), m_decls() {}
DWARFAbbreviationDeclarationSet(dw_offset_t offset, uint32_t idx_offset)
: m_offset(offset), m_idx_offset(idx_offset), m_decls() {}
/// @}
private:
dw_offset_t m_offset;
- uint32_t m_idx_offset;
+ uint32_t m_idx_offset = 0;
std::vector<DWARFAbbreviationDeclaration> m_decls;
};
typedef collection::const_iterator const_iterator;
DWARFDebugInfoEntry()
- : m_offset(DW_INVALID_OFFSET), m_parent_idx(0), m_sibling_idx(0),
- m_has_children(false), m_abbr_idx(0), m_tag(llvm::dwarf::DW_TAG_null) {}
+ : m_offset(DW_INVALID_OFFSET), m_sibling_idx(0), m_has_children(false) {}
explicit operator bool() const { return m_offset != DW_INVALID_OFFSET; }
bool operator==(const DWARFDebugInfoEntry &rhs) const;
GetDWARFDeclContextStatic(const DWARFDebugInfoEntry *die, DWARFUnit *cu);
dw_offset_t m_offset; // Offset within the .debug_info/.debug_types
- uint32_t m_parent_idx; // How many to subtract from "this" to get the parent.
- // If zero this die has no parent
+ uint32_t m_parent_idx = 0; // How many to subtract from "this" to get the
+ // parent. If zero this die has no parent
uint32_t m_sibling_idx : 31, // How many to add to "this" to get the sibling.
// If it is zero, then the DIE doesn't have children, or the
// DWARF claimed it had children but the DIE only contained
// a single NULL terminating child.
m_has_children : 1;
- uint16_t m_abbr_idx;
+ uint16_t m_abbr_idx = 0;
/// A copy of the DW_TAG value so we don't have to go through the compile
/// unit abbrev table
dw_tag_t m_tag = llvm::dwarf::DW_TAG_null;
class DWARFDeclContext {
public:
struct Entry {
- Entry() : tag(llvm::dwarf::DW_TAG_null), name(nullptr) {}
+ Entry() {}
Entry(dw_tag_t t, const char *n) : tag(t), name(n) {}
bool NameMatches(const Entry &rhs) const {
// Test operator
explicit operator bool() const { return tag != 0; }
- dw_tag_t tag;
- const char *name;
+ dw_tag_t tag = llvm::dwarf::DW_TAG_null;
+ const char *name = nullptr;
};
- DWARFDeclContext() : m_entries(), m_language(lldb::eLanguageTypeUnknown) {}
+ DWARFDeclContext() : m_entries() {}
void AppendDeclContext(dw_tag_t tag, const char *name) {
m_entries.push_back(Entry(tag, name));
typedef std::vector<Entry> collection;
collection m_entries;
mutable std::string m_qualified_name;
- lldb::LanguageType m_language;
+ lldb::LanguageType m_language = lldb::eLanguageTypeUnknown;
};
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDECLCONTEXT_H
class DWARFFormValue {
public:
typedef struct ValueTypeTag {
- ValueTypeTag() : value(), data(nullptr) { value.uval = 0; }
+ ValueTypeTag() : value() { value.uval = 0; }
union {
uint64_t uval;
int64_t sval;
const char *cstr;
} value;
- const uint8_t *data;
+ const uint8_t *data = nullptr;
} ValueType;
enum {
: die_offset(o), tag(t), type_flags(f), qualified_name_hash(h) {}
DWARFMappedHash::Prologue::Prologue(dw_offset_t _die_base_offset)
- : die_base_offset(_die_base_offset), atoms(), atom_mask(0),
- min_hash_data_byte_size(0), hash_data_has_fixed_byte_size(true) {
+ : die_base_offset(_die_base_offset), atoms() {
// Define an array of DIE offsets by first defining an array, and then define
// the atom type for the array, in this case we have an array of DIE offsets.
AppendAtom(eAtomTypeDIEOffset, DW_FORM_data4);
/// DIE offset base so die offsets in hash_data can be CU relative.
dw_offset_t die_base_offset;
AtomArray atoms;
- uint32_t atom_mask;
- size_t min_hash_data_byte_size;
- bool hash_data_has_fixed_byte_size;
+ uint32_t atom_mask = 0;
+ size_t min_hash_data_byte_size = 0;
+ bool hash_data_has_fixed_byte_size = true;
};
class Header : public MappedHash::Header<Prologue> {
llvm::sys::TimePoint<> oso_mod_time;
OSOInfoSP oso_sp;
lldb::CompUnitSP compile_unit_sp;
- uint32_t first_symbol_index;
- uint32_t last_symbol_index;
- uint32_t first_symbol_id;
- uint32_t last_symbol_id;
+ uint32_t first_symbol_index = UINT32_MAX;
+ uint32_t last_symbol_index = UINT32_MAX;
+ uint32_t first_symbol_id = UINT32_MAX;
+ uint32_t last_symbol_id = UINT32_MAX;
FileRangeMap file_range_map;
- bool file_range_map_valid;
+ bool file_range_map_valid = false;
CompileUnitInfo()
: so_file(), oso_path(), oso_mod_time(), oso_sp(), compile_unit_sp(),
- first_symbol_index(UINT32_MAX), last_symbol_index(UINT32_MAX),
- first_symbol_id(UINT32_MAX), last_symbol_id(UINT32_MAX),
- file_range_map(), file_range_map_valid(false) {}
+
+ file_range_map() {}
const FileRangeMap &GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile);
};
// OSOEntry
class OSOEntry {
public:
- OSOEntry()
- : m_exe_sym_idx(UINT32_MAX), m_oso_file_addr(LLDB_INVALID_ADDRESS) {}
+ OSOEntry() {}
OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
: m_exe_sym_idx(exe_sym_idx), m_oso_file_addr(oso_file_addr) {}
}
protected:
- uint32_t m_exe_sym_idx;
- lldb::addr_t m_oso_file_addr;
+ uint32_t m_exe_sym_idx = UINT32_MAX;
+ lldb::addr_t m_oso_file_addr = LLDB_INVALID_ADDRESS;
};
typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, OSOEntry>
class UniqueDWARFASTType {
public:
// Constructors and Destructors
- UniqueDWARFASTType()
- : m_type_sp(), m_die(), m_declaration(),
- m_byte_size(
- -1) // Set to negative value to make sure we have a valid value
- {}
+ UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration() {}
UniqueDWARFASTType(lldb::TypeSP &type_sp, const DWARFDIE &die,
const lldb_private::Declaration &decl, int32_t byte_size)
lldb::TypeSP m_type_sp;
DWARFDIE m_die;
lldb_private::Declaration m_declaration;
- int32_t m_byte_size;
+ int32_t m_byte_size = -1;
};
class UniqueDWARFASTTypeList {
~AppleGetItemInfoHandler();
struct GetItemInfoReturnInfo {
- lldb::addr_t item_buffer_ptr; /* the address of the item buffer from
- libBacktraceRecording */
- lldb::addr_t item_buffer_size; /* the size of the item buffer from
+ lldb::addr_t item_buffer_ptr = LLDB_INVALID_ADDRESS; /* the address of the
+ item buffer from libBacktraceRecording */
+ lldb::addr_t item_buffer_size = 0; /* the size of the item buffer from
libBacktraceRecording */
- GetItemInfoReturnInfo()
- : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {}
+ GetItemInfoReturnInfo() {}
};
/// Get the information about a work item by calling
~AppleGetPendingItemsHandler();
struct GetPendingItemsReturnInfo {
- lldb::addr_t items_buffer_ptr; /* the address of the pending items buffer
- from libBacktraceRecording */
- lldb::addr_t
- items_buffer_size; /* the size of the pending items buffer from
- libBacktraceRecording */
- uint64_t count; /* the number of pending items included in the buffer */
+ lldb::addr_t items_buffer_ptr =
+ LLDB_INVALID_ADDRESS; /* the address of the pending items buffer
+ from libBacktraceRecording */
+ lldb::addr_t items_buffer_size = 0; /* the size of the pending items buffer
+ from libBacktraceRecording */
+ uint64_t count = 0; /* the number of pending items included in the buffer */
GetPendingItemsReturnInfo()
- : items_buffer_ptr(LLDB_INVALID_ADDRESS), items_buffer_size(0),
- count(0) {}
+
+ {}
};
/// Get the list of pending items for a given queue via a call to
~AppleGetQueuesHandler();
struct GetQueuesReturnInfo {
- lldb::addr_t queues_buffer_ptr; /* the address of the queues buffer from
+ lldb::addr_t queues_buffer_ptr =
+ LLDB_INVALID_ADDRESS; /* the address of the queues buffer from
+ libBacktraceRecording */
+ lldb::addr_t queues_buffer_size = 0; /* the size of the queues buffer from
libBacktraceRecording */
- lldb::addr_t queues_buffer_size; /* the size of the queues buffer from
- libBacktraceRecording */
- uint64_t count; /* the number of queues included in the queues buffer */
+ uint64_t count = 0; /* the number of queues included in the queues buffer */
GetQueuesReturnInfo()
- : queues_buffer_ptr(LLDB_INVALID_ADDRESS), queues_buffer_size(0),
- count(0) {}
+
+ {}
};
/// Get the list of queues that exist (with any active or pending items) via
~AppleGetThreadItemInfoHandler();
struct GetThreadItemInfoReturnInfo {
- lldb::addr_t item_buffer_ptr; /* the address of the item buffer from
- libBacktraceRecording */
- lldb::addr_t item_buffer_size; /* the size of the item buffer from
+ lldb::addr_t item_buffer_ptr = LLDB_INVALID_ADDRESS; /* the address of the
+ item buffer from libBacktraceRecording */
+ lldb::addr_t item_buffer_size = 0; /* the size of the item buffer from
libBacktraceRecording */
- GetThreadItemInfoReturnInfo()
- : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {}
+ GetThreadItemInfoReturnInfo() {}
};
/// Get the information about a work item by calling
private:
struct libBacktraceRecording_info {
- uint16_t queue_info_version;
- uint16_t queue_info_data_offset;
- uint16_t item_info_version;
- uint16_t item_info_data_offset;
-
- libBacktraceRecording_info()
- : queue_info_version(0), queue_info_data_offset(0),
- item_info_version(0), item_info_data_offset(0) {}
+ uint16_t queue_info_version = 0;
+ uint16_t queue_info_data_offset = 0;
+ uint16_t item_info_version = 0;
+ uint16_t item_info_data_offset = 0;
+
+ libBacktraceRecording_info() {}
};
// A structure which reflects the data recorded in the
};
struct LibdispatchVoucherOffsets {
- uint16_t vo_version;
- uint16_t vo_activity_ids_count;
- uint16_t vo_activity_ids_count_size;
- uint16_t vo_activity_ids_array;
- uint16_t vo_activity_ids_array_entry_size;
+ uint16_t vo_version = UINT16_MAX;
+ uint16_t vo_activity_ids_count = UINT16_MAX;
+ uint16_t vo_activity_ids_count_size = UINT16_MAX;
+ uint16_t vo_activity_ids_array = UINT16_MAX;
+ uint16_t vo_activity_ids_array_entry_size = UINT16_MAX;
LibdispatchVoucherOffsets()
- : vo_version(UINT16_MAX), vo_activity_ids_count(UINT16_MAX),
- vo_activity_ids_count_size(UINT16_MAX),
- vo_activity_ids_array(UINT16_MAX),
- vo_activity_ids_array_entry_size(UINT16_MAX) {}
+
+ {}
bool IsValid() { return vo_version != UINT16_MAX; }
};
struct LibdispatchTSDIndexes {
- uint16_t dti_version;
- uint64_t dti_queue_index;
- uint64_t dti_voucher_index;
- uint64_t dti_qos_class_index;
+ uint16_t dti_version = UINT16_MAX;
+ uint64_t dti_queue_index = UINT64_MAX;
+ uint64_t dti_voucher_index = UINT64_MAX;
+ uint64_t dti_qos_class_index = UINT64_MAX;
- LibdispatchTSDIndexes()
- : dti_version(UINT16_MAX), dti_queue_index(UINT64_MAX),
- dti_voucher_index(UINT64_MAX), dti_qos_class_index(UINT64_MAX) {}
+ LibdispatchTSDIndexes() {}
bool IsValid() { return dti_version != UINT16_MAX; }
};
struct LibpthreadOffsets {
- uint16_t plo_version;
- uint16_t plo_pthread_tsd_base_offset;
- uint16_t plo_pthread_tsd_base_address_offset;
- uint16_t plo_pthread_tsd_entry_size;
+ uint16_t plo_version = UINT16_MAX;
+ uint16_t plo_pthread_tsd_base_offset = UINT16_MAX;
+ uint16_t plo_pthread_tsd_base_address_offset = UINT16_MAX;
+ uint16_t plo_pthread_tsd_entry_size = UINT16_MAX;
LibpthreadOffsets()
- : plo_version(UINT16_MAX), plo_pthread_tsd_base_offset(UINT16_MAX),
- plo_pthread_tsd_base_address_offset(UINT16_MAX),
- plo_pthread_tsd_entry_size(UINT16_MAX) {}
+
+ {}
bool IsValid() { return plo_version != UINT16_MAX; }
};
/// are called. This one takes a vector of register name and lldb
/// register numbers.
struct lldb_reg_info {
- const char *name;
- uint32_t lldb_regnum;
- lldb_reg_info() : name(nullptr), lldb_regnum(LLDB_INVALID_REGNUM) {}
+ const char *name = nullptr;
+ uint32_t lldb_regnum = LLDB_INVALID_REGNUM;
+ lldb_reg_info() {}
};
void Initialize(std::vector<lldb_reg_info> ®_info);
using namespace lldb_private;
LineEntry::LineEntry()
- : range(), file(), line(LLDB_INVALID_LINE_NUMBER), column(0),
- is_start_of_statement(0), is_start_of_basic_block(0), is_prologue_end(0),
- is_epilogue_begin(0), is_terminal_entry(0) {}
+ : range(), file(), is_start_of_statement(0), is_start_of_basic_block(0),
+ is_prologue_end(0), is_epilogue_begin(0), is_terminal_entry(0) {}
LineEntry::LineEntry(const lldb::SectionSP §ion_sp,
lldb::addr_t section_offset, lldb::addr_t byte_size,
using namespace lldb_private;
Symbol::Symbol()
- : SymbolContextScope(), m_uid(UINT32_MAX), m_type_data(0),
- m_type_data_resolved(false), m_is_synthetic(false), m_is_debug(false),
- m_is_external(false), m_size_is_sibling(false),
+ : SymbolContextScope(), m_type_data_resolved(false), m_is_synthetic(false),
+ m_is_debug(false), m_is_external(false), m_size_is_sibling(false),
m_size_is_synthesized(false), m_size_is_valid(false),
m_demangled_is_synthesized(false), m_contains_linker_annotations(false),
- m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(), m_addr_range(),
- m_flags() {}
+ m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(),
+ m_addr_range() {}
Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type, bool external,
bool is_debug, bool is_trampoline, bool is_artificial,
using namespace lldb;
using namespace lldb_private;
-SymbolContext::SymbolContext()
- : target_sp(), module_sp(), comp_unit(nullptr), function(nullptr),
- block(nullptr), line_entry(), symbol(nullptr), variable(nullptr) {}
+SymbolContext::SymbolContext() : target_sp(), module_sp(), line_entry() {}
SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f,
Block *b, LineEntry *le, Symbol *s)
}
Type::Type()
- : std::enable_shared_from_this<Type>(), UserID(0), m_name("<INVALID TYPE>"),
- m_symbol_file(nullptr), m_context(nullptr), m_encoding_type(nullptr),
- m_encoding_uid(LLDB_INVALID_UID), m_encoding_uid_type(eEncodingInvalid),
- m_compiler_type_resolve_state(ResolveState::Unresolved) {
+ : std::enable_shared_from_this<Type>(), UserID(0),
+ m_name("<INVALID TYPE>") {
m_byte_size = 0;
m_byte_size_has_value = false;
}
#pragma mark TypeSystemMap
-TypeSystemMap::TypeSystemMap()
- : m_mutex(), m_map(), m_clear_in_progress(false) {}
+TypeSystemMap::TypeSystemMap() : m_mutex(), m_map() {}
TypeSystemMap::~TypeSystemMap() {}
}
}
-UnwindPlan::Row::Row()
- : m_offset(0), m_cfa_value(), m_afa_value(), m_register_locations(),
- m_unspecified_registers_are_undefined(false) {}
+UnwindPlan::Row::Row() : m_cfa_value(), m_afa_value(), m_register_locations() {}
bool UnwindPlan::Row::GetRegisterInfo(
uint32_t reg_num,
}
ExecutionContextRef::ExecutionContextRef()
- : m_target_wp(), m_process_wp(), m_thread_wp(),
- m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {}
+ : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {}
ExecutionContextRef::ExecutionContextRef(const ExecutionContext *exe_ctx)
: m_target_wp(), m_process_wp(), m_thread_wp(),
}
}
// PathMappingList constructor
-PathMappingList::PathMappingList()
- : m_pairs(), m_callback(nullptr), m_callback_baton(nullptr), m_mod_id(0) {}
+PathMappingList::PathMappingList() : m_pairs() {}
PathMappingList::PathMappingList(ChangedCallback callback, void *callback_baton)
: m_pairs(), m_callback(callback), m_callback_baton(callback_baton),
// Process Event Data
-Process::ProcessEventData::ProcessEventData()
- : EventData(), m_process_wp(), m_state(eStateInvalid), m_restarted(false),
- m_update_state(0), m_interrupted(false) {}
+Process::ProcessEventData::ProcessEventData() : EventData(), m_process_wp() {}
Process::ProcessEventData::ProcessEventData(const ProcessSP &process_sp,
StateType state)
}
}
-RegisterNumber::RegisterNumber()
- : m_reg_ctx_sp(), m_regnum(LLDB_INVALID_REGNUM),
- m_kind(lldb::kNumRegisterKinds), m_kind_regnum_map(), m_name(nullptr) {}
+RegisterNumber::RegisterNumber() : m_reg_ctx_sp(), m_kind_regnum_map() {}
void RegisterNumber::init(lldb_private::Thread &thread, lldb::RegisterKind kind,
uint32_t num) {
ThreadSpec::OptionNames::LastOptionName)]{"Index", "ID", "Name",
"QueueName"};
-ThreadSpec::ThreadSpec()
- : m_index(UINT32_MAX), m_tid(LLDB_INVALID_THREAD_ID), m_name(),
- m_queue_name() {}
+ThreadSpec::ThreadSpec() : m_name(), m_queue_name() {}
std::unique_ptr<ThreadSpec> ThreadSpec::CreateFromStructuredData(
const StructuredData::Dictionary &spec_dict, Status &error) {
// Default constructor.
DataEncoder::DataEncoder()
- : m_start(nullptr), m_end(nullptr),
- m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
+ : m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
m_data_sp() {}
// This constructor allows us to use data that is owned by someone else. The
}
DataExtractor::DataExtractor()
- : m_start(nullptr), m_end(nullptr),
- m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
- m_data_sp(), m_target_byte_size(1) {}
+ : m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
+ m_data_sp() {}
// This constructor allows us to use data that is owned by someone else. The
// data must stay around as long as this object is valid.
using namespace lldb_private::repro;
ProcessInfo::ProcessInfo()
- : m_executable(), m_arguments(), m_environment(), m_uid(UINT32_MAX),
- m_gid(UINT32_MAX), m_arch(), m_pid(LLDB_INVALID_PROCESS_ID) {}
+ : m_executable(), m_arguments(), m_environment(), m_arch() {}
ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
lldb::pid_t pid)
}
Recorder::Recorder()
- : m_serializer(nullptr), m_pretty_func(), m_pretty_args(),
- m_local_boundary(false), m_result_recorded(true),
+ : m_pretty_func(), m_pretty_args(),
+
m_sequence(std::numeric_limits<unsigned>::max()) {
if (!g_global_boundary) {
g_global_boundary = true;
using namespace lldb;
using namespace lldb_private;
-Status::Status() : m_code(0), m_type(eErrorTypeInvalid), m_string() {}
+Status::Status() : m_string() {}
Status::Status(ValueType err, ErrorType type)
: m_code(err), m_type(type), m_string() {}
m_indent_level(0), m_forwarder(*this, colors) {}
Stream::Stream(bool colors)
- : m_flags(0), m_addr_size(4), m_byte_order(endian::InlHostByteOrder()),
- m_indent_level(0), m_forwarder(*this, colors) {}
+ : m_flags(0), m_byte_order(endian::InlHostByteOrder()),
+ m_forwarder(*this, colors) {}
// Destructor
Stream::~Stream() {}
}
// StringExtractor constructor
-StringExtractor::StringExtractor() : m_packet(), m_index(0) {}
+StringExtractor::StringExtractor() : m_packet() {}
StringExtractor::StringExtractor(llvm::StringRef packet_str)
: m_packet(), m_index(0) {