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),
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) {
83 if (
m_count.GetDefaultValue() == 0) {
87 if (
m_count.GetCurrentValue() == 0)
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) {
174 m_count.SetCurrentValue(count);
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.
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 with file/line, symbol + offset,...
std::shared_ptr< lldb_private::Target > TargetSP