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  const bool include_symbols = true;
326  const bool include_inlines = true;
327 
328  // Find functions matching the given name.
329  SymbolContextList sc_list;
331  name, eFunctionNameTypeAuto, include_symbols, include_inlines, sc_list);
332 
333  std::vector<AddressRange> ranges;
334  llvm::Error range_errs = llvm::Error::success();
335  AddressRange range;
336  const uint32_t scope =
337  eSymbolContextBlock | eSymbolContextFunction | eSymbolContextSymbol;
338  const bool use_inline_block_range = true;
339  for (SymbolContext sc : sc_list.SymbolContexts()) {
340  for (uint32_t range_idx = 0;
341  sc.GetAddressRange(scope, range_idx, use_inline_block_range, range);
342  ++range_idx) {
343  if (llvm::Error err = CheckRangeSize(range, "a range"))
344  range_errs = joinErrors(std::move(range_errs), std::move(err));
345  else
346  ranges.push_back(range);
347  }
348  }
349  if (ranges.empty()) {
350  if (range_errs)
351  return std::move(range_errs);
352  return llvm::createStringError(llvm::inconvertibleErrorCode(),
353  "Unable to find symbol with name '%s'.\n",
354  name.GetCString());
355  }
356  if (range_errs)
357  result.AppendWarning(toString(std::move(range_errs)));
358  return ranges;
359 }
360 
361 llvm::Expected<std::vector<AddressRange>>
363  StackFrame *frame = m_exe_ctx.GetFramePtr();
364  if (!frame) {
365  return llvm::createStringError(llvm::inconvertibleErrorCode(),
366  "Cannot disassemble around the current "
367  "PC without a selected frame.\n");
368  }
369 
370  if (m_options.num_instructions == 0) {
371  // Disassembling at the PC always disassembles some number of
372  // instructions (not the whole function).
374  }
375  return std::vector<AddressRange>{{frame->GetFrameCodeAddress(), 0}};
376 }
377 
378 llvm::Expected<std::vector<AddressRange>>
380  addr_t size = 0;
383  return llvm::createStringError(llvm::inconvertibleErrorCode(),
384  "End address before start address.");
385  }
387  }
388  return std::vector<AddressRange>{{Address(m_options.start_addr), size}};
389 }
390 
391 llvm::Expected<std::vector<AddressRange>>
393  CommandReturnObject &result) {
398  if (m_options.frame_line)
400  if (!m_options.func_name.empty())
405 }
406 
408  CommandReturnObject &result) {
409  Target *target = &GetSelectedTarget();
410 
411  if (!m_options.arch.IsValid())
412  m_options.arch = target->GetArchitecture();
413 
414  if (!m_options.arch.IsValid()) {
415  result.AppendError(
416  "use the --arch option or set the target architecture to disassemble");
417  return false;
418  }
419 
420  const char *plugin_name = m_options.GetPluginName();
421  const char *flavor_string = m_options.GetFlavorString();
422 
423  DisassemblerSP disassembler =
424  Disassembler::FindPlugin(m_options.arch, flavor_string, plugin_name);
425 
426  if (!disassembler) {
427  if (plugin_name) {
428  result.AppendErrorWithFormat(
429  "Unable to find Disassembler plug-in named '%s' that supports the "
430  "'%s' architecture.\n",
431  plugin_name, m_options.arch.GetArchitectureName());
432  } else
433  result.AppendErrorWithFormat(
434  "Unable to find Disassembler plug-in for the '%s' architecture.\n",
436  return false;
437  } else if (flavor_string != nullptr && !disassembler->FlavorValidForArchSpec(
438  m_options.arch, flavor_string))
440  "invalid disassembler flavor \"%s\", using default.\n", flavor_string);
441 
443 
444  if (!command.empty()) {
445  result.AppendErrorWithFormat(
446  "\"disassemble\" arguments are specified as options.\n");
447  const int terminal_width =
450  terminal_width);
451  return false;
452  }
453 
456 
457  // Always show the PC in the disassembly
459 
460  // Mark the source line for the current PC only if we are doing mixed source
461  // and assembly
462  if (m_options.show_mixed)
464 
465  if (m_options.show_bytes)
467 
468  if (m_options.raw)
470 
471  llvm::Expected<std::vector<AddressRange>> ranges =
472  GetRangesForSelectedMode(result);
473  if (!ranges) {
474  result.AppendError(toString(ranges.takeError()));
475  return result.Succeeded();
476  }
477 
478  bool print_sc_header = ranges->size() > 1;
479  for (AddressRange cur_range : *ranges) {
480  Disassembler::Limit limit;
481  if (m_options.num_instructions == 0) {
482  limit = {Disassembler::Limit::Bytes, cur_range.GetByteSize()};
483  if (limit.value == 0)
485  } else {
487  }
489  GetDebugger(), m_options.arch, plugin_name, flavor_string,
490  m_exe_ctx, cur_range.GetBaseAddress(), limit, m_options.show_mixed,
492  result.GetOutputStream())) {
494  } else {
496  result.AppendErrorWithFormat(
497  "Failed to disassemble memory in function at 0x%8.8" PRIx64 ".\n",
499  } else {
500  result.AppendErrorWithFormat(
501  "Failed to disassemble memory at 0x%8.8" PRIx64 ".\n",
502  cur_range.GetBaseAddress().GetLoadAddress(target));
503  }
504  }
505  if (print_sc_header)
506  result.GetOutputStream() << "\n";
507  }
508 
509  return result.Succeeded();
510 }
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: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:480
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: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: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: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: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: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: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:445
lldb_private::Disassembler::eOptionShowBytes
@ eOptionShowBytes
Definition: Disassembler.h:365
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:919
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:304
lldb_private::CommandObjectDisassemble::GetStartEndAddressRanges
llvm::Expected< std::vector< AddressRange > > GetStartEndAddressRanges()
Definition: CommandObjectDisassemble.cpp:379
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: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: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: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:39
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:362
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:392
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:390
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:323
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:961
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:393
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:407
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:393
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:1034
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::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::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:3915
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