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