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) {
84 error.SetErrorString(
"--count option is disabled");
88 error.SetErrorStringWithFormat(
"invalid --count option value '%s'",
89 option_arg.str().c_str());
95 error.SetErrorString(
"--size option is disabled");
99 error.SetErrorStringWithFormat(
"invalid --size option value '%s'",
100 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() ||
125 error.SetErrorStringWithFormat(
"invalid gdb format string '%s'",
126 option_arg.str().c_str());
138 if (byte_size_enabled) {
147 error.SetErrorString(
148 "this command doesn't support specifying a byte size");
161 error.SetErrorString(
"this command doesn't support specifying a count");
168 if (byte_size_enabled) {
179 llvm_unreachable(
"Unimplemented option");
187 uint32_t &byte_size) {
189 switch (format_letter) {
220 byte_size = target_sp->GetArchitecture().GetAddressByteSize();
254 if (format_letter ==
'b')
256 else if (format_letter ==
'h')
258 else if (format_letter ==
'w')
260 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
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.