Go to the documentation of this file.
9 #ifndef LLDB_SYMBOL_COMPILEUNIT_H
10 #define LLDB_SYMBOL_COMPILEUNIT_H
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/DenseSet.h"
38 class CompileUnit :
public std::enable_shared_from_this<CompileUnit>,
77 CompileUnit(
const lldb::ModuleSP &module_sp,
void *user_data,
116 CompileUnit(
const lldb::ModuleSP &module_sp,
void *user_data,
163 llvm::function_ref<
bool(
const lldb::FunctionSP &)> lambda)
const;
175 llvm::function_ref<
bool(
const lldb::FunctionSP &)> matching_lambda);
185 void Dump(
Stream *s,
bool show_context)
const;
223 const FileSpec *file_spec_ptr,
bool exact,
258 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
259 llvm::function_ref<
bool(
Module &)> lambda);
381 lldb::SymbolContextItem resolve_scope,
451 #endif // LLDB_SYMBOL_COMPILEUNIT_H
@ flagsParsedAllFunctions
Have we already parsed all our functions.
const FileSpecList & GetSupportFiles()
Get the compile unit's support file list.
lldb::VariableListSP GetVariableList(bool can_create)
Get the variable list for a compile unit.
@ flagsParsedLineTable
Have we parsed the line table already?
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.
const char * GetCachedLanguage() const
@ flagsParsedSupportFiles
Have we already parsed the support files for this compile unit?
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.
llvm::DenseMap< lldb::user_id_t, lldb::FunctionSP > m_functions_by_uid
Maps UIDs to functions.
void SetVariableList(lldb::VariableListSP &variable_list_sp)
Set accessor for the variable list.
LanguageType
Programming language type.
void * GetUserData() const
Get the SymbolFile plug-in user data.
FileSpec m_file_spec
The primary file associated with this compile unit.
FileSpecList m_support_files
Files associated with this compile unit's line table and declarations.
@ flagsParsedVariables
Have we already parsed globals and statics?
DebugMacros * GetDebugMacros()
@ flagsParsedLanguage
Have we parsed the language already?
lldb_private::LazyBool m_is_optimized
eLazyBoolYes if this compile unit was compiled with optimization.
lldb::LanguageType m_language
The programming language enumeration value.
lldb::ModuleSP CalculateSymbolContextModule() override
void AddFunction(lldb::FunctionSP &function_sp)
Add a function to this compile unit.
std::shared_ptr< DebugMacros > DebugMacrosSP
void SetLanguage(lldb::LanguageType language)
const CompileUnit & operator=(const CompileUnit &)=delete
std::unique_ptr< LineTable > m_line_table_up
Line table that will get parsed on demand.
void SetSupportFiles(const FileSpecList &support_files)
DebugMacrosSP m_debug_macros_sp
Debug macros that will get parsed on demand.
void SetLineTable(LineTable *line_table)
Set the line table for the compile unit.
bool GetIsOptimized()
Get whether compiler optimizations were enabled for this compile unit.
void SetDebugMacros(const DebugMacrosSP &debug_macros)
const FileSpec & GetPrimaryFile() const
Return the primary source file associated with this compile unit.
LineTable * GetLineTable()
Get the line table for the compile unit.
lldb::LanguageType GetLanguage()
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.
void ForeachFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> lambda) const
Apply a lambda to each function in this compile unit.
@ flagsParsedImportedModules
Have we parsed the imported modules already?
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.
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
@ flagsParsedDebugMacros
Have we parsed the debug macros already?
void * m_user_data
User data for the SymbolFile parser to store information into.
size_t GetNumFunctions() const
Returns the number of functions in this compile unit.
const std::vector< SourceModule > & GetImportedModules()
Get the compile unit's imported module list.
void ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
Resolve symbol contexts by file and line.
lldb::FunctionSP FindFunctionByUID(lldb::user_id_t uid)
Finds a function by user ID.
Flags m_flags
Compile unit flags that help with partial parsing.
A class that represents a running process on the host machine.
CompileUnit * CalculateSymbolContextCompileUnit() override
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
void Dump(Stream *s, bool show_context) const
Dump the compile unit contents to the stream s.
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
std::vector< SourceModule > m_imported_modules
All modules, including the current module, imported by this compile unit.
lldb::VariableListSP m_variables
Global and static variable list that will get parsed on demand.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.