#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Status.h"
-#include "lldb/Utility/XcodeSDK.h"
#include "lldb/Utility/UUID.h"
+#include "lldb/Utility/XcodeSDK.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
Module(const ModuleSpec &module_spec);
template <typename ObjFilePlugin, typename... Args>
- static lldb::ModuleSP CreateModuleFromObjectFile(Args &&... args) {
+ static lldb::ModuleSP CreateModuleFromObjectFile(Args &&...args) {
// Must create a module and place it into a shared pointer before we can
// create an object file since it has a std::weak_ptr back to the module,
// so we need to control the creation carefully in this static function
/// Returns a valid symbol pointer if a symbol was found,
/// nullptr otherwise.
const Symbol *FindFirstSymbolWithNameAndType(
- ConstString name,
- lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
+ ConstString name, lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
void FindSymbolsWithNameAndType(ConstString name,
lldb::SymbolType symbol_type,
///
/// \param searched_symbol_files
/// Prevents one file from being visited multiple times.
- void FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
- llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
- TypeMap &types);
+ void
+ FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
+ llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
+ TypeMap &types);
- lldb::TypeSP FindFirstType(const SymbolContext &sc,
- ConstString type_name, bool exact_match);
+ lldb::TypeSP FindFirstType(const SymbolContext &sc, ConstString type_name,
+ bool exact_match);
/// Find types by name that are in a namespace. This function is used by the
/// expression parser when searches need to happen in an exact namespace
const FileSpec &file_spec, uint32_t line, bool check_inlines,
lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list);
- void SetFileSpecAndObjectName(const FileSpec &file,
- ConstString object_name);
+ void SetFileSpecAndObjectName(const FileSpec &file, ConstString object_name);
bool GetIsDynamicLinkEditor();
/// The value is returned as a reference to allow it to be updated by the
/// ElapsedTime RAII object.
StatsDuration &GetSymtabParseTime() { return m_symtab_parse_time; }
-
+
/// Accessor for the symbol table index time metric.
///
/// The value is returned as a reference to allow it to be updated by the
protected:
// Member Variables
mutable std::recursive_mutex m_mutex; ///< A mutex to keep this object happy
- ///in multi-threaded environments.
+ /// in multi-threaded environments.
/// The modification time for this module when it was created.
llvm::sys::TimePoint<> m_mod_time;
- ArchSpec m_arch; ///< The architecture for this module.
+ ArchSpec m_arch; ///< The architecture for this module.
UUID m_uuid; ///< Each module is assumed to have a unique identifier to help
- ///match it up to debug symbols.
+ /// match it up to debug symbols.
FileSpec m_file; ///< The file representation on disk for this module (if
- ///there is one).
+ /// there is one).
FileSpec m_platform_file; ///< The path to the module on the platform on which
- ///it is being debugged
+ /// it is being debugged
FileSpec m_remote_install_file; ///< If set when debugging on remote
- ///platforms, this module will be installed at
- ///this location
+ /// platforms, this module will be installed
+ /// at this location
FileSpec m_symfile_spec; ///< If this path is valid, then this is the file
- ///that _will_ be used as the symbol file for this
- ///module
+ /// that _will_ be used as the symbol file for this
+ /// module
ConstString m_object_name; ///< The name an object within this module that is
- ///selected, or empty of the module is represented
- ///by \a m_file.
+ /// selected, or empty of the module is represented
+ /// by \a m_file.
uint64_t m_object_offset = 0;
llvm::sys::TimePoint<> m_object_mod_time;
lldb::DataBufferSP m_data_sp;
lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file
- ///parser for this module as it may or may
- ///not be shared with the SymbolFile
+ /// parser for this module as it may or may
+ /// not be shared with the SymbolFile
llvm::Optional<UnwindTable> m_unwind_table; ///< Table of FuncUnwinders
/// objects created for this
/// Module's functions
m_symfile_up; ///< A pointer to the symbol vendor for this module.
std::vector<lldb::SymbolVendorUP>
m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and
- ///changes the symbol file,
+ /// changes the symbol file,
///< we need to keep all old symbol files around in case anyone has type
- ///references to them
- TypeSystemMap m_type_system_map; ///< A map of any type systems associated
- ///with this module
+ /// references to them
+ TypeSystemMap m_type_system_map; ///< A map of any type systems associated
+ /// with this module
/// Module specific source remappings for when you have debug info for a
/// module that doesn't match where the sources currently are.
PathMappingList m_source_mappings =
virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0;
virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0;
-
/// The characteristics of an array type.
struct ArrayInfo {
int64_t first_index = 0;
///
/// \returns 0.0 if no information has been parsed or if there is
/// no computational cost to parsing the debug information.
- virtual StatsDuration GetDebugInfoParseTime() {
- return StatsDuration(0.0);
- }
+ virtual StatsDuration GetDebugInfoParseTime() { return StatsDuration(0.0); }
/// Return the time it took to index the debug information in the object
/// file.
///
/// \returns 0.0 if the file doesn't need to be indexed or if it
/// hasn't been indexed yet, or a valid duration if it has.
- virtual StatsDuration GetDebugInfoIndexTime() {
- return StatsDuration(0.0);
- }
-
+ virtual StatsDuration GetDebugInfoIndexTime() { return StatsDuration(0.0); }
protected:
void AssertModuleLock();
Module::Module(const FileSpec &file_spec, const ArchSpec &arch,
const ConstString *object_name, lldb::offset_t object_offset,
const llvm::sys::TimePoint<> &object_mod_time)
- : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), m_arch(arch),
- m_file(file_spec), m_object_offset(object_offset),
+ : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)),
+ m_arch(arch), m_file(file_spec), m_object_offset(object_offset),
m_object_mod_time(object_mod_time), m_file_has_changed(false),
m_first_file_changed_log(false) {
// Scope for locker below...
// that the symbol has been resolved.
if (so_addr.GetOffset() ==
addr_range.GetBaseAddress().GetOffset() ||
- so_addr.GetOffset() ==
- addr_range.GetBaseAddress().GetOffset() +
- addr_range.GetByteSize()) {
+ so_addr.GetOffset() == addr_range.GetBaseAddress().GetOffset() +
+ addr_range.GetByteSize()) {
resolved_flags |= flags;
}
} else {
// pull anything out
ConstString mangled_name(sc.GetFunctionName(Mangled::ePreferMangled));
ConstString full_name(sc.GetFunctionName());
- if (mangled_name != m_name && full_name != m_name)
- {
+ if (mangled_name != m_name && full_name != m_name) {
CPlusPlusLanguage::MethodName cpp_method(full_name);
if (cpp_method.IsValid()) {
if (cpp_method.GetContext().empty()) {
}
}
-lldb::TypeSP Module::FindFirstType(const SymbolContext &sc,
- ConstString name, bool exact_match) {
+lldb::TypeSP Module::FindFirstType(const SymbolContext &sc, ConstString name,
+ bool exact_match) {
TypeList type_list;
llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
FindTypes(name, exact_match, 1, searched_symbol_files, type_list);
}
}
-void Module::FindFunctionSymbols(ConstString name,
- uint32_t name_type_mask,
- SymbolContextList &sc_list) {
+void Module::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
+ SymbolContextList &sc_list) {
LLDB_SCOPED_TIMERF("Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)",
name.AsCString(), name_type_mask);
if (Symtab *symtab = GetSymtab())
}
void Module::FindSymbolsWithNameAndType(ConstString name,
- SymbolType symbol_type,
- SymbolContextList &sc_list) {
+ SymbolType symbol_type,
+ SymbolContextList &sc_list) {
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
if (Symtab *symtab = GetSymtab()) {
return false;
}
-llvm::Optional<std::string> Module::RemapSourceFile(llvm::StringRef path) const {
+llvm::Optional<std::string>
+Module::RemapSourceFile(llvm::StringRef path) const {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (auto remapped = m_source_mappings.RemapPath(path))
return remapped->GetPath();
return {};
}
-void Module::RegisterXcodeSDK(llvm::StringRef sdk_name, llvm::StringRef sysroot) {
+void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
+ llvm::StringRef sysroot) {
XcodeSDK sdk(sdk_name.str());
llvm::StringRef sdk_path(HostInfo::GetXcodeSDKPath(sdk));
if (sdk_path.empty())
if (const char *include_path = module_die.GetAttributeValueAsString(
DW_AT_LLVM_include_path, nullptr)) {
FileSpec include_spec(include_path, dwarf_cu->GetPathStyle());
- MakeAbsoluteAndRemap(include_spec, *dwarf_cu, m_objfile_sp->GetModule());
+ MakeAbsoluteAndRemap(include_spec, *dwarf_cu,
+ m_objfile_sp->GetModule());
module.search_path = ConstString(include_spec.GetPath());
}
if (const char *sysroot = dwarf_cu->DIE().GetAttributeValueAsString(
block_die = function_die.LookupDeepestBlock(file_vm_addr);
}
- if (!sc.function || ! lookup_block)
+ if (!sc.function || !lookup_block)
return;
Block &block = sc.function->GetBlock(true);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
log,
- "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, sc_list)",
+ "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, "
+ "sc_list)",
name.GetCString(), name_type_mask);
}
log,
"SymbolFileDWARF::FindFunctions (name=\"%s\", "
"name_type_mask=0x%x, include_inlines=%d, sc_list) => %u",
- name.GetCString(), name_type_mask, include_inlines,
- num_matches);
+ name.GetCString(), name_type_mask, include_inlines, num_matches);
}
}
ExternalTypeModuleMap;
/// Return the list of Clang modules imported by this SymbolFile.
- const ExternalTypeModuleMap& getExternalTypeModules() const {
- return m_external_type_modules;
+ const ExternalTypeModuleMap &getExternalTypeModules() const {
+ return m_external_type_modules;
}
virtual DWARFDIE GetDIE(const DIERef &die_ref);
return m_parse_time;
}
-
protected:
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
DIEToTypePtr;
virtual lldb::TypeSP
FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx);
- virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
- const DWARFDIE &die, lldb_private::ConstString type_name,
- bool must_be_implementation);
+ virtual lldb::TypeSP
+ FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die,
+ lldb_private::ConstString type_name,
+ bool must_be_implementation);
lldb_private::Symbol *
GetObjCClassSymbol(lldb_private::ConstString objc_class_name);
// We assert that we have to module lock by trying to acquire the lock from a
// different thread. Note that we must abort if the result is true to
// guarantee correctness.
- assert(std::async(std::launch::async,
- [this] { return this->GetModuleMutex().try_lock(); })
- .get() == false &&
+ assert(std::async(
+ std::launch::async,
+ [this] {
+ return this->GetModuleMutex().try_lock();
+ }).get() == false &&
"Module is not locked");
#endif
}