LLDB  mainline
Symbol.cpp
Go to the documentation of this file.
1 //===-- Symbol.cpp ----------------------------------------------*- C++ -*-===//
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_uid(UINT32_MAX), m_type_data(0),
27  m_type_data_resolved(false), m_is_synthetic(false), m_is_debug(false),
28  m_is_external(false), m_size_is_sibling(false),
29  m_size_is_synthesized(false), m_size_is_valid(false),
30  m_demangled_is_synthesized(false), m_contains_linker_annotations(false),
31  m_type(eSymbolTypeInvalid), m_mangled(), m_addr_range(), m_flags() {}
32 
33 Symbol::Symbol(uint32_t symID, const char *name, bool name_is_mangled,
34  SymbolType type, bool external, bool is_debug,
35  bool is_trampoline, bool is_artificial,
36  const lldb::SectionSP &section_sp, addr_t offset, addr_t size,
37  bool size_is_valid, bool contains_linker_annotations,
38  uint32_t flags)
39  : SymbolContextScope(), m_uid(symID), m_type_data(0),
40  m_type_data_resolved(false), m_is_synthetic(is_artificial),
41  m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false),
42  m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0),
44  m_contains_linker_annotations(contains_linker_annotations), m_type(type),
45  m_mangled(ConstString(name), name_is_mangled),
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),
59  m_contains_linker_annotations(contains_linker_annotations), m_type(type),
60  m_mangled(mangled), m_addr_range(range), m_flags(flags) {}
61 
71  m_type(rhs.m_type), m_mangled(rhs.m_mangled),
73 
74 const Symbol &Symbol::operator=(const Symbol &rhs) {
75  if (this != &rhs) {
76  SymbolContextScope::operator=(rhs);
77  m_uid = rhs.m_uid;
81  m_is_debug = rhs.m_is_debug;
88  m_type = rhs.m_type;
89  m_mangled = rhs.m_mangled;
91  m_flags = rhs.m_flags;
92  }
93  return *this;
94 }
95 
96 void Symbol::Clear() {
97  m_uid = UINT32_MAX;
98  m_mangled.Clear();
99  m_type_data = 0;
100  m_type_data_resolved = false;
101  m_is_synthetic = false;
102  m_is_debug = false;
103  m_is_external = false;
104  m_size_is_sibling = false;
105  m_size_is_synthesized = false;
106  m_size_is_valid = false;
110  m_flags = 0;
112 }
113 
115  return m_addr_range.GetBaseAddress().GetSection().get() != nullptr;
116 }
117 
119  return m_mangled.GetDisplayDemangledName(GetLanguage());
120 }
121 
123  if (m_type == eSymbolTypeReExported) {
124  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
125  // as the offset in the address range base address. We can then make this
126  // back into a string that is the re-exported name.
127  intptr_t str_ptr = m_addr_range.GetBaseAddress().GetOffset();
128  if (str_ptr != 0)
129  return ConstString((const char *)str_ptr);
130  else
131  return GetName();
132  }
133  return ConstString();
134 }
135 
137  if (m_type == eSymbolTypeReExported) {
138  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
139  // as the offset in the address range base address. We can then make this
140  // back into a string that is the re-exported name.
141  intptr_t str_ptr = m_addr_range.GetByteSize();
142  if (str_ptr != 0)
143  return FileSpec((const char *)str_ptr);
144  }
145  return FileSpec();
146 }
147 
150  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
151  // as the offset in the address range base address.
152  m_addr_range.GetBaseAddress().SetOffset((uintptr_t)name.GetCString());
153 }
154 
156  if (m_type == eSymbolTypeReExported) {
157  // For eSymbolTypeReExported, the "const char *" from a ConstString is used
158  // as the offset in the address range base address.
160  (uintptr_t)ConstString(fspec.GetPath().c_str()).GetCString());
161  return true;
162  }
163  return false;
164 }
165 
168 }
169 
171 
172 bool Symbol::IsIndirect() const { return m_type == eSymbolTypeResolver; }
173 
175  Target *target) const {
176  s->Printf("id = {0x%8.8x}", m_uid);
177 
179  if (ValueIsAddress()) {
180  const lldb::addr_t byte_size = GetByteSize();
181  if (byte_size > 0) {
182  s->PutCString(", range = ");
185  } else {
186  s->PutCString(", address = ");
187  m_addr_range.GetBaseAddress().Dump(s, target,
190  }
191  } else
192  s->Printf(", value = 0x%16.16" PRIx64,
194  } else {
195  if (m_size_is_sibling)
196  s->Printf(", sibling = %5" PRIu64,
198  else
199  s->Printf(", value = 0x%16.16" PRIx64,
201  }
202  ConstString demangled = m_mangled.GetDemangledName(GetLanguage());
203  if (demangled)
204  s->Printf(", name=\"%s\"", demangled.AsCString());
205  if (m_mangled.GetMangledName())
206  s->Printf(", mangled=\"%s\"", m_mangled.GetMangledName().AsCString());
207 }
208 
209 void Symbol::Dump(Stream *s, Target *target, uint32_t index) const {
210  s->Printf("[%5u] %6u %c%c%c %-15s ", index, GetID(), m_is_debug ? 'D' : ' ',
211  m_is_synthetic ? 'S' : ' ', m_is_external ? 'X' : ' ',
212  GetTypeAsString());
213 
214  // Make sure the size of the symbol is up to date before dumping
215  GetByteSize();
216 
217  ConstString name = m_mangled.GetName(GetLanguage());
218  if (ValueIsAddress()) {
219  if (!m_addr_range.GetBaseAddress().Dump(s, nullptr,
221  s->Printf("%*s", 18, "");
222 
223  s->PutChar(' ');
224 
225  if (!m_addr_range.GetBaseAddress().Dump(s, target,
227  s->Printf("%*s", 18, "");
228 
229  const char *format = m_size_is_sibling ? " Sibling -> [%5llu] 0x%8.8x %s\n"
230  : " 0x%16.16" PRIx64 " 0x%8.8x %s\n";
231  s->Printf(format, GetByteSize(), m_flags, name.AsCString(""));
232  } else if (m_type == eSymbolTypeReExported) {
233  s->Printf(
234  " 0x%8.8x %s",
235  m_flags, name.AsCString(""));
236 
237  ConstString reexport_name = GetReExportedSymbolName();
238  intptr_t shlib = m_addr_range.GetByteSize();
239  if (shlib)
240  s->Printf(" -> %s`%s\n", (const char *)shlib, reexport_name.GetCString());
241  else
242  s->Printf(" -> %s\n", reexport_name.GetCString());
243  } else {
244  const char *format =
246  ? "0x%16.16" PRIx64
247  " Sibling -> [%5llu] 0x%8.8x %s\n"
248  : "0x%16.16" PRIx64 " 0x%16.16" PRIx64
249  " 0x%8.8x %s\n";
251  m_flags, name.AsCString(""));
252  }
253 }
254 
257  if (!m_type_data_resolved) {
258  m_type_data_resolved = true;
259 
260  const Address &base_address = m_addr_range.GetBaseAddress();
261  Function *function = base_address.CalculateSymbolContextFunction();
262  if (function) {
263  // Functions have line entries which can also potentially have end of
264  // prologue information. So if this symbol points to a function, use
265  // the prologue information from there.
266  m_type_data = function->GetPrologueByteSize();
267  } else {
268  ModuleSP module_sp(base_address.GetModule());
269  SymbolContext sc;
270  if (module_sp) {
271  uint32_t resolved_flags = module_sp->ResolveSymbolContextForAddress(
272  base_address, eSymbolContextLineEntry, sc);
273  if (resolved_flags & eSymbolContextLineEntry) {
274  // Default to the end of the first line entry.
275  m_type_data = sc.line_entry.range.GetByteSize();
276 
277  // Set address for next line.
278  Address addr(base_address);
279  addr.Slide(m_type_data);
280 
281  // Check the first few instructions and look for one that has a
282  // line number that is different than the first entry. This is also
283  // done in Function::GetPrologueByteSize().
284  uint16_t total_offset = m_type_data;
285  for (int idx = 0; idx < 6; ++idx) {
286  SymbolContext sc_temp;
287  resolved_flags = module_sp->ResolveSymbolContextForAddress(
288  addr, eSymbolContextLineEntry, sc_temp);
289  // Make sure we got line number information...
290  if (!(resolved_flags & eSymbolContextLineEntry))
291  break;
292 
293  // If this line number is different than our first one, use it
294  // and we're done.
295  if (sc_temp.line_entry.line != sc.line_entry.line) {
296  m_type_data = total_offset;
297  break;
298  }
299 
300  // Slide addr up to the next line address.
301  addr.Slide(sc_temp.line_entry.range.GetByteSize());
302  total_offset += sc_temp.line_entry.range.GetByteSize();
303  // If we've gone too far, bail out.
304  if (total_offset >= m_addr_range.GetByteSize())
305  break;
306  }
307 
308  // Sanity check - this may be a function in the middle of code that
309  // has debug information, but not for this symbol. So the line
310  // entries surrounding us won't lie inside our function. In that
311  // case, the line entry will be bigger than we are, so we do that
312  // quick check and if that is true, we just return 0.
314  m_type_data = 0;
315  } else {
316  // TODO: expose something in Process to figure out the
317  // size of a function prologue.
318  m_type_data = 0;
319  }
320  }
321  }
322  }
323  return m_type_data;
324  }
325  return 0;
326 }
327 
328 bool Symbol::Compare(ConstString name, SymbolType type) const {
329  if (type == eSymbolTypeAny || m_type == type)
330  return m_mangled.GetMangledName() == name ||
331  m_mangled.GetDemangledName(GetLanguage()) == name;
332  return false;
333 }
334 
335 #define ENUM_TO_CSTRING(x) \
336  case eSymbolType##x: \
337  return #x;
338 
339 const char *Symbol::GetTypeAsString() const {
340  switch (m_type) {
342  ENUM_TO_CSTRING(Absolute);
343  ENUM_TO_CSTRING(Code);
344  ENUM_TO_CSTRING(Resolver);
345  ENUM_TO_CSTRING(Data);
346  ENUM_TO_CSTRING(Trampoline);
347  ENUM_TO_CSTRING(Runtime);
348  ENUM_TO_CSTRING(Exception);
349  ENUM_TO_CSTRING(SourceFile);
350  ENUM_TO_CSTRING(HeaderFile);
352  ENUM_TO_CSTRING(CommonBlock);
354  ENUM_TO_CSTRING(Local);
355  ENUM_TO_CSTRING(Param);
357  ENUM_TO_CSTRING(VariableType);
359  ENUM_TO_CSTRING(LineHeader);
360  ENUM_TO_CSTRING(ScopeBegin);
361  ENUM_TO_CSTRING(ScopeEnd);
362  ENUM_TO_CSTRING(Additional);
363  ENUM_TO_CSTRING(Compiler);
364  ENUM_TO_CSTRING(Instrumentation);
365  ENUM_TO_CSTRING(Undefined);
366  ENUM_TO_CSTRING(ObjCClass);
367  ENUM_TO_CSTRING(ObjCMetaClass);
368  ENUM_TO_CSTRING(ObjCIVar);
369  ENUM_TO_CSTRING(ReExported);
370  default:
371  break;
372  }
373  return "<unknown SymbolType>";
374 }
375 
377  // Symbols can reconstruct the symbol and the module in the symbol context
378  sc->symbol = this;
379  if (ValueIsAddress())
381  else
382  sc->module_sp.reset();
383 }
384 
386  if (ValueIsAddress())
387  return GetAddressRef().GetModule();
388  return ModuleSP();
389 }
390 
392 
394  bool dumped_module = false;
395  if (ValueIsAddress()) {
396  ModuleSP module_sp(GetAddressRef().GetModule());
397  if (module_sp) {
398  dumped_module = true;
399  module_sp->DumpSymbolContext(s);
400  }
401  }
402  if (dumped_module)
403  s->PutCString(", ");
404 
405  s->Printf("Symbol{0x%8.8x}", GetID());
406 }
407 
409 
411  Target &target, ConstString &reexport_name, ModuleSpec &module_spec,
412  ModuleList &seen_modules) const {
413  ModuleSP module_sp;
414  if (module_spec.GetFileSpec()) {
415  // Try searching for the module file spec first using the full path
416  module_sp = target.GetImages().FindFirstModule(module_spec);
417  if (!module_sp) {
418  // Next try and find the module by basename in case environment variables
419  // or other runtime trickery causes shared libraries to be loaded from
420  // alternate paths
421  module_spec.GetFileSpec().GetDirectory().Clear();
422  module_sp = target.GetImages().FindFirstModule(module_spec);
423  }
424  }
425 
426  if (module_sp) {
427  // There should not be cycles in the reexport list, but we don't want to
428  // crash if there are so make sure we haven't seen this before:
429  if (!seen_modules.AppendIfNeeded(module_sp))
430  return nullptr;
431 
433  module_sp->FindSymbolsWithNameAndType(reexport_name, eSymbolTypeAny,
434  sc_list);
435  const size_t num_scs = sc_list.GetSize();
436  if (num_scs > 0) {
437  for (size_t i = 0; i < num_scs; ++i) {
439  if (sc_list.GetContextAtIndex(i, sc)) {
440  if (sc.symbol->IsExternal())
441  return sc.symbol;
442  }
443  }
444  }
445  // If we didn't find the symbol in this module, it may be because this
446  // module re-exports some whole other library. We have to search those as
447  // well:
448  seen_modules.Append(module_sp);
449 
450  FileSpecList reexported_libraries =
451  module_sp->GetObjectFile()->GetReExportedLibraries();
452  size_t num_reexported_libraries = reexported_libraries.GetSize();
453  for (size_t idx = 0; idx < num_reexported_libraries; idx++) {
454  ModuleSpec reexported_module_spec;
455  reexported_module_spec.GetFileSpec() =
456  reexported_libraries.GetFileSpecAtIndex(idx);
458  target, reexport_name, reexported_module_spec, seen_modules);
459  if (result_symbol)
460  return result_symbol;
461  }
462  }
463  return nullptr;
464 }
465 
467  ConstString reexport_name(GetReExportedSymbolName());
468  if (reexport_name) {
469  ModuleSpec module_spec;
470  ModuleList seen_modules;
472  if (module_spec.GetFileSpec()) {
473  return ResolveReExportedSymbolInModuleSpec(target, reexport_name,
474  module_spec, seen_modules);
475  }
476  }
477  return nullptr;
478 }
479 
481  if (ValueIsAddress())
482  return GetAddressRef().GetFileAddress();
483  else
484  return LLDB_INVALID_ADDRESS;
485 }
486 
488  if (ValueIsAddress())
489  return GetAddressRef().GetLoadAddress(target);
490  else
491  return LLDB_INVALID_ADDRESS;
492 }
493 
494 ConstString Symbol::GetName() const { return m_mangled.GetName(GetLanguage()); }
495 
497  return m_mangled.GetName(GetLanguage(),
498  Mangled::ePreferDemangledWithoutArguments);
499 }
500 
503  return LLDB_INVALID_ADDRESS;
504 
505  Address func_so_addr;
506 
507  bool is_indirect = IsIndirect();
508  if (GetType() == eSymbolTypeReExported) {
509  Symbol *reexported_symbol = ResolveReExportedSymbol(target);
510  if (reexported_symbol) {
511  func_so_addr = reexported_symbol->GetAddress();
512  is_indirect = reexported_symbol->IsIndirect();
513  }
514  } else {
515  func_so_addr = GetAddress();
516  is_indirect = IsIndirect();
517  }
518 
519  if (func_so_addr.IsValid()) {
520  if (!target.GetProcessSP() && is_indirect) {
521  // can't resolve indirect symbols without calling a function...
522  return LLDB_INVALID_ADDRESS;
523  }
524 
525  lldb::addr_t load_addr =
526  func_so_addr.GetCallableLoadAddress(&target, is_indirect);
527 
528  if (load_addr != LLDB_INVALID_ADDRESS) {
529  return load_addr;
530  }
531  }
532 
533  return LLDB_INVALID_ADDRESS;
534 }
535 
536 lldb::DisassemblerSP Symbol::GetInstructions(const ExecutionContext &exe_ctx,
537  const char *flavor,
538  bool prefer_file_cache) {
539  ModuleSP module_sp(m_addr_range.GetBaseAddress().GetModule());
540  if (module_sp) {
541  const bool prefer_file_cache = false;
542  return Disassembler::DisassembleRange(module_sp->GetArchitecture(), nullptr,
543  flavor, exe_ctx, m_addr_range,
544  prefer_file_cache);
545  }
546  return lldb::DisassemblerSP();
547 }
548 
549 bool Symbol::GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor,
550  bool prefer_file_cache, Stream &strm) {
551  lldb::DisassemblerSP disassembler_sp =
552  GetInstructions(exe_ctx, flavor, prefer_file_cache);
553  if (disassembler_sp) {
554  const bool show_address = true;
555  const bool show_bytes = false;
556  disassembler_sp->GetInstructionList().Dump(&strm, show_address, show_bytes,
557  &exe_ctx);
558  return true;
559  }
560  return false;
561 }
562 
564  return m_addr_range.ContainsFileAddress(file_addr);
565 }
const char * GetTypeAsString() const
Definition: Symbol.cpp:339
Address & GetAddressRef()
Definition: Symbol.h:56
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
Definition: Address.cpp:317
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:61
A line table entry class.
Definition: LineEntry.h:20
Function * CalculateSymbolContextFunction() const
Definition: Address.cpp:822
Defines a list of symbol context objects.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
lldb::LanguageType GetLanguage() const
Definition: Symbol.h:112
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
Definition: AddressRange.h:232
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:224
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
lldb::addr_t GetFileAddress() const
Definition: Symbol.cpp:480
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
bool IsTrampoline() const
Definition: Symbol.cpp:170
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:292
Symbol * ResolveReExportedSymbolInModuleSpec(Target &target, ConstString &reexport_name, lldb_private::ModuleSpec &module_spec, lldb_private::ModuleList &seen_modules) const
Definition: Symbol.cpp:410
Mangled m_mangled
Definition: Symbol.h:254
uint16_t m_contains_linker_annotations
Definition: Symbol.h:233
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:374
lldb::addr_t GetLoadAddress(Target *target) const
Definition: Symbol.cpp:487
bool ContainsFileAddress(const Address &so_addr) const
Check if a section offset address is contained in this range.
A file utility class.
Definition: FileSpec.h:55
bool Compare(ConstString name, lldb::SymbolType type) const
Definition: Symbol.cpp:328
uint16_t m_type_data_resolved
Definition: Symbol.h:233
lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx, const char *flavor, bool prefer_file_cache)
Definition: Symbol.cpp:536
uint16_t m_type_data
Definition: Symbol.h:232
A class that describes a function.
Definition: Function.h:323
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:272
bool GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor, bool prefer_file_cache, Stream &strm)
Definition: Symbol.cpp:549
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:58
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
uint16_t m_is_debug
Definition: Symbol.h:233
#define ENUM_TO_CSTRING(x)
Definition: Symbol.cpp:335
uint32_t GetSiblingIndex() const
Definition: Symbol.cpp:166
uint32_t GetID() const
Definition: Symbol.h:110
Address GetAddress() const
Definition: Symbol.h:72
A class that describes a single lexical block.
Definition: Block.h:41
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Definition: Address.h:419
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object&#39;s symbol context into sc.
Definition: Symbol.cpp:376
Symbol * symbol
The Symbol for a given query.
uint32_t m_flags
Definition: Symbol.h:258
void Dump(Stream *s, Target *target, uint32_t index) const
Definition: Symbol.cpp:209
void SetReExportedSymbolName(ConstString name)
Definition: Symbol.cpp:148
uint32_t GetSize() const
Get accessor for a symbol context list size.
lldb::SymbolType GetType() const
Definition: Symbol.h:136
lldb::addr_t GetOffset() const
Get the section relative offset value.
Definition: Address.h:317
void DumpSymbolContext(Stream *s) override
Dump the object&#39;s symbol context to the stream s.
Definition: Symbol.cpp:393
uint16_t m_size_is_synthesized
Definition: Symbol.h:233
#define UINT32_MAX
Definition: lldb-defines.h:31
bool Slide(int64_t offset)
Definition: Address.h:430
uint32_t m_uid
Definition: Symbol.h:231
lldb::addr_t GetByteSize() const
Definition: Symbol.cpp:408
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:206
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
ConstString GetNameNoArguments() const
Definition: Symbol.cpp:496
A collection class for Module objects.
Definition: ModuleList.h:91
bool IsIndirect() const
Definition: Symbol.cpp:172
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Definition: ModuleList.cpp:599
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, const AddressRange &disasm_range, bool prefer_file_cache)
uint32_t line
The source line number, or zero if there is no line number information.
Definition: LineEntry.h:154
bool ValueIsAddress() const
Definition: Symbol.cpp:114
AddressRange m_addr_range
Definition: Symbol.h:255
lldb::addr_t ResolveCallableAddress(Target &target) const
Definition: Symbol.cpp:501
Symbol * CalculateSymbolContextSymbol() override
Definition: Symbol.cpp:391
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:106
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:343
A section + offset based address class.
Definition: Address.h:80
FileSpec & GetFileSpec()
Definition: ModuleSpec.h:75
bool SetReExportedSymbolSharedLibrary(const FileSpec &fspec)
Definition: Symbol.cpp:155
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
Definition: Symbol.cpp:174
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
ConstString GetReExportedSymbolName() const
Definition: Symbol.cpp:122
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:899
size_t PutChar(char ch)
Definition: Stream.cpp:103
ConstString & GetDirectory()
Directory string get accessor.
Definition: FileSpec.cpp:363
Symbol * ResolveReExportedSymbol(Target &target) const
Definition: Symbol.cpp:466
uint64_t addr_t
Definition: lldb-types.h:83
Display as the load address (if resolved).
Definition: Address.h:104
uint16_t m_size_is_sibling
Definition: Symbol.h:233
A uniqued constant string class.
Definition: ConstString.h:38
uint16_t m_is_external
Definition: Symbol.h:233
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:264
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:247
ConstString GetDisplayName() const
Definition: Symbol.cpp:118
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.
lldb::ModuleSP module_sp
The Module for a given query.
LineEntry line_entry
The LineEntry for a given query.
Definition: SBAddress.h:15
ConstString GetName() const
Definition: Symbol.cpp:494
uint16_t m_type
Definition: Symbol.h:233
FileSpec GetReExportedSymbolSharedLibrary() const
Definition: Symbol.cpp:136
uint32_t GetPrologueByteSize()
Definition: Symbol.cpp:255
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:220
bool IsExternal() const
Definition: Symbol.h:161
uint16_t m_demangled_is_synthesized
Definition: Symbol.h:233
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:410
uint16_t m_is_synthetic
Definition: Symbol.h:233
const Symbol & operator=(const Symbol &rhs)
Definition: Symbol.cpp:74
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:376
bool AppendIfNeeded(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list, if it is not already there.
bool ContainsFileAddress(lldb::addr_t file_addr) const
Definition: Symbol.cpp:563
uint16_t m_size_is_valid
Definition: Symbol.h:233
A section + offset based address range class.
Definition: AddressRange.h:32
void Clear()
Clear the object&#39;s state.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
void SetType(lldb::SymbolType type)
Definition: Symbol.h:138
AddressRange range
The section offset address range for this line entry.
Definition: LineEntry.h:150
lldb::ModuleSP CalculateSymbolContextModule() override
Definition: Symbol.cpp:385
void Clear()
Clear this object&#39;s state.
Definition: ConstString.h:263
void SetByteSize(lldb::addr_t byte_size)
Set accessor for the byte size of this range.
Definition: AddressRange.h:248
Display as the file address (if any).
Definition: Address.h:95