LLDB  mainline
Public Member Functions | Protected Attributes | List of all members
lldb_private::CompileUnit Class Reference

A class that describes a compilation unit. More...

#include "lldb/Symbol/CompileUnit.h"

Inheritance diagram for lldb_private::CompileUnit:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::CompileUnit:
Collaboration graph
[legend]

Public Member Functions

 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. More...
 
 CompileUnit (const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized)
 Construct with a module, file spec, UID and language. More...
 
 ~CompileUnit () override
 Destructor. More...
 
void AddFunction (lldb::FunctionSP &function_sp)
 Add a function to this compile unit. More...
 
void CalculateSymbolContext (SymbolContext *sc) override
 Reconstruct the object's symbol context into sc. More...
 
lldb::ModuleSP CalculateSymbolContextModule () override
 
CompileUnitCalculateSymbolContextCompileUnit () override
 
void DumpSymbolContext (Stream *s) override
 Dump the object's symbol context to the stream s. More...
 
lldb::LanguageType GetLanguage ()
 
void SetLanguage (lldb::LanguageType language)
 
void GetDescription (Stream *s, lldb::DescriptionLevel level) const
 
void ForeachFunction (llvm::function_ref< bool(const lldb::FunctionSP &)> lambda) const
 Apply a lambda to each function in this compile unit. More...
 
void Dump (Stream *s, bool show_context) const
 Dump the compile unit contents to the stream s. More...
 
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. More...
 
LineTableGetLineTable ()
 Get the line table for the compile unit. More...
 
DebugMacrosGetDebugMacros ()
 
FileSpecList & GetSupportFiles ()
 Get the compile unit's support file list. More...
 
const std::vector< SourceModule > & GetImportedModules ()
 Get the compile unit's imported module list. More...
 
void * GetUserData () const
 Get the SymbolFile plug-in user data. More...
 
lldb::VariableListSP GetVariableList (bool can_create)
 Get the variable list for a compile unit. More...
 
lldb::FunctionSP FindFunctionByUID (lldb::user_id_t uid)
 Finds a function by user ID. More...
 
void SetLineTable (LineTable *line_table)
 Set the line table for the compile unit. More...
 
void SetDebugMacros (const DebugMacrosSP &debug_macros)
 
void SetVariableList (lldb::VariableListSP &variable_list_sp)
 Set accessor for the variable list. More...
 
uint32_t ResolveSymbolContext (const FileSpec &file_spec, uint32_t line, bool check_inlines, bool exact, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
 Resolve symbol contexts by file and line. More...
 
bool GetIsOptimized ()
 Get whether compiler optimizations were enabled for this compile unit. More...
 
size_t GetNumFunctions () const
 Returns the number of functions in this compile unit. More...
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module. More...
 
 ModuleChild (const ModuleChild &rhs)
 Copy constructor. More...
 
 ~ModuleChild ()
 Destructor. More...
 
const ModuleChildoperator= (const ModuleChild &rhs)
 Assignment operator. More...
 
lldb::ModuleSP GetModule () const
 Get const accessor for the module pointer. More...
 
void SetModule (const lldb::ModuleSP &module_sp)
 Set accessor for the module pointer. More...
 
- Public Member Functions inherited from lldb_private::FileSpec
 FileSpec ()
 
 FileSpec (llvm::StringRef path, Style style=Style::native)
 Constructor with path. More...
 
 FileSpec (llvm::StringRef path, const llvm::Triple &Triple)
 
 FileSpec (const FileSpec &rhs)
 Copy constructor. More...
 
 FileSpec (const FileSpec *rhs)
 Copy constructor. More...
 
 ~FileSpec ()
 Destructor. More...
 
bool DirectoryEquals (const FileSpec &other) const
 
bool FileEquals (const FileSpec &other) const
 
const FileSpecoperator= (const FileSpec &rhs)
 Assignment operator. More...
 
bool operator== (const FileSpec &rhs) const
 Equal to operator. More...
 
bool operator!= (const FileSpec &rhs) const
 Not equal to operator. More...
 
bool operator< (const FileSpec &rhs) const
 Less than to operator. More...
 
 operator bool () const
 Convert to pointer operator. More...
 
bool operator! () const
 Logical NOT operator. More...
 
void Clear ()
 Clears the object state. More...
 
bool IsCaseSensitive () const
 Case sensitivity of path. More...
 
void Dump (Stream *s) const
 Dump this object to a Stream. More...
 
Style GetPathStyle () const
 
ConstStringGetDirectory ()
 Directory string get accessor. More...
 
ConstString GetDirectory () const
 Directory string const get accessor. More...
 
ConstStringGetFilename ()
 Filename string get accessor. More...
 
ConstString GetFilename () const
 Filename string const get accessor. More...
 
bool IsSourceImplementationFile () const
 Returns true if the filespec represents an implementation source file (files with a ".c", ".cpp", ".m", ".mm" (many more) extension). More...
 
bool IsRelative () const
 Returns true if the filespec represents a relative path. More...
 
bool IsAbsolute () const
 Returns true if the filespec represents an absolute path. More...
 
void MakeAbsolute (const FileSpec &dir)
 Make the FileSpec absolute by treating it relative to dir. More...
 
void SetPath (llvm::StringRef p)
 Temporary helper for FileSystem change. More...
 
size_t GetPath (char *path, size_t max_path_length, bool denormalize=true) const
 Extract the full path to the file. More...
 
std::string GetPath (bool denormalize=true) const
 Extract the full path to the file. More...
 
const char * GetCString (bool denormalize=true) const
 
void GetPath (llvm::SmallVectorImpl< char > &path, bool denormalize=true) const
 Extract the full path to the file. More...
 
ConstString GetFileNameExtension () const
 Extract the extension of the file. More...
 
ConstString GetFileNameStrippingExtension () const
 Return the filename without the extension part. More...
 
size_t MemorySize () const
 Get the memory cost of this object. More...
 
void SetFile (llvm::StringRef path, Style style)
 Change the file specified with a new path. More...
 
void SetFile (llvm::StringRef path, const llvm::Triple &Triple)
 
bool IsResolved () const
 
void SetIsResolved (bool is_resolved)
 Set if the file path has been resolved or not. More...
 
FileSpec CopyByAppendingPathComponent (llvm::StringRef component) const
 
FileSpec CopyByRemovingLastPathComponent () const
 
void PrependPathComponent (llvm::StringRef component)
 
void PrependPathComponent (const FileSpec &new_path)
 
void AppendPathComponent (llvm::StringRef component)
 
void AppendPathComponent (const FileSpec &new_path)
 
bool RemoveLastPathComponent ()
 Removes the last path component by replacing the current path with its parent. More...
 
ConstString GetLastPathComponent () const
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 
- Public Member Functions inherited from lldb_private::SymbolContextScope
virtual ~SymbolContextScope ()=default
 
virtual FunctionCalculateSymbolContextFunction ()
 
virtual BlockCalculateSymbolContextBlock ()
 
virtual SymbolCalculateSymbolContextSymbol ()
 

Protected Attributes

void * m_user_data
 User data for the SymbolFile parser to store information into. More...
 
lldb::LanguageType m_language
 The programming language enumeration value. More...
 
Flags m_flags
 Compile unit flags that help with partial parsing. More...
 
llvm::DenseMap< lldb::user_id_t, lldb::FunctionSP > m_functions_by_uid
 Maps UIDs to functions. More...
 
std::vector< SourceModulem_imported_modules
 All modules, including the current module, imported by this compile unit. More...
 
FileSpecList m_support_files
 Files associated with this compile unit's line table and declarations. More...
 
std::unique_ptr< LineTablem_line_table_up
 Line table that will get parsed on demand. More...
 
DebugMacrosSP m_debug_macros_sp
 Debug macros that will get parsed on demand. More...
 
lldb::VariableListSP m_variables
 Global and static variable list that will get parsed on demand. More...
 
lldb_private::LazyBool m_is_optimized
 eLazyBoolYes if this compile unit was compiled with optimization. More...
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class. More...
 
- Protected Attributes inherited from lldb_private::FileSpec
ConstString m_directory
 The uniqued directory path. More...
 
ConstString m_filename
 The uniqued filename path. More...
 
bool m_is_resolved = false
 True if this path has been resolved. More...
 
Style m_style
 The syntax that this path uses (e.g. Windows / Posix) More...
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 

Additional Inherited Members

- Public Types inherited from lldb_private::FileSpec
using Style = llvm::sys::path::Style
 
- Static Public Member Functions inherited from lldb_private::FileSpec
static int Compare (const FileSpec &lhs, const FileSpec &rhs, bool full)
 Compare two FileSpec objects. More...
 
static bool Equal (const FileSpec &a, const FileSpec &b, bool full)
 
static llvm::Optional< StyleGuessPathStyle (llvm::StringRef absolute_path)
 Attempt to guess path style for a given path string. More...
 
- Protected Member Functions inherited from lldb_private::FileSpec
void SetFile (llvm::StringRef path)
 

Detailed Description

A class that describes a compilation unit.

A representation of a compilation unit, or compiled source file. The UserID of the compile unit is specified by the SymbolFile plug-in and can have any value as long as the value is unique within the Module that owns this compile units.

Each compile unit has a list of functions, global and static variables, support file list (include files and inlined source files), and a line table.

Definition at line 35 of file CompileUnit.h.

Constructor & Destructor Documentation

◆ CompileUnit() [1/2]

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.

Initialize the compile unit given the owning module, a path to convert into a FileSpec, the SymbolFile plug-in supplied uid, and the source language type.

Parameters
[in]moduleThe parent module that owns this compile unit. This value must be a valid pointer value.
[in]user_dataUser data where the SymbolFile parser can store data.
[in]pathnameThe path to the source file for this compile unit.
[in]uidThe user ID of the compile unit. This value is supplied by the SymbolFile plug-in and should be a value that allows the SymbolFile plug-in to easily locate and parse additional information for the compile unit.
[in]languageA language enumeration type that describes the main language of this compile unit.
[in]is_optimizedA value that can initialized with eLazyBoolYes, eLazyBoolNo or eLazyBoolCalculate. If set to eLazyBoolCalculate, then an extra call into SymbolVendor will be made to calculate if the compile unit is optimized will be made when CompileUnit::GetIsOptimized() is called.
See also
lldb::LanguageType

Definition at line 19 of file CompileUnit.cpp.

References lldb::eLanguageTypeUnknown, m_flags, and lldb_private::Flags::Set().

◆ CompileUnit() [2/2]

CompileUnit::CompileUnit ( const lldb::ModuleSP &  module_sp,
void *  user_data,
const FileSpec file_spec,
lldb::user_id_t  uid,
lldb::LanguageType  language,
lldb_private::LazyBool  is_optimized 
)

Construct with a module, file spec, UID and language.

Initialize the compile unit given the owning module, a path to convert into a FileSpec, the SymbolFile plug-in supplied uid, and the source language type.

Parameters
[in]moduleThe parent module that owns this compile unit. This value must be a valid pointer value.
[in]user_dataUser data where the SymbolFile parser can store data.
[in]file_specThe file specification for the source file of this compile unit.
[in]uidThe user ID of the compile unit. This value is supplied by the SymbolFile plug-in and should be a value that allows the plug-in to easily locate and parse additional information for the compile unit.
[in]languageA language enumeration type that describes the main language of this compile unit.
[in]is_optimizedA value that can initialized with eLazyBoolYes, eLazyBoolNo or eLazyBoolCalculate. If set to eLazyBoolCalculate, then an extra call into SymbolVendor will be made to calculate if the compile unit is optimized will be made when CompileUnit::GetIsOptimized() is called.
See also
lldb::LanguageType

Definition at line 32 of file CompileUnit.cpp.

References lldb::eLanguageTypeUnknown, m_flags, and lldb_private::Flags::Set().

◆ ~CompileUnit()

CompileUnit::~CompileUnit ( )
override

Destructor.

Definition at line 45 of file CompileUnit.cpp.

Member Function Documentation

◆ AddFunction()

void CompileUnit::AddFunction ( lldb::FunctionSP &  function_sp)

Add a function to this compile unit.

Typically called by the SymbolFile plug-ins as they partially parse the debug information.

Parameters
[in]function_spA shared pointer to the Function object.

Definition at line 118 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by SymbolFileSymtab::ParseFunctions().

◆ CalculateSymbolContext()

void CompileUnit::CalculateSymbolContext ( SymbolContext sc)
overridevirtual

Reconstruct the object's symbol context into sc.

The object should fill in as much of the SymbolContext as it can so function calls that require a symbol context can be made for the given object.

Parameters
[out]scA symbol context object pointer that gets filled in.
See also
SymbolContextScope

Implements lldb_private::SymbolContextScope.

Definition at line 47 of file CompileUnit.cpp.

References lldb_private::SymbolContext::comp_unit, and lldb_private::ModuleChild::GetModule().

Referenced by lldb_private::Function::CalculateSymbolContext(), GetImportedModules(), and GetVariableList().

◆ CalculateSymbolContextCompileUnit()

CompileUnit * CompileUnit::CalculateSymbolContextCompileUnit ( )
overridevirtual

Reimplemented from lldb_private::SymbolContextScope.

Definition at line 54 of file CompileUnit.cpp.

Referenced by lldb_private::BreakpointLocation::ConditionSaysStop().

◆ CalculateSymbolContextModule()

ModuleSP CompileUnit::CalculateSymbolContextModule ( )
overridevirtual

Reimplemented from lldb_private::SymbolContextScope.

Definition at line 52 of file CompileUnit.cpp.

References lldb_private::ModuleChild::GetModule().

◆ Dump()

void CompileUnit::Dump ( Stream s,
bool  show_context 
) const

Dump the compile unit contents to the stream s.

Parameters
[in]sThe stream to which to dump the object description.
[in]show_contextIf true, variables will dump their symbol context information.

Definition at line 88 of file CompileUnit.cpp.

References lldb_private::Stream::EOL(), ForeachFunction(), lldb_private::Language::GetNameForLanguageType(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_functions_by_uid, m_language, m_variables, and lldb_private::Stream::Printf().

Referenced by lldb::SBCompileUnit::GetDescription(), and SetLanguage().

◆ DumpSymbolContext()

void CompileUnit::DumpSymbolContext ( Stream s)
overridevirtual

Dump the object's symbol context to the stream s.

The object should dump its symbol context to the stream s. This function is widely used in the DumpDebug and verbose output for lldb objects.

Parameters
[in]sThe stream to which to dump the object's symbol context.
See also
SymbolContextScope

Implements lldb_private::SymbolContextScope.

Definition at line 56 of file CompileUnit.cpp.

References lldb_private::UserID::GetID(), lldb_private::ModuleChild::GetModule(), and lldb_private::Stream::Printf().

Referenced by lldb_private::Function::DumpSymbolContext().

◆ FindFunctionByUID()

FunctionSP CompileUnit::FindFunctionByUID ( lldb::user_id_t  uid)

Finds a function by user ID.

Typically used by SymbolFile plug-ins when partially parsing the debug information to see if the function has been parsed yet.

Parameters
[in]uidThe user ID of the function to find. This value is supplied by the SymbolFile plug-in and should be a value that allows the plug-in to easily locate and parse additional information in the function.
Returns
A shared pointer to the function object that might contain a NULL Function pointer.

Definition at line 165 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by SymbolFileDWARF::GetFunction(), SymbolFileDWARF::GetGlobalAranges(), SymbolFilePDB::ParseDeclsForContext(), SymbolFilePDB::ParseFunctions(), SymbolFileDWARF::ParseFunctions(), SymbolFilePDB::ParseLanguage(), SymbolFileDWARF::ParseTypes(), and SetLanguage().

◆ FindLineEntry()

uint32_t CompileUnit::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.

Finds the first line entry that has an index greater than start_idx that matches line. If file_spec_ptr is NULL, then the search matches line entries whose file matches the file for the compile unit. If file_spec_ptr is not NULL, line entries must match the specified file spec (for inlined line table entries).

Multiple calls to this function can find all entries that match a given file and line by starting with start_idx equal to zero, and calling this function back with the return value + 1.

Parameters
[in]start_idxThe zero based index at which to start looking for matches.
[in]lineThe line number to search for.
[in]file_spec_ptrIf non-NULL search for entries that match this file spec, else if NULL, search for line entries that match the compile unit file.
[in]exactIf match only if there is a line table entry for this line number. If , find the line table entry equal to or after this line number.
[out]line_entryIf non-NULL, a copy of the line entry that was found.
Returns
The zero based index of a matching line entry, or UINT32_MAX if no matching line entry is found.

Definition at line 238 of file CompileUnit.cpp.

References lldb_private::LineTable::FindLineEntryIndexByFileIndex(), GetLineTable(), GetSupportFiles(), and UINT32_MAX.

Referenced by CommandObjectSourceInfo::DumpFileLinesInCompUnit(), lldb::SBCompileUnit::FindLineEntryIndex(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), and SetLanguage().

◆ ForeachFunction()

void CompileUnit::ForeachFunction ( llvm::function_ref< bool(const lldb::FunctionSP &)>  lambda) const

Apply a lambda to each function in this compile unit.

This provides raw access to the function shared pointer list and will not cause the SymbolFile plug-in to parse any unparsed functions.

Note
Prefer using FindFunctionByUID over this if possible.
Parameters
[in]lambdaThe lambda that should be applied to every function. The lambda can return true if the iteration should be aborted earlier.

Definition at line 68 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by Dump(), lldb_private::Module::ParseAllDebugSymbols(), and SetLanguage().

◆ GetDebugMacros()

DebugMacros * CompileUnit::GetDebugMacros ( )

◆ GetDescription()

void CompileUnit::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
) const

◆ GetImportedModules()

const std::vector< SourceModule > & CompileUnit::GetImportedModules ( )

Get the compile unit's imported module list.

This reports all the imports that the compile unit made, including the current module.

Returns
A list of imported modules.

Definition at line 387 of file CompileUnit.cpp.

References CalculateSymbolContext(), lldb_private::ModuleChild::GetModule(), lldb_private::Flags::IsClear(), m_flags, m_imported_modules, and lldb_private::Flags::Set().

Referenced by lldb_private::ClangModulesDeclVendor::LanguageSupportsClangModules(), SetLanguage(), and SupportsCxxModuleImport().

◆ GetIsOptimized()

bool CompileUnit::GetIsOptimized ( )

Get whether compiler optimizations were enabled for this compile unit.

"optimized" means that the debug experience may be difficult for the user to understand. Variables may not be available when the developer would expect them, stepping through the source lines in the function may appear strange, etc.

Returns
Returns 'true' if this compile unit was compiled with optimization. 'false' indicates that either the optimization is unknown, or this compile unit was built without optimization.

Definition at line 372 of file CompileUnit.cpp.

References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::ModuleChild::GetModule(), and m_is_optimized.

Referenced by lldb::SBFunction::GetIsOptimized(), lldb_private::Function::GetIsOptimized(), and SetLanguage().

◆ GetLanguage()

lldb::LanguageType CompileUnit::GetLanguage ( )

◆ GetLineTable()

LineTable * CompileUnit::GetLineTable ( )

◆ GetNumFunctions()

size_t lldb_private::CompileUnit::GetNumFunctions ( ) const
inline

Returns the number of functions in this compile unit.

Definition at line 373 of file CompileUnit.h.

References m_functions_by_uid.

Referenced by lldb_private::npdb::SymbolFileNativePDB::ParseFunctions().

◆ GetSupportFiles()

FileSpecList & CompileUnit::GetSupportFiles ( )

◆ GetUserData()

void * CompileUnit::GetUserData ( ) const

Get the SymbolFile plug-in user data.

SymbolFile plug-ins can store user data to internal state or objects to quickly allow them to parse more information for a given object.

Returns
The user data stored with the CompileUnit when it was constructed.

Definition at line 413 of file CompileUnit.cpp.

References m_user_data.

Referenced by SetLanguage().

◆ GetVariableList()

VariableListSP CompileUnit::GetVariableList ( bool  can_create)

Get the variable list for a compile unit.

Called by clients to get the variable list for a compile unit. The variable list will contain all global and static variables that were defined at the compile unit level.

Parameters
[in]can_createIf true, the variable list will be parsed on demand. If false, the current variable list will be returned even if it contains a NULL VariableList object (typically called by dumping routines that want to display only what has currently been parsed).
Returns
A shared pointer to a variable list, that can contain NULL VariableList pointer if there are no global or static variables.

Definition at line 227 of file CompileUnit.cpp.

References CalculateSymbolContext(), m_variables, and lldb_private::SymbolContext::module_sp.

Referenced by CommandObjectTargetVariable::DoExecute(), lldb_private::StackFrame::GetInScopeVariableList(), lldb_private::StackFrame::GetVariableList(), SymbolFilePDB::ParseDeclsForContext(), SymbolFileDWARF::ParseVariables(), SymbolFilePDB::ParseVariablesForContext(), lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext(), SymbolFileDWARF::ParseVariablesForContext(), and SetLanguage().

◆ ResolveSymbolContext()

uint32_t CompileUnit::ResolveSymbolContext ( const FileSpec file_spec,
uint32_t  line,
bool  check_inlines,
bool  exact,
lldb::SymbolContextItem  resolve_scope,
SymbolContextList sc_list 
)

Resolve symbol contexts by file and line.

Given a file in file_spec, and a line number, find all instances and append them to the supplied symbol context list sc_list.

Parameters
[in]file_specA file specification. If file_spec contains no directory information, only the basename will be used when matching contexts. If the directory in file_spec is valid, a complete file specification match will be performed.
[in]lineThe line number to match against the compile unit's line tables.
[in]check_inlinesIf true this function will also match any inline file and line matches. If false, the compile unit's file specification must match file_spec for any matches to be returned.
[in]exactIf true, only resolve the context if line exists in the line table. If false, resolve the context to the closest line greater than line in the line table.
[in]resolve_scopeFor each matching line entry, this bitfield indicates what values within each SymbolContext that gets added to sc_list will be resolved. See the SymbolContext::Scope enumeration for a list of all available bits that can be resolved. Only SymbolContext entries that can be resolved using a LineEntry base address will be able to be resolved.
[out]sc_listA SymbolContext list class that will get any matching entries appended to.
Returns
The number of new matches that were added to sc_list.
See also
enum SymbolContext::Scope

Definition at line 265 of file CompileUnit.cpp.

References lldb_private::SymbolContextList::Append(), lldb_private::Address::CalculateSymbolContext(), lldb_private::SymbolContext::comp_unit, lldb_private::FileSpec::Equal(), lldb_private::LineTable::FindLineEntryIndexByFileIndex(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::FileSpec::GetDirectory(), GetLineTable(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolContextList::GetSize(), GetSupportFiles(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, lldb_private::LineEntry::range, and UINT32_MAX.

Referenced by lldb_private::breakpad::SymbolFileBreakpad::ResolveSymbolContext(), lldb_private::BreakpointResolverFileRegex::SearchCallback(), lldb_private::AddressResolverFileLine::SearchCallback(), and SetLanguage().

◆ SetDebugMacros()

void CompileUnit::SetDebugMacros ( const DebugMacrosSP debug_macros)

◆ SetLanguage()

void lldb_private::CompileUnit::SetLanguage ( lldb::LanguageType  language)
inline

◆ SetLineTable()

void CompileUnit::SetLineTable ( LineTable line_table)

Set the line table for the compile unit.

Called by the SymbolFile plug-in when if first parses the line table and hands ownership of the line table to this object. The compile unit owns the line table object and will delete the object when it is deleted.

Parameters
[in]line_tableA line table object pointer that this object now owns.

Definition at line 197 of file CompileUnit.cpp.

References lldb_private::Flags::Clear(), m_flags, m_line_table_up, and lldb_private::Flags::Set().

Referenced by SymbolFilePDB::GetPDBSession(), lldb_private::breakpad::SymbolFileBreakpad::ParseLineTable(), lldb_private::npdb::SymbolFileNativePDB::ParseLineTable(), SymbolFileDWARF::ParseLineTable(), and SetLanguage().

◆ SetVariableList()

void CompileUnit::SetVariableList ( lldb::VariableListSP &  variable_list_sp)

Set accessor for the variable list.

Called by the SymbolFile plug-ins after they have parsed the variable lists and are ready to hand ownership of the list over to this object.

Parameters
[in]variable_list_spA shared pointer to a VariableList.

Definition at line 383 of file CompileUnit.cpp.

References m_variables.

Referenced by SymbolFilePDB::ParseDeclsForContext(), lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext(), SymbolFileDWARF::ParseVariablesForContext(), and SetLanguage().

Member Data Documentation

◆ m_debug_macros_sp

DebugMacrosSP lldb_private::CompileUnit::m_debug_macros_sp
protected

Debug macros that will get parsed on demand.

Definition at line 393 of file CompileUnit.h.

Referenced by GetDebugMacros(), and SetDebugMacros().

◆ m_flags

Flags lldb_private::CompileUnit::m_flags
protected

Compile unit flags that help with partial parsing.

Definition at line 381 of file CompileUnit.h.

Referenced by CompileUnit(), GetDebugMacros(), GetImportedModules(), GetLanguage(), GetLineTable(), GetSupportFiles(), SetDebugMacros(), SetLanguage(), and SetLineTable().

◆ m_functions_by_uid

llvm::DenseMap<lldb::user_id_t, lldb::FunctionSP> lldb_private::CompileUnit::m_functions_by_uid
protected

Maps UIDs to functions.

Definition at line 383 of file CompileUnit.h.

Referenced by AddFunction(), Dump(), FindFunctionByUID(), ForeachFunction(), and GetNumFunctions().

◆ m_imported_modules

std::vector<SourceModule> lldb_private::CompileUnit::m_imported_modules
protected

All modules, including the current module, imported by this compile unit.

Definition at line 386 of file CompileUnit.h.

Referenced by GetImportedModules().

◆ m_is_optimized

lldb_private::LazyBool lldb_private::CompileUnit::m_is_optimized
protected

eLazyBoolYes if this compile unit was compiled with optimization.

Definition at line 398 of file CompileUnit.h.

Referenced by GetIsOptimized().

◆ m_language

lldb::LanguageType lldb_private::CompileUnit::m_language
protected

The programming language enumeration value.

Definition at line 379 of file CompileUnit.h.

Referenced by Dump(), GetDescription(), GetLanguage(), and SetLanguage().

◆ m_line_table_up

std::unique_ptr<LineTable> lldb_private::CompileUnit::m_line_table_up
protected

Line table that will get parsed on demand.

Definition at line 391 of file CompileUnit.h.

Referenced by GetLineTable(), and SetLineTable().

◆ m_support_files

FileSpecList lldb_private::CompileUnit::m_support_files
protected

Files associated with this compile unit's line table and declarations.

Definition at line 389 of file CompileUnit.h.

Referenced by GetSupportFiles().

◆ m_user_data

void* lldb_private::CompileUnit::m_user_data
protected

User data for the SymbolFile parser to store information into.

Definition at line 377 of file CompileUnit.h.

Referenced by GetUserData().

◆ m_variables

lldb::VariableListSP lldb_private::CompileUnit::m_variables
protected

Global and static variable list that will get parsed on demand.

Definition at line 395 of file CompileUnit.h.

Referenced by Dump(), GetVariableList(), and SetVariableList().


The documentation for this class was generated from the following files: