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