LLDB  mainline
SymbolContext.cpp
Go to the documentation of this file.
1 //===-- SymbolContext.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 
11 #include "lldb/Core/Module.h"
12 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Host/Host.h"
14 #include "lldb/Symbol/Block.h"
16 #include "lldb/Symbol/ObjectFile.h"
17 #include "lldb/Symbol/Symbol.h"
18 #include "lldb/Symbol/SymbolFile.h"
20 #include "lldb/Symbol/Variable.h"
21 #include "lldb/Target/Target.h"
22 #include "lldb/Utility/Log.h"
24 
25 using namespace lldb;
26 using namespace lldb_private;
27 
28 SymbolContext::SymbolContext() : target_sp(), module_sp(), line_entry() {}
29 
30 SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f,
31  Block *b, LineEntry *le, Symbol *s)
32  : target_sp(), module_sp(m), comp_unit(cu), function(f), block(b),
33  line_entry(), symbol(s), variable(nullptr) {
34  if (le)
35  line_entry = *le;
36 }
37 
38 SymbolContext::SymbolContext(const TargetSP &t, const ModuleSP &m,
39  CompileUnit *cu, Function *f, Block *b,
40  LineEntry *le, Symbol *s)
41  : target_sp(t), module_sp(m), comp_unit(cu), function(f), block(b),
42  line_entry(), symbol(s), variable(nullptr) {
43  if (le)
44  line_entry = *le;
45 }
46 
48  : target_sp(), module_sp(), comp_unit(nullptr), function(nullptr),
49  block(nullptr), line_entry(), symbol(nullptr), variable(nullptr) {
50  sc_scope->CalculateSymbolContext(this);
51 }
52 
54 
55 void SymbolContext::Clear(bool clear_target) {
56  if (clear_target)
57  target_sp.reset();
58  module_sp.reset();
59  comp_unit = nullptr;
60  function = nullptr;
61  block = nullptr;
62  line_entry.Clear();
63  symbol = nullptr;
64  variable = nullptr;
65 }
66 
68  const Address &addr, bool show_fullpaths,
69  bool show_module, bool show_inlined_frames,
70  bool show_function_arguments,
71  bool show_function_name) const {
72  bool dumped_something = false;
73  if (show_module && module_sp) {
74  if (show_fullpaths)
75  *s << module_sp->GetFileSpec();
76  else
77  *s << module_sp->GetFileSpec().GetFilename();
78  s->PutChar('`');
79  dumped_something = true;
80  }
81 
82  if (function != nullptr) {
83  SymbolContext inline_parent_sc;
84  Address inline_parent_addr;
85  if (!show_function_name) {
86  s->Printf("<");
87  dumped_something = true;
88  } else {
89  ConstString name;
90  if (!show_function_arguments)
91  name = function->GetNameNoArguments();
92  if (!name)
93  name = function->GetName();
94  if (name)
95  name.Dump(s);
96  }
97 
98  if (addr.IsValid()) {
99  const addr_t function_offset =
100  addr.GetOffset() -
101  function->GetAddressRange().GetBaseAddress().GetOffset();
102  if (!show_function_name) {
103  // Print +offset even if offset is 0
104  dumped_something = true;
105  s->Printf("+%" PRIu64 ">", function_offset);
106  } else if (function_offset) {
107  dumped_something = true;
108  s->Printf(" + %" PRIu64, function_offset);
109  }
110  }
111 
112  if (GetParentOfInlinedScope(addr, inline_parent_sc, inline_parent_addr)) {
113  dumped_something = true;
114  Block *inlined_block = block->GetContainingInlinedBlock();
115  const InlineFunctionInfo *inlined_block_info =
116  inlined_block->GetInlinedFunctionInfo();
117  s->Printf(" [inlined] %s", inlined_block_info->GetName().GetCString());
118 
119  lldb_private::AddressRange block_range;
120  if (inlined_block->GetRangeContainingAddress(addr, block_range)) {
121  const addr_t inlined_function_offset =
122  addr.GetOffset() - block_range.GetBaseAddress().GetOffset();
123  if (inlined_function_offset) {
124  s->Printf(" + %" PRIu64, inlined_function_offset);
125  }
126  }
127  // "line_entry" will always be valid as GetParentOfInlinedScope(...) will
128  // fill it in correctly with the calling file and line. Previous code
129  // was extracting the calling file and line from inlined_block_info and
130  // using it right away which is not correct. On the first call to this
131  // function "line_entry" will contain the actual line table entry. On
132  // susequent calls "line_entry" will contain the calling file and line
133  // from the previous inline info.
134  if (line_entry.IsValid()) {
135  s->PutCString(" at ");
136  line_entry.DumpStopContext(s, show_fullpaths);
137  }
138 
139  if (show_inlined_frames) {
140  s->EOL();
141  s->Indent();
142  const bool show_function_name = true;
143  return inline_parent_sc.DumpStopContext(
144  s, exe_scope, inline_parent_addr, show_fullpaths, show_module,
145  show_inlined_frames, show_function_arguments, show_function_name);
146  }
147  } else {
148  if (line_entry.IsValid()) {
149  dumped_something = true;
150  s->PutCString(" at ");
151  if (line_entry.DumpStopContext(s, show_fullpaths))
152  dumped_something = true;
153  }
154  }
155  } else if (symbol != nullptr) {
156  if (!show_function_name) {
157  s->Printf("<");
158  dumped_something = true;
159  } else if (symbol->GetName()) {
160  dumped_something = true;
162  s->PutCString("symbol stub for: ");
163  symbol->GetName().Dump(s);
164  }
165 
166  if (addr.IsValid() && symbol->ValueIsAddress()) {
167  const addr_t symbol_offset =
168  addr.GetOffset() - symbol->GetAddressRef().GetOffset();
169  if (!show_function_name) {
170  // Print +offset even if offset is 0
171  dumped_something = true;
172  s->Printf("+%" PRIu64 ">", symbol_offset);
173  } else if (symbol_offset) {
174  dumped_something = true;
175  s->Printf(" + %" PRIu64, symbol_offset);
176  }
177  }
178  } else if (addr.IsValid()) {
179  addr.Dump(s, exe_scope, Address::DumpStyleModuleWithFileAddress);
180  dumped_something = true;
181  }
182  return dumped_something;
183 }
184 
186  Target *target) const {
187  if (module_sp) {
188  s->Indent(" Module: file = \"");
189  module_sp->GetFileSpec().Dump(s->AsRawOstream());
190  *s << '"';
191  if (module_sp->GetArchitecture().IsValid())
192  s->Printf(", arch = \"%s\"",
193  module_sp->GetArchitecture().GetArchitectureName());
194  s->EOL();
195  }
196 
197  if (comp_unit != nullptr) {
198  s->Indent("CompileUnit: ");
199  comp_unit->GetDescription(s, level);
200  s->EOL();
201  }
202 
203  if (function != nullptr) {
204  s->Indent(" Function: ");
205  function->GetDescription(s, level, target);
206  s->EOL();
207 
208  Type *func_type = function->GetType();
209  if (func_type) {
210  s->Indent(" FuncType: ");
211  func_type->GetDescription(s, level, false, target);
212  s->EOL();
213  }
214  }
215 
216  if (block != nullptr) {
217  std::vector<Block *> blocks;
218  blocks.push_back(block);
219  Block *parent_block = block->GetParent();
220 
221  while (parent_block) {
222  blocks.push_back(parent_block);
223  parent_block = parent_block->GetParent();
224  }
225  std::vector<Block *>::reverse_iterator pos;
226  std::vector<Block *>::reverse_iterator begin = blocks.rbegin();
227  std::vector<Block *>::reverse_iterator end = blocks.rend();
228  for (pos = begin; pos != end; ++pos) {
229  if (pos == begin)
230  s->Indent(" Blocks: ");
231  else
232  s->Indent(" ");
233  (*pos)->GetDescription(s, function, level, target);
234  s->EOL();
235  }
236  }
237 
238  if (line_entry.IsValid()) {
239  s->Indent(" LineEntry: ");
240  line_entry.GetDescription(s, level, comp_unit, target, false);
241  s->EOL();
242  }
243 
244  if (symbol != nullptr) {
245  s->Indent(" Symbol: ");
246  symbol->GetDescription(s, level, target);
247  s->EOL();
248  }
249 
250  if (variable != nullptr) {
251  s->Indent(" Variable: ");
252 
253  s->Printf("id = {0x%8.8" PRIx64 "}, ", variable->GetID());
254 
255  switch (variable->GetScope()) {
257  s->PutCString("kind = global, ");
258  break;
259 
261  s->PutCString("kind = static, ");
262  break;
263 
265  s->PutCString("kind = argument, ");
266  break;
267 
269  s->PutCString("kind = local, ");
270  break;
271 
273  s->PutCString("kind = thread local, ");
274  break;
275 
276  default:
277  break;
278  }
279 
280  s->Printf("name = \"%s\"\n", variable->GetName().GetCString());
281  }
282 }
283 
285  uint32_t resolved_mask = 0;
286  if (target_sp)
287  resolved_mask |= eSymbolContextTarget;
288  if (module_sp)
289  resolved_mask |= eSymbolContextModule;
290  if (comp_unit)
291  resolved_mask |= eSymbolContextCompUnit;
292  if (function)
293  resolved_mask |= eSymbolContextFunction;
294  if (block)
295  resolved_mask |= eSymbolContextBlock;
296  if (line_entry.IsValid())
297  resolved_mask |= eSymbolContextLineEntry;
298  if (symbol)
299  resolved_mask |= eSymbolContextSymbol;
300  if (variable)
301  resolved_mask |= eSymbolContextVariable;
302  return resolved_mask;
303 }
304 
305 void SymbolContext::Dump(Stream *s, Target *target) const {
306  *s << this << ": ";
307  s->Indent();
308  s->PutCString("SymbolContext");
309  s->IndentMore();
310  s->EOL();
311  s->IndentMore();
312  s->Indent();
313  *s << "Module = " << module_sp.get() << ' ';
314  if (module_sp)
315  module_sp->GetFileSpec().Dump(s->AsRawOstream());
316  s->EOL();
317  s->Indent();
318  *s << "CompileUnit = " << comp_unit;
319  if (comp_unit != nullptr)
320  s->Format(" {{{0:x-16}} {1}", comp_unit->GetID(),
322  s->EOL();
323  s->Indent();
324  *s << "Function = " << function;
325  if (function != nullptr) {
326  s->Format(" {{{0:x-16}} {1}, address-range = ", function->GetID(),
327  function->GetType()->GetName());
328  function->GetAddressRange().Dump(s, target, Address::DumpStyleLoadAddress,
330  s->EOL();
331  s->Indent();
332  Type *func_type = function->GetType();
333  if (func_type) {
334  *s << " Type = ";
335  func_type->Dump(s, false);
336  }
337  }
338  s->EOL();
339  s->Indent();
340  *s << "Block = " << block;
341  if (block != nullptr)
342  s->Format(" {{{0:x-16}}", block->GetID());
343  s->EOL();
344  s->Indent();
345  *s << "LineEntry = ";
348  s->EOL();
349  s->Indent();
350  *s << "Symbol = " << symbol;
351  if (symbol != nullptr && symbol->GetMangled())
352  *s << ' ' << symbol->GetName().AsCString();
353  s->EOL();
354  *s << "Variable = " << variable;
355  if (variable != nullptr) {
356  s->Format(" {{{0:x-16}} {1}", variable->GetID(),
357  variable->GetType()->GetName());
358  s->EOL();
359  }
360  s->IndentLess();
361  s->IndentLess();
362 }
363 
365  const SymbolContext &rhs) {
366  return lhs.function == rhs.function && lhs.symbol == rhs.symbol &&
367  lhs.module_sp.get() == rhs.module_sp.get() &&
368  lhs.comp_unit == rhs.comp_unit &&
369  lhs.target_sp.get() == rhs.target_sp.get() &&
370  LineEntry::Compare(lhs.line_entry, rhs.line_entry) == 0 &&
371  lhs.variable == rhs.variable;
372 }
373 
375  const SymbolContext &rhs) {
376  return !(lhs == rhs);
377 }
378 
380  bool use_inline_block_range,
381  AddressRange &range) const {
382  if ((scope & eSymbolContextLineEntry) && line_entry.IsValid()) {
383  range = line_entry.range;
384  return true;
385  }
386 
387  if ((scope & eSymbolContextBlock) && (block != nullptr)) {
388  if (use_inline_block_range) {
389  Block *inline_block = block->GetContainingInlinedBlock();
390  if (inline_block)
391  return inline_block->GetRangeAtIndex(range_idx, range);
392  } else {
393  return block->GetRangeAtIndex(range_idx, range);
394  }
395  }
396 
397  if ((scope & eSymbolContextFunction) && (function != nullptr)) {
398  if (range_idx == 0) {
399  range = function->GetAddressRange();
400  return true;
401  }
402  }
403 
404  if ((scope & eSymbolContextSymbol) && (symbol != nullptr)) {
405  if (range_idx == 0) {
406  if (symbol->ValueIsAddress()) {
407  range.GetBaseAddress() = symbol->GetAddressRef();
408  range.SetByteSize(symbol->GetByteSize());
409  return true;
410  }
411  }
412  }
413  range.Clear();
414  return false;
415 }
416 
418  LanguageType lang;
419  if (function && (lang = function->GetLanguage()) != eLanguageTypeUnknown) {
420  return lang;
421  } else if (variable &&
422  (lang = variable->GetLanguage()) != eLanguageTypeUnknown) {
423  return lang;
424  } else if (symbol && (lang = symbol->GetLanguage()) != eLanguageTypeUnknown) {
425  return lang;
426  } else if (comp_unit &&
427  (lang = comp_unit->GetLanguage()) != eLanguageTypeUnknown) {
428  return lang;
429  } else if (symbol) {
430  // If all else fails, try to guess the language from the name.
431  return symbol->GetMangled().GuessLanguage();
432  }
433  return eLanguageTypeUnknown;
434 }
435 
437  SymbolContext &next_frame_sc,
438  Address &next_frame_pc) const {
439  next_frame_sc.Clear(false);
440  next_frame_pc.Clear();
441 
442  if (block) {
443  // const addr_t curr_frame_file_addr = curr_frame_pc.GetFileAddress();
444 
445  // In order to get the parent of an inlined function we first need to see
446  // if we are in an inlined block as "this->block" could be an inlined
447  // block, or a parent of "block" could be. So lets check if this block or
448  // one of this blocks parents is an inlined function.
449  Block *curr_inlined_block = block->GetContainingInlinedBlock();
450  if (curr_inlined_block) {
451  // "this->block" is contained in an inline function block, so to get the
452  // scope above the inlined block, we get the parent of the inlined block
453  // itself
454  Block *next_frame_block = curr_inlined_block->GetParent();
455  // Now calculate the symbol context of the containing block
456  next_frame_block->CalculateSymbolContext(&next_frame_sc);
457 
458  // If we get here we weren't able to find the return line entry using the
459  // nesting of the blocks and the line table. So just use the call site
460  // info from our inlined block.
461 
462  AddressRange range;
463  if (curr_inlined_block->GetRangeContainingAddress(curr_frame_pc, range)) {
464  // To see there this new frame block it, we need to look at the call
465  // site information from
466  const InlineFunctionInfo *curr_inlined_block_inlined_info =
467  curr_inlined_block->GetInlinedFunctionInfo();
468  next_frame_pc = range.GetBaseAddress();
469  next_frame_sc.line_entry.range.GetBaseAddress() = next_frame_pc;
470  next_frame_sc.line_entry.file =
471  curr_inlined_block_inlined_info->GetCallSite().GetFile();
472  next_frame_sc.line_entry.original_file =
473  curr_inlined_block_inlined_info->GetCallSite().GetFile();
474  next_frame_sc.line_entry.line =
475  curr_inlined_block_inlined_info->GetCallSite().GetLine();
476  next_frame_sc.line_entry.column =
477  curr_inlined_block_inlined_info->GetCallSite().GetColumn();
478  return true;
479  } else {
481 
482  if (log) {
483  LLDB_LOGF(
484  log,
485  "warning: inlined block 0x%8.8" PRIx64
486  " doesn't have a range that contains file address 0x%" PRIx64,
487  curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress());
488  }
489 #ifdef LLDB_CONFIGURATION_DEBUG
490  else {
491  ObjectFile *objfile = nullptr;
492  if (module_sp) {
493  if (SymbolFile *symbol_file = module_sp->GetSymbolFile())
494  objfile = symbol_file->GetObjectFile();
495  }
496  if (objfile) {
499  "warning: inlined block 0x%8.8" PRIx64
500  " doesn't have a range that contains file address 0x%" PRIx64
501  " in %s\n",
502  curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress(),
503  objfile->GetFileSpec().GetPath().c_str());
504  } else {
507  "warning: inlined block 0x%8.8" PRIx64
508  " doesn't have a range that contains file address 0x%" PRIx64
509  "\n",
510  curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress());
511  }
512  }
513 #endif
514  }
515  }
516  }
517 
518  return false;
519 }
520 
522  if (function) {
523  if (block) {
524  // If this symbol context has a block, check to see if this block is
525  // itself, or is contained within a block with inlined function
526  // information. If so, then the inlined block is the block that defines
527  // the function.
528  Block *inlined_block = block->GetContainingInlinedBlock();
529  if (inlined_block)
530  return inlined_block;
531 
532  // The block in this symbol context is not inside an inlined block, so
533  // the block that defines the function is the function's top level block,
534  // which is returned below.
535  }
536 
537  // There is no block information in this symbol context, so we must assume
538  // that the block that is desired is the top level block of the function
539  // itself.
540  return &function->GetBlock(true);
541  }
542  return nullptr;
543 }
544 
546  bool &is_instance_method,
547  ConstString &language_object_name)
548 
549 {
550  Block *function_block = GetFunctionBlock();
551  if (function_block) {
552  CompilerDeclContext decl_ctx = function_block->GetDeclContext();
553  if (decl_ctx)
554  return decl_ctx.IsClassMethod(&language, &is_instance_method,
555  &language_object_name);
556  }
557  return false;
558 }
559 
560 void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
561  Block *curr_block = block;
562  bool isInlinedblock = false;
563  if (curr_block != nullptr &&
564  curr_block->GetContainingInlinedBlock() != nullptr)
565  isInlinedblock = true;
566 
567  // Find all types that match the current block if we have one and put them
568  // first in the list. Keep iterating up through all blocks.
569  while (curr_block != nullptr && !isInlinedblock) {
570  type_map.ForEach(
571  [curr_block, &type_list](const lldb::TypeSP &type_sp) -> bool {
572  SymbolContextScope *scs = type_sp->GetSymbolContextScope();
573  if (scs && curr_block == scs->CalculateSymbolContextBlock())
574  type_list.Insert(type_sp);
575  return true; // Keep iterating
576  });
577 
578  // Remove any entries that are now in "type_list" from "type_map" since we
579  // can't remove from type_map while iterating
580  type_list.ForEach([&type_map](const lldb::TypeSP &type_sp) -> bool {
581  type_map.Remove(type_sp);
582  return true; // Keep iterating
583  });
584  curr_block = curr_block->GetParent();
585  }
586  // Find all types that match the current function, if we have onem, and put
587  // them next in the list.
588  if (function != nullptr && !type_map.Empty()) {
589  const size_t old_type_list_size = type_list.GetSize();
590  type_map.ForEach([this, &type_list](const lldb::TypeSP &type_sp) -> bool {
591  SymbolContextScope *scs = type_sp->GetSymbolContextScope();
592  if (scs && function == scs->CalculateSymbolContextFunction())
593  type_list.Insert(type_sp);
594  return true; // Keep iterating
595  });
596 
597  // Remove any entries that are now in "type_list" from "type_map" since we
598  // can't remove from type_map while iterating
599  const size_t new_type_list_size = type_list.GetSize();
600  if (new_type_list_size > old_type_list_size) {
601  for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
602  type_map.Remove(type_list.GetTypeAtIndex(i));
603  }
604  }
605  // Find all types that match the current compile unit, if we have one, and
606  // put them next in the list.
607  if (comp_unit != nullptr && !type_map.Empty()) {
608  const size_t old_type_list_size = type_list.GetSize();
609 
610  type_map.ForEach([this, &type_list](const lldb::TypeSP &type_sp) -> bool {
611  SymbolContextScope *scs = type_sp->GetSymbolContextScope();
612  if (scs && comp_unit == scs->CalculateSymbolContextCompileUnit())
613  type_list.Insert(type_sp);
614  return true; // Keep iterating
615  });
616 
617  // Remove any entries that are now in "type_list" from "type_map" since we
618  // can't remove from type_map while iterating
619  const size_t new_type_list_size = type_list.GetSize();
620  if (new_type_list_size > old_type_list_size) {
621  for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
622  type_map.Remove(type_list.GetTypeAtIndex(i));
623  }
624  }
625  // Find all types that match the current module, if we have one, and put them
626  // next in the list.
627  if (module_sp && !type_map.Empty()) {
628  const size_t old_type_list_size = type_list.GetSize();
629  type_map.ForEach([this, &type_list](const lldb::TypeSP &type_sp) -> bool {
630  SymbolContextScope *scs = type_sp->GetSymbolContextScope();
631  if (scs && module_sp == scs->CalculateSymbolContextModule())
632  type_list.Insert(type_sp);
633  return true; // Keep iterating
634  });
635  // Remove any entries that are now in "type_list" from "type_map" since we
636  // can't remove from type_map while iterating
637  const size_t new_type_list_size = type_list.GetSize();
638  if (new_type_list_size > old_type_list_size) {
639  for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
640  type_map.Remove(type_list.GetTypeAtIndex(i));
641  }
642  }
643  // Any types that are left get copied into the list an any order.
644  if (!type_map.Empty()) {
645  type_map.ForEach([&type_list](const lldb::TypeSP &type_sp) -> bool {
646  type_list.Insert(type_sp);
647  return true; // Keep iterating
648  });
649  }
650 }
651 
653 SymbolContext::GetFunctionName(Mangled::NamePreference preference) const {
654  if (function) {
655  if (block) {
656  Block *inlined_block = block->GetContainingInlinedBlock();
657 
658  if (inlined_block) {
659  const InlineFunctionInfo *inline_info =
660  inlined_block->GetInlinedFunctionInfo();
661  if (inline_info)
662  return inline_info->GetName();
663  }
664  }
665  return function->GetMangled().GetName(preference);
666  } else if (symbol && symbol->ValueIsAddress()) {
667  return symbol->GetMangled().GetName(preference);
668  } else {
669  // No function, return an empty string.
670  return ConstString();
671  }
672 }
673 
676  Address start_addr;
677  if (block) {
678  Block *inlined_block = block->GetContainingInlinedBlock();
679  if (inlined_block) {
680  if (inlined_block->GetStartAddress(start_addr)) {
682  return line_entry;
683  }
684  return LineEntry();
685  }
686  }
687 
688  if (function) {
690  .GetBaseAddress()
692  return line_entry;
693  }
694  return LineEntry();
695 }
696 
698  AddressRange &range,
699  Status &error) {
700  if (!line_entry.IsValid()) {
701  error.SetErrorString("Symbol context has no line table.");
702  return false;
703  }
704 
705  range = line_entry.range;
706  if (line_entry.line > end_line) {
707  error.SetErrorStringWithFormat(
708  "end line option %d must be after the current line: %d", end_line,
709  line_entry.line);
710  return false;
711  }
712 
713  uint32_t line_index = 0;
714  bool found = false;
715  while (true) {
716  LineEntry this_line;
717  line_index = comp_unit->FindLineEntry(line_index, line_entry.line, nullptr,
718  false, &this_line);
719  if (line_index == UINT32_MAX)
720  break;
721  if (LineEntry::Compare(this_line, line_entry) == 0) {
722  found = true;
723  break;
724  }
725  }
726 
727  LineEntry end_entry;
728  if (!found) {
729  // Can't find the index of the SymbolContext's line entry in the
730  // SymbolContext's CompUnit.
731  error.SetErrorString(
732  "Can't find the current line entry in the CompUnit - can't process "
733  "the end-line option");
734  return false;
735  }
736 
737  line_index = comp_unit->FindLineEntry(line_index, end_line, nullptr, false,
738  &end_entry);
739  if (line_index == UINT32_MAX) {
740  error.SetErrorStringWithFormat(
741  "could not find a line table entry corresponding "
742  "to end line number %d",
743  end_line);
744  return false;
745  }
746 
747  Block *func_block = GetFunctionBlock();
748  if (func_block && func_block->GetRangeIndexContainingAddress(
749  end_entry.range.GetBaseAddress()) == UINT32_MAX) {
750  error.SetErrorStringWithFormat(
751  "end line number %d is not contained within the current function.",
752  end_line);
753  return false;
754  }
755 
756  lldb::addr_t range_size = end_entry.range.GetBaseAddress().GetFileAddress() -
757  range.GetBaseAddress().GetFileAddress();
758  range.SetByteSize(range_size);
759  return true;
760 }
761 
763  Status &error) {
764  error.Clear();
765 
766  if (!target_sp) {
767  return nullptr;
768  }
769 
770  Target &target = *target_sp;
771  Module *module = module_sp.get();
772 
773  auto ProcessMatches = [this, &name, &target,
774  module](SymbolContextList &sc_list,
775  Status &error) -> const Symbol * {
776  llvm::SmallVector<const Symbol *, 1> external_symbols;
777  llvm::SmallVector<const Symbol *, 1> internal_symbols;
778  const uint32_t matches = sc_list.GetSize();
779  for (uint32_t i = 0; i < matches; ++i) {
780  SymbolContext sym_ctx;
781  sc_list.GetContextAtIndex(i, sym_ctx);
782  if (sym_ctx.symbol) {
783  const Symbol *symbol = sym_ctx.symbol;
784  const Address sym_address = symbol->GetAddress();
785 
786  if (sym_address.IsValid()) {
787  switch (symbol->GetType()) {
788  case eSymbolTypeData:
789  case eSymbolTypeRuntime:
790  case eSymbolTypeAbsolute:
793  case eSymbolTypeObjCIVar:
795  // If the demangled name was synthesized, then don't use it for
796  // expressions. Only let the symbol match if the mangled named
797  // matches for these symbols.
798  if (symbol->GetMangled().GetMangledName() != name)
799  break;
800  }
801  if (symbol->IsExternal()) {
802  external_symbols.push_back(symbol);
803  } else {
804  internal_symbols.push_back(symbol);
805  }
806  break;
807  case eSymbolTypeReExported: {
808  ConstString reexport_name = symbol->GetReExportedSymbolName();
809  if (reexport_name) {
810  ModuleSP reexport_module_sp;
811  ModuleSpec reexport_module_spec;
812  reexport_module_spec.GetPlatformFileSpec() =
814  if (reexport_module_spec.GetPlatformFileSpec()) {
815  reexport_module_sp =
816  target.GetImages().FindFirstModule(reexport_module_spec);
817  if (!reexport_module_sp) {
818  reexport_module_spec.GetPlatformFileSpec()
819  .GetDirectory()
820  .Clear();
821  reexport_module_sp =
822  target.GetImages().FindFirstModule(reexport_module_spec);
823  }
824  }
825  // Don't allow us to try and resolve a re-exported symbol if it
826  // is the same as the current symbol
827  if (name == symbol->GetReExportedSymbolName() &&
828  module == reexport_module_sp.get())
829  return nullptr;
830 
832  error);
833  }
834  } break;
835 
836  case eSymbolTypeCode: // We already lookup functions elsewhere
837  case eSymbolTypeVariable:
838  case eSymbolTypeLocal:
839  case eSymbolTypeParam:
841  case eSymbolTypeInvalid:
847  case eSymbolTypeBlock:
852  case eSymbolTypeScopeEnd:
854  case eSymbolTypeCompiler:
857  case eSymbolTypeResolver:
858  break;
859  }
860  }
861  }
862  }
863 
864  if (external_symbols.size() > 1) {
865  StreamString ss;
866  ss.Printf("Multiple external symbols found for '%s'\n", name.AsCString());
867  for (const Symbol *symbol : external_symbols) {
869  }
870  ss.PutChar('\n');
871  error.SetErrorString(ss.GetData());
872  return nullptr;
873  } else if (external_symbols.size()) {
874  return external_symbols[0];
875  } else if (internal_symbols.size() > 1) {
876  StreamString ss;
877  ss.Printf("Multiple internal symbols found for '%s'\n", name.AsCString());
878  for (const Symbol *symbol : internal_symbols) {
880  ss.PutChar('\n');
881  }
882  error.SetErrorString(ss.GetData());
883  return nullptr;
884  } else if (internal_symbols.size()) {
885  return internal_symbols[0];
886  } else {
887  return nullptr;
888  }
889  };
890 
891  if (module) {
892  SymbolContextList sc_list;
893  module->FindSymbolsWithNameAndType(name, eSymbolTypeAny, sc_list);
894  const Symbol *const module_symbol = ProcessMatches(sc_list, error);
895 
896  if (!error.Success()) {
897  return nullptr;
898  } else if (module_symbol) {
899  return module_symbol;
900  }
901  }
902 
903  {
904  SymbolContextList sc_list;
905  target.GetImages().FindSymbolsWithNameAndType(name, eSymbolTypeAny,
906  sc_list);
907  const Symbol *const target_symbol = ProcessMatches(sc_list, error);
908 
909  if (!error.Success()) {
910  return nullptr;
911  } else if (target_symbol) {
912  return target_symbol;
913  }
914  }
915 
916  return nullptr; // no error; we just didn't find anything
917 }
918 
919 //
920 // SymbolContextSpecifier
921 //
922 
924  : m_target_sp(target_sp), m_module_spec(), m_module_sp(), m_file_spec_up(),
925  m_start_line(0), m_end_line(0), m_function_spec(), m_class_name(),
926  m_address_range_up(), m_type(eNothingSpecified) {}
927 
929 
931  SpecificationType type) {
932  bool return_value = true;
933  switch (type) {
934  case eNothingSpecified:
935  Clear();
936  break;
937  case eLineStartSpecified:
938  m_start_line = line_no;
940  break;
941  case eLineEndSpecified:
942  m_end_line = line_no;
944  break;
945  default:
946  return_value = false;
947  break;
948  }
949  return return_value;
950 }
951 
952 bool SymbolContextSpecifier::AddSpecification(const char *spec_string,
953  SpecificationType type) {
954  bool return_value = true;
955  switch (type) {
956  case eNothingSpecified:
957  Clear();
958  break;
959  case eModuleSpecified: {
960  // See if we can find the Module, if so stick it in the SymbolContext.
961  FileSpec module_file_spec(spec_string);
962  ModuleSpec module_spec(module_file_spec);
963  lldb::ModuleSP module_sp(
964  m_target_sp->GetImages().FindFirstModule(module_spec));
966  if (module_sp)
967  m_module_sp = module_sp;
968  else
969  m_module_spec.assign(spec_string);
970  } break;
971  case eFileSpecified:
972  // CompUnits can't necessarily be resolved here, since an inlined function
973  // might show up in a number of CompUnits. Instead we just convert to a
974  // FileSpec and store it away.
975  m_file_spec_up = std::make_unique<FileSpec>(spec_string);
977  break;
978  case eLineStartSpecified:
979  if ((return_value = llvm::to_integer(spec_string, m_start_line)))
981  break;
982  case eLineEndSpecified:
983  if ((return_value = llvm::to_integer(spec_string, m_end_line)))
985  break;
986  case eFunctionSpecified:
987  m_function_spec.assign(spec_string);
989  break;
991  Clear();
992  m_class_name.assign(spec_string);
994  break;
996  // Not specified yet...
997  break;
998  }
999 
1000  return return_value;
1001 }
1002 
1004  m_module_spec.clear();
1005  m_file_spec_up.reset();
1006  m_function_spec.clear();
1007  m_class_name.clear();
1008  m_start_line = 0;
1009  m_end_line = 0;
1010  m_address_range_up.reset();
1011 
1013 }
1014 
1016  if (m_type == eNothingSpecified)
1017  return true;
1018 
1019  // Only compare targets if this specifier has one and it's not the Dummy
1020  // target. Otherwise if a specifier gets made in the dummy target and
1021  // copied over we'll artificially fail the comparision.
1022  if (m_target_sp && !m_target_sp->IsDummyTarget() &&
1023  m_target_sp != sc.target_sp)
1024  return false;
1025 
1026  if (m_type & eModuleSpecified) {
1027  if (sc.module_sp) {
1028  if (m_module_sp.get() != nullptr) {
1029  if (m_module_sp.get() != sc.module_sp.get())
1030  return false;
1031  } else {
1032  FileSpec module_file_spec(m_module_spec);
1033  if (!FileSpec::Match(module_file_spec, sc.module_sp->GetFileSpec()))
1034  return false;
1035  }
1036  }
1037  }
1038  if (m_type & eFileSpecified) {
1039  if (m_file_spec_up) {
1040  // If we don't have a block or a comp_unit, then we aren't going to match
1041  // a source file.
1042  if (sc.block == nullptr && sc.comp_unit == nullptr)
1043  return false;
1044 
1045  // Check if the block is present, and if so is it inlined:
1046  bool was_inlined = false;
1047  if (sc.block != nullptr) {
1048  const InlineFunctionInfo *inline_info =
1050  if (inline_info != nullptr) {
1051  was_inlined = true;
1053  inline_info->GetDeclaration().GetFile()))
1054  return false;
1055  }
1056  }
1057 
1058  // Next check the comp unit, but only if the SymbolContext was not
1059  // inlined.
1060  if (!was_inlined && sc.comp_unit != nullptr) {
1062  return false;
1063  }
1064  }
1065  }
1068  return false;
1069  }
1070 
1071  if (m_type & eFunctionSpecified) {
1072  // First check the current block, and if it is inlined, get the inlined
1073  // function name:
1074  bool was_inlined = false;
1075  ConstString func_name(m_function_spec.c_str());
1076 
1077  if (sc.block != nullptr) {
1078  const InlineFunctionInfo *inline_info =
1080  if (inline_info != nullptr) {
1081  was_inlined = true;
1082  const Mangled &name = inline_info->GetMangled();
1083  if (!name.NameMatches(func_name))
1084  return false;
1085  }
1086  }
1087  // If it wasn't inlined, check the name in the function or symbol:
1088  if (!was_inlined) {
1089  if (sc.function != nullptr) {
1090  if (!sc.function->GetMangled().NameMatches(func_name))
1091  return false;
1092  } else if (sc.symbol != nullptr) {
1093  if (!sc.symbol->GetMangled().NameMatches(func_name))
1094  return false;
1095  }
1096  }
1097  }
1098 
1099  return true;
1100 }
1101 
1104 
1105  } else {
1106  Address match_address(addr, nullptr);
1107  SymbolContext sc;
1108  m_target_sp->GetImages().ResolveSymbolContextForAddress(
1109  match_address, eSymbolContextEverything, sc);
1110  return SymbolContextMatches(sc);
1111  }
1112  return true;
1113 }
1114 
1116  Stream *s, lldb::DescriptionLevel level) const {
1117  char path_str[PATH_MAX + 1];
1118 
1119  if (m_type == eNothingSpecified) {
1120  s->Printf("Nothing specified.\n");
1121  }
1122 
1123  if (m_type == eModuleSpecified) {
1124  s->Indent();
1125  if (m_module_sp) {
1126  m_module_sp->GetFileSpec().GetPath(path_str, PATH_MAX);
1127  s->Printf("Module: %s\n", path_str);
1128  } else
1129  s->Printf("Module: %s\n", m_module_spec.c_str());
1130  }
1131 
1132  if (m_type == eFileSpecified && m_file_spec_up != nullptr) {
1133  m_file_spec_up->GetPath(path_str, PATH_MAX);
1134  s->Indent();
1135  s->Printf("File: %s", path_str);
1136  if (m_type == eLineStartSpecified) {
1137  s->Printf(" from line %" PRIu64 "", (uint64_t)m_start_line);
1138  if (m_type == eLineEndSpecified)
1139  s->Printf("to line %" PRIu64 "", (uint64_t)m_end_line);
1140  else
1141  s->Printf("to end");
1142  } else if (m_type == eLineEndSpecified) {
1143  s->Printf(" from start to line %" PRIu64 "", (uint64_t)m_end_line);
1144  }
1145  s->Printf(".\n");
1146  }
1147 
1148  if (m_type == eLineStartSpecified) {
1149  s->Indent();
1150  s->Printf("From line %" PRIu64 "", (uint64_t)m_start_line);
1151  if (m_type == eLineEndSpecified)
1152  s->Printf("to line %" PRIu64 "", (uint64_t)m_end_line);
1153  else
1154  s->Printf("to end");
1155  s->Printf(".\n");
1156  } else if (m_type == eLineEndSpecified) {
1157  s->Printf("From start to line %" PRIu64 ".\n", (uint64_t)m_end_line);
1158  }
1159 
1160  if (m_type == eFunctionSpecified) {
1161  s->Indent();
1162  s->Printf("Function: %s.\n", m_function_spec.c_str());
1163  }
1164 
1166  s->Indent();
1167  s->Printf("Class name: %s.\n", m_class_name.c_str());
1168  }
1169 
1170  if (m_type == eAddressRangeSpecified && m_address_range_up != nullptr) {
1171  s->Indent();
1172  s->PutCString("Address range: ");
1173  m_address_range_up->Dump(s, m_target_sp.get(),
1176  s->PutCString("\n");
1177  }
1178 }
1179 
1180 //
1181 // SymbolContextList
1182 //
1183 
1184 SymbolContextList::SymbolContextList() : m_symbol_contexts() {}
1185 
1187 
1189  m_symbol_contexts.push_back(sc);
1190 }
1191 
1193  collection::const_iterator pos, end = sc_list.m_symbol_contexts.end();
1194  for (pos = sc_list.m_symbol_contexts.begin(); pos != end; ++pos)
1195  m_symbol_contexts.push_back(*pos);
1196 }
1197 
1199  bool merge_symbol_into_function) {
1200  uint32_t unique_sc_add_count = 0;
1201  collection::const_iterator pos, end = sc_list.m_symbol_contexts.end();
1202  for (pos = sc_list.m_symbol_contexts.begin(); pos != end; ++pos) {
1203  if (AppendIfUnique(*pos, merge_symbol_into_function))
1204  ++unique_sc_add_count;
1205  }
1206  return unique_sc_add_count;
1207 }
1208 
1210  bool merge_symbol_into_function) {
1211  collection::iterator pos, end = m_symbol_contexts.end();
1212  for (pos = m_symbol_contexts.begin(); pos != end; ++pos) {
1213  if (*pos == sc)
1214  return false;
1215  }
1216  if (merge_symbol_into_function && sc.symbol != nullptr &&
1217  sc.comp_unit == nullptr && sc.function == nullptr &&
1218  sc.block == nullptr && !sc.line_entry.IsValid()) {
1219  if (sc.symbol->ValueIsAddress()) {
1220  for (pos = m_symbol_contexts.begin(); pos != end; ++pos) {
1221  // Don't merge symbols into inlined function symbol contexts
1222  if (pos->block && pos->block->GetContainingInlinedBlock())
1223  continue;
1224 
1225  if (pos->function) {
1226  if (pos->function->GetAddressRange().GetBaseAddress() ==
1227  sc.symbol->GetAddressRef()) {
1228  // Do we already have a function with this symbol?
1229  if (pos->symbol == sc.symbol)
1230  return false;
1231  if (pos->symbol == nullptr) {
1232  pos->symbol = sc.symbol;
1233  return false;
1234  }
1235  }
1236  }
1237  }
1238  }
1239  }
1240  m_symbol_contexts.push_back(sc);
1241  return true;
1242 }
1243 
1245 
1246 void SymbolContextList::Dump(Stream *s, Target *target) const {
1247 
1248  *s << this << ": ";
1249  s->Indent();
1250  s->PutCString("SymbolContextList");
1251  s->EOL();
1252  s->IndentMore();
1253 
1254  collection::const_iterator pos, end = m_symbol_contexts.end();
1255  for (pos = m_symbol_contexts.begin(); pos != end; ++pos) {
1256  // pos->Dump(s, target);
1257  pos->GetDescription(s, eDescriptionLevelVerbose, target);
1258  }
1259  s->IndentLess();
1260 }
1261 
1263  if (idx < m_symbol_contexts.size()) {
1264  sc = m_symbol_contexts[idx];
1265  return true;
1266  }
1267  return false;
1268 }
1269 
1271  if (idx < m_symbol_contexts.size()) {
1272  m_symbol_contexts.erase(m_symbol_contexts.begin() + idx);
1273  return true;
1274  }
1275  return false;
1276 }
1277 
1279 
1280 bool SymbolContextList::IsEmpty() const { return m_symbol_contexts.empty(); }
1281 
1283  uint32_t match_count = 0;
1284  const size_t size = m_symbol_contexts.size();
1285  for (size_t idx = 0; idx < size; ++idx) {
1286  if (m_symbol_contexts[idx].line_entry.line == line)
1287  ++match_count;
1288  }
1289  return match_count;
1290 }
1291 
1293  Target *target) const {
1294  const size_t size = m_symbol_contexts.size();
1295  for (size_t idx = 0; idx < size; ++idx)
1296  m_symbol_contexts[idx].GetDescription(s, level, target);
1297 }
1298 
1300  const SymbolContextList &rhs) {
1301  const uint32_t size = lhs.GetSize();
1302  if (size != rhs.GetSize())
1303  return false;
1304 
1305  SymbolContext lhs_sc;
1306  SymbolContext rhs_sc;
1307  for (uint32_t i = 0; i < size; ++i) {
1308  lhs.GetContextAtIndex(i, lhs_sc);
1309  rhs.GetContextAtIndex(i, rhs_sc);
1310  if (lhs_sc != rhs_sc)
1311  return false;
1312  }
1313  return true;
1314 }
1315 
1317  const SymbolContextList &rhs) {
1318  return !(lhs == rhs);
1319 }
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
Block.h
lldb_private::Stream::IndentLess
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:171
lldb_private::Stream::Format
void Format(const char *format, Args &&... args)
Definition: Stream.h:309
lldb::eSymbolTypeCompiler
@ eSymbolTypeCompiler
Definition: lldb-enumerations.h:637
lldb_private::Variable::GetScope
lldb::ValueType GetScope() const
Definition: Variable.h:66
lldb_private::SymbolContextSpecifier::~SymbolContextSpecifier
~SymbolContextSpecifier()
lldb_private::Block::GetRangeContainingAddress
bool GetRangeContainingAddress(const Address &addr, AddressRange &range)
Definition: Block.cpp:249
lldb_private::SymbolFile
Definition: SymbolFile.h:38
lldb_private::SymbolContext::block
Block * block
The Block for a given query.
Definition: SymbolContext.h:321
lldb_private::LineEntry::Compare
static int Compare(const LineEntry &lhs, const LineEntry &rhs)
Compare two LineEntry objects.
Definition: LineEntry.cpp:157
lldb::eSymbolTypeParam
@ eSymbolTypeParam
Definition: lldb-enumerations.h:628
lldb_private::SymbolContext::comp_unit
CompileUnit * comp_unit
The CompileUnit for a given query.
Definition: SymbolContext.h:319
lldb_private::SymbolContextSpecifier::AddSpecification
bool AddSpecification(const char *spec_string, SpecificationType type)
Definition: SymbolContext.cpp:952
lldb::eSymbolTypeObjCIVar
@ eSymbolTypeObjCIVar
Definition: lldb-enumerations.h:642
lldb_private::LineEntry::file
FileSpec file
The source file, possibly mapped by the target.source-map setting.
Definition: LineEntry.h:140
lldb::eValueTypeVariableGlobal
@ eValueTypeVariableGlobal
globals variable
Definition: lldb-enumerations.h:317
lldb_private::ObjectFile::GetFileSpec
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition: ObjectFile.h:291
lldb_private::ModuleSpec::GetPlatformFileSpec
FileSpec & GetPlatformFileSpec()
Definition: ModuleSpec.h:70
lldb::eSymbolTypeHeaderFile
@ eSymbolTypeHeaderFile
Definition: lldb-enumerations.h:623
lldb_private::SymbolContextSpecifier::eNothingSpecified
@ eNothingSpecified
Definition: SymbolContext.h:331
lldb_private::Address::Clear
void Clear()
Clear the object's state.
Definition: Address.h:178
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::LineEntry::DumpStopContext
bool DumpStopContext(Stream *s, bool show_fullpaths) const
Dumps information specific to a process that stops at this line entry to the supplied stream s.
Definition: LineEntry.cpp:50
lldb_private::SymbolContextSpecifier::eLineEndSpecified
@ eLineEndSpecified
Definition: SymbolContext.h:335
lldb_private::InlineFunctionInfo
Definition: Function.h:127
CompileUnit.h
lldb_private::LineEntry::IsValid
bool IsValid() const
Check if a line entry object is valid.
Definition: LineEntry.cpp:46
lldb::eSymbolTypeInstrumentation
@ eSymbolTypeInstrumentation
Definition: lldb-enumerations.h:638
lldb_private::SymbolContextSpecifier::m_type
uint32_t m_type
Definition: SymbolContext.h:368
ModuleSpec.h
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:461
lldb_private::Symbol::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
Definition: Symbol.cpp:178
lldb_private::SymbolContextScope::CalculateSymbolContextModule
virtual lldb::ModuleSP CalculateSymbolContextModule()
Definition: SymbolContextScope.h:78
lldb_private::SymbolContextList::~SymbolContextList
~SymbolContextList()
Destructor.
lldb_private::SymbolContextSpecifier::m_module_spec
std::string m_module_spec
Definition: SymbolContext.h:360
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::Symbol::ValueIsAddress
bool ValueIsAddress() const
Definition: Symbol.cpp:117
lldb_private::SymbolContextSpecifier::m_function_spec
std::string m_function_spec
Definition: SymbolContext.h:365
lldb::eSymbolTypeInvalid
@ eSymbolTypeInvalid
Definition: lldb-enumerations.h:614
Host.h
lldb_private::SymbolContext::GetAddressRange
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Definition: SymbolContext.cpp:379
lldb_private::SymbolContext::target_sp
lldb::TargetSP target_sp
The Target for a given query.
Definition: SymbolContext.h:317
lldb::eSymbolTypeLineEntry
@ eSymbolTypeLineEntry
Definition: lldb-enumerations.h:631
lldb_private::SymbolContextSpecifier::eFileSpecified
@ eFileSpecified
Definition: SymbolContext.h:333
lldb_private::SymbolContextList::Append
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
Definition: SymbolContext.cpp:1188
lldb_private::Address::DumpStyleFileAddress
@ DumpStyleFileAddress
Display as the file address (if any).
Definition: Address.h:84
lldb_private::SymbolContextScope::CalculateSymbolContextFunction
virtual Function * CalculateSymbolContextFunction()
Definition: SymbolContextScope.h:84
lldb::eSymbolTypeCommonBlock
@ eSymbolTypeCommonBlock
Definition: lldb-enumerations.h:625
lldb::eSymbolTypeTrampoline
@ eSymbolTypeTrampoline
Definition: lldb-enumerations.h:619
lldb_private::Block::GetParent
Block * GetParent() const
Get the parent block.
Definition: Block.cpp:201
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
Module.h
lldb_private::InlineFunctionInfo::GetCallSite
Declaration & GetCallSite()
Get accessor for the call site declaration information.
Definition: Function.cpp:106
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb::eSymbolTypeScopeBegin
@ eSymbolTypeScopeBegin
Definition: lldb-enumerations.h:633
lldb::eSymbolTypeData
@ eSymbolTypeData
Definition: lldb-enumerations.h:618
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::Module
Definition: Module.h:85
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::SymbolContextSpecifier::Clear
void Clear()
Definition: SymbolContext.cpp:1003
lldb_private::Declaration::GetFile
FileSpec & GetFile()
Get accessor for file specification.
Definition: Declaration.h:107
lldb::eSymbolTypeRuntime
@ eSymbolTypeRuntime
Definition: lldb-enumerations.h:620
lldb_private::Symbol::GetReExportedSymbolName
ConstString GetReExportedSymbolName() const
Definition: Symbol.cpp:126
lldb_private::SymbolContextSpecifier::AddLineSpecification
bool AddLineSpecification(uint32_t line_no, SpecificationType type)
Definition: SymbolContext.cpp:930
lldb_private::Declaration::GetColumn
uint16_t GetColumn() const
Get accessor for the declaration column number.
Definition: Declaration.h:127
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Type::GetName
ConstString GetName()
Definition: Type.cpp:301
lldb_private::TypeList::GetTypeAtIndex
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::SymbolContext::~SymbolContext
~SymbolContext()
lldb_private::SymbolContext::SortTypeList
void SortTypeList(TypeMap &type_map, TypeList &type_list) const
Sorts the types in TypeMap according to SymbolContext to TypeList.
Definition: SymbolContext.cpp:560
lldb_private::SymbolContextSpecifier::eLineStartSpecified
@ eLineStartSpecified
Definition: SymbolContext.h:334
lldb_private::SymbolContextSpecifier::SymbolContextSpecifier
SymbolContextSpecifier(const lldb::TargetSP &target_sp)
Definition: SymbolContext.cpp:923
lldb_private::Variable::GetName
ConstString GetName() const
Definition: Variable.cpp:71
LIBLLDB_LOG_SYMBOLS
#define LIBLLDB_LOG_SYMBOLS
Definition: Logging.h:34
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:451
lldb_private::TypeList::ForEach
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeList.cpp:78
lldb_private::SymbolContextList::Clear
void Clear()
Clear the object's state.
Definition: SymbolContext.cpp:1244
lldb_private::SymbolContextSpecifier::eFunctionSpecified
@ eFunctionSpecified
Definition: SymbolContext.h:336
lldb_private::Type::Dump
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:235
lldb_private::SymbolContextList::SymbolContextList
SymbolContextList()
Default constructor.
Definition: SymbolContext.cpp:1184
lldb_private::LineEntry::GetDescription
bool GetDescription(Stream *s, lldb::DescriptionLevel level, CompileUnit *cu, Target *target, bool show_address_only) const
Definition: LineEntry.cpp:105
lldb_private::CompileUnit
Definition: CompileUnit.h:38
lldb_private::SymbolContextSpecifier::eClassOrNamespaceSpecified
@ eClassOrNamespaceSpecified
Definition: SymbolContext.h:337
lldb_private::SymbolContextSpecifier::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
Definition: SymbolContext.cpp:1115
lldb_private::SymbolContextList::Dump
void Dump(Stream *s, Target *target) const
Dump a description of this object to a Stream.
Definition: SymbolContext.cpp:1246
Target.h
lldb_private::Address::CalculateSymbolContextLineEntry
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const
Definition: Address.cpp:890
lldb_private::SymbolContextSpecifier::m_class_name
std::string m_class_name
Definition: SymbolContext.h:366
lldb_private::operator==
bool operator==(const Address &lhs, const Address &rhs)
Definition: Address.cpp:999
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::SymbolContextSpecifier::m_module_sp
lldb::ModuleSP m_module_sp
Definition: SymbolContext.h:361
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
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::eSymbolTypeBlock
@ eSymbolTypeBlock
Definition: lldb-enumerations.h:626
lldb_private::Host::eSystemLogWarning
@ eSystemLogWarning
Definition: Host.h:106
lldb_private::LineEntry::Dump
bool Dump(Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const
Dump a description of this object to a Stream.
Definition: LineEntry.cpp:70
lldb_private::Function
Definition: Function.h:413
lldb_private::SymbolContext::DumpStopContext
bool DumpStopContext(Stream *s, ExecutionContextScope *exe_scope, const Address &so_addr, bool show_fullpaths, bool show_module, bool show_inlined_frames, bool show_function_arguments, bool show_function_name) const
Dump the stop context in this object to a Stream.
Definition: SymbolContext.cpp:67
lldb_private::Stream::Indent
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:130
lldb::eSymbolTypeSourceFile
@ eSymbolTypeSourceFile
Definition: lldb-enumerations.h:622
lldb_private::Address::DumpStyleLoadAddress
@ DumpStyleLoadAddress
Display as the load address (if resolved).
Definition: Address.h:96
Log.h
lldb::eSymbolTypeUndefined
@ eSymbolTypeUndefined
Definition: lldb-enumerations.h:639
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb::eSymbolTypeObjectFile
@ eSymbolTypeObjectFile
Definition: lldb-enumerations.h:624
lldb_private::SymbolContextScope::CalculateSymbolContextCompileUnit
virtual CompileUnit * CalculateSymbolContextCompileUnit()
Definition: SymbolContextScope.h:82
lldb_private::TypeList::Insert
void Insert(const lldb::TypeSP &type)
Definition: TypeList.cpp:27
lldb_private::SymbolContext::Dump
void Dump(Stream *s, Target *target) const
Dump a description of this object to a Stream.
Definition: SymbolContext.cpp:305
lldb_private::FileSpec::Match
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
Definition: FileSpec.cpp:300
lldb_private::SymbolContext::GetFunctionStartLineEntry
LineEntry GetFunctionStartLineEntry() const
Get the line entry that corresponds to the function.
Definition: SymbolContext.cpp:674
lldb_private::TypeMap::Empty
bool Empty() const
Definition: TypeMap.cpp:77
lldb_private::SymbolContextSpecifier::m_address_range_up
std::unique_ptr< AddressRange > m_address_range_up
Definition: SymbolContext.h:367
lldb_private::StreamString::GetData
const char * GetData() const
Definition: StreamString.h:43
lldb_private::SymbolContextScope::CalculateSymbolContext
virtual void CalculateSymbolContext(SymbolContext *sc)=0
Reconstruct the object's symbol context into sc.
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
StreamString.h
lldb_private::Address::GetFileAddress
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:290
lldb_private::SymbolContextSpecifier::AddressMatches
bool AddressMatches(lldb::addr_t addr)
Definition: SymbolContext.cpp:1102
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
lldb_private::InlineFunctionInfo::GetMangled
Mangled & GetMangled()
Get accessor for the mangled name object.
Definition: Function.cpp:112
lldb_private::TypeList::GetSize
uint32_t GetSize() const
Definition: TypeList.cpp:60
lldb_private::Variable::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Variable.cpp:54
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::StreamString
Definition: StreamString.h:23
lldb_private::SymbolContextSpecifier::m_file_spec_up
std::unique_ptr< FileSpec > m_file_spec_up
Definition: SymbolContext.h:362
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::SymbolContext::GetFunctionName
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
Definition: SymbolContext.cpp:653
lldb_private::Host::SystemLog
static void SystemLog(SystemLogType type, const char *format,...) __attribute__((format(printf
Definition: common/Host.cpp:296
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
lldb_private::Symbol::IsExternal
bool IsExternal() const
Definition: Symbol.h:170
lldb_private::SymbolContextSpecifier::m_start_line
size_t m_start_line
Definition: SymbolContext.h:363
lldb_private::InlineFunctionInfo::GetName
ConstString GetName() const
Definition: Function.cpp:94
lldb_private::SymbolContext::GetFunctionBlock
Block * GetFunctionBlock()
Find a block that defines the function represented by this symbol context.
Definition: SymbolContext.cpp:521
lldb_private::SymbolContextList::m_symbol_contexts
collection m_symbol_contexts
The list of symbol contexts.
Definition: SymbolContext.h:469
lldb::eSymbolTypeObjCClass
@ eSymbolTypeObjCClass
Definition: lldb-enumerations.h:640
lldb_private::SymbolContextList::AppendIfUnique
bool AppendIfUnique(const SymbolContext &sc, bool merge_symbol_into_function)
Definition: SymbolContext.cpp:1209
lldb::eSymbolTypeAdditional
@ eSymbolTypeAdditional
When symbols take more than one entry, the extra entries get this type.
Definition: lldb-enumerations.h:635
lldb_private::SymbolContext::variable
Variable * variable
The global variable matching the given query.
Definition: SymbolContext.h:324
lldb_private::CompileUnit::GetPrimaryFile
const FileSpec & GetPrimaryFile() const
Return the primary source file associated with this compile unit.
Definition: CompileUnit.h:227
lldb::eValueTypeVariableArgument
@ eValueTypeVariableArgument
function argument variables
Definition: lldb-enumerations.h:319
lldb_private::SymbolContextSpecifier::m_target_sp
lldb::TargetSP m_target_sp
Definition: SymbolContext.h:359
lldb_private::CompileUnit::GetLanguage
lldb::LanguageType GetLanguage()
Definition: CompileUnit.cpp:150
lldb_private::SymbolContextScope::CalculateSymbolContextBlock
virtual Block * CalculateSymbolContextBlock()
Definition: SymbolContextScope.h:86
lldb_private::LineEntry::column
uint16_t column
The column number of the source line, or zero if there is no column information.
Definition: LineEntry.h:146
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::ConstString::Dump
void Dump(Stream *s, const char *value_if_empty=nullptr) const
Dump the object description to a stream.
Definition: ConstString.cpp:283
lldb::eSymbolTypeVariable
@ eSymbolTypeVariable
Definition: lldb-enumerations.h:629
lldb::eSymbolTypeScopeEnd
@ eSymbolTypeScopeEnd
Definition: lldb-enumerations.h:634
lldb_private::SymbolContextList::NumLineEntriesWithLine
uint32_t NumLineEntriesWithLine(uint32_t line) const
Definition: SymbolContext.cpp:1282
lldb_private::TypeMap
Definition: TypeMap.h:20
lldb_private::Address::DumpStyleModuleWithFileAddress
@ DumpStyleModuleWithFileAddress
Display as the file address with the module name prepended (if any).
Definition: Address.h:90
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::operator!=
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:1005
lldb_private::LineEntry::original_file
FileSpec original_file
The original source file, from debug info.
Definition: LineEntry.h:142
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
lldb_private::SymbolContext::FindBestGlobalDataSymbol
const Symbol * FindBestGlobalDataSymbol(ConstString name, Status &error)
Find the best global data symbol visible from this context.
Definition: SymbolContext.cpp:762
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::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
lldb_private::FunctionInfo::GetDeclaration
Declaration & GetDeclaration()
Get accessor for the declaration information.
Definition: Function.cpp:51
lldb_private::SymbolContext::SymbolContext
SymbolContext()
Default constructor.
Definition: SymbolContext.cpp:28
lldb_private::Type::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:170
Symbol.h
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:501
lldb_private::ConstString::Clear
void Clear()
Clear this object's state.
Definition: ConstString.h:232
lldb_private::SymbolContextSpecifier::eModuleSpecified
@ eModuleSpecified
Definition: SymbolContext.h:332
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Symbol::GetDemangledNameIsSynthesized
bool GetDemangledNameIsSynthesized() const
Definition: Symbol.h:199
lldb_private::SymbolContextSpecifier::m_end_line
size_t m_end_line
Definition: SymbolContext.h:364
lldb_private::Declaration::GetLine
uint32_t GetLine() const
Get accessor for the declaration line number.
Definition: Declaration.h:120
lldb_private::CompileUnit::FindLineEntry
uint32_t FindLineEntry(uint32_t start_idx, uint32_t line, const FileSpec *file_spec_ptr, bool exact, LineEntry *line_entry)
Find the line entry by line and optional inlined file spec.
Definition: CompileUnit.cpp:228
lldb::eValueTypeVariableLocal
@ eValueTypeVariableLocal
function local variables
Definition: lldb-enumerations.h:320
lldb_private::Status
Definition: Status.h:44
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
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:437
lldb_private::SymbolContext::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
Definition: SymbolContext.cpp:185
uint32_t
lldb_private::Stream::IndentMore
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:168
lldb_private::Block::GetDeclContext
CompilerDeclContext GetDeclContext()
Definition: Block.cpp:479
lldb_private::Address
Definition: Address.h:59
lldb_private::SymbolContext::GetFunctionMethodInfo
bool GetFunctionMethodInfo(lldb::LanguageType &language, bool &is_instance_method, ConstString &language_object_name)
If this symbol context represents a function that is a method, return true and provide information ab...
Definition: SymbolContext.cpp:545
lldb_private::Stream::EOL
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
lldb_private::SymbolContext::GetResolvedMask
uint32_t GetResolvedMask() const
Definition: SymbolContext.cpp:284
lldb_private::Block::GetRangeAtIndex
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range)
Definition: Block.cpp:302
lldb_private::Symbol::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Symbol.h:113
lldb_private::SymbolContextSpecifier::eAddressRangeSpecified
@ eAddressRangeSpecified
Definition: SymbolContext.h:338
lldb_private::Type
Definition: Type.h:66
lldb_private::Symbol::GetByteSize
lldb::addr_t GetByteSize() const
Definition: Symbol.cpp:415
lldb_private::Stream::AsRawOstream
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
Definition: Stream.h:357
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::TypeMap::ForEach
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeMap.cpp:94
lldb::eSymbolTypeObjCMetaClass
@ eSymbolTypeObjCMetaClass
Definition: lldb-enumerations.h:641
lldb_private::SymbolContext::GetParentOfInlinedScope
bool GetParentOfInlinedScope(const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &inlined_frame_addr) const
Find the block containing the inlined block that contains this block.
Definition: SymbolContext.cpp:436
lldb::eSymbolTypeVariableType
@ eSymbolTypeVariableType
Definition: lldb-enumerations.h:630
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
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_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
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::Function::GetType
Type * GetType()
Get accessor for the type that describes the function return value type, and parameter types.
Definition: Function.cpp:501
lldb_private::TypeMap::Remove
bool Remove(const lldb::TypeSP &type_sp)
Definition: TypeMap.cpp:110
lldb_private::SymbolContextList::IsEmpty
bool IsEmpty() const
Definition: SymbolContext.cpp:1280
lldb_private::Function::GetMangled
const Mangled & GetMangled() const
Definition: Function.h:542
lldb_private::SymbolContextSpecifier::SpecificationType
SpecificationType
Definition: SymbolContext.h:330
lldb::eSymbolTypeReExported
@ eSymbolTypeReExported
Definition: lldb-enumerations.h:643
SymbolContext.h
lldb_private::LineEntry::Clear
void Clear()
Clear the object's state.
Definition: LineEntry.cpp:33
lldb_private::SymbolContext::Clear
void Clear(bool clear_target)
Clear the object's state.
Definition: SymbolContext.cpp:55
lldb::eValueTypeVariableThreadLocal
@ eValueTypeVariableThreadLocal
thread local storage variable
Definition: lldb-enumerations.h:324
lldb_private::Block::GetRangeIndexContainingAddress
uint32_t GetRangeIndexContainingAddress(const Address &addr)
Definition: Block.cpp:285
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::eDescriptionLevelVerbose
@ eDescriptionLevelVerbose
Definition: lldb-enumerations.h:210
lldb_private::SymbolContext::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: SymbolContext.cpp:417
lldb_private::TypeList
Definition: TypeList.h:20
lldb::eSymbolTypeLineHeader
@ eSymbolTypeLineHeader
Definition: lldb-enumerations.h:632
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::Variable::GetType
Type * GetType()
Definition: Variable.cpp:96
lldb_private::Module::FindSymbolsWithNameAndType
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list)
Definition: Module.cpp:1343
lldb::eSymbolTypeException
@ eSymbolTypeException
Definition: lldb-enumerations.h:621
lldb_private::Block::GetStartAddress
bool GetStartAddress(Address &addr)
Definition: Block.cpp:316
lldb_private::Log
Definition: Log.h:49
lldb::eValueTypeVariableStatic
@ eValueTypeVariableStatic
static variable
Definition: lldb-enumerations.h:318
lldb_private::Block::GetInlinedFunctionInfo
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
Definition: Block.h:276
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::CompileUnit::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
Definition: CompileUnit.cpp:53
lldb::eSymbolTypeResolver
@ eSymbolTypeResolver
Definition: lldb-enumerations.h:617
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
Variable.h
lldb_private::SymbolContextList::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
Definition: SymbolContext.cpp:1292
PATH_MAX
#define PATH_MAX
Definition: windows/PosixApi.h:25
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::GetType
lldb::SymbolType GetType() const
Definition: Symbol.h:143
lldb::eSymbolTypeLocal
@ eSymbolTypeLocal
Definition: lldb-enumerations.h:627
lldb
Definition: SBAddress.h:15
lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine
bool GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range, Status &error)
Definition: SymbolContext.cpp:697
lldb_private::Function::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Function.cpp:644
lldb_private::Block::CalculateSymbolContext
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Definition: Block.cpp:135
SymbolFile.h
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::Block::GetContainingInlinedBlock
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
Definition: Block.cpp:207
lldb_private::SymbolContextSpecifier::SymbolContextMatches
bool SymbolContextMatches(const SymbolContext &sc)
Definition: SymbolContext.cpp:1015
lldb_private::ObjectFile
Definition: ObjectFile.h:59
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::SymbolContextList::RemoveContextAtIndex
bool RemoveContextAtIndex(size_t idx)
Definition: SymbolContext.cpp:1270
lldb_private::CompilerDeclContext::IsClassMethod
bool IsClassMethod(lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr)
Checks if this decl context represents a method of a class.
Definition: CompilerDeclContext.cpp:37
lldb_private::Symbol::GetAddress
Address GetAddress() const
Definition: Symbol.h:73