LLDB  mainline
CommandObjectRegister.cpp
Go to the documentation of this file.
1 //===-- CommandObjectRegister.cpp -----------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "lldb/Core/Debugger.h"
12 #include "lldb/Host/OptionParser.h"
21 #include "lldb/Target/Process.h"
24 #include "lldb/Target/Thread.h"
25 #include "lldb/Utility/Args.h"
28 #include "llvm/Support/Errno.h"
29 
30 using namespace lldb;
31 using namespace lldb_private;
32 
33 // "register read"
34 #define LLDB_OPTIONS_register_read
35 #include "CommandOptions.inc"
36 
38 public:
41  interpreter, "register read",
42  "Dump the contents of one or more register values from the current "
43  "frame. If no register is specified, dumps them all.",
44  nullptr,
45  eCommandRequiresFrame | eCommandRequiresRegContext |
46  eCommandProcessMustBeLaunched | eCommandProcessMustBePaused),
47  m_format_options(eFormatDefault) {
49  CommandArgumentData register_arg;
50 
51  // Define the first (and only) variant of this arg.
52  register_arg.arg_type = eArgTypeRegisterName;
53  register_arg.arg_repetition = eArgRepeatStar;
54 
55  // There is only one variant this argument could be; put it into the
56  // argument entry.
57  arg.push_back(register_arg);
58 
59  // Push the data for the first argument into the m_arguments vector.
60  m_arguments.push_back(arg);
61 
62  // Add the "--format"
63  m_option_group.Append(&m_format_options,
64  OptionGroupFormat::OPTION_GROUP_FORMAT |
65  OptionGroupFormat::OPTION_GROUP_GDB_FMT,
67  m_option_group.Append(&m_command_options);
68  m_option_group.Finalize();
69  }
70 
71  ~CommandObjectRegisterRead() override = default;
72 
73  void
75  OptionElementVector &opt_element_vector) override {
76  if (!m_exe_ctx.HasProcessScope())
77  return;
78 
79  CommandCompletions::InvokeCommonCompletionCallbacks(
80  GetCommandInterpreter(), CommandCompletions::eRegisterCompletion,
81  request, nullptr);
82  }
83 
84  Options *GetOptions() override { return &m_option_group; }
85 
86  bool DumpRegister(const ExecutionContext &exe_ctx, Stream &strm,
87  RegisterContext *reg_ctx, const RegisterInfo *reg_info) {
88  if (reg_info) {
89  RegisterValue reg_value;
90 
91  if (reg_ctx->ReadRegister(reg_info, reg_value)) {
92  strm.Indent();
93 
94  bool prefix_with_altname = (bool)m_command_options.alternate_name;
95  bool prefix_with_name = !prefix_with_altname;
96  DumpRegisterValue(reg_value, &strm, reg_info, prefix_with_name,
97  prefix_with_altname, m_format_options.GetFormat(), 8);
98  if ((reg_info->encoding == eEncodingUint) ||
99  (reg_info->encoding == eEncodingSint)) {
100  Process *process = exe_ctx.GetProcessPtr();
101  if (process && reg_info->byte_size == process->GetAddressByteSize()) {
102  addr_t reg_addr = reg_value.GetAsUInt64(LLDB_INVALID_ADDRESS);
103  if (reg_addr != LLDB_INVALID_ADDRESS) {
104  Address so_reg_addr;
105  if (exe_ctx.GetTargetRef()
107  .ResolveLoadAddress(reg_addr, so_reg_addr)) {
108  strm.PutCString(" ");
109  so_reg_addr.Dump(&strm, exe_ctx.GetBestExecutionContextScope(),
110  Address::DumpStyleResolvedDescription);
111  }
112  }
113  }
114  }
115  strm.EOL();
116  return true;
117  }
118  }
119  return false;
120  }
121 
122  bool DumpRegisterSet(const ExecutionContext &exe_ctx, Stream &strm,
123  RegisterContext *reg_ctx, size_t set_idx,
124  bool primitive_only = false) {
125  uint32_t unavailable_count = 0;
126  uint32_t available_count = 0;
127 
128  if (!reg_ctx)
129  return false; // thread has no registers (i.e. core files are corrupt,
130  // incomplete crash logs...)
131 
132  const RegisterSet *const reg_set = reg_ctx->GetRegisterSet(set_idx);
133  if (reg_set) {
134  strm.Printf("%s:\n", (reg_set->name ? reg_set->name : "unknown"));
135  strm.IndentMore();
136  const size_t num_registers = reg_set->num_registers;
137  for (size_t reg_idx = 0; reg_idx < num_registers; ++reg_idx) {
138  const uint32_t reg = reg_set->registers[reg_idx];
139  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg);
140  // Skip the dumping of derived register if primitive_only is true.
141  if (primitive_only && reg_info && reg_info->value_regs)
142  continue;
143 
144  if (DumpRegister(exe_ctx, strm, reg_ctx, reg_info))
145  ++available_count;
146  else
147  ++unavailable_count;
148  }
149  strm.IndentLess();
150  if (unavailable_count) {
151  strm.Indent();
152  strm.Printf("%u registers were unavailable.\n", unavailable_count);
153  }
154  strm.EOL();
155  }
156  return available_count > 0;
157  }
158 
159 protected:
160  bool DoExecute(Args &command, CommandReturnObject &result) override {
161  Stream &strm = result.GetOutputStream();
162  RegisterContext *reg_ctx = m_exe_ctx.GetRegisterContext();
163 
164  const RegisterInfo *reg_info = nullptr;
165  if (command.GetArgumentCount() == 0) {
166  size_t set_idx;
167 
168  size_t num_register_sets = 1;
169  const size_t set_array_size = m_command_options.set_indexes.GetSize();
170  if (set_array_size > 0) {
171  for (size_t i = 0; i < set_array_size; ++i) {
172  set_idx = m_command_options.set_indexes[i]->GetUInt64Value(UINT32_MAX,
173  nullptr);
174  if (set_idx < reg_ctx->GetRegisterSetCount()) {
175  if (!DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) {
176  if (errno)
177  result.AppendErrorWithFormatv("register read failed: {0}\n",
178  llvm::sys::StrError());
179  else
180  result.AppendError("unknown error while reading registers.\n");
181  break;
182  }
183  } else {
184  result.AppendErrorWithFormat(
185  "invalid register set index: %" PRIu64 "\n", (uint64_t)set_idx);
186  break;
187  }
188  }
189  } else {
190  if (m_command_options.dump_all_sets)
191  num_register_sets = reg_ctx->GetRegisterSetCount();
192 
193  for (set_idx = 0; set_idx < num_register_sets; ++set_idx) {
194  // When dump_all_sets option is set, dump primitive as well as
195  // derived registers.
196  DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx,
197  !m_command_options.dump_all_sets.GetCurrentValue());
198  }
199  }
200  } else {
201  if (m_command_options.dump_all_sets) {
202  result.AppendError("the --all option can't be used when registers "
203  "names are supplied as arguments\n");
204  } else if (m_command_options.set_indexes.GetSize() > 0) {
205  result.AppendError("the --set <set> option can't be used when "
206  "registers names are supplied as arguments\n");
207  } else {
208  for (auto &entry : command) {
209  // in most LLDB commands we accept $rbx as the name for register RBX
210  // - and here we would reject it and non-existant. we should be more
211  // consistent towards the user and allow them to say reg read $rbx -
212  // internally, however, we should be strict and not allow ourselves
213  // to call our registers $rbx in our own API
214  auto arg_str = entry.ref();
215  arg_str.consume_front("$");
216 
217  reg_info = reg_ctx->GetRegisterInfoByName(arg_str);
218 
219  if (reg_info) {
220  if (!DumpRegister(m_exe_ctx, strm, reg_ctx, reg_info))
221  strm.Printf("%-12s = error: unavailable\n", reg_info->name);
222  } else {
223  result.AppendErrorWithFormat("Invalid register name '%s'.\n",
224  arg_str.str().c_str());
225  }
226  }
227  }
228  }
229  return result.Succeeded();
230  }
231 
232  class CommandOptions : public OptionGroup {
233  public:
235  : set_indexes(OptionValue::ConvertTypeToMask(OptionValue::eTypeUInt64)),
236  dump_all_sets(false, false), // Initial and default values are false
237  alternate_name(false, false) {}
238 
239  ~CommandOptions() override = default;
240 
241  llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
242  return llvm::makeArrayRef(g_register_read_options);
243  }
244 
245  void OptionParsingStarting(ExecutionContext *execution_context) override {
246  set_indexes.Clear();
247  dump_all_sets.Clear();
248  alternate_name.Clear();
249  }
250 
251  Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
252  ExecutionContext *execution_context) override {
253  Status error;
254  const int short_option = GetDefinitions()[option_idx].short_option;
255  switch (short_option) {
256  case 's': {
257  OptionValueSP value_sp(OptionValueUInt64::Create(option_value, error));
258  if (value_sp)
259  set_indexes.AppendValue(value_sp);
260  } break;
261 
262  case 'a':
263  // When we don't use OptionValue::SetValueFromCString(const char *) to
264  // set an option value, it won't be marked as being set in the options
265  // so we make a call to let users know the value was set via option
266  dump_all_sets.SetCurrentValue(true);
267  dump_all_sets.SetOptionWasSet();
268  break;
269 
270  case 'A':
271  // When we don't use OptionValue::SetValueFromCString(const char *) to
272  // set an option value, it won't be marked as being set in the options
273  // so we make a call to let users know the value was set via option
274  alternate_name.SetCurrentValue(true);
275  dump_all_sets.SetOptionWasSet();
276  break;
277 
278  default:
279  llvm_unreachable("Unimplemented option");
280  }
281  return error;
282  }
283 
284  // Instance variables to hold the values for command options.
288  };
289 
293 };
294 
295 // "register write"
297 public:
299  : CommandObjectParsed(interpreter, "register write",
300  "Modify a single register value.", nullptr,
301  eCommandRequiresFrame | eCommandRequiresRegContext |
302  eCommandProcessMustBeLaunched |
303  eCommandProcessMustBePaused) {
306  CommandArgumentData register_arg;
307  CommandArgumentData value_arg;
308 
309  // Define the first (and only) variant of this arg.
310  register_arg.arg_type = eArgTypeRegisterName;
311  register_arg.arg_repetition = eArgRepeatPlain;
312 
313  // There is only one variant this argument could be; put it into the
314  // argument entry.
315  arg1.push_back(register_arg);
316 
317  // Define the first (and only) variant of this arg.
318  value_arg.arg_type = eArgTypeValue;
319  value_arg.arg_repetition = eArgRepeatPlain;
320 
321  // There is only one variant this argument could be; put it into the
322  // argument entry.
323  arg2.push_back(value_arg);
324 
325  // Push the data for the first argument into the m_arguments vector.
326  m_arguments.push_back(arg1);
327  m_arguments.push_back(arg2);
328  }
329 
330  ~CommandObjectRegisterWrite() override = default;
331 
332  void
334  OptionElementVector &opt_element_vector) override {
335  if (!m_exe_ctx.HasProcessScope() || request.GetCursorIndex() != 0)
336  return;
337 
338  CommandCompletions::InvokeCommonCompletionCallbacks(
339  GetCommandInterpreter(), CommandCompletions::eRegisterCompletion,
340  request, nullptr);
341  }
342 
343 protected:
344  bool DoExecute(Args &command, CommandReturnObject &result) override {
345  DataExtractor reg_data;
346  RegisterContext *reg_ctx = m_exe_ctx.GetRegisterContext();
347 
348  if (command.GetArgumentCount() != 2) {
349  result.AppendError(
350  "register write takes exactly 2 arguments: <reg-name> <value>");
351  } else {
352  auto reg_name = command[0].ref();
353  auto value_str = command[1].ref();
354 
355  // in most LLDB commands we accept $rbx as the name for register RBX -
356  // and here we would reject it and non-existant. we should be more
357  // consistent towards the user and allow them to say reg write $rbx -
358  // internally, however, we should be strict and not allow ourselves to
359  // call our registers $rbx in our own API
360  reg_name.consume_front("$");
361 
362  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(reg_name);
363 
364  if (reg_info) {
365  RegisterValue reg_value;
366 
367  Status error(reg_value.SetValueFromString(reg_info, value_str));
368  if (error.Success()) {
369  if (reg_ctx->WriteRegister(reg_info, reg_value)) {
370  // Toss all frames and anything else in the thread after a register
371  // has been written.
372  m_exe_ctx.GetThreadRef().Flush();
374  return true;
375  }
376  }
377  if (error.AsCString()) {
378  result.AppendErrorWithFormat(
379  "Failed to write register '%s' with value '%s': %s\n",
380  reg_name.str().c_str(), value_str.str().c_str(),
381  error.AsCString());
382  } else {
383  result.AppendErrorWithFormat(
384  "Failed to write register '%s' with value '%s'",
385  reg_name.str().c_str(), value_str.str().c_str());
386  }
387  } else {
388  result.AppendErrorWithFormat("Register not found for '%s'.\n",
389  reg_name.str().c_str());
390  }
391  }
392  return result.Succeeded();
393  }
394 };
395 
396 // CommandObjectRegister constructor
397 CommandObjectRegister::CommandObjectRegister(CommandInterpreter &interpreter)
398  : CommandObjectMultiword(interpreter, "register",
399  "Commands to access registers for the current "
400  "thread and stack frame.",
401  "register [read|write] ...") {
402  LoadSubCommand("read",
403  CommandObjectSP(new CommandObjectRegisterRead(interpreter)));
404  LoadSubCommand("write",
405  CommandObjectSP(new CommandObjectRegisterWrite(interpreter)));
406 }
407 
lldb::eArgTypeRegisterName
@ eArgTypeRegisterName
Definition: lldb-enumerations.h:568
lldb_private::Stream::IndentLess
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:171
lldb_private::RegisterContext::WriteRegister
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
lldb_private::CommandObjectParsed
Definition: CommandObject.h:389
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
OptionGroupFormat.h
lldb_private::eArgRepeatPlain
@ eArgRepeatPlain
Definition: lldb-private-enumerations.h:95
CommandObjectRegisterRead::CommandOptions::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition: CommandObjectRegister.cpp:251
CommandObjectRegisterRead::DumpRegister
bool DumpRegister(const ExecutionContext &exe_ctx, Stream &strm, RegisterContext *reg_ctx, const RegisterInfo *reg_info)
Definition: CommandObjectRegister.cpp:86
lldb_private::RegisterValue
Definition: RegisterValue.h:28
CommandObjectRegisterWrite
Definition: CommandObjectRegister.cpp:296
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:206
lldb_private::OptionValueBoolean
Definition: OptionValueBoolean.h:16
OptionValueUInt64.h
lldb_private::RegisterContext::GetRegisterSet
virtual const RegisterSet * GetRegisterSet(size_t reg_set)=0
CommandObjectRegisterRead::DumpRegisterSet
bool DumpRegisterSet(const ExecutionContext &exe_ctx, Stream &strm, RegisterContext *reg_ctx, size_t set_idx, bool primitive_only=false)
Definition: CommandObjectRegister.cpp:122
lldb_private::RegisterContext::ReadRegister
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
lldb_private::Process
Definition: Process.h:338
lldb_private::OptionGroupOptions
Definition: Options.h:255
lldb_private::CommandObject::CommandArgumentData
Used to build individual command argument lists.
Definition: CommandObject.h:91
lldb_private::OptionGroup
Definition: Options.h:233
SectionLoadList.h
CommandObjectRegisterRead::CommandObjectRegisterRead
CommandObjectRegisterRead(CommandInterpreter &interpreter)
Definition: CommandObjectRegister.cpp:39
CommandObjectRegisterRead::m_option_group
OptionGroupOptions m_option_group
Definition: CommandObjectRegister.cpp:290
RegisterValue.h
lldb_private::CommandObject::CommandArgumentData::arg_repetition
ArgumentRepetitionType arg_repetition
Definition: CommandObject.h:93
lldb::eArgTypeValue
@ eArgTypeValue
Definition: lldb-enumerations.h:593
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Args
Definition: Args.h:33
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::CommandReturnObject::Succeeded
bool Succeeded() const
Definition: CommandReturnObject.cpp:131
CommandObjectRegisterWrite::HandleArgumentCompletion
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
Definition: CommandObjectRegister.cpp:333
DumpRegister
static bool DumpRegister(Stream &s, StackFrame *frame, RegisterKind reg_kind, uint32_t reg_num, Format format)
Definition: FormatEntity.cpp:594
CommandReturnObject.h
lldb_private::RegisterContext::GetRegisterInfoAtIndex
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
Debugger.h
lldb_private::CommandReturnObject::AppendErrorWithFormatv
void AppendErrorWithFormatv(const char *format, Args &&... args)
Definition: CommandReturnObject.h:130
Process.h
lldb_private::RegisterValue::GetAsUInt64
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
Definition: RegisterValue.cpp:563
CommandObjectRegister.h
lldb::eReturnStatusSuccessFinishNoResult
@ eReturnStatusSuccessFinishNoResult
Definition: lldb-enumerations.h:260
DumpRegisterValue.h
CommandObjectRegisterWrite::DoExecute
bool DoExecute(Args &command, CommandReturnObject &result) override
Definition: CommandObjectRegister.cpp:344
CommandObjectRegisterRead
Definition: CommandObjectRegister.cpp:37
lldb_private::CommandObjectMultiword
Definition: CommandObjectMultiword.h:19
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
Options.h
lldb::eEncodingSint
@ eEncodingSint
signed integer
Definition: lldb-enumerations.h:149
lldb_private::Options
Definition: Options.h:57
lldb_private::Stream::Indent
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:130
lldb_private::DataExtractor
Definition: DataExtractor.h:48
Args.h
CommandObjectRegisterRead::CommandOptions::CommandOptions
CommandOptions()
Definition: CommandObjectRegister.cpp:234
lldb_private::CommandObjectMultiword::LoadSubCommand
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
Definition: CommandObjectMultiword.cpp:80
CommandObjectRegisterRead::GetOptions
Options * GetOptions() override
Definition: CommandObjectRegister.cpp:84
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:127
lldb_private::OptionGroupFormat
Definition: OptionGroupFormat.h:24
CommandObjectRegisterRead::HandleArgumentCompletion
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
Definition: CommandObjectRegister.cpp:74
lldb_private::CommandReturnObject::GetOutputStream
Stream & GetOutputStream()
Definition: CommandReturnObject.h:46
LLDB_OPT_SET_ALL
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:100
lldb_private::Process::GetAddressByteSize
uint32_t GetAddressByteSize() const
Definition: Process.cpp:3345
lldb::eEncodingUint
@ eEncodingUint
unsigned integer
Definition: lldb-enumerations.h:148
OptionValueArray.h
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::eArgRepeatStar
@ eArgRepeatStar
Definition: lldb-private-enumerations.h:98
lldb_private::CommandObjectRegister::~CommandObjectRegister
~CommandObjectRegister() override
CommandObjectRegisterRead::CommandOptions::dump_all_sets
OptionValueBoolean dump_all_sets
Definition: CommandObjectRegister.cpp:286
lldb_private::DumpRegisterValue
bool DumpRegisterValue(const RegisterValue &reg_val, Stream *s, const RegisterInfo *reg_info, bool prefix_with_name, bool prefix_with_alt_name, lldb::Format format, uint32_t reg_name_right_align_at=0)
Definition: DumpRegisterValue.cpp:18
lldb_private::CommandObject::CommandArgumentData::arg_type
lldb::CommandArgumentType arg_type
Definition: CommandObject.h:92
lldb_private::OptionElementVector
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:42
Thread.h
lldb_private::SectionLoadList::ResolveLoadAddress
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
Definition: SectionLoadList.cpp:209
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb_private::RegisterContext::GetRegisterSetCount
virtual size_t GetRegisterSetCount()=0
CommandObjectRegisterRead::CommandOptions::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition: CommandObjectRegister.cpp:245
lldb_private::Status
Definition: Status.h:44
lldb_private::Address::Dump
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX, bool all_ranges=false) const
Dump a description of this object to a Stream.
Definition: Address.cpp:406
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:26
uint32_t
lldb_private::ExecutionContext::GetBestExecutionContextScope
ExecutionContextScope * GetBestExecutionContextScope() const
Definition: ExecutionContext.cpp:214
lldb_private::Stream::IndentMore
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:168
lldb_private::Address
Definition: Address.h:59
lldb_private::Stream::EOL
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
CommandObjectRegisterRead::DoExecute
bool DoExecute(Args &command, CommandReturnObject &result) override
Definition: CommandObjectRegister.cpp:160
CommandObjectRegisterRead::CommandOptions::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition: CommandObjectRegister.cpp:241
CommandObjectRegisterRead::CommandOptions
Definition: CommandObjectRegister.cpp:232
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1091
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
CommandObjectRegisterRead::CommandOptions::alternate_name
OptionValueBoolean alternate_name
Definition: CommandObjectRegister.cpp:287
DataExtractor.h
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb_private::ExecutionContext::GetTargetRef
Target & GetTargetRef() const
Returns a reference to the target object.
Definition: ExecutionContext.cpp:224
lldb_private::CommandReturnObject::AppendErrorWithFormat
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:46
CommandObjectRegisterRead::m_format_options
OptionGroupFormat m_format_options
Definition: CommandObjectRegister.cpp:291
OptionParser.h
lldb_private::CompletionRequest::GetCursorIndex
size_t GetCursorIndex() const
Definition: CompletionRequest.h:156
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
CommandOptionArgumentTable.h
CommandObjectRegisterWrite::CommandObjectRegisterWrite
CommandObjectRegisterWrite(CommandInterpreter &interpreter)
Definition: CommandObjectRegister.cpp:298
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
OptionValueBoolean.h
lldb_private::OptionValue
Definition: OptionValue.h:24
lldb_private::CommandObject::CommandArgumentEntry
std::vector< CommandArgumentData > CommandArgumentEntry
Definition: CommandObject.h:106
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::Args::GetArgumentCount
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
Definition: Args.h:118
lldb
Definition: SBAddress.h:15
CommandObjectRegisterRead::CommandOptions::set_indexes
OptionValueArray set_indexes
Definition: CommandObjectRegister.cpp:285
RegisterContext.h
lldb_private::RegisterValue::SetValueFromString
Status SetValueFromString(const RegisterInfo *reg_info, llvm::StringRef value_str)
Definition: RegisterValue.cpp:335
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
ExecutionContext.h
CommandObjectRegisterRead::m_command_options
CommandOptions m_command_options
Definition: CommandObjectRegister.cpp:292
lldb_private::RegisterContext::GetRegisterInfoByName
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
Definition: RegisterContext.cpp:52
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
lldb_private::OptionValueArray
Definition: OptionValueArray.h:18