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