LLDB  mainline
CommandObjectDisassemble.cpp
Go to the documentation of this file.
1 //===-- CommandObjectDisassemble.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/AddressRange.h"
11 #include "lldb/Core/Disassembler.h"
12 #include "lldb/Core/Module.h"
13 #include "lldb/Host/OptionParser.h"
19 #include "lldb/Symbol/Function.h"
20 #include "lldb/Symbol/Symbol.h"
22 #include "lldb/Target/StackFrame.h"
23 #include "lldb/Target/Target.h"
24 
25 static constexpr unsigned default_disasm_byte_size = 32;
26 static constexpr unsigned default_disasm_num_ins = 4;
27 
28 using namespace lldb;
29 using namespace lldb_private;
30 
31 #define LLDB_OPTIONS_disassemble
32 #include "CommandOptions.inc"
33 
34 CommandObjectDisassemble::CommandOptions::CommandOptions() {
35  OptionParsingStarting(nullptr);
36 }
37 
38 CommandObjectDisassemble::CommandOptions::~CommandOptions() = default;
39 
40 Status CommandObjectDisassemble::CommandOptions::SetOptionValue(
41  uint32_t option_idx, llvm::StringRef option_arg,
42  ExecutionContext *execution_context) {
43  Status error;
44 
45  const int short_option = m_getopt_table[option_idx].val;
46 
47  switch (short_option) {
48  case 'm':
49  show_mixed = true;
50  break;
51 
52  case 'C':
53  if (option_arg.getAsInteger(0, num_lines_context))
54  error.SetErrorStringWithFormat("invalid num context lines string: \"%s\"",
55  option_arg.str().c_str());
56  break;
57 
58  case 'c':
59  if (option_arg.getAsInteger(0, num_instructions))
60  error.SetErrorStringWithFormat(
61  "invalid num of instructions string: \"%s\"",
62  option_arg.str().c_str());
63  break;
64 
65  case 'b':
66  show_bytes = true;
67  break;
68 
69  case 'k':
70  show_control_flow_kind = true;
71  break;
72 
73  case 's': {
74  start_addr = OptionArgParser::ToAddress(execution_context, option_arg,
76  if (start_addr != LLDB_INVALID_ADDRESS)
77  some_location_specified = true;
78  } break;
79  case 'e': {
80  end_addr = OptionArgParser::ToAddress(execution_context, option_arg,
82  if (end_addr != LLDB_INVALID_ADDRESS)
83  some_location_specified = true;
84  } break;
85 
86  case 'n':
87  func_name.assign(std::string(option_arg));
88  some_location_specified = true;
89  break;
90 
91  case 'p':
92  at_pc = true;
93  some_location_specified = true;
94  break;
95 
96  case 'l':
97  frame_line = true;
98  // Disassemble the current source line kind of implies showing mixed source
99  // code context.
100  show_mixed = true;
101  some_location_specified = true;
102  break;
103 
104  case 'P':
105  plugin_name.assign(std::string(option_arg));
106  break;
107 
108  case 'F': {
109  TargetSP target_sp =
110  execution_context ? execution_context->GetTargetSP() : TargetSP();
111  if (target_sp && (target_sp->GetArchitecture().GetTriple().getArch() ==
112  llvm::Triple::x86 ||
113  target_sp->GetArchitecture().GetTriple().getArch() ==
114  llvm::Triple::x86_64)) {
115  flavor_string.assign(std::string(option_arg));
116  } else
117  error.SetErrorStringWithFormat("Disassembler flavors are currently only "
118  "supported for x86 and x86_64 targets.");
119  break;
120  }
121 
122  case 'r':
123  raw = true;
124  break;
125 
126  case 'f':
127  current_function = true;
128  some_location_specified = true;
129  break;
130 
131  case 'A':
132  if (execution_context) {
133  const auto &target_sp = execution_context->GetTargetSP();
134  auto platform_ptr = target_sp ? target_sp->GetPlatform().get() : nullptr;
135  arch = Platform::GetAugmentedArchSpec(platform_ptr, option_arg);
136  }
137  break;
138 
139  case 'a': {
140  symbol_containing_addr = OptionArgParser::ToAddress(
141  execution_context, option_arg, LLDB_INVALID_ADDRESS, &error);
142  if (symbol_containing_addr != LLDB_INVALID_ADDRESS) {
143  some_location_specified = true;
144  }
145  } break;
146 
147  case '\x01':
148  force = true;
149  break;
150 
151  default:
152  llvm_unreachable("Unimplemented option");
153  }
154 
155  return error;
156 }
157 
158 void CommandObjectDisassemble::CommandOptions::OptionParsingStarting(
159  ExecutionContext *execution_context) {
160  show_mixed = false;
161  show_bytes = false;
162  show_control_flow_kind = false;
163  num_lines_context = 0;
164  num_instructions = 0;
165  func_name.clear();
166  current_function = false;
167  at_pc = false;
168  frame_line = false;
169  start_addr = LLDB_INVALID_ADDRESS;
170  end_addr = LLDB_INVALID_ADDRESS;
171  symbol_containing_addr = LLDB_INVALID_ADDRESS;
172  raw = false;
173  plugin_name.clear();
174 
175  Target *target =
176  execution_context ? execution_context->GetTargetPtr() : nullptr;
177 
178  // This is a hack till we get the ability to specify features based on
179  // architecture. For now GetDisassemblyFlavor is really only valid for x86
180  // (and for the llvm assembler plugin, but I'm papering over that since that
181  // is the only disassembler plugin we have...
182  if (target) {
183  if (target->GetArchitecture().GetTriple().getArch() == llvm::Triple::x86 ||
184  target->GetArchitecture().GetTriple().getArch() ==
185  llvm::Triple::x86_64) {
186  flavor_string.assign(target->GetDisassemblyFlavor());
187  } else
188  flavor_string.assign("default");
189 
190  } else
191  flavor_string.assign("default");
192 
193  arch.Clear();
194  some_location_specified = false;
195  force = false;
196 }
197 
198 Status CommandObjectDisassemble::CommandOptions::OptionParsingFinished(
199  ExecutionContext *execution_context) {
200  if (!some_location_specified)
201  current_function = true;
202  return Status();
203 }
204 
205 llvm::ArrayRef<OptionDefinition>
206 CommandObjectDisassemble::CommandOptions::GetDefinitions() {
207  return llvm::makeArrayRef(g_disassemble_options);
208 }
209 
210 // CommandObjectDisassemble
211 
212 CommandObjectDisassemble::CommandObjectDisassemble(
213  CommandInterpreter &interpreter)
215  interpreter, "disassemble",
216  "Disassemble specified instructions in the current target. "
217  "Defaults to the current function for the current thread and "
218  "stack frame.",
219  "disassemble [<cmd-options>]", eCommandRequiresTarget),
220  m_options() {}
221 
223 
225  llvm::StringRef what) {
227  range.GetByteSize() < GetDebugger().GetStopDisassemblyMaxSize())
228  return llvm::Error::success();
229  StreamString msg;
230  msg << "Not disassembling " << what << " because it is very large ";
233  msg << ". To disassemble specify an instruction count limit, start/stop "
234  "addresses or use the --force option.";
235  return llvm::createStringError(llvm::inconvertibleErrorCode(),
236  msg.GetString());
237 }
238 
239 llvm::Expected<std::vector<AddressRange>>
241  std::vector<AddressRange> ranges;
242  const auto &get_range = [&](Address addr) {
243  ModuleSP module_sp(addr.GetModule());
244  SymbolContext sc;
245  bool resolve_tail_call_address = true;
246  addr.GetModule()->ResolveSymbolContextForAddress(
247  addr, eSymbolContextEverything, sc, resolve_tail_call_address);
248  if (sc.function || sc.symbol) {
249  AddressRange range;
250  sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, 0,
251  false, range);
252  ranges.push_back(range);
253  }
254  };
255 
256  Target &target = GetSelectedTarget();
257  if (!target.GetSectionLoadList().IsEmpty()) {
258  Address symbol_containing_address;
260  m_options.symbol_containing_addr, symbol_containing_address)) {
261  get_range(symbol_containing_address);
262  }
263  } else {
264  for (lldb::ModuleSP module_sp : target.GetImages().Modules()) {
265  Address file_address;
266  if (module_sp->ResolveFileAddress(m_options.symbol_containing_addr,
267  file_address)) {
268  get_range(file_address);
269  }
270  }
271  }
272 
273  if (ranges.empty()) {
274  return llvm::createStringError(
275  llvm::inconvertibleErrorCode(),
276  "Could not find function bounds for address 0x%" PRIx64,
278  }
279 
280  if (llvm::Error err = CheckRangeSize(ranges[0], "the function"))
281  return std::move(err);
282  return ranges;
283 }
284 
285 llvm::Expected<std::vector<AddressRange>>
287  Process *process = m_exe_ctx.GetProcessPtr();
288  StackFrame *frame = m_exe_ctx.GetFramePtr();
289  if (!frame) {
290  if (process) {
291  return llvm::createStringError(
292  llvm::inconvertibleErrorCode(),
293  "Cannot disassemble around the current "
294  "function without the process being stopped.\n");
295  } else {
296  return llvm::createStringError(llvm::inconvertibleErrorCode(),
297  "Cannot disassemble around the current "
298  "function without a selected frame: "
299  "no currently running process.\n");
300  }
301  }
302  SymbolContext sc(
303  frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextSymbol));
304  AddressRange range;
305  if (sc.function)
306  range = sc.function->GetAddressRange();
307  else if (sc.symbol && sc.symbol->ValueIsAddress()) {
308  range = {sc.symbol->GetAddress(), sc.symbol->GetByteSize()};
309  } else
310  range = {frame->GetFrameCodeAddress(), default_disasm_byte_size};
311 
312  if (llvm::Error err = CheckRangeSize(range, "the current function"))
313  return std::move(err);
314  return std::vector<AddressRange>{range};
315 }
316 
317 llvm::Expected<std::vector<AddressRange>>
319  Process *process = m_exe_ctx.GetProcessPtr();
320  StackFrame *frame = m_exe_ctx.GetFramePtr();
321  if (!frame) {
322  if (process) {
323  return llvm::createStringError(
324  llvm::inconvertibleErrorCode(),
325  "Cannot disassemble around the current "
326  "function without the process being stopped.\n");
327  } else {
328  return llvm::createStringError(llvm::inconvertibleErrorCode(),
329  "Cannot disassemble around the current "
330  "line without a selected frame: "
331  "no currently running process.\n");
332  }
333  }
334 
335  LineEntry pc_line_entry(
336  frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
337  if (pc_line_entry.IsValid())
338  return std::vector<AddressRange>{pc_line_entry.range};
339 
340  // No line entry, so just disassemble around the current pc
341  m_options.show_mixed = false;
342  return GetPCRanges();
343 }
344 
345 llvm::Expected<std::vector<AddressRange>>
347  ConstString name(m_options.func_name.c_str());
348 
349  ModuleFunctionSearchOptions function_options;
350  function_options.include_symbols = true;
351  function_options.include_inlines = true;
352 
353  // Find functions matching the given name.
354  SymbolContextList sc_list;
355  GetSelectedTarget().GetImages().FindFunctions(name, eFunctionNameTypeAuto,
356  function_options, sc_list);
357 
358  std::vector<AddressRange> ranges;
359  llvm::Error range_errs = llvm::Error::success();
360  AddressRange range;
361  const uint32_t scope =
362  eSymbolContextBlock | eSymbolContextFunction | eSymbolContextSymbol;
363  const bool use_inline_block_range = true;
364  for (SymbolContext sc : sc_list.SymbolContexts()) {
365  for (uint32_t range_idx = 0;
366  sc.GetAddressRange(scope, range_idx, use_inline_block_range, range);
367  ++range_idx) {
368  if (llvm::Error err = CheckRangeSize(range, "a range"))
369  range_errs = joinErrors(std::move(range_errs), std::move(err));
370  else
371  ranges.push_back(range);
372  }
373  }
374  if (ranges.empty()) {
375  if (range_errs)
376  return std::move(range_errs);
377  return llvm::createStringError(llvm::inconvertibleErrorCode(),
378  "Unable to find symbol with name '%s'.\n",
379  name.GetCString());
380  }
381  if (range_errs)
382  result.AppendWarning(toString(std::move(range_errs)));
383  return ranges;
384 }
385 
386 llvm::Expected<std::vector<AddressRange>>
388  Process *process = m_exe_ctx.GetProcessPtr();
389  StackFrame *frame = m_exe_ctx.GetFramePtr();
390  if (!frame) {
391  if (process) {
392  return llvm::createStringError(
393  llvm::inconvertibleErrorCode(),
394  "Cannot disassemble around the current "
395  "function without the process being stopped.\n");
396  } else {
397  return llvm::createStringError(llvm::inconvertibleErrorCode(),
398  "Cannot disassemble around the current "
399  "PC without a selected frame: "
400  "no currently running process.\n");
401  }
402  }
403 
404  if (m_options.num_instructions == 0) {
405  // Disassembling at the PC always disassembles some number of
406  // instructions (not the whole function).
408  }
409  return std::vector<AddressRange>{{frame->GetFrameCodeAddress(), 0}};
410 }
411 
412 llvm::Expected<std::vector<AddressRange>>
414  addr_t size = 0;
417  return llvm::createStringError(llvm::inconvertibleErrorCode(),
418  "End address before start address.");
419  }
421  }
422  return std::vector<AddressRange>{{Address(m_options.start_addr), size}};
423 }
424 
425 llvm::Expected<std::vector<AddressRange>>
427  CommandReturnObject &result) {
432  if (m_options.frame_line)
434  if (!m_options.func_name.empty())
439 }
440 
442  CommandReturnObject &result) {
443  Target *target = &GetSelectedTarget();
444 
445  if (!m_options.arch.IsValid())
446  m_options.arch = target->GetArchitecture();
447 
448  if (!m_options.arch.IsValid()) {
449  result.AppendError(
450  "use the --arch option or set the target architecture to disassemble");
451  return false;
452  }
453 
454  const char *plugin_name = m_options.GetPluginName();
455  const char *flavor_string = m_options.GetFlavorString();
456 
457  DisassemblerSP disassembler =
458  Disassembler::FindPlugin(m_options.arch, flavor_string, plugin_name);
459 
460  if (!disassembler) {
461  if (plugin_name) {
462  result.AppendErrorWithFormat(
463  "Unable to find Disassembler plug-in named '%s' that supports the "
464  "'%s' architecture.\n",
465  plugin_name, m_options.arch.GetArchitectureName());
466  } else
467  result.AppendErrorWithFormat(
468  "Unable to find Disassembler plug-in for the '%s' architecture.\n",
470  return false;
471  } else if (flavor_string != nullptr && !disassembler->FlavorValidForArchSpec(
472  m_options.arch, flavor_string))
474  "invalid disassembler flavor \"%s\", using default.\n", flavor_string);
475 
477 
478  if (!command.empty()) {
479  result.AppendErrorWithFormat(
480  "\"disassemble\" arguments are specified as options.\n");
481  const int terminal_width =
483  GetOptions()->GenerateOptionUsage(result.GetErrorStream(), *this,
484  terminal_width);
485  return false;
486  }
487 
490 
491  // Always show the PC in the disassembly
493 
494  // Mark the source line for the current PC only if we are doing mixed source
495  // and assembly
496  if (m_options.show_mixed)
498 
499  if (m_options.show_bytes)
501 
504 
505  if (m_options.raw)
507 
508  llvm::Expected<std::vector<AddressRange>> ranges =
509  GetRangesForSelectedMode(result);
510  if (!ranges) {
511  result.AppendError(toString(ranges.takeError()));
512  return result.Succeeded();
513  }
514 
515  bool print_sc_header = ranges->size() > 1;
516  for (AddressRange cur_range : *ranges) {
517  Disassembler::Limit limit;
518  if (m_options.num_instructions == 0) {
519  limit = {Disassembler::Limit::Bytes, cur_range.GetByteSize()};
520  if (limit.value == 0)
522  } else {
524  }
526  GetDebugger(), m_options.arch, plugin_name, flavor_string,
527  m_exe_ctx, cur_range.GetBaseAddress(), limit, m_options.show_mixed,
529  result.GetOutputStream())) {
531  } else {
533  result.AppendErrorWithFormat(
534  "Failed to disassemble memory in function at 0x%8.8" PRIx64 ".\n",
536  } else {
537  result.AppendErrorWithFormat(
538  "Failed to disassemble memory at 0x%8.8" PRIx64 ".\n",
539  cur_range.GetBaseAddress().GetLoadAddress(target));
540  }
541  }
542  if (print_sc_header)
543  result.GetOutputStream() << "\n";
544  }
545 
546  return result.Succeeded();
547 }
lldb_private::toString
const char * toString(AppleArm64ExceptionClass EC)
Definition: AppleArm64ExceptionClass.h:38
lldb_private::CommandObjectParsed
Definition: CommandObject.h:389
default_disasm_byte_size
static constexpr unsigned default_disasm_byte_size
Definition: CommandObjectDisassemble.cpp:25
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::CommandObjectDisassemble::CommandOptions::end_addr
lldb::addr_t end_addr
Definition: CommandObjectDisassemble.h:56
lldb_private::ModuleList::Modules
ModuleIterable Modules() const
Definition: ModuleList.h:491
lldb_private::LineEntry::IsValid
bool IsValid() const
Check if a line entry object is valid.
Definition: LineEntry.cpp:46
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:457
lldb_private::CommandObjectDisassemble::CommandOptions::num_instructions
uint32_t num_instructions
Definition: CommandObjectDisassemble.h:51
lldb_private::Symbol::ValueIsAddress
bool ValueIsAddress() const
Definition: Symbol.cpp:117
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:206
CommandObjectDisassemble.h
lldb_private::SymbolContext::GetAddressRange
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Definition: SymbolContext.cpp:380
lldb_private::Address::DumpStyleFileAddress
@ DumpStyleFileAddress
Display as the file address (if any).
Definition: Address.h:84
lldb_private::StackFrame::GetFrameCodeAddress
const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
Definition: StackFrame.cpp:189
lldb_private::CommandObject::m_exe_ctx
ExecutionContext m_exe_ctx
Definition: CommandObject.h:369
lldb_private::Disassembler::FindPlugin
static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name)
Definition: Disassembler.cpp:58
lldb_private::CommandObjectDisassemble::GetOptions
Options * GetOptions() override
Definition: CommandObjectDisassemble.h:73
lldb_private::Process
Definition: Process.h:338
lldb_private::CommandObjectDisassemble::CommandOptions::frame_line
bool frame_line
Definition: CommandObjectDisassemble.h:58
lldb_private::AddressRange::GetByteSize
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
Definition: AddressRange.h:221
Module.h
lldb_private::Disassembler::Limit::Bytes
@ Bytes
Definition: Disassembler.h:412
lldb_private::CommandObjectDisassemble::CommandOptions::func_name
std::string func_name
Definition: CommandObjectDisassemble.h:53
lldb_private::CommandObjectDisassemble::CommandOptions::arch
ArchSpec arch
Definition: CommandObjectDisassemble.h:61
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
OptionArgParser.h
SectionLoadList.h
lldb_private::ExecutionContext::GetFramePtr
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Definition: ExecutionContext.h:408
StackFrame.h
Disassembler.h
lldb_private::Disassembler::Limit
Definition: Disassembler.h:411
lldb_private::Args
Definition: Args.h:33
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:455
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::CommandReturnObject::Succeeded
bool Succeeded() const
Definition: CommandReturnObject.cpp:131
lldb_private::ModuleFunctionSearchOptions::include_symbols
bool include_symbols
Include the symbol table.
Definition: Module.h:65
CommandReturnObject.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:467
lldb_private::Disassembler::eOptionShowBytes
@ eOptionShowBytes
Definition: Disassembler.h:383
lldb_private::CommandObjectDisassemble::GetCurrentFunctionRanges
llvm::Expected< std::vector< AddressRange > > GetCurrentFunctionRanges()
Definition: CommandObjectDisassemble.cpp:286
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:941
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::ModuleFunctionSearchOptions::include_inlines
bool include_inlines
Include inlined functions.
Definition: Module.h:67
lldb_private::CommandObjectDisassemble::CommandOptions::GetFlavorString
const char * GetFlavorString()
Definition: CommandObjectDisassemble.h:39
Target.h
lldb_private::CommandObjectDisassemble::GetCurrentLineRanges
llvm::Expected< std::vector< AddressRange > > GetCurrentLineRanges()
Definition: CommandObjectDisassemble.cpp:318
lldb_private::CommandObjectDisassemble::GetStartEndAddressRanges
llvm::Expected< std::vector< AddressRange > > GetStartEndAddressRanges()
Definition: CommandObjectDisassemble.cpp:413
lldb_private::CommandObjectDisassemble::CommandOptions::show_mixed
bool show_mixed
Definition: CommandObjectDisassemble.h:47
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
Options.h
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
lldb_private::Address::DumpStyleLoadAddress
@ DumpStyleLoadAddress
Display as the load address (if resolved).
Definition: Address.h:96
lldb_private::CommandObjectDisassemble::CommandOptions::force
bool force
Definition: CommandObjectDisassemble.h:66
lldb_private::CommandObjectDisassemble::GetContainingAddressRanges
llvm::Expected< std::vector< AddressRange > > GetContainingAddressRanges()
Definition: CommandObjectDisassemble.cpp:240
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:127
lldb_private::Disassembler::eOptionShowControlFlowKind
@ eOptionShowControlFlowKind
Definition: Disassembler.h:389
default_disasm_num_ins
static constexpr unsigned default_disasm_num_ins
Definition: CommandObjectDisassemble.cpp:26
lldb_private::CommandObjectDisassemble::~CommandObjectDisassemble
~CommandObjectDisassemble() override
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
lldb_private::CommandReturnObject::GetOutputStream
Stream & GetOutputStream()
Definition: CommandReturnObject.h:46
lldb_private::Debugger::GetTerminalWidth
uint32_t GetTerminalWidth() const
Definition: Debugger.cpp:344
lldb_private::Disassembler::Disassemble
static bool Disassemble(Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, const Address &start, Limit limit, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
Definition: Disassembler.cpp:168
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::StreamString
Definition: StreamString.h:23
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::CommandObjectDisassemble::CommandOptions::symbol_containing_addr
lldb::addr_t symbol_containing_addr
Definition: CommandObjectDisassemble.h:65
lldb_private::CommandReturnObject::GetErrorStream
Stream & GetErrorStream()
Definition: CommandReturnObject.h:56
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ArchSpec::IsValid
bool IsValid() const
Tests if this ArchSpec is valid.
Definition: ArchSpec.h:353
lldb_private::CommandObject::GetSelectedTarget
Target & GetSelectedTarget()
Definition: CommandObject.cpp:688
lldb_private::CommandObjectDisassemble::GetPCRanges
llvm::Expected< std::vector< AddressRange > > GetPCRanges()
Definition: CommandObjectDisassemble.cpp:387
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::CommandObjectDisassemble::GetRangesForSelectedMode
llvm::Expected< std::vector< AddressRange > > GetRangesForSelectedMode(CommandReturnObject &result)
Definition: CommandObjectDisassemble.cpp:426
lldb_private::Disassembler::Limit::value
lldb::addr_t value
Definition: Disassembler.h:413
lldb_private::Disassembler::eOptionMarkPCAddress
@ eOptionMarkPCAddress
Definition: Disassembler.h:387
lldb_private::CommandObjectDisassemble::CommandOptions::num_lines_context
uint32_t num_lines_context
Definition: CommandObjectDisassemble.h:50
lldb_private::ModuleFunctionSearchOptions
Options used by Module::FindFunctions.
Definition: Module.h:63
Symbol.h
lldb_private::SectionLoadList::IsEmpty
bool IsEmpty() const
Definition: SectionLoadList.cpp:38
lldb_private::CommandObjectDisassemble::GetNameRanges
llvm::Expected< std::vector< AddressRange > > GetNameRanges(CommandReturnObject &result)
Definition: CommandObjectDisassemble.cpp:346
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:983
lldb_private::Status
Definition: Status.h:44
lldb_private::CommandObjectDisassemble::CommandOptions::show_control_flow_kind
bool show_control_flow_kind
Definition: CommandObjectDisassemble.h:49
lldb_private::ArchSpec::GetArchitectureName
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition: ArchSpec.cpp:539
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:26
uint32_t
lldb_private::CommandInterpreter::GetDebugger
Debugger & GetDebugger()
Definition: CommandInterpreter.h:437
lldb_private::AddressRange::Dump
bool Dump(Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style=Address::DumpStyleInvalid) const
Dump a description of this object to a Stream.
Definition: AddressRange.cpp:148
lldb_private::CommandObjectDisassemble::DoExecute
bool DoExecute(Args &command, CommandReturnObject &result) override
Definition: CommandObjectDisassemble.cpp:441
lldb::eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishResult
Definition: lldb-enumerations.h:261
lldb_private::Broadcaster::Clear
void Clear()
Definition: Broadcaster.h:284
lldb_private::SymbolContextList::SymbolContexts
SymbolContextIterable SymbolContexts()
Definition: SymbolContext.h:474
lldb_private::Address
Definition: Address.h:59
lldb_private::CommandReturnObject::AppendWarning
void void AppendWarning(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:94
lldb_private::Disassembler::Limit::Instructions
@ Instructions
Definition: Disassembler.h:412
lldb_private::Options::GenerateOptionUsage
void GenerateOptionUsage(Stream &strm, CommandObject &cmd, uint32_t screen_width)
Definition: Options.cpp:395
lldb_private::CommandObjectDisassemble::CheckRangeSize
llvm::Error CheckRangeSize(const AddressRange &range, llvm::StringRef what)
Definition: CommandObjectDisassemble.cpp:224
lldb_private::Symbol::GetByteSize
lldb::addr_t GetByteSize() const
Definition: Symbol.cpp:415
lldb_private::CommandReturnObject::AppendWarningWithFormat
void AppendWarningWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:76
lldb_private::LineEntry::range
AddressRange range
The section offset address range for this line entry.
Definition: LineEntry.h:139
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1091
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
lldb_private::ExecutionContext::GetTargetSP
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
Definition: ExecutionContext.h:454
lldb_private::CommandObjectDisassemble::CommandOptions::show_bytes
bool show_bytes
Definition: CommandObjectDisassemble.h:48
lldb_private::CommandObject::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: CommandObject.h:122
Function.h
lldb_private::ModuleList::FindFunctions
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
lldb_private::CommandReturnObject::AppendErrorWithFormat
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:46
OptionParser.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CommandObjectDisassemble::CommandOptions::GetPluginName
const char * GetPluginName()
Definition: CommandObjectDisassemble.h:35
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
CommandInterpreter.h
lldb_private::Args::empty
bool empty() const
Definition: Args.h:120
CommandOptionArgumentTable.h
lldb_private::CommandObjectDisassemble::CommandOptions::raw
bool raw
Definition: CommandObjectDisassemble.h:52
lldb_private::SymbolContext::line_entry
LineEntry line_entry
The LineEntry for a given query.
Definition: SymbolContext.h:322
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::CommandObjectDisassemble::CommandOptions::start_addr
lldb::addr_t start_addr
Definition: CommandObjectDisassemble.h:55
lldb_private::TargetProperties::GetDisassemblyFlavor
const char * GetDisassemblyFlavor() const
Definition: Target.cpp:4137
AddressRange.h
lldb
Definition: SBAddress.h:15
lldb_private::CommandObjectDisassemble::m_options
CommandOptions m_options
Definition: CommandObjectDisassemble.h:91
lldb_private::StackFrame::GetSymbolContext
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
Definition: StackFrame.cpp:299
lldb_private::Disassembler::eOptionMarkPCSourceLine
@ eOptionMarkPCSourceLine
Definition: Disassembler.h:385
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:198
lldb_private::Disassembler::eOptionRawOuput
@ eOptionRawOuput
Definition: Disassembler.h:384
lldb_private::CommandObjectDisassemble::CommandOptions::current_function
bool current_function
Definition: CommandObjectDisassemble.h:54
lldb_private::CommandObject::GetDebugger
Debugger & GetDebugger()
Definition: CommandObject.cpp:53
lldb_private::Symbol::GetAddress
Address GetAddress() const
Definition: Symbol.h:73