LLDB  mainline
CompileUnit.cpp
Go to the documentation of this file.
1 //===-- CompileUnit.cpp ---------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "lldb/Core/Module.h"
11 #include "lldb/Symbol/LineTable.h"
12 #include "lldb/Symbol/SymbolFile.h"
14 #include "lldb/Target/Language.h"
15 #include "lldb/Utility/Timer.h"
16 #include <optional>
17 
18 using namespace lldb;
19 using namespace lldb_private;
20 
21 CompileUnit::CompileUnit(const lldb::ModuleSP &module_sp, void *user_data,
22  const char *pathname, const lldb::user_id_t cu_sym_id,
23  lldb::LanguageType language,
24  lldb_private::LazyBool is_optimized)
25  : CompileUnit(module_sp, user_data, FileSpec(pathname), cu_sym_id, language,
26  is_optimized) {}
27 
28 CompileUnit::CompileUnit(const lldb::ModuleSP &module_sp, void *user_data,
29  const FileSpec &fspec, const lldb::user_id_t cu_sym_id,
30  lldb::LanguageType language,
31  lldb_private::LazyBool is_optimized)
32  : ModuleChild(module_sp), UserID(cu_sym_id), m_user_data(user_data),
33  m_language(language), m_flags(0), m_file_spec(fspec),
34  m_is_optimized(is_optimized) {
35  if (language != eLanguageTypeUnknown)
37  assert(module_sp);
38 }
39 
41  sc->comp_unit = this;
42  GetModule()->CalculateSymbolContext(sc);
43 }
44 
46 
48 
50  GetModule()->DumpSymbolContext(s);
51  s->Printf(", CompileUnit{0x%8.8" PRIx64 "}", GetID());
52 }
53 
55  lldb::DescriptionLevel level) const {
56  const char *language = GetCachedLanguage();
57  *s << "id = " << (const UserID &)*this << ", file = \""
58  << this->GetPrimaryFile() << "\", language = \"" << language << '"';
59 }
60 
62  llvm::function_ref<bool(const FunctionSP &)> lambda) const {
63  std::vector<lldb::FunctionSP> sorted_functions;
64  sorted_functions.reserve(m_functions_by_uid.size());
65  for (auto &p : m_functions_by_uid)
66  sorted_functions.push_back(p.second);
67  llvm::sort(sorted_functions,
68  [](const lldb::FunctionSP &a, const lldb::FunctionSP &b) {
69  return a->GetID() < b->GetID();
70  });
71 
72  for (auto &f : sorted_functions)
73  if (lambda(f))
74  return;
75 }
76 
77 lldb::FunctionSP CompileUnit::FindFunction(
78  llvm::function_ref<bool(const FunctionSP &)> matching_lambda) {
80 
81  lldb::ModuleSP module = CalculateSymbolContextModule();
82 
83  if (!module)
84  return {};
85 
86  SymbolFile *symbol_file = module->GetSymbolFile();
87 
88  if (!symbol_file)
89  return {};
90 
91  // m_functions_by_uid is filled in lazily but we need all the entries.
92  symbol_file->ParseFunctions(*this);
93 
94  for (auto &p : m_functions_by_uid) {
95  if (matching_lambda(p.second))
96  return p.second;
97  }
98  return {};
99 }
100 
101 const char *CompileUnit::GetCachedLanguage() const {
103  return "<not loaded>";
105 }
106 
107 // Dump the current contents of this object. No functions that cause on demand
108 // parsing of functions, globals, statics are called, so this is a good
109 // function to call to get an idea of the current contents of the CompileUnit
110 // object.
111 void CompileUnit::Dump(Stream *s, bool show_context) const {
112  const char *language = GetCachedLanguage();
113 
114  s->Printf("%p: ", static_cast<const void *>(this));
115  s->Indent();
116  *s << "CompileUnit" << static_cast<const UserID &>(*this) << ", language = \""
117  << language << "\", file = '" << GetPrimaryFile() << "'\n";
118 
119  // m_types.Dump(s);
120 
121  if (m_variables.get()) {
122  s->IndentMore();
123  m_variables->Dump(s, show_context);
124  s->IndentLess();
125  }
126 
127  if (!m_functions_by_uid.empty()) {
128  s->IndentMore();
129  ForeachFunction([&s, show_context](const FunctionSP &f) {
130  f->Dump(s, show_context);
131  return false;
132  });
133 
134  s->IndentLess();
135  s->EOL();
136  }
137 }
138 
139 // Add a function to this compile unit
140 void CompileUnit::AddFunction(FunctionSP &funcSP) {
141  m_functions_by_uid[funcSP->GetID()] = funcSP;
142 }
143 
145  auto it = m_functions_by_uid.find(func_uid);
146  if (it == m_functions_by_uid.end())
147  return FunctionSP();
148  return it->second;
149 }
150 
155  if (SymbolFile *symfile = GetModule()->GetSymbolFile())
156  m_language = symfile->ParseLanguage(*this);
157  }
158  }
159  return m_language;
160 }
161 
163  if (m_line_table_up == nullptr) {
166  if (SymbolFile *symfile = GetModule()->GetSymbolFile())
167  symfile->ParseLineTable(*this);
168  }
169  }
170  return m_line_table_up.get();
171 }
172 
174  if (line_table == nullptr)
176  else
178  m_line_table_up.reset(line_table);
179 }
180 
181 void CompileUnit::SetSupportFiles(const FileSpecList &support_files) {
182  m_support_files = support_files;
183 }
184 
185 void CompileUnit::SetSupportFiles(FileSpecList &&support_files) {
186  m_support_files = std::move(support_files);
187 }
188 
190  if (m_debug_macros_sp.get() == nullptr) {
193  if (SymbolFile *symfile = GetModule()->GetSymbolFile())
194  symfile->ParseDebugMacros(*this);
195  }
196  }
197 
198  return m_debug_macros_sp.get();
199 }
200 
201 void CompileUnit::SetDebugMacros(const DebugMacrosSP &debug_macros_sp) {
202  if (debug_macros_sp.get() == nullptr)
204  else
206  m_debug_macros_sp = debug_macros_sp;
207 }
208 
209 VariableListSP CompileUnit::GetVariableList(bool can_create) {
210  if (m_variables.get() == nullptr && can_create) {
211  SymbolContext sc;
213  assert(sc.module_sp);
214  sc.module_sp->GetSymbolFile()->ParseVariablesForContext(sc);
215  }
216 
217  return m_variables;
218 }
219 
220 std::vector<uint32_t> FindFileIndexes(const FileSpecList &files,
221  const FileSpec &file) {
222  std::vector<uint32_t> result;
223  uint32_t idx = -1;
224  while ((idx = files.FindCompatibleIndex(idx + 1, file)) !=
225  UINT32_MAX)
226  result.push_back(idx);
227  return result;
228 }
229 
231  const FileSpec *file_spec_ptr, bool exact,
232  LineEntry *line_entry_ptr) {
233  if (!file_spec_ptr)
234  file_spec_ptr = &GetPrimaryFile();
235  std::vector<uint32_t> file_indexes = FindFileIndexes(GetSupportFiles(),
236  *file_spec_ptr);
237  if (file_indexes.empty())
238  return UINT32_MAX;
239 
240  // TODO: Handle SourceLocationSpec column information
241  SourceLocationSpec location_spec(*file_spec_ptr, line,
242  /*column=*/std::nullopt,
243  /*check_inlines=*/false, exact);
244 
245  LineTable *line_table = GetLineTable();
246  if (line_table)
247  return line_table->FindLineEntryIndexByFileIndex(
248  start_idx, file_indexes, location_spec, line_entry_ptr);
249  return UINT32_MAX;
250 }
251 
253  const SourceLocationSpec &src_location_spec,
254  SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
255  const FileSpec file_spec = src_location_spec.GetFileSpec();
256  const uint32_t line = src_location_spec.GetLine().value_or(0);
257  const bool check_inlines = src_location_spec.GetCheckInlines();
258 
259  // First find all of the file indexes that match our "file_spec". If
260  // "file_spec" has an empty directory, then only compare the basenames when
261  // finding file indexes
262  bool file_spec_matches_cu_file_spec =
263  FileSpec::Match(file_spec, this->GetPrimaryFile());
264 
265  // If we are not looking for inlined functions and our file spec doesn't
266  // match then we are done...
267  if (!file_spec_matches_cu_file_spec && !check_inlines)
268  return;
269 
270  SymbolContext sc(GetModule());
271  sc.comp_unit = this;
272 
273  if (line == 0) {
274  if (file_spec_matches_cu_file_spec && !check_inlines) {
275  // only append the context if we aren't looking for inline call sites by
276  // file and line and if the file spec matches that of the compile unit
277  sc_list.Append(sc);
278  }
279  return;
280  }
281 
282  std::vector<uint32_t> file_indexes = FindFileIndexes(GetSupportFiles(),
283  file_spec);
284  const size_t num_file_indexes = file_indexes.size();
285  if (num_file_indexes == 0)
286  return;
287 
288  // Found a matching source file in this compile unit load its debug info.
289  GetModule()->GetSymbolFile()->SetLoadDebugInfoEnabled();
290 
291  LineTable *line_table = sc.comp_unit->GetLineTable();
292 
293  if (line_table == nullptr) {
294  if (file_spec_matches_cu_file_spec && !check_inlines) {
295  sc_list.Append(sc);
296  }
297  return;
298  }
299 
300  uint32_t line_idx;
301  LineEntry line_entry;
302 
303  if (num_file_indexes == 1) {
304  // We only have a single support file that matches, so use the line
305  // table function that searches for a line entries that match a single
306  // support file index
307  line_idx = line_table->FindLineEntryIndexByFileIndex(
308  0, file_indexes.front(), src_location_spec, &line_entry);
309  } else {
310  // We found multiple support files that match "file_spec" so use the
311  // line table function that searches for a line entries that match a
312  // multiple support file indexes.
313  line_idx = line_table->FindLineEntryIndexByFileIndex(
314  0, file_indexes, src_location_spec, &line_entry);
315  }
316 
317  // If "exact == true", then "found_line" will be the same as "line". If
318  // "exact == false", the "found_line" will be the closest line entry
319  // with a line number greater than "line" and we will use this for our
320  // subsequent line exact matches below.
321  const bool inlines = false;
322  const bool exact = true;
323  const std::optional<uint16_t> column =
324  src_location_spec.GetColumn() ? std::optional<uint16_t>(line_entry.column)
325  : std::nullopt;
326 
327  SourceLocationSpec found_entry(line_entry.file, line_entry.line, column,
328  inlines, exact);
329 
330  while (line_idx != UINT32_MAX) {
331  // If they only asked for the line entry, then we're done, we can
332  // just copy that over. But if they wanted more than just the line
333  // number, fill it in.
334  SymbolContext resolved_sc;
335  sc.line_entry = line_entry;
336  if (resolve_scope == eSymbolContextLineEntry) {
337  sc_list.Append(sc);
338  } else {
339  line_entry.range.GetBaseAddress().CalculateSymbolContext(&resolved_sc,
340  resolve_scope);
341  // Sometimes debug info is bad and isn't able to resolve the line entry's
342  // address back to the same compile unit and/or line entry. If the compile
343  // unit changed, then revert back to just the compile unit and line entry.
344  // Prior to this fix, the above code might end up not being able to lookup
345  // the address, and then it would clear compile unit and the line entry in
346  // the symbol context and the breakpoint would fail to get set even though
347  // we have a valid line table entry in this compile unit. The address
348  // lookup can also end up finding another function in another compiler
349  // unit if the DWARF has overlappging address ranges. So if we end up with
350  // no compile unit or a different one after the above function call,
351  // revert back to the same results as if resolve_scope was set exactly to
352  // eSymbolContextLineEntry.
353  if (resolved_sc.comp_unit == this) {
354  sc_list.Append(resolved_sc);
355  } else {
356  if (resolved_sc.comp_unit == nullptr && resolved_sc.module_sp) {
357  // Only report an error if we don't map back to any compile unit. With
358  // link time optimizations, the debug info might have many compile
359  // units that have the same address range due to function outlining
360  // or other link time optimizations. If the compile unit is NULL, then
361  // address resolving is completely failing and more deserving of an
362  // error message the user can see.
363  resolved_sc.module_sp->ReportError(
364  "unable to resolve a line table file address {0:x16} back "
365  "to a compile unit, please file a bug and attach the address "
366  "and file.",
367  line_entry.range.GetBaseAddress().GetFileAddress());
368  }
369  sc_list.Append(sc);
370  }
371  }
372 
373  if (num_file_indexes == 1)
374  line_idx = line_table->FindLineEntryIndexByFileIndex(
375  line_idx + 1, file_indexes.front(), found_entry, &line_entry);
376  else
377  line_idx = line_table->FindLineEntryIndexByFileIndex(
378  line_idx + 1, file_indexes, found_entry, &line_entry);
379  }
380 }
381 
385  if (SymbolFile *symfile = GetModule()->GetSymbolFile()) {
386  if (symfile->ParseIsOptimized(*this))
388  }
389  }
390  return m_is_optimized;
391 }
392 
393 void CompileUnit::SetVariableList(VariableListSP &variables) {
394  m_variables = variables;
395 }
396 
397 const std::vector<SourceModule> &CompileUnit::GetImportedModules() {
398  if (m_imported_modules.empty() &&
401  if (SymbolFile *symfile = GetModule()->GetSymbolFile()) {
402  SymbolContext sc;
404  symfile->ParseImportedModules(sc, m_imported_modules);
405  }
406  }
407  return m_imported_modules;
408 }
409 
411  llvm::DenseSet<SymbolFile *> &visited_symbol_files,
412  llvm::function_ref<bool(Module &)> lambda) {
413  if (SymbolFile *symfile = GetModule()->GetSymbolFile())
414  return symfile->ForEachExternalModule(*this, visited_symbol_files, lambda);
415  return false;
416 }
417 
418 const FileSpecList &CompileUnit::GetSupportFiles() {
419  if (m_support_files.GetSize() == 0) {
422  if (SymbolFile *symfile = GetModule()->GetSymbolFile())
423  symfile->ParseSupportFiles(*this, m_support_files);
424  }
425  }
426  return m_support_files;
427 }
428 
429 void *CompileUnit::GetUserData() const { return m_user_data; }
lldb_private::SourceLocationSpec::GetFileSpec
FileSpec GetFileSpec() const
Definition: SourceLocationSpec.h:166
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
lldb_private::Stream::IndentLess
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:171
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:47
lldb_private::SymbolContext::comp_unit
CompileUnit * comp_unit
The CompileUnit for a given query.
Definition: SymbolContext.h:319
lldb_private::CompileUnit::GetSupportFiles
const FileSpecList & GetSupportFiles()
Get the compile unit's support file list.
Definition: CompileUnit.cpp:418
lldb_private::CompileUnit::GetVariableList
lldb::VariableListSP GetVariableList(bool can_create)
Get the variable list for a compile unit.
Definition: CompileUnit.cpp:209
lldb_private::LineEntry::file
FileSpec file
The source file, possibly mapped by the target.source-map setting.
Definition: LineEntry.h:140
lldb_private::ModuleChild
Definition: ModuleChild.h:19
CompileUnit.h
lldb_private::DebugMacros
Definition: DebugMacros.h:71
lldb_private::CompileUnit::FindFunction
lldb::FunctionSP FindFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> matching_lambda)
Find a function in the compile unit based on the predicate matching_lambda.
Definition: CompileUnit.cpp:77
lldb_private::CompileUnit::GetCachedLanguage
const char * GetCachedLanguage() const
Definition: CompileUnit.cpp:101
lldb_private::SourceLocationSpec
Definition: SourceLocationSpec.h:27
lldb_private::CompileUnit::flagsParsedDebugMacros
@ flagsParsedDebugMacros
Have we parsed the debug macros already?
Definition: CompileUnit.h:440
lldb_private::SymbolContextList::Append
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
Definition: SymbolContext.cpp:1184
lldb_private::UserID
Definition: UserID.h:31
lldb_private::SourceLocationSpec::GetLine
std::optional< uint32_t > GetLine() const
Definition: SourceLocationSpec.cpp:70
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
lldb_private::SourceLocationSpec::GetColumn
std::optional< uint16_t > GetColumn() const
Definition: SourceLocationSpec.cpp:77
lldb_private::SymbolFile::ParseFunctions
virtual size_t ParseFunctions(CompileUnit &comp_unit)=0
lldb_private::CompileUnit::CompileUnit
CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized)
Construct with a module, path, UID and language.
Definition: CompileUnit.cpp:21
lldb_private::Flags::Clear
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
Definition: Flags.h:61
Module.h
lldb_private::CompileUnit::m_functions_by_uid
llvm::DenseMap< lldb::user_id_t, lldb::FunctionSP > m_functions_by_uid
Maps UIDs to functions.
Definition: CompileUnit.h:408
lldb_private::CompileUnit::SetVariableList
void SetVariableList(lldb::VariableListSP &variable_list_sp)
Set accessor for the variable list.
Definition: CompileUnit.cpp:393
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:443
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::CompileUnit::GetUserData
void * GetUserData() const
Get the SymbolFile plug-in user data.
Definition: CompileUnit.cpp:429
lldb_private::Module
Definition: Module.h:87
lldb_private::Stream
Definition: Stream.h:28
Language.h
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::CompileUnit::m_support_files
FileSpecList m_support_files
Files associated with this compile unit's line table and declarations.
Definition: CompileUnit.h:416
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::CompileUnit
Definition: CompileUnit.h:38
lldb_private::CompileUnit::GetDebugMacros
DebugMacros * GetDebugMacros()
Definition: CompileUnit.cpp:189
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::LineTable
Definition: LineTable.h:40
lldb_private::CompileUnit::m_is_optimized
lldb_private::LazyBool m_is_optimized
eLazyBoolYes if this compile unit was compiled with optimization.
Definition: CompileUnit.h:425
lldb_private::Stream::Indent
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:130
lldb_private::CompileUnit::m_language
lldb::LanguageType m_language
The programming language enumeration value.
Definition: CompileUnit.h:404
FindFileIndexes
std::vector< uint32_t > FindFileIndexes(const FileSpecList &files, const FileSpec &file)
Definition: CompileUnit.cpp:220
lldb_private::CompileUnit::flagsParsedSupportFiles
@ flagsParsedSupportFiles
Have we already parsed the support files for this compile unit?
Definition: CompileUnit.h:433
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::CompileUnit::CalculateSymbolContextModule
lldb::ModuleSP CalculateSymbolContextModule() override
Definition: CompileUnit.cpp:45
lldb_private::Address::GetFileAddress
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:291
lldb_private::CompileUnit::AddFunction
void AddFunction(lldb::FunctionSP &function_sp)
Add a function to this compile unit.
Definition: CompileUnit.cpp:140
lldb_private::DebugMacrosSP
std::shared_ptr< DebugMacros > DebugMacrosSP
Definition: DebugMacros.h:21
Timer.h
lldb_private::CompileUnit::m_line_table_up
std::unique_ptr< LineTable > m_line_table_up
Line table that will get parsed on demand.
Definition: CompileUnit.h:418
lldb_private::CompileUnit::SetSupportFiles
void SetSupportFiles(const FileSpecList &support_files)
Definition: CompileUnit.cpp:181
lldb_private::CompileUnit::m_debug_macros_sp
DebugMacrosSP m_debug_macros_sp
Debug macros that will get parsed on demand.
Definition: CompileUnit.h:420
lldb_private::CompileUnit::SetLineTable
void SetLineTable(LineTable *line_table)
Set the line table for the compile unit.
Definition: CompileUnit.cpp:173
LLDB_SCOPED_TIMER
#define LLDB_SCOPED_TIMER()
Definition: Timer.h:83
lldb_private::CompileUnit::GetIsOptimized
bool GetIsOptimized()
Get whether compiler optimizations were enabled for this compile unit.
Definition: CompileUnit.cpp:382
lldb_private::CompileUnit::flagsParsedLanguage
@ flagsParsedLanguage
Have we parsed the language already?
Definition: CompileUnit.h:437
lldb_private::CompileUnit::SetDebugMacros
void SetDebugMacros(const DebugMacrosSP &debug_macros)
Definition: CompileUnit.cpp:201
lldb_private::CompileUnit::GetPrimaryFile
const FileSpec & GetPrimaryFile() const
Return the primary source file associated with this compile unit.
Definition: CompileUnit.h:227
lldb_private::CompileUnit::GetLineTable
LineTable * GetLineTable()
Get the line table for the compile unit.
Definition: CompileUnit.cpp:162
lldb_private::CompileUnit::GetLanguage
lldb::LanguageType GetLanguage()
Definition: CompileUnit.cpp:151
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::CompileUnit::ForEachExternalModule
virtual bool ForEachExternalModule(llvm::DenseSet< lldb_private::SymbolFile * > &visited_symbol_files, llvm::function_ref< bool(Module &)> lambda)
Apply a lambda to each external lldb::Module referenced by this compilation unit.
Definition: CompileUnit.cpp:410
VariableList.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::CompileUnit::ForeachFunction
void ForeachFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> lambda) const
Apply a lambda to each function in this compile unit.
Definition: CompileUnit.cpp:61
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:230
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:444
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::Stream::IndentMore
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:168
lldb_private::LineTable::FindLineEntryIndexByFileIndex
uint32_t FindLineEntryIndexByFileIndex(uint32_t start_idx, uint32_t file_idx, const SourceLocationSpec &src_location_spec, LineEntry *line_entry_ptr)
Find a line entry index that has a matching file index and source line number.
Definition: LineTable.cpp:305
lldb_private::CompileUnit::DumpSymbolContext
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
Definition: CompileUnit.cpp:49
lldb_private::Stream::EOL
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
lldb_private::CompileUnit::flagsParsedLineTable
@ flagsParsedLineTable
Have we parsed the line table already?
Definition: CompileUnit.h:435
LineTable.h
lldb_private::CompileUnit::m_user_data
void * m_user_data
User data for the SymbolFile parser to store information into.
Definition: CompileUnit.h:402
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::LineEntry::range
AddressRange range
The section offset address range for this line entry.
Definition: LineEntry.h:139
lldb_private::ModuleChild::GetModule
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
lldb_private::CompileUnit::GetImportedModules
const std::vector< SourceModule > & GetImportedModules()
Get the compile unit's imported module list.
Definition: CompileUnit.cpp:397
lldb_private::CompileUnit::ResolveSymbolContext
void ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
Resolve symbol contexts by file and line.
Definition: CompileUnit.cpp:252
lldb_private::SymbolContext::module_sp
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SymbolContext.h:318
lldb_private::CompileUnit::FindFunctionByUID
lldb::FunctionSP FindFunctionByUID(lldb::user_id_t uid)
Finds a function by user ID.
Definition: CompileUnit.cpp:144
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::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::CompileUnit::m_flags
Flags m_flags
Compile unit flags that help with partial parsing.
Definition: CompileUnit.h:406
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
lldb_private::CompileUnit::CalculateSymbolContextCompileUnit
CompileUnit * CalculateSymbolContextCompileUnit() override
Definition: CompileUnit.cpp:47
lldb_private::CompileUnit::flagsParsedImportedModules
@ flagsParsedImportedModules
Have we parsed the imported modules already?
Definition: CompileUnit.h:438
lldb_private::CompileUnit::CalculateSymbolContext
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Definition: CompileUnit.cpp:40
lldb_private::Flags::Set
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
Definition: Flags.h:73
lldb_private::SourceLocationSpec::GetCheckInlines
bool GetCheckInlines() const
Definition: SourceLocationSpec.h:172
lldb_private::CompileUnit::Dump
void Dump(Stream *s, bool show_context) const
Dump the compile unit contents to the stream s.
Definition: CompileUnit.cpp:111
lldb_private::CompileUnit::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
Definition: CompileUnit.cpp:54
lldb_private::SymbolContext::line_entry
LineEntry line_entry
The LineEntry for a given query.
Definition: SymbolContext.h:322
lldb_private::Language::GetNameForLanguageType
static const char * GetNameForLanguageType(lldb::LanguageType language)
Definition: Language.cpp:217
lldb_private::CompileUnit::m_imported_modules
std::vector< SourceModule > m_imported_modules
All modules, including the current module, imported by this compile unit.
Definition: CompileUnit.h:411
lldb
Definition: SBAddress.h:15
lldb_private::Flags::IsClear
bool IsClear(ValueType bit) const
Test a single flag bit to see if it is clear (zero).
Definition: Flags.h:111
SymbolFile.h
lldb_private::Address::CalculateSymbolContext
uint32_t CalculateSymbolContext(SymbolContext *sc, lldb::SymbolContextItem resolve_scope=lldb::eSymbolContextEverything) const
Reconstruct a symbol context from an address.
Definition: Address.cpp:825
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::CompileUnit::m_variables
lldb::VariableListSP m_variables
Global and static variable list that will get parsed on demand.
Definition: CompileUnit.h:422
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:208