Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,4 @@
add_subdirectory(DWARF)
if (LLVM_ENABLE_DIA_SDK)
add_subdirectory(PDB)
endif()

View File

@ -0,0 +1,20 @@
add_lldb_unittest(SymbolFileDWARFTests
SymbolFileDWARFTests.cpp
LINK_LIBS
lldbCore
lldbHost
lldbSymbol
lldbPluginObjectFilePECOFF
lldbPluginSymbolFileDWARF
lldbPluginSymbolFilePDB
lldbUtilityHelpers
LINK_COMPONENTS
Support
DebugInfoPDB
)
set(test_inputs
test-dwarf.exe)
add_unittest_inputs(SymbolFileDWARFTests "${test_inputs}")

View File

@ -0,0 +1,6 @@
// Compile with "cl /c /Zi /GR- test.cpp"
// Link with "link test.obj /debug /nodefaultlib /entry:main /out:test.exe"
int __cdecl _purecall(void) { return 0; }
int main(int argc, char **argv) { return 0; }

View File

@ -0,0 +1,76 @@
//===-- PythonDataObjectsTests.cpp ------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "gtest/gtest.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
#include "TestingSupport/TestUtilities.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/FileSpec.h"
using namespace lldb_private;
class SymbolFileDWARFTests : public testing::Test {
public:
void SetUp() override {
// Initialize and TearDown the plugin every time, so we get a brand new
// AST every time so that modifications to the AST from each test don't
// leak into the next test.
HostInfo::Initialize();
ObjectFilePECOFF::Initialize();
SymbolFileDWARF::Initialize();
ClangASTContext::Initialize();
SymbolFilePDB::Initialize();
m_dwarf_test_exe = GetInputFilePath("test-dwarf.exe");
}
void TearDown() override {
SymbolFilePDB::Terminate();
ClangASTContext::Initialize();
SymbolFileDWARF::Terminate();
ObjectFilePECOFF::Terminate();
HostInfo::Terminate();
}
protected:
std::string m_dwarf_test_exe;
};
TEST_F(SymbolFileDWARFTests, TestAbilitiesForDWARF) {
// Test that when we have Dwarf debug info, SymbolFileDWARF is used.
FileSpec fspec(m_dwarf_test_exe, false);
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
EXPECT_NE(nullptr, symfile);
EXPECT_EQ(symfile->GetPluginName(), SymbolFileDWARF::GetPluginNameStatic());
uint32_t expected_abilities = SymbolFile::kAllAbilities;
EXPECT_EQ(expected_abilities, symfile->CalculateAbilities());
}

View File

@ -0,0 +1,23 @@
add_lldb_unittest(SymbolFilePDBTests
SymbolFilePDBTests.cpp
LINK_LIBS
lldbCore
lldbHost
lldbSymbol
lldbPluginObjectFilePECOFF
lldbPluginSymbolFileDWARF
lldbPluginSymbolFilePDB
lldbUtilityHelpers
LINK_COMPONENTS
Support
DebugInfoPDB
)
set(test_inputs
test-pdb.exe
test-pdb.pdb
test-pdb-types.exe
test-pdb-types.pdb)
add_unittest_inputs(SymbolFilePDBTests "${test_inputs}")

View File

@ -0,0 +1,7 @@
// Compile with "cl /c /Zi /GR- test-pdb-alt.cpp"
// Link with "link test-pdb.obj test-pdb-alt.obj /debug /nodefaultlib
// /entry:main /out:test-pdb.exe"
#include "test-pdb.h"
int bar(int n) { return n - 1; }

View File

@ -0,0 +1,6 @@
#ifndef TEST_PDB_NESTED_H
#define TEST_PDB_NESTED_H
inline int baz(int n) { return n + 1; }
#endif

View File

@ -0,0 +1,72 @@
// Compile with "cl /c /Zi /GR- /EHsc test-pdb-types.cpp"
// Link with "link test-pdb-types.obj /debug /nodefaultlib /entry:main
// /out:test-pdb-types.exe"
using namespace std;
// Sizes of builtin types
static const int sizeof_char = sizeof(char);
static const int sizeof_uchar = sizeof(unsigned char);
static const int sizeof_short = sizeof(short);
static const int sizeof_ushort = sizeof(unsigned short);
static const int sizeof_int = sizeof(int);
static const int sizeof_uint = sizeof(unsigned int);
static const int sizeof_long = sizeof(long);
static const int sizeof_ulong = sizeof(unsigned long);
static const int sizeof_longlong = sizeof(long long);
static const int sizeof_ulonglong = sizeof(unsigned long long);
static const int sizeof_int64 = sizeof(__int64);
static const int sizeof_uint64 = sizeof(unsigned __int64);
static const int sizeof_float = sizeof(float);
static const int sizeof_double = sizeof(double);
static const int sizeof_bool = sizeof(bool);
static const int sizeof_wchar = sizeof(wchar_t);
enum Enum {
EValue1 = 1,
EValue2 = 2,
};
enum ShortEnum : short { ESValue1 = 1, ESValue2 = 2 };
namespace NS {
class NSClass {
float f;
double d;
};
}
class Class {
public:
class NestedClass {
Enum e;
};
ShortEnum se;
};
int test_func(int a, int b) { return a + b; }
typedef Class ClassTypedef;
typedef NS::NSClass NSClassTypedef;
int GlobalArray[10];
static const int sizeof_NSClass = sizeof(NS::NSClass);
static const int sizeof_Class = sizeof(Class);
static const int sizeof_NestedClass = sizeof(Class::NestedClass);
static const int sizeof_Enum = sizeof(Enum);
static const int sizeof_ShortEnum = sizeof(ShortEnum);
static const int sizeof_ClassTypedef = sizeof(ClassTypedef);
static const int sizeof_NSClassTypedef = sizeof(NSClassTypedef);
static const int sizeof_GlobalArray = sizeof(GlobalArray);
int main(int argc, char **argv) {
ShortEnum e1;
Enum e2;
Class c1;
Class::NestedClass c2;
NS::NSClass c3;
ClassTypedef t1;
NSClassTypedef t2;
return test_func(1, 2);
}

View File

@ -0,0 +1 @@
acf241bcb5d6c084d3ccd602e691c60936143bce

View File

@ -0,0 +1,9 @@
// Compile with "cl /c /Zi /GR- test-pdb.cpp"
// Link with "link test-pdb.obj /debug /nodefaultlib /entry:main
// /out:test-pdb.exe"
#include "test-pdb.h"
int __cdecl _purecall(void) { return 0; }
int main(int argc, char **argv) { return foo(argc) + bar(argc); }

View File

@ -0,0 +1,10 @@
#ifndef TEST_PDB_H
#define TEST_PDB_H
#include "test-pdb-nested.h"
int bar(int n);
inline int foo(int n) { return baz(n) + 1; }
#endif

View File

@ -0,0 +1 @@
f43d334d215a780e420337a61342242ee903141b

File diff suppressed because it is too large Load Diff