22 "Specify a format to be used for display."},
25 "Specify a format using a GDB format specifier string."},
28 "The size in bytes to use when displaying with the selected format."},
31 "The number of total items to display."},
37 : m_format(default_format, default_format),
38 m_byte_size(default_byte_size, default_byte_size),
39 m_count(default_count, default_count), m_prev_gdb_format(
'x'),
40 m_prev_gdb_size(
'w'), m_has_gdb_format(false) {
46 for (
auto usage_text_tuple : usage_text_vector) {
47 switch (std::get<0>(usage_text_tuple)) {
55 llvm_unreachable(
"Unimplemented option");
66 return result.take_front(3);
68 return result.take_front(2);
72 llvm::StringRef option_arg,
77 switch (short_option) {
89 "invalid --count option value '%s'", option_arg.str().c_str());
100 "invalid --size option value '%s'", option_arg.str().c_str());
106 llvm::StringRef gdb_format_str = option_arg;
107 gdb_format_str.consumeInteger(0, count);
110 uint32_t byte_size = 0;
112 while (!gdb_format_str.empty() &&
115 gdb_format_str = gdb_format_str.drop_front();
122 if (!gdb_format_str.empty() ||
126 "invalid gdb format string '%s'", option_arg.str().c_str());
138 if (byte_size_enabled) {
148 "this command doesn't support specifying a byte size");
162 "this command doesn't support specifying a count");
169 if (byte_size_enabled) {
180 llvm_unreachable(
"Unimplemented option");
188 uint32_t &byte_size) {
190 switch (format_letter) {
221 byte_size = target_sp->GetArchitecture().GetAddressByteSize();
255 if (format_letter ==
'b')
257 else if (format_letter ==
'h')
259 else if (format_letter ==
'w')
261 else if (format_letter ==
'g')
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
uint64_t GetCurrentValue() const
bool SetCurrentValue(uint64_t value)
uint64_t GetDefaultValue() const
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
A class that represents a running process on the host machine.
std::vector< std::tuple< lldb::CommandArgumentType, const char * > > OptionGroupFormatUsageTextVector
Format
Display format definitions.
@ eFormatCString
NULL terminated C strings.
@ eFormatInstruction
Disassemble an opcode.
@ eFormatHexFloat
ISO C99 hex float string.
@ eFormatOSType
OS character codes encoded into an integer 'PICT' 'text' etc...
@ eFormatAddressInfo
Describe what an address points to (func + offset.
std::shared_ptr< lldb_private::Target > TargetSP
const char * usage_text
Full text explaining what this options does and what (if any) argument to pass it.
int short_option
Single character for this option.