diff options
Diffstat (limited to 'lldb/source/Plugins')
10 files changed, 45 insertions, 25 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp index 606f951..e20dd31 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp @@ -142,7 +142,13 @@ lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd:: SyntheticChildrenFrontEnd * lldb_private::formatters::LibcxxAtomicSyntheticFrontEndCreator( CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp) { - if (valobj_sp) + if (valobj_sp && IsLibCxxAtomic(*valobj_sp)) return new LibcxxStdAtomicSyntheticFrontEnd(valobj_sp); return nullptr; } + +bool lldb_private::formatters::IsLibCxxAtomic(ValueObject &valobj) { + if (auto valobj_sp = valobj.GetNonSyntheticValue()) + return valobj_sp->GetChildMemberWithName("__a_") != nullptr; + return false; +} diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h index 9327446..7005950 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h @@ -18,6 +18,8 @@ namespace lldb_private { namespace formatters { +bool IsLibCxxAtomic(ValueObject &valobj); + lldb::ValueObjectSP GetLibCxxAtomicValue(ValueObject &valobj); bool LibCxxAtomicSummaryProvider(ValueObject &valobj, Stream &stream, diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h b/lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h index 8a49181..e818b88 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h +++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h @@ -89,6 +89,7 @@ MsvcStlVariantSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp); // MSVC STL std::atomic<> +bool IsMsvcStlAtomic(ValueObject &valobj); bool MsvcStlAtomicSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); SyntheticChildrenFrontEnd * diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp index 3ec3245..c871861 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp @@ -83,7 +83,9 @@ llvm::Expected<size_t> lldb_private::formatters:: lldb_private::SyntheticChildrenFrontEnd * lldb_private::formatters::MsvcStlAtomicSyntheticFrontEndCreator( CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp) { - return new MsvcStlAtomicSyntheticFrontEnd(valobj_sp); + if (valobj_sp && IsMsvcStlAtomic(*valobj_sp)) + return new MsvcStlAtomicSyntheticFrontEnd(valobj_sp); + return nullptr; } bool lldb_private::formatters::MsvcStlAtomicSummaryProvider( @@ -100,3 +102,9 @@ bool lldb_private::formatters::MsvcStlAtomicSummaryProvider( } return false; } + +bool lldb_private::formatters::IsMsvcStlAtomic(ValueObject &valobj) { + if (auto valobj_sp = valobj.GetNonSyntheticValue()) + return valobj_sp->GetChildMemberWithName("_Storage") != nullptr; + return false; +} diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp index f538fc6..57d88f6 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -9,6 +9,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/UriParser.h" diff --git a/lldb/source/Plugins/Process/wasm/RegisterContextWasm.cpp b/lldb/source/Plugins/Process/wasm/RegisterContextWasm.cpp index b468171..2e02076 100644 --- a/lldb/source/Plugins/Process/wasm/RegisterContextWasm.cpp +++ b/lldb/source/Plugins/Process/wasm/RegisterContextWasm.cpp @@ -22,7 +22,7 @@ using namespace lldb_private::process_gdb_remote; using namespace lldb_private::wasm; RegisterContextWasm::RegisterContextWasm( - wasm::ThreadWasm &thread, uint32_t concrete_frame_idx, + ThreadGDBRemote &thread, uint32_t concrete_frame_idx, GDBRemoteDynamicRegisterInfoSP reg_info_sp) : GDBRemoteRegisterContext(thread, concrete_frame_idx, reg_info_sp, false, false) {} diff --git a/lldb/source/Plugins/Process/wasm/RegisterContextWasm.h b/lldb/source/Plugins/Process/wasm/RegisterContextWasm.h index 7e63eb8..6ca31e5 100644 --- a/lldb/source/Plugins/Process/wasm/RegisterContextWasm.h +++ b/lldb/source/Plugins/Process/wasm/RegisterContextWasm.h @@ -10,6 +10,7 @@ #define LLDB_SOURCE_PLUGINS_PROCESS_WASM_REGISTERCONTEXTWASM_H #include "Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h" +#include "Plugins/Process/gdb-remote/ThreadGDBRemote.h" #include "ThreadWasm.h" #include "Utility/WasmVirtualRegisters.h" #include "lldb/lldb-private-types.h" @@ -34,7 +35,7 @@ class RegisterContextWasm : public process_gdb_remote::GDBRemoteRegisterContext { public: RegisterContextWasm( - wasm::ThreadWasm &thread, uint32_t concrete_frame_idx, + process_gdb_remote::ThreadGDBRemote &thread, uint32_t concrete_frame_idx, process_gdb_remote::GDBRemoteDynamicRegisterInfoSP reg_info_sp); ~RegisterContextWasm() override; diff --git a/lldb/source/Plugins/Process/wasm/UnwindWasm.cpp b/lldb/source/Plugins/Process/wasm/UnwindWasm.cpp index 99845dd..319c5e2 100644 --- a/lldb/source/Plugins/Process/wasm/UnwindWasm.cpp +++ b/lldb/source/Plugins/Process/wasm/UnwindWasm.cpp @@ -9,6 +9,7 @@ #include "UnwindWasm.h" #include "Plugins/Process/gdb-remote/ThreadGDBRemote.h" #include "ProcessWasm.h" +#include "RegisterContextWasm.h" #include "ThreadWasm.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" @@ -18,21 +19,6 @@ using namespace lldb_private; using namespace process_gdb_remote; using namespace wasm; -class WasmGDBRemoteRegisterContext : public GDBRemoteRegisterContext { -public: - WasmGDBRemoteRegisterContext(ThreadGDBRemote &thread, - uint32_t concrete_frame_idx, - GDBRemoteDynamicRegisterInfoSP ®_info_sp, - uint64_t pc) - : GDBRemoteRegisterContext(thread, concrete_frame_idx, reg_info_sp, false, - false) { - // Wasm does not have a fixed set of registers but relies on a mechanism - // named local and global variables to store information such as the stack - // pointer. The only actual register is the PC. - PrivateSetRegisterValue(0, pc); - } -}; - lldb::RegisterContextSP UnwindWasm::DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) { if (m_frames.size() <= frame->GetFrameIndex()) @@ -43,9 +29,9 @@ UnwindWasm::DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) { ProcessWasm *wasm_process = static_cast<ProcessWasm *>(thread->GetProcess().get()); - return std::make_shared<WasmGDBRemoteRegisterContext>( - *gdb_thread, frame->GetConcreteFrameIndex(), - wasm_process->GetRegisterInfo(), m_frames[frame->GetFrameIndex()]); + return std::make_shared<RegisterContextWasm>(*gdb_thread, + frame->GetConcreteFrameIndex(), + wasm_process->GetRegisterInfo()); } uint32_t UnwindWasm::DoGetFrameCount() { diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index 75a8189..7e275f1 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -2141,14 +2141,17 @@ TypeSP SymbolFileNativePDB::CreateTypedef(PdbGlobalSymId id) { if (!ts) return nullptr; - ts->GetNativePDBParser()->GetOrCreateTypedefDecl(id); + auto *typedef_decl = ts->GetNativePDBParser()->GetOrCreateTypedefDecl(id); + + CompilerType ct = target_type->GetForwardCompilerType(); + if (auto *clang = llvm::dyn_cast_or_null<TypeSystemClang>(ts.get())) + ct = clang->GetType(clang->getASTContext().getTypeDeclType(typedef_decl)); Declaration decl; return MakeType(toOpaqueUid(id), ConstString(udt.Name), llvm::expectedToOptional(target_type->GetByteSize(nullptr)), nullptr, target_type->GetID(), - lldb_private::Type::eEncodingIsTypedefUID, decl, - target_type->GetForwardCompilerType(), + lldb_private::Type::eEncodingIsTypedefUID, decl, ct, lldb_private::Type::ResolveState::Forward); } diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 21c265e..12cabff 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -849,8 +849,20 @@ lldb::BasicType TypeSystemClang::GetBasicTypeEnumeration(llvm::StringRef name) { {"unsigned long long int", eBasicTypeUnsignedLongLong}, // "int128" + // + // The following two lines are here only + // for the sake of backward-compatibility. + // Neither "__int128_t", nor "__uint128_t" are basic-types. + // They are typedefs. {"__int128_t", eBasicTypeInt128}, {"__uint128_t", eBasicTypeUnsignedInt128}, + // In order to be consistent with: + // - gcc's C programming language extension related to 128-bit integers + // https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html + // - the "BuiltinType::getName" method in LLVM + // the following two lines must be present: + {"__int128", eBasicTypeInt128}, + {"unsigned __int128", eBasicTypeUnsignedInt128}, // "bool" {"bool", eBasicTypeBool}, |