Author: Raphael Isemann Date: 2020-02-18T10:25:27+01:00 New Revision: 57835875bd4346ba00f7f6ded5e1382e26b3fd5c
URL: https://github.com/llvm/llvm-project/commit/57835875bd4346ba00f7f6ded5e1382e26b3fd5c DIFF: https://github.com/llvm/llvm-project/commit/57835875bd4346ba00f7f6ded5e1382e26b3fd5c.diff LOG: [lldb][NFC] Modernize documentation in lldb-private-types.h Added: Modified: lldb/include/lldb/lldb-private-types.h Removed: ################################################################################ diff --git a/lldb/include/lldb/lldb-private-types.h b/lldb/include/lldb/lldb-private-types.h index 623936df73b8..2034c6c17909 100644 --- a/lldb/include/lldb/lldb-private-types.h +++ b/lldb/include/lldb/lldb-private-types.h @@ -28,38 +28,42 @@ class ExecutionContext; typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)( const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error); -// Every register is described in detail including its name, alternate name -// (optional), encoding, size in bytes and the default display format. +/// Every register is described in detail including its name, alternate name +/// (optional), encoding, size in bytes and the default display format. struct RegisterInfo { - const char *name; // Name of this register, can't be NULL - const char *alt_name; // Alternate name of this register, can be NULL - uint32_t byte_size; // Size in bytes of the register - uint32_t byte_offset; // The byte offset in the register context data where - // this register's value is found. - // This is optional, and can be 0 if a particular RegisterContext does not - // need to address its registers by byte offset. - lldb::Encoding encoding; // Encoding of the register bits - lldb::Format format; // Default display format - uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register - // numbers for all register kinds - uint32_t *value_regs; // List of registers (terminated with - // LLDB_INVALID_REGNUM). If this value is not null, - // all registers in this list will be read first, at - // which point the value for this register will be - // valid. For example, the value list for ah would be - // eax (x86) or rax (x64). - uint32_t *invalidate_regs; // List of registers (terminated with - // LLDB_INVALID_REGNUM). If this value is not - // null, all registers in this list will be - // invalidated when the value of this register - // changes. For example, the invalidate list for - // eax would be rax ax, ah, and al. - const uint8_t *dynamic_size_dwarf_expr_bytes; // A DWARF expression that when - // evaluated gives - // the byte size of this register. - size_t dynamic_size_dwarf_len; // The length of the DWARF expression in bytes - // in the dynamic_size_dwarf_expr_bytes - // member. + /// Name of this register, can't be NULL. + const char *name; + /// Alternate name of this register, can be NULL. + const char *alt_name; + /// Size in bytes of the register. + uint32_t byte_size; + /// The byte offset in the register context data where this register's + /// value is found. + /// This is optional, and can be 0 if a particular RegisterContext does not + /// need to address its registers by byte offset. + uint32_t byte_offset; + /// Encoding of the register bits. + lldb::Encoding encoding; + /// Default display format. + lldb::Format format; + /// Holds all of the various register numbers for all register kinds. + uint32_t kinds[lldb::kNumRegisterKinds]; // + /// List of registers (terminated with LLDB_INVALID_REGNUM). If this value is + /// not null, all registers in this list will be read first, at which point + /// the value for this register will be valid. For example, the value list + /// for ah would be eax (x86) or rax (x64). + uint32_t *value_regs; // + /// List of registers (terminated with LLDB_INVALID_REGNUM). If this value is + /// not null, all registers in this list will be invalidated when the value of + /// this register changes. For example, the invalidate list for eax would be + /// rax ax, ah, and al. + uint32_t *invalidate_regs; + /// A DWARF expression that when evaluated gives the byte size of this + /// register. + const uint8_t *dynamic_size_dwarf_expr_bytes; + /// The length of the DWARF expression in bytes in the + /// dynamic_size_dwarf_expr_bytes member. + size_t dynamic_size_dwarf_len; llvm::ArrayRef<uint8_t> data(const uint8_t *context_base) const { return llvm::ArrayRef<uint8_t>(context_base + byte_offset, byte_size); @@ -71,17 +75,20 @@ struct RegisterInfo { } }; -// Registers are grouped into register sets +/// Registers are grouped into register sets struct RegisterSet { - const char *name; // Name of this register set - const char *short_name; // A short name for this register set - size_t num_registers; // The number of registers in REGISTERS array below - const uint32_t *registers; // An array of register indices in this set. The - // values in this array are - // *indices* (not register numbers) into a particular RegisterContext's - // register array. For example, if eax is defined at index 4 for a - // particular RegisterContext, eax would be included in this RegisterSet by - // adding the value 4. Not by adding the value lldb_eax_i386. + /// Name of this register set. + const char *name; + /// A short name for this register set. + const char *short_name; + /// The number of registers in REGISTERS array below. + size_t num_registers; + /// An array of register indices in this set. The values in this array are + /// *indices* (not register numbers) into a particular RegisterContext's + /// register array. For example, if eax is defined at index 4 for a + /// particular RegisterContext, eax would be included in this RegisterSet by + /// adding the value 4. Not by adding the value lldb_eax_i386. + const uint32_t *registers; }; struct OptionEnumValueElement { @@ -101,22 +108,29 @@ struct OptionValidator { }; struct OptionDefinition { - uint32_t usage_mask; // Used to mark options that can be used together. If (1 - // << n & usage_mask) != 0 - // then this option belongs to option set n. - bool required; // This option is required (in the current usage level) - const char *long_option; // Full name for this option. - int short_option; // Single character for this option. - int option_has_arg; // no_argument, required_argument or optional_argument - OptionValidator *validator; // If non-NULL, option is valid iff - // |validator->IsValid()|, otherwise always valid. - OptionEnumValues enum_values; // If not empty, an array of enum values. - uint32_t completion_type; // Cookie the option class can use to do define the - // argument completion. - lldb::CommandArgumentType argument_type; // Type of argument this option takes - const char *usage_text; // Full text explaining what this options does and - // what (if any) argument to - // pass it. + /// Used to mark options that can be used together. If + /// `(1 << n & usage_mask) != 0` then this option belongs to option set n. + uint32_t usage_mask; + /// This option is required (in the current usage level). + bool required; + /// Full name for this option. + const char *long_option; + /// Single character for this option. + int short_option; + /// no_argument, required_argument or optional_argument + int option_has_arg; + /// If non-NULL, option is valid iff |validator->IsValid()|, otherwise + /// always valid. + OptionValidator *validator; + /// If not empty, an array of enum values. + OptionEnumValues enum_values; + /// Cookie the option class can use to do define the argument completion. + uint32_t completion_type; + /// Type of argument this option takes. + lldb::CommandArgumentType argument_type; + /// Full text explaining what this options does and what (if any) argument to + /// pass it. + const char *usage_text; }; typedef struct type128 { uint64_t x[2]; } type128; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits