From 5583ec4218dd1bbc64f1b0918c3ea6979b38a44a Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 6 Jun 2018 09:16:00 +0000 Subject: [PATCH] Revert "PDB support of function-level linking and splitted functions" This reverts commit r334030 because it adds a broken test. llvm-svn: 334076 --- .../Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 3 -- lldb/unittests/SymbolFile/PDB/CMakeLists.txt | 4 -- .../PDB/Inputs/test-pdb-function-level-linking.cpp | 17 ------- .../PDB/Inputs/test-pdb-function-level-linking.exe | 0 .../PDB/Inputs/test-pdb-function-level-linking.pdb | 0 .../PDB/Inputs/test-pdb-splitted-function.cpp | 27 ----------- .../PDB/Inputs/test-pdb-splitted-function.exe | 0 .../PDB/Inputs/test-pdb-splitted-function.pdb | 0 .../SymbolFile/PDB/SymbolFilePDBTests.cpp | 56 ---------------------- 9 files changed, 107 deletions(-) delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.cpp delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.exe delete mode 100644 lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.pdb diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 19a0e95..f298749 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -1571,9 +1571,6 @@ bool SymbolFilePDB::ParseCompileUnitLineTable( line_table->AppendLineEntryToSequence( sequence.get(), prev_addr + prev_length, prev_line, 0, prev_source_idx, false, false, false, false, true); - - line_table->InsertSequence(sequence.release()); - sequence.reset(line_table->CreateLineSequenceContainer()); } if (ShouldAddLine(match_line, lno, length)) { diff --git a/lldb/unittests/SymbolFile/PDB/CMakeLists.txt b/lldb/unittests/SymbolFile/PDB/CMakeLists.txt index b9dada0..dd7e224 100644 --- a/lldb/unittests/SymbolFile/PDB/CMakeLists.txt +++ b/lldb/unittests/SymbolFile/PDB/CMakeLists.txt @@ -17,10 +17,6 @@ add_lldb_unittest(SymbolFilePDBTests set(test_inputs test-pdb.exe test-pdb.pdb - test-pdb-function-level-linking.exe - test-pdb-function-level-linking.pdb - test-pdb-splitted-function.exe - test-pdb-splitted-function.pdb test-pdb-types.exe test-pdb-types.pdb) diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp deleted file mode 100644 index e1d5aab..0000000 --- a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Compile with "cl /c /ZI /sdl /EHsc /MTd /permissive- -// test-pdb-function-level-linking.cpp" -// Link with "link /debug:full test-pdb-function-level-linking.obj" - -#include -#include - -std::string foo() -{ - return "Hello!"; -} - -int main() -{ - auto x = foo(); - return 0; -} diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe deleted file mode 100644 index e69de29..0000000 diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb deleted file mode 100644 index e69de29..0000000 diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.cpp b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.cpp deleted file mode 100644 index 5155b8c..0000000 --- a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Compile with "cl /c /Zi /GL /O2 /EHsc /MTd test-pdb-splitted-function.cpp" -// Link with "link /debug:full /LTCG /GENPROFILE -// test-pdb-splitted-function.obj" -// Run several times -// Link with "link /debug:full /LTCG /USEPROFILE -// test-pdb-splitted-function.obj" - -#include -#include - -int main() -{ - auto b = false; - for (auto i = 1; i <= 1024; i++) - { - if (b) - { - std::cout << "Unreachable code" << std::endl; - auto x = std::sin(i); - return x; - } - - b = (i % 2 + (i - 1) % 2) != 1; - } - - return 0; -} diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.exe b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.exe deleted file mode 100644 index e69de29..0000000 diff --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.pdb b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.pdb deleted file mode 100644 index e69de29..0000000 diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp index 9b93ab0..1e867b1 100644 --- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp +++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp @@ -56,10 +56,6 @@ public: SymbolFilePDB::Initialize(); m_pdb_test_exe = GetInputFilePath("test-pdb.exe"); - m_function_level_linking_test_exe = - GetInputFilePath("test-pdb-function-level-linking.exe"); - m_splitted_function_test_exe = - GetInputFilePath("test-pdb-splitted-function.exe"); m_types_test_exe = GetInputFilePath("test-pdb-types.exe"); } @@ -77,8 +73,6 @@ public: protected: std::string m_pdb_test_exe; - std::string m_function_level_linking_test_exe; - std::string m_splitted_function_test_exe; std::string m_types_test_exe; bool FileSpecMatchesAsBaseOrFull(const FileSpec &left, @@ -360,56 +354,6 @@ TEST_F(SymbolFilePDBTests, TestLineTablesMatchSpecific) { VerifyLineEntry(module, sc, header1, *lt, 9, 0x401090); } -void TestLineTableConsistency(llvm::StringRef exe_path, llvm::StringRef source_name) -{ - // All line entries of compile unit's line table must be consistent - // even if compiled sources are not continuous in the binary file. - FileSpec fspec(exe_path, false); - ArchSpec aspec("i686-pc-windows"); - lldb::ModuleSP module = std::make_shared(fspec, aspec); - SymbolVendor *plugin = module->GetSymbolVendor(); - SymbolFile *symfile = plugin->GetSymbolFile(); - FileSpec source_file(source_name, false); - uint32_t scope = lldb::eSymbolContextCompUnit | lldb::eSymbolContextLineEntry; - SymbolContextList sc_list; - uint32_t count = - symfile->ResolveSymbolContext(source_file, 0, true, scope, sc_list); - EXPECT_EQ(1u, count); - - SymbolContext sc; - EXPECT_TRUE(sc_list.GetContextAtIndex(0, sc)); - - LineTable *lt = sc.comp_unit->GetLineTable(); - EXPECT_NE(nullptr, lt); - - count = lt->GetSize(); - EXPECT_LT(0u, count); - - LineEntry le; - EXPECT_TRUE(lt->GetLineEntryAtIndex(0, le)); - for (int i = 1; i < count; i++) - { - lldb::addr_t curr_end = - le.range.GetBaseAddress().GetFileAddress() + le.range.GetByteSize(); - - EXPECT_TRUE(lt->GetLineEntryAtIndex(i, le)); - - EXPECT_LE(curr_end, le.range.GetBaseAddress().GetFileAddress()); - } -} - -TEST_F(SymbolFilePDBTests, TestFunctionLevelLinking) { - TestLineTableConsistency( - m_function_level_linking_test_exe, - "test-pdb-function-level-linking.cpp"); -} - -TEST_F(SymbolFilePDBTests, TestSplittedFunction) { - TestLineTableConsistency( - m_splitted_function_test_exe, - "test-pdb-splitted-function.cpp"); -} - TEST_F(SymbolFilePDBTests, TestSimpleClassTypes) { FileSpec fspec(m_types_test_exe.c_str(), false); ArchSpec aspec("i686-pc-windows"); -- 2.7.4