LLDB  mainline
Symbol.cpp
Go to the documentation of this file.
1 //===-- Symbol.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 
9 #include "lldb/Symbol/Symbol.h"
10 
11 #include "lldb/Core/Module.h"
12 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Core/Section.h"
14 #include "lldb/Symbol/Function.h"
15 #include "lldb/Symbol/ObjectFile.h"
17 #include "lldb/Symbol/Symtab.h"
18 #include "lldb/Target/Process.h"
19 #include "lldb/Target/Target.h"
20 #include "lldb/Utility/Stream.h"
21 
22 using namespace lldb;
23 using namespace lldb_private;
24 
25 Symbol::Symbol()
26  : SymbolContextScope(), m_type_data_resolved(false), m_is_synthetic(false),
27  m_is_debug(false), m_is_external(false), m_size_is_sibling(false),
28  m_size_is_synthesized(false), m_size_is_valid(false),
29  m_demangled_is_synthesized(false), m_contains_linker_annotations(false),
30  m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(),
31  m_addr_range() {}
32 
33 Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type, bool external,
34  bool is_debug, bool is_trampoline, bool is_artificial,
35  const lldb::SectionSP &section_sp, addr_t offset, addr_t size,
36  bool size_is_valid, bool contains_linker_annotations,
37  uint32_t flags)
38  : SymbolContextScope(), m_uid(symID), m_type_data(0),
39  m_type_data_resolved(false), m_is_synthetic(is_artificial),
40  m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false),
41  m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0),
42  m_demangled_is_synthesized(false),
43  m_contains_linker_annotations(contains_linker_annotations),
44  m_is_weak(false), m_type(type),
45  m_mangled(name),
46  m_addr_range(section_sp, offset, size), m_flags(flags) {}
47 
48 Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type,
49  bool external, bool is_debug, bool is_trampoline,
50  bool is_artificial, const AddressRange &range,
51  bool size_is_valid, bool contains_linker_annotations,
52  uint32_t flags)
53  : SymbolContextScope(), m_uid(symID), m_type_data(0),
54  m_type_data_resolved(false), m_is_synthetic(is_artificial),
55  m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false),
56  m_size_is_synthesized(false),
57  m_size_is_valid(size_is_valid || range.GetByteSize() > 0),
58  m_demangled_is_synthesized(false),
59  m_contains_linker_annotations(contains_linker_annotations),
60  m_is_weak(false), m_type(type), m_mangled(mangled), m_addr_range(range),
61  m_flags(flags) {}
62 
64  : SymbolContextScope(rhs), m_uid(rhs.m_uid), m_type_data(rhs.m_type_data),
65  m_type_data_resolved(rhs.m_type_data_resolved),
66  m_is_synthetic(rhs.m_is_synthetic), m_is_debug(rhs.m_is_debug),
67  m_is_external(rhs.m_is_external),
68  m_size_is_sibling(rhs.m_size_is_sibling), m_size_is_synthesized(false),
69  m_size_is_valid(rhs.m_size_is_valid),
70  m_demangled_is_synthesized(rhs.m_demangled_is_synthesized),
71  m_contains_linker_annotations(rhs.m_contains_linker_annotations),
72  m_is_weak(rhs.m_is_weak), m_type(rhs.m_type), m_mangled(rhs.m_mangled),
73  m_addr_range(rhs.m_addr_range), m_flags(rhs.m_flags) {}
74 
75 const Symbol &Symbol::operator=(const Symbol &rhs) {
76  if (this != &rhs) {
77  SymbolContextScope::operator=(rhs);
78  m_uid = rhs.m_uid;
82  m_is_debug = rhs.m_is_debug;
89  m_is_weak = rhs.m_is_weak;
90  m_type = rhs.m_type;
91  m_mangled = rhs.m_mangled;
93  m_flags = rhs.m_flags;
94  }
95  return *this;
96 }
97 
98 void Symbol::Clear() {
99  m_uid = UINT32_MAX;
100  m_mangled.Clear();
101  m_type_data = 0;
102  m_type_data_resolved = false;
103  m_is_synthetic = false;
104  m_is_debug = false;
105  m_is_external = false;
106  m_size_is_sibling = false;
107  m_size_is_synthesized = false;
108  m_size_is_valid = false;
111  m_is_weak = false;
113  m_flags = 0;
115 }
116 
118  return m_addr_range.GetBaseAddress().GetSection().get() != nullptr ||
120 }
121 
123  return GetMangled().GetDisplayDemangledName();
124 }
125 
127  if (m_type == eSymbolTypeReExported) {
128  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
129  // as the offset in the address range base address. We can then make this
130  // back into a string that is the re-exported name.
131  intptr_t str_ptr = m_addr_range.GetBaseAddress().GetOffset();
132  if (str_ptr != 0)
133  return ConstString((const char *)str_ptr);
134  else
135  return GetName();
136  }
137  return ConstString();
138 }
139 
141  if (m_type == eSymbolTypeReExported) {
142  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
143  // as the offset in the address range base address. We can then make this
144  // back into a string that is the re-exported name.
145  intptr_t str_ptr = m_addr_range.GetByteSize();
146  if (str_ptr != 0)
147  return FileSpec((const char *)str_ptr);
148  }
149  return FileSpec();
150 }
151 
154  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
155  // as the offset in the address range base address.
156  m_addr_range.GetBaseAddress().SetOffset((uintptr_t)name.GetCString());
157 }
158 
160  if (m_type == eSymbolTypeReExported) {
161  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
162  // as the offset in the address range base address.
164  (uintptr_t)ConstString(fspec.GetPath().c_str()).GetCString());
165  return true;
166  }
167  return false;
168 }
169 
172 }
173 
175 
176 bool Symbol::IsIndirect() const { return m_type == eSymbolTypeResolver; }
177 
179  Target *target) const {
180  s->Printf("id = {0x%8.8x}", m_uid);
181 
183  if (ValueIsAddress()) {
184  const lldb::addr_t byte_size = GetByteSize();
185  if (byte_size > 0) {
186  s->PutCString(", range = ");
189  } else {
190  s->PutCString(", address = ");
191  m_addr_range.GetBaseAddress().Dump(s, target,
194  }
195  } else
196  s->Printf(", value = 0x%16.16" PRIx64,
198  } else {
199  if (m_size_is_sibling)
200  s->Printf(", sibling = %5" PRIu64,
202  else
203  s->Printf(", value = 0x%16.16" PRIx64,
205  }
206  ConstString demangled = GetMangled().GetDemangledName();
207  if (demangled)
208  s->Printf(", name=\"%s\"", demangled.AsCString());
209  if (m_mangled.GetMangledName())
210  s->Printf(", mangled=\"%s\"", m_mangled.GetMangledName().AsCString());
211 }
212 
213 void Symbol::Dump(Stream *s, Target *target, uint32_t index,
214  Mangled::NamePreference name_preference) const {
215  s->Printf("[%5u] %6u %c%c%c %-15s ", index, GetID(), m_is_debug ? 'D' : ' ',
216  m_is_synthetic ? 'S' : ' ', m_is_external ? 'X' : ' ',
217  GetTypeAsString());
218 
219  // Make sure the size of the symbol is up to date before dumping
220  GetByteSize();
221 
222  ConstString name = GetMangled().GetName(name_preference);
223  if (ValueIsAddress()) {
224  if (!m_addr_range.GetBaseAddress().Dump(s, nullptr,
226  s->Printf("%*s", 18, "");
227 
228  s->PutChar(' ');
229 
230  if (!m_addr_range.GetBaseAddress().Dump(s, target,
232  s->Printf("%*s", 18, "");
233 
234  const char *format = m_size_is_sibling ? " Sibling -> [%5llu] 0x%8.8x %s\n"
235  : " 0x%16.16" PRIx64 " 0x%8.8x %s\n";
236  s->Printf(format, GetByteSize(), m_flags, name.AsCString(""));
237  } else if (m_type == eSymbolTypeReExported) {
238  s->Printf(
239  " 0x%8.8x %s",
240  m_flags, name.AsCString(""));
241 
242  ConstString reexport_name = GetReExportedSymbolName();
243  intptr_t shlib = m_addr_range.GetByteSize();
244  if (shlib)
245  s->Printf(" -> %s`%s\n", (const char *)shlib, reexport_name.GetCString());
246  else
247  s->Printf(" -> %s\n", reexport_name.GetCString());
248  } else {
249  const char *format =
251  ? "0x%16.16" PRIx64
252  " Sibling -> [%5llu] 0x%8.8x %s\n"
253  : "0x%16.16" PRIx64 " 0x%16.16" PRIx64
254  " 0x%8.8x %s\n";
256  m_flags, name.AsCString(""));
257  }
258 }
259 
262  if (!m_type_data_resolved) {
263  m_type_data_resolved = true;
264 
265  const Address &base_address = m_addr_range.GetBaseAddress();
266  Function *function = base_address.CalculateSymbolContextFunction();
267  if (function) {
268  // Functions have line entries which can also potentially have end of
269  // prologue information. So if this symbol points to a function, use
270  // the prologue information from there.
271  m_type_data = function->GetPrologueByteSize();
272  } else {
273  ModuleSP module_sp(base_address.GetModule());
274  SymbolContext sc;
275  if (module_sp) {
276  uint32_t resolved_flags = module_sp->ResolveSymbolContextForAddress(
277  base_address, eSymbolContextLineEntry, sc);
278  if (resolved_flags & eSymbolContextLineEntry) {
279  // Default to the end of the first line entry.
281 
282  // Set address for next line.
283  Address addr(base_address);
284  addr.Slide(m_type_data);
285 
286  // Check the first few instructions and look for one that has a
287  // line number that is different than the first entry. This is also
288  // done in Function::GetPrologueByteSize().
289  uint16_t total_offset = m_type_data;
290  for (int idx = 0; idx < 6; ++idx) {
291  SymbolContext sc_temp;
292  resolved_flags = module_sp->ResolveSymbolContextForAddress(
293  addr, eSymbolContextLineEntry, sc_temp);
294  // Make sure we got line number information...
295  if (!(resolved_flags & eSymbolContextLineEntry))
296  break;
297 
298  // If this line number is different than our first one, use it
299  // and we're done.
300  if (sc_temp.line_entry.line != sc.line_entry.line) {
301  m_type_data = total_offset;
302  break;
303  }
304 
305  // Slide addr up to the next line address.
306  addr.Slide(sc_temp.line_entry.range.GetByteSize());
307  total_offset += sc_temp.line_entry.range.GetByteSize();
308  // If we've gone too far, bail out.
309  if (total_offset >= m_addr_range.GetByteSize())
310  break;
311  }
312 
313  // Sanity check - this may be a function in the middle of code that
314  // has debug information, but not for this symbol. So the line
315  // entries surrounding us won't lie inside our function. In that
316  // case, the line entry will be bigger than we are, so we do that
317  // quick check and if that is true, we just return 0.
319  m_type_data = 0;
320  } else {
321  // TODO: expose something in Process to figure out the
322  // size of a function prologue.
323  m_type_data = 0;
324  }
325  }
326  }
327  }
328  return m_type_data;
329  }
330  return 0;
331 }
332 
333 bool Symbol::Compare(ConstString name, SymbolType type) const {
334  if (type == eSymbolTypeAny || m_type == type) {
335  const Mangled &mangled = GetMangled();
336  return mangled.GetMangledName() == name ||
337  mangled.GetDemangledName() == name;
338  }
339  return false;
340 }
341 
342 #define ENUM_TO_CSTRING(x) \
343  case eSymbolType##x: \
344  return #x;
345 
346 const char *Symbol::GetTypeAsString() const {
347  switch (m_type) {
349  ENUM_TO_CSTRING(Absolute);
350  ENUM_TO_CSTRING(Code);
351  ENUM_TO_CSTRING(Resolver);
352  ENUM_TO_CSTRING(Data);
353  ENUM_TO_CSTRING(Trampoline);
355  ENUM_TO_CSTRING(Exception);
356  ENUM_TO_CSTRING(SourceFile);
357  ENUM_TO_CSTRING(HeaderFile);
359  ENUM_TO_CSTRING(CommonBlock);
361  ENUM_TO_CSTRING(Local);
362  ENUM_TO_CSTRING(Param);
364  ENUM_TO_CSTRING(VariableType);
366  ENUM_TO_CSTRING(LineHeader);
367  ENUM_TO_CSTRING(ScopeBegin);
368  ENUM_TO_CSTRING(ScopeEnd);
369  ENUM_TO_CSTRING(Additional);
370  ENUM_TO_CSTRING(Compiler);
371  ENUM_TO_CSTRING(Instrumentation);
372  ENUM_TO_CSTRING(Undefined);
373  ENUM_TO_CSTRING(ObjCClass);
374  ENUM_TO_CSTRING(ObjCMetaClass);
375  ENUM_TO_CSTRING(ObjCIVar);
376  ENUM_TO_CSTRING(ReExported);
377  default:
378  break;
379  }
380  return "<unknown SymbolType>";
381 }
382 
384  // Symbols can reconstruct the symbol and the module in the symbol context
385  sc->symbol = this;
386  if (ValueIsAddress())
388  else
389  sc->module_sp.reset();
390 }
391 
393  if (ValueIsAddress())
394  return GetAddressRef().GetModule();
395  return ModuleSP();
396 }
397 
399 
401  bool dumped_module = false;
402  if (ValueIsAddress()) {
403  ModuleSP module_sp(GetAddressRef().GetModule());
404  if (module_sp) {
405  dumped_module = true;
406  module_sp->DumpSymbolContext(s);
407  }
408  }
409  if (dumped_module)
410  s->PutCString(", ");
411 
412  s->Printf("Symbol{0x%8.8x}", GetID());
413 }
414 
416 
418  Target &target, ConstString &reexport_name, ModuleSpec &module_spec,
419  ModuleList &seen_modules) const {
420  ModuleSP module_sp;
421  if (module_spec.GetFileSpec()) {
422  // Try searching for the module file spec first using the full path
423  module_sp = target.GetImages().FindFirstModule(module_spec);
424  if (!module_sp) {
425  // Next try and find the module by basename in case environment variables
426  // or other runtime trickery causes shared libraries to be loaded from
427  // alternate paths
428  module_spec.GetFileSpec().GetDirectory().Clear();
429  module_sp = target.GetImages().FindFirstModule(module_spec);
430  }
431  }
432 
433  if (module_sp) {
434  // There should not be cycles in the reexport list, but we don't want to
435  // crash if there are so make sure we haven't seen this before:
436  if (!seen_modules.AppendIfNeeded(module_sp))
437  return nullptr;
438 
440  module_sp->FindSymbolsWithNameAndType(reexport_name, eSymbolTypeAny,
441  sc_list);
442  const size_t num_scs = sc_list.GetSize();
443  if (num_scs > 0) {
444  for (size_t i = 0; i < num_scs; ++i) {
446  if (sc_list.GetContextAtIndex(i, sc)) {
447  if (sc.symbol->IsExternal())
448  return sc.symbol;
449  }
450  }
451  }
452  // If we didn't find the symbol in this module, it may be because this
453  // module re-exports some whole other library. We have to search those as
454  // well:
455  seen_modules.Append(module_sp);
456 
457  FileSpecList reexported_libraries =
458  module_sp->GetObjectFile()->GetReExportedLibraries();
459  size_t num_reexported_libraries = reexported_libraries.GetSize();
460  for (size_t idx = 0; idx < num_reexported_libraries; idx++) {
461  ModuleSpec reexported_module_spec;
462  reexported_module_spec.GetFileSpec() =
463  reexported_libraries.GetFileSpecAtIndex(idx);
465  target, reexport_name, reexported_module_spec, seen_modules);
466  if (result_symbol)
467  return result_symbol;
468  }
469  }
470  return nullptr;
471 }
472 
474  ConstString reexport_name(GetReExportedSymbolName());
475  if (reexport_name) {
476  ModuleSpec module_spec;
477  ModuleList seen_modules;
479  if (module_spec.GetFileSpec()) {
480  return ResolveReExportedSymbolInModuleSpec(target, reexport_name,
481  module_spec, seen_modules);
482  }
483  }
484  return nullptr;
485 }
486 
488  if (ValueIsAddress())
489  return GetAddressRef().GetFileAddress();
490  else
491  return LLDB_INVALID_ADDRESS;
492 }
493 
495  if (ValueIsAddress())
496  return GetAddressRef().GetLoadAddress(target);
497  else
498  return LLDB_INVALID_ADDRESS;
499 }
500 
501 ConstString Symbol::GetName() const { return GetMangled().GetName(); }
502 
504  return GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments);
505 }
506 
509  return LLDB_INVALID_ADDRESS;
510 
511  Address func_so_addr;
512 
513  bool is_indirect = IsIndirect();
514  if (GetType() == eSymbolTypeReExported) {
515  Symbol *reexported_symbol = ResolveReExportedSymbol(target);
516  if (reexported_symbol) {
517  func_so_addr = reexported_symbol->GetAddress();
518  is_indirect = reexported_symbol->IsIndirect();
519  }
520  } else {
521  func_so_addr = GetAddress();
522  is_indirect = IsIndirect();
523  }
524 
525  if (func_so_addr.IsValid()) {
526  if (!target.GetProcessSP() && is_indirect) {
527  // can't resolve indirect symbols without calling a function...
528  return LLDB_INVALID_ADDRESS;
529  }
530 
531  lldb::addr_t load_addr =
532  func_so_addr.GetCallableLoadAddress(&target, is_indirect);
533 
534  if (load_addr != LLDB_INVALID_ADDRESS) {
535  return load_addr;
536  }
537  }
538 
539  return LLDB_INVALID_ADDRESS;
540 }
541 
542 lldb::DisassemblerSP Symbol::GetInstructions(const ExecutionContext &exe_ctx,
543  const char *flavor,
544  bool prefer_file_cache) {
545  ModuleSP module_sp(m_addr_range.GetBaseAddress().GetModule());
546  if (module_sp && exe_ctx.HasTargetScope()) {
547  return Disassembler::DisassembleRange(module_sp->GetArchitecture(), nullptr,
548  flavor, exe_ctx.GetTargetRef(),
549  m_addr_range, !prefer_file_cache);
550  }
551  return lldb::DisassemblerSP();
552 }
553 
554 bool Symbol::GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor,
555  bool prefer_file_cache, Stream &strm) {
556  lldb::DisassemblerSP disassembler_sp =
557  GetInstructions(exe_ctx, flavor, prefer_file_cache);
558  if (disassembler_sp) {
559  const bool show_address = true;
560  const bool show_bytes = false;
561  disassembler_sp->GetInstructionList().Dump(&strm, show_address, show_bytes,
562  &exe_ctx);
563  return true;
564  }
565  return false;
566 }
567 
569  return m_addr_range.ContainsFileAddress(file_addr);
570 }
571 
573  if (!IsSynthetic())
574  return false;
575  if (!m_mangled)
576  return true;
577  ConstString demangled = m_mangled.GetDemangledName();
578  return demangled.GetStringRef().startswith(GetSyntheticSymbolPrefix());
579 }
580 
582  if (m_is_synthetic && !m_mangled) {
583  // Synthetic symbol names don't mean anything, but they do uniquely
584  // identify individual symbols so we give them a unique name. The name
585  // starts with the synthetic symbol prefix, followed by a unique number.
586  // Typically the UserID of a real symbol is the symbol table index of the
587  // symbol in the object file's symbol table(s), so it will be the same
588  // every time you read in the object file. We want the same persistence for
589  // synthetic symbols so that users can identify them across multiple debug
590  // sessions, to understand crashes in those symbols and to reliably set
591  // breakpoints on them.
592  llvm::SmallString<256> name;
593  llvm::raw_svector_ostream os(name);
594  os << GetSyntheticSymbolPrefix() << GetID();
595  m_mangled.SetDemangledName(ConstString(os.str()));
596  }
597 }
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::CompilerContextKind::Invalid
@ Invalid
lldb_private::Symbol::m_type
uint16_t m_type
Definition: Symbol.h:274
lldb_private::ExecutionContext::HasTargetScope
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
Definition: ExecutionContext.cpp:381
lldb_private::Address::IsValid
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:336
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:616
lldb_private::Symbol::GetPrologueByteSize
uint32_t GetPrologueByteSize()
Definition: Symbol.cpp:260
lldb_private::Symbol::GetSyntheticSymbolPrefix
static llvm::StringRef GetSyntheticSymbolPrefix()
Definition: Symbol.h:234
ModuleSpec.h
lldb_private::Address::CalculateSymbolContextFunction
Function * CalculateSymbolContextFunction() const
Definition: Address.cpp:848
lldb_private::Symbol::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
Definition: Symbol.cpp:178
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::Symbol::ValueIsAddress
bool ValueIsAddress() const
Definition: Symbol.cpp:117
lldb::eSymbolTypeInvalid
@ eSymbolTypeInvalid
Definition: lldb-enumerations.h:614
lldb_private::Symbol::DumpSymbolContext
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
Definition: Symbol.cpp:400
lldb_private::Address::DumpStyleFileAddress
@ DumpStyleFileAddress
Display as the file address (if any).
Definition: Address.h:84
lldb::eSymbolTypeTrampoline
@ eSymbolTypeTrampoline
Definition: lldb-enumerations.h:619
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::Symbol::m_size_is_valid
uint16_t m_size_is_valid
Definition: Symbol.h:266
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1262
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb_private::Symbol::SetType
void SetType(lldb::SymbolType type)
Definition: Symbol.h:145
lldb_private::Symbol::CalculateSymbolContextModule
lldb::ModuleSP CalculateSymbolContextModule() override
Definition: Symbol.cpp:392
lldb_private::Symbol::GetReExportedSymbolName
ConstString GetReExportedSymbolName() const
Definition: Symbol.cpp:126
lldb_private::Symbol::CalculateSymbolContextSymbol
Symbol * CalculateSymbolContextSymbol() override
Definition: Symbol.cpp:398
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Symbol::m_uid
uint32_t m_uid
Definition: Symbol.h:250
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Symbol::IsSyntheticWithAutoGeneratedName
bool IsSyntheticWithAutoGeneratedName() const
Definition: Symbol.cpp:572
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:451
Section.h
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:925
lldb_private::Symbol::m_mangled
Mangled m_mangled
Definition: Symbol.h:275
Process.h
lldb_private::Symbol::ResolveCallableAddress
lldb::addr_t ResolveCallableAddress(Target &target) const
Definition: Symbol.cpp:507
lldb_private::Symbol::m_is_synthetic
uint16_t m_is_synthetic
Definition: Symbol.h:255
Target.h
lldb_private::Symbol::m_type_data_resolved
uint16_t m_type_data_resolved
Definition: Symbol.h:253
lldb_private::Symbol::ContainsFileAddress
bool ContainsFileAddress(lldb::addr_t file_addr) const
Definition: Symbol.cpp:568
lldb_private::Symbol::Dump
void Dump(Stream *s, Target *target, uint32_t index, Mangled::NamePreference name_preference=Mangled::ePreferDemangled) const
Definition: Symbol.cpp:213
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb::eSymbolTypeAny
@ eSymbolTypeAny
Definition: lldb-enumerations.h:613
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
lldb_private::Function
Definition: Function.h:413
lldb_private::Disassembler::DisassembleRange
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, Target &target, const AddressRange &disasm_range, bool force_live_memory=false)
Definition: Disassembler.cpp:122
lldb_private::Address::DumpStyleLoadAddress
@ DumpStyleLoadAddress
Display as the load address (if resolved).
Definition: Address.h:96
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
lldb_private::ModuleList
Definition: ModuleList.h:72
lldb::eSymbolTypeUndefined
@ eSymbolTypeUndefined
Definition: lldb-enumerations.h:639
lldb_private::Symbol::SetReExportedSymbolSharedLibrary
bool SetReExportedSymbolSharedLibrary(const FileSpec &fspec)
Definition: Symbol.cpp:159
lldb_private::Symbol::m_size_is_sibling
uint16_t m_size_is_sibling
Definition: Symbol.h:261
lldb_private::Address::GetCallableLoadAddress
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
Definition: Address.cpp:335
lldb_private::Symbol::m_demangled_is_synthesized
uint16_t m_demangled_is_synthesized
Definition: Symbol.h:267
lldb_private::Symbol::CalculateSymbolContext
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Definition: Symbol.cpp:383
lldb_private::Address::GetFileAddress
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:290
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
lldb_private::Symbol::GetInstructions
lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx, const char *flavor, bool prefer_file_cache)
Definition: Symbol.cpp:542
lldb_private::Symbol::operator=
const Symbol & operator=(const Symbol &rhs)
Definition: Symbol.cpp:75
lldb_private::SymbolContextList::GetSize
uint32_t GetSize() const
Get accessor for a symbol context list size.
Definition: SymbolContext.cpp:1278
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Symbol::Clear
void Clear()
Definition: Symbol.cpp:98
lldb_private::Symbol::m_contains_linker_annotations
uint16_t m_contains_linker_annotations
Definition: Symbol.h:270
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::ModuleList::FindFirstModule
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Definition: ModuleList.cpp:564
lldb_private::Symbol::IsExternal
bool IsExternal() const
Definition: Symbol.h:170
lldb_private::Symbol::Compare
bool Compare(ConstString name, lldb::SymbolType type) const
Definition: Symbol.cpp:333
lldb_private::Symbol::IsSynthetic
bool IsSynthetic() const
Definition: Symbol.h:156
lldb_private::Address::GetSection
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:420
lldb_private::Stream::PutChar
size_t PutChar(char ch)
Definition: Stream.cpp:104
lldb_private::Symbol::GetMangled
Mangled & GetMangled()
Definition: Symbol.h:121
lldb_private::Symbol::GetTypeAsString
const char * GetTypeAsString() const
Definition: Symbol.cpp:346
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:612
lldb_private::Runtime
Definition: Runtime.h:15
lldb_private::Symbol::m_is_external
uint16_t m_is_external
Definition: Symbol.h:260
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
ObjectFile.h
lldb_private::LineEntry::line
uint32_t line
The source line number, or zero if there is no line number information.
Definition: LineEntry.h:143
lldb_private::AddressRange::ContainsFileAddress
bool ContainsFileAddress(const Address &so_addr) const
Check if a section offset address is contained in this range.
Definition: AddressRange.cpp:62
Symbol.h
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:501
lldb_private::Symbol::m_flags
uint32_t m_flags
Definition: Symbol.h:279
lldb_private::Target::GetProcessSP
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:211
lldb_private::ConstString::Clear
void Clear()
Clear this object's state.
Definition: ConstString.h:232
lldb_private::Symbol::Symbol
Symbol()
Definition: Symbol.cpp:25
lldb_private::ModuleSpec::GetFileSpec
FileSpec & GetFileSpec()
Definition: ModuleSpec.h:58
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Symbol::GetDisassembly
bool GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor, bool prefer_file_cache, Stream &strm)
Definition: Symbol.cpp:554
lldb_private::Symbol::GetReExportedSymbolSharedLibrary
FileSpec GetReExportedSymbolSharedLibrary() const
Definition: Symbol.cpp:140
lldb_private::Block
Definition: Block.h:41
lldb_private::AddressRange::Clear
void Clear()
Clear the object's state.
Definition: AddressRange.cpp:143
uint32_t
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::Address
Definition: Address.h:59
lldb_private::ModuleList::AppendIfNeeded
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
Symtab.h
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:310
lldb_private::Symbol::GetByteSize
lldb::addr_t GetByteSize() const
Definition: Symbol.cpp:415
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::LineEntry::range
AddressRange range
The section offset address range for this line entry.
Definition: LineEntry.h:139
lldb_private::Address::Dump
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX) const
Dump a description of this object to a Stream.
Definition: Address.cpp:405
lldb_private::SymbolContext::module_sp
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SymbolContext.h:318
uint16_t
lldb_private::Symbol::SynthesizeNameIfNeeded
void SynthesizeNameIfNeeded() const
Definition: Symbol.cpp:581
lldb_private::Symbol::GetFileAddress
lldb::addr_t GetFileAddress() const
Definition: Symbol.cpp:487
lldb_private::Address::SetOffset
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Definition: Address.h:429
lldb_private::AddressRange::SetByteSize
void SetByteSize(lldb::addr_t byte_size)
Set accessor for the byte size of this range.
Definition: AddressRange.h:237
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
Function.h
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb_private::ExecutionContext::GetTargetRef
Target & GetTargetRef() const
Returns a reference to the target object.
Definition: ExecutionContext.cpp:226
lldb::eSymbolTypeReExported
@ eSymbolTypeReExported
Definition: lldb-enumerations.h:643
lldb_private::Symbol::m_addr_range
AddressRange m_addr_range
Definition: Symbol.h:276
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Symbol::IsTrampoline
bool IsTrampoline() const
Definition: Symbol.cpp:174
lldb_private::FileSpec::GetDirectory
ConstString & GetDirectory()
Directory string get accessor.
Definition: FileSpec.cpp:333
lldb_private::Address::GetOffset
lldb::addr_t GetOffset() const
Get the section relative offset value.
Definition: Address.h:310
lldb_private::Symbol::m_type_data
uint16_t m_type_data
Definition: Symbol.h:252
lldb_private::Symbol::GetNameNoArguments
ConstString GetNameNoArguments() const
Definition: Symbol.cpp:503
lldb_private::Address::GetModule
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:282
Stream.h
lldb_private::Variable
Definition: Variable.h:25
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb::eSymbolTypeResolver
@ eSymbolTypeResolver
Definition: lldb-enumerations.h:617
lldb_private::Symbol::IsIndirect
bool IsIndirect() const
Definition: Symbol.cpp:176
lldb_private::Symbol::SetReExportedSymbolName
void SetReExportedSymbolName(ConstString name)
Definition: Symbol.cpp:152
lldb_private::Symbol::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Definition: Symbol.cpp:494
lldb_private::SymbolContext::line_entry
LineEntry line_entry
The LineEntry for a given query.
Definition: SymbolContext.h:322
SymbolVendor.h
lldb::eSymbolTypeAbsolute
@ eSymbolTypeAbsolute
Definition: lldb-enumerations.h:615
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:346
lldb_private::Symbol::GetDisplayName
ConstString GetDisplayName() const
Definition: Symbol.cpp:122
lldb_private::Symbol::GetType
lldb::SymbolType GetType() const
Definition: Symbol.h:143
lldb_private::Address::Slide
bool Slide(int64_t offset)
Definition: Address.h:440
lldb_private::Symbol::m_size_is_synthesized
uint16_t m_size_is_synthesized
Definition: Symbol.h:263
lldb
Definition: SBAddress.h:15
lldb_private::Symbol::m_is_weak
uint16_t m_is_weak
Definition: Symbol.h:273
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::Symbol::ResolveReExportedSymbol
Symbol * ResolveReExportedSymbol(Target &target) const
Definition: Symbol.cpp:473
lldb_private::ObjectFile
Definition: ObjectFile.h:59
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
lldb_private::Symbol::ResolveReExportedSymbolInModuleSpec
Symbol * ResolveReExportedSymbolInModuleSpec(Target &target, ConstString &reexport_name, lldb_private::ModuleSpec &module_spec, lldb_private::ModuleList &seen_modules) const
Definition: Symbol.cpp:417
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Symbol::m_is_debug
uint16_t m_is_debug
Definition: Symbol.h:258
ENUM_TO_CSTRING
#define ENUM_TO_CSTRING(x)
Definition: Symbol.cpp:342
lldb_private::Symbol::GetSiblingIndex
uint32_t GetSiblingIndex() const
Definition: Symbol.cpp:170
lldb_private::Symbol::GetID
uint32_t GetID() const
Definition: Symbol.h:111
lldb_private::Symbol::GetAddress
Address GetAddress() const
Definition: Symbol.h:73