[Lldb-commits] [lldb] r267688 - Fix compiler warnings in SymbolFilePDBTests
Author: labath Date: Wed Apr 27 05:40:52 2016 New Revision: 267688 URL: http://llvm.org/viewvc/llvm-project?rev=267688&view=rev Log: Fix compiler warnings in SymbolFilePDBTests Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=267688&r1=267687&r2=267688&view=diff == --- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original) +++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Wed Apr 27 05:40:52 2016 @@ -400,13 +400,13 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; -EXPECT_EQ(1, symfile->FindTypes(sc, ConstString("Class"), nullptr, false, 0, searched_files, results)); -EXPECT_EQ(1, results.GetSize()); +EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString("Class"), nullptr, false, 0, searched_files, results)); +EXPECT_EQ(1u, results.GetSize()); lldb::TypeSP udt_type = results.GetTypeAtIndex(0); EXPECT_EQ(ConstString("Class"), udt_type->GetName()); CompilerType compiler_type = udt_type->GetForwardCompilerType(); EXPECT_TRUE(ClangASTContext::IsClassType(compiler_type.GetOpaqueQualType())); -EXPECT_EQ(GetGlobalConstantInteger(session, "sizeof_Class"), udt_type->GetByteSize()); +EXPECT_EQ(uint64_t(GetGlobalConstantInteger(session, "sizeof_Class")), udt_type->GetByteSize()); } TEST_F(SymbolFilePDBTests, REQUIRES_DIA_SDK(TestNestedClassTypes)) @@ -421,8 +421,8 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; -EXPECT_EQ(1, symfile->FindTypes(sc, ConstString("Class::NestedClass"), nullptr, false, 0, searched_files, results)); -EXPECT_EQ(1, results.GetSize()); +EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString("Class::NestedClass"), nullptr, false, 0, searched_files, results)); +EXPECT_EQ(1u, results.GetSize()); lldb::TypeSP udt_type = results.GetTypeAtIndex(0); EXPECT_EQ(ConstString("Class::NestedClass"), udt_type->GetName()); CompilerType compiler_type = udt_type->GetForwardCompilerType(); @@ -442,8 +442,8 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; -EXPECT_EQ(1, symfile->FindTypes(sc, ConstString("NS::NSClass"), nullptr, false, 0, searched_files, results)); -EXPECT_EQ(1, results.GetSize()); +EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString("NS::NSClass"), nullptr, false, 0, searched_files, results)); +EXPECT_EQ(1u, results.GetSize()); lldb::TypeSP udt_type = results.GetTypeAtIndex(0); EXPECT_EQ(ConstString("NS::NSClass"), udt_type->GetName()); CompilerType compiler_type = udt_type->GetForwardCompilerType(); @@ -466,8 +466,8 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ for (auto Enum : EnumsToCheck) { TypeMap results; -EXPECT_EQ(1, symfile->FindTypes(sc, ConstString(Enum), nullptr, false, 0, searched_files, results)); -EXPECT_EQ(1, results.GetSize()); +EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString(Enum), nullptr, false, 0, searched_files, results)); +EXPECT_EQ(1u, results.GetSize()); lldb::TypeSP enum_type = results.GetTypeAtIndex(0); EXPECT_EQ(ConstString(Enum), enum_type->GetName()); CompilerType compiler_type = enum_type->GetFullCompilerType(); @@ -511,8 +511,8 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ for (auto Typedef : TypedefsToCheck) { TypeMap results; -EXPECT_EQ(1, symfile->FindTypes(sc, ConstString(Typedef), nullptr, false, 0, searched_files, results)); -EXPECT_EQ(1, results.GetSize()); +EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString(Typedef), nullptr, false, 0, searched_files, results)); +EXPECT_EQ(1u, results.GetSize()); lldb::TypeSP typedef_type = results.GetTypeAtIndex(0); EXPECT_EQ(ConstString(Typedef), typedef_type->GetName()); CompilerType compiler_type = typedef_type->GetFullCompilerType(); @@ -536,8 +536,8 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; -int num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr, false, 0, searched_files, results); -EXPECT_GT(num_results, 1); +uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr, false, 0, searched_files, results); +EXPECT_GT(num_results, 1u); EXPECT_EQ(num_results, results.GetSize()); } @@ -552,14 +552,14 @@ TEST_F(SymbolFilePDBTests, REQUIRES_DIA_ SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; -int num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr, false, 0, se
[Lldb-commits] [lldb] r267704 - Remove flaky decorator from three tests on linux
Author: labath Date: Wed Apr 27 07:43:37 2016 New Revision: 267704 URL: http://llvm.org/viewvc/llvm-project?rev=267704&view=rev Log: Remove flaky decorator from three tests on linux The flakyness is no longer reproducible, and the tests seem to be passing reliably now. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py?rev=267704&r1=267703&r2=267704&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py Wed Apr 27 07:43:37 2016 @@ -21,7 +21,6 @@ class ExprDoesntDeadlockTestCase(TestBas mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr17946') -@expectedFlakeyLinux # failed 1/365 test runs, line 61, thread.IsValid() @expectedFailureAll(oslist=["windows"], bugnumber="Windows doesn't have pthreads, test needs to be ported") def test_with_run_command(self): """Test that expr will time out and allow other threads to run if it blocks.""" Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py?rev=267704&r1=267703&r2=267704&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py Wed Apr 27 07:43:37 2016 @@ -21,7 +21,6 @@ class ThreadSpecificBreakPlusConditionTe @skipIfFreeBSD # test frequently times out or hangs @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522') # hits break in another thread in testrun @add_test_categories(['pyapi']) -@expectedFlakeyLinux # this test fails 6/100 dosep runs def test_python(self): """Test that we obey thread conditioned breakpoints.""" self.build() Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py?rev=267704&r1=267703&r2=267704&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py Wed Apr 27 07:43:37 2016 @@ -14,7 +14,6 @@ class CPPThisTestCase(TestBase): @expectedFailureAll(compiler="gcc", bugnumber="llvm.org/pr15439 The 'this' pointer isn't available during expression evaluation when stopped in an inlined member function") @expectedFailureAll(compiler="icc", bugnumber="ICC doesn't emit correct DWARF inline debug info for inlined member functions.") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows") -@expectedFlakeyClang(bugnumber='llvm.org/pr23012', compiler_version=['>=','3.6']) # failed with totclang - clang3.7 def test_with_run_command(self): """Test that the appropriate member variables are available when stopped in C++ static, inline, and const methods""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r267726 - Decorate TSan tests with "@skipUnlessThreadSanitizer" which skips the tests if the selected compiler can't compile with "-fsanitize=thread".
Author: kuba.brecka Date: Wed Apr 27 10:26:27 2016 New Revision: 267726 URL: http://llvm.org/viewvc/llvm-project?rev=267726&view=rev Log: Decorate TSan tests with "@skipUnlessThreadSanitizer" which skips the tests if the selected compiler can't compile with "-fsanitize=thread". Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=267726&r1=267725&r2=267726&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Apr 27 10:26:27 2016 @@ -7,6 +7,7 @@ from functools import wraps import os import re import sys +import tempfile # Third-party modules import six @@ -505,6 +506,23 @@ def skipUnlessCompilerRt(func): return "compiler-rt not found" if not os.path.exists(compilerRtPath) else None return skipTestIfFn(is_compiler_rt_missing)(func) +def skipUnlessThreadSanitizer(func): +"""Decorate the item to skip test unless Clang -fsanitize=thread is supported.""" +def is_compiler_clang_with_thread_sanitizer(self): +compiler_path = self.getCompiler() +compiler = os.path.basename(compiler_path) +if not compiler.startswith("clang"): +return "Test requires clang as compiler" +f = tempfile.NamedTemporaryFile() +cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, f.name) +if os.popen(cmd).close() != None: +return None # The compiler cannot compile at all, let's *not* skip the test +cmd = "echo 'int main() {}' | %s -fsanitize=thread -x c -o %s -" % (compiler_path, f.name) +if os.popen(cmd).close() != None: +return "Compiler cannot compile with -fsanitize=thread" +return None +return skipTestIfFn(is_compiler_clang_with_thread_sanitizer)(func) + def skipUnlessClangModules(): """Decorate the item to skip test unless Clang -gmodules flag is supported.""" def is_compiler_clang_with_gmodules(self): Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py?rev=267726&r1=267725&r2=267726&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py Wed Apr 27 10:26:27 2016 @@ -17,6 +17,7 @@ class TsanBasicTestCase(TestBase): @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote @skipUnlessCompilerRt +@skipUnlessThreadSanitizer def test (self): self.build () self.tsan_tests () Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py?rev=267726&r1=267725&r2=267726&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py Wed Apr 27 10:26:27 2016 @@ -17,6 +17,7 @@ class TsanMultipleTestCase(TestBase): @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote @skipUnlessCompilerRt +@skipUnlessThreadSanitizer def test (self): self.build () self.tsan_tests () Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py?rev=267726&r1=267725&r2=267726&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py Wed Apr 27 10:26:27 2016 @@ -17,6 +17,7 @@ class TsanThread
[Lldb-commits] [lldb] r267741 - Use absolute module path when possible if sent in svr4 packets
Author: fjricci Date: Wed Apr 27 12:10:15 2016 New Revision: 267741 URL: http://llvm.org/viewvc/llvm-project?rev=267741&view=rev Log: Use absolute module path when possible if sent in svr4 packets Summary: If the remote uses svr4 packets to communicate library info, the LoadUnload tests will fail, as lldb only used the basename for modules, causing problems when two modules have the same basename. Using absolute path as sent by the remote will ensure that lldb locates the module from the correct directory when there are overlapping basenames. When debugging a remote process, LoadModuleAtAddress will still fall back to using basename and module_search_paths, so we don't need to worry about using absolute paths in this case. Reviewers: ADodds, jasonmolenda, clayborg, ovyalov Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19557 Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=267741&r1=267740&r2=267741&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed Apr 27 12:10:15 2016 @@ -4863,14 +4863,7 @@ ProcessGDBRemote::LoadModules (LoadedMod if (!modInfo.get_link_map (link_map)) link_map = LLDB_INVALID_ADDRESS; -// hack (cleaner way to get file name only?) (win/unix compat?) -size_t marker = mod_name.rfind ('/'); -if (marker == std::string::npos) -marker = 0; -else -marker += 1; - -FileSpec file (mod_name.c_str()+marker, true); +FileSpec file (mod_name.c_str(), true); lldb::ModuleSP module_sp = LoadModuleAtAddress (file, link_map, mod_base, mod_base_is_offset); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19557: Use absolute module path when possible if sent in svr4 packets
This revision was automatically updated to reflect the committed changes. Closed by commit rL267741: Use absolute module path when possible if sent in svr4 packets (authored by fjricci). Changed prior to commit: http://reviews.llvm.org/D19557?vs=55083&id=55253#toc Repository: rL LLVM http://reviews.llvm.org/D19557 Files: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -4863,14 +4863,7 @@ if (!modInfo.get_link_map (link_map)) link_map = LLDB_INVALID_ADDRESS; -// hack (cleaner way to get file name only?) (win/unix compat?) -size_t marker = mod_name.rfind ('/'); -if (marker == std::string::npos) -marker = 0; -else -marker += 1; - -FileSpec file (mod_name.c_str()+marker, true); +FileSpec file (mod_name.c_str(), true); lldb::ModuleSP module_sp = LoadModuleAtAddress (file, link_map, mod_base, mod_base_is_offset); Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -4863,14 +4863,7 @@ if (!modInfo.get_link_map (link_map)) link_map = LLDB_INVALID_ADDRESS; -// hack (cleaner way to get file name only?) (win/unix compat?) -size_t marker = mod_name.rfind ('/'); -if (marker == std::string::npos) -marker = 0; -else -marker += 1; - -FileSpec file (mod_name.c_str()+marker, true); +FileSpec file (mod_name.c_str(), true); lldb::ModuleSP module_sp = LoadModuleAtAddress (file, link_map, mod_base, mod_base_is_offset); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
sas created this revision. sas added a reviewer: zturner. sas added a subscriber: lldb-commits. http://reviews.llvm.org/D19603 Files: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp === --- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -825,7 +825,7 @@ return m_entry_point_address; SectionList *section_list = GetSectionList(); -addr_t offset = m_coff_header_opt.entry; +addr_t offset = m_coff_header_opt.entry + m_coff_header_opt.image_base; if (!section_list) m_entry_point_address.SetOffset(offset); Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp === --- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -825,7 +825,7 @@ return m_entry_point_address; SectionList *section_list = GetSectionList(); -addr_t offset = m_coff_header_opt.entry; +addr_t offset = m_coff_header_opt.entry + m_coff_header_opt.image_base; if (!section_list) m_entry_point_address.SetOffset(offset); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.
sas created this revision. sas added a reviewer: zturner. sas added a subscriber: lldb-commits. Herald added subscribers: rengolin, aemerson. This is required to start debugging WinPhone ARM targets. http://reviews.llvm.org/D19604 Files: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp === --- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -144,6 +144,11 @@ spec.SetTriple("i686-pc-windows"); specs.Append(ModuleSpec(file, spec)); } +else if (coff_header.machine == MachineArmNt) +{ +spec.SetTriple("armv7-pc-windows"); +specs.Append(ModuleSpec(file, spec)); +} } } } Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp === --- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -144,6 +144,11 @@ spec.SetTriple("i686-pc-windows"); specs.Append(ModuleSpec(file, spec)); } +else if (coff_header.machine == MachineArmNt) +{ +spec.SetTriple("armv7-pc-windows"); +specs.Append(ModuleSpec(file, spec)); +} } } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D6959: LLDB Help Improvements
k8stone closed this revision. k8stone added a comment. Long since complete. http://reviews.llvm.org/D6959 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r267749 - Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093
Author: kate Date: Wed Apr 27 12:49:51 2016 New Revision: 267749 URL: http://llvm.org/viewvc/llvm-project?rev=267749&view=rev Log: Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093 Modified: lldb/trunk/source/Host/linux/HostInfoLinux.cpp Modified: lldb/trunk/source/Host/linux/HostInfoLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostInfoLinux.cpp?rev=267749&r1=267748&r2=267749&view=diff == --- lldb/trunk/source/Host/linux/HostInfoLinux.cpp (original) +++ lldb/trunk/source/Host/linux/HostInfoLinux.cpp Wed Apr 27 12:49:51 2016 @@ -235,7 +235,7 @@ HostInfoLinux::ComputeSupportExeDirector bool HostInfoLinux::ComputeSystemPluginsDirectory(FileSpec &file_spec) { -FileSpec temp_file("/usr/lib/lldb", true); +FileSpec temp_file("/usr/lib/lldb/plugins", true); file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str()); return true; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
zturner added a reviewer: clayborg. zturner added a comment. +greg. I thought I remember Greg saying that that offsets were supposed to be RVAs, not VAs. Am I wrong here? http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
sas added a comment. @zturner, you might be right, I might have to change the code I have to load the initial executable's `Module` and use an offset different than 0 there. I'll wait to see what @clayborg says. http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19606: XFail TestLambdas.py on Windows after fixing some of the problems
amccarth created this revision. amccarth added a reviewer: spyffe. amccarth added a subscriber: lldb-commits. 1. Fixed semicolon placement in the lambda in the test itself. 2. Fixed lldbinline tests in general so that we don't attempt tests on platforms that don't use the given type of debug info. (For example, no DWO tests on Windows.) This fixes one of the two failures on Windows. (TestLambdas.py was the only inline test that wasn't XFailed or skipped on Windows.) 3. Set the error string in `IRInterpreter::CanInterpret` so that the caller doesn't print `(null)` instead of an explanation. I don't entirely understand the error, so feel free to suggest a better wording. 4. XFailed the test on Windows. The interpreter won't evaluate the lambda because the module has multiple function bodies. I don't exactly understand why that's a problem for the interpreter nor why the problem arises only on Windows. http://reviews.llvm.org/D19606 Files: packages/Python/lldbsuite/test/lang/cpp/lambdas/TestLambdas.py packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp packages/Python/lldbsuite/test/lldbinline.py source/Expression/IRInterpreter.cpp Index: source/Expression/IRInterpreter.cpp === --- source/Expression/IRInterpreter.cpp +++ source/Expression/IRInterpreter.cpp @@ -477,6 +477,7 @@ static const char *memory_read_error= "Interpreter couldn't read from memory"; static const char *infinite_loop_error = "Interpreter ran for too many cycles"; //static const char *bad_result_error = "Result of expression is in bad memory"; +static const char *too_many_functions_error = "Interpreter doesn't handle modules with multiple function bodies."; static bool CanResolveConstant (llvm::Constant *constant) @@ -506,7 +507,7 @@ Constant *base = dyn_cast(*op_cursor); if (!base) return false; - + return CanResolveConstant(base); } } @@ -535,7 +536,13 @@ if (fi->begin() != fi->end()) { if (saw_function_with_body) +{ +if (log) +log->Printf("More than one function in the module has a body"); +error.SetErrorToGenericError(); +error.SetErrorString(too_many_functions_error); return false; +} saw_function_with_body = true; } } @@ -664,7 +671,7 @@ return false; } } - + if (Constant *constant = llvm::dyn_cast(operand)) { if (!CanResolveConstant(constant)) @@ -680,7 +687,8 @@ } -return true;} +return true; +} bool IRInterpreter::Interpret (llvm::Module &module, Index: packages/Python/lldbsuite/test/lldbinline.py === --- packages/Python/lldbsuite/test/lldbinline.py +++ packages/Python/lldbsuite/test/lldbinline.py @@ -186,7 +186,7 @@ elif hasattr(decorators, '__call__'): tmp = decorators(tmp) return tmp - + def MakeInlineTest(__file, __globals, decorators=None): # Adjust the filename if it ends in .pyc. We want filenames to @@ -200,13 +200,17 @@ InlineTest.mydir = TestBase.compute_mydir(__file) test_name, _ = os.path.splitext(file_basename) -# Build the test case +# Build the test case test = type(test_name, (InlineTest,), {'using_dsym': None}) test.name = test_name -test.test_with_dsym = ApplyDecoratorsToFunction(test._InlineTest__test_with_dsym, decorators) -test.test_with_dwarf = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwarf, decorators) -test.test_with_dwo = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwo, decorators) +target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] +if test_categories.is_supported_on_platform("dsym", target_platform): +test.test_with_dsym = ApplyDecoratorsToFunction(test._InlineTest__test_with_dsym, decorators) +if test_categories.is_supported_on_platform("dwarf", target_platform): +test.test_with_dwarf = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwarf, decorators) +if test_categories.is_supported_on_platform("dwo", target_platform): +test.test_with_dwo = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwo, decorators) # Add the test case to the globals, and hide InlineTest __globals.update({test_name : test}) Index: packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp === --- packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp +++ packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp @@ -1
Re: [Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.
rengolin added reviewers: omjavaid, compnerd. rengolin added a comment. Nice! LLDB on ARM Windows! :) Adding Omair and Saleem to approve, as hard-coding the triple may bring unwanted consequences. http://reviews.llvm.org/D19604 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19608: Checkout release_38 branches of llvm and clang when building lldb 3.8
fjricci created this revision. fjricci added reviewers: clayborg, jasonmolenda. fjricci added subscribers: hans, sas, lldb-commits. This commit is intended only for the release_38 branch, not for master. Fixes xcodebuild for the release_38 branch, since llvm and clang must be on the same branch as lldb when building. http://reviews.llvm.org/D19608 Files: scripts/build-llvm.pl Index: scripts/build-llvm.pl === --- scripts/build-llvm.pl +++ scripts/build-llvm.pl @@ -22,10 +22,6 @@ our $llvm_configuration = $ENV{LLVM_CONFIGURATION}; -our $llvm_revision = "HEAD"; -our $clang_revision = "HEAD"; -our $compiler_rt_revision = "HEAD"; - our $SRCROOT = "$ENV{SRCROOT}"; our @archs = split (/\s+/, $ENV{ARCHS}); my $os_release = 11; @@ -64,12 +60,12 @@ } else { -print "Checking out llvm sources from revision $llvm_revision...\n"; -do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1); -print "Checking out clang sources from revision $clang_revision...\n"; -do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1); -#print "Checking out compiler-rt sources from revision $compiler_rt_revision...\n"; -#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet --revision $compiler_rt_revision http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt", "checking out compiler-rt from repository", 1); +print "Checking out llvm sources from release_38...\n"; +do_command ("cd '$SRCROOT' && svn co --quiet http://llvm.org/svn/llvm-project/llvm/branches/release_38 llvm", "checking out llvm from repository", 1); +print "Checking out clang sources from release_38...\n"; +do_command ("cd '$llvm_srcroot/tools' && svn co --quiet http://llvm.org/svn/llvm-project/cfe/branches/release_38 clang", "checking out clang from repository", 1); +#print "Checking out compiler-rt sources from release_38...\n"; +#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet http://llvm.org/svn/llvm-project/compiler-rt/branches/release_38 compiler-rt", "checking out compiler-rt from repository", 1); print "Applying any local patches to LLVM/Clang..."; my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff"); Index: scripts/build-llvm.pl === --- scripts/build-llvm.pl +++ scripts/build-llvm.pl @@ -22,10 +22,6 @@ our $llvm_configuration = $ENV{LLVM_CONFIGURATION}; -our $llvm_revision = "HEAD"; -our $clang_revision = "HEAD"; -our $compiler_rt_revision = "HEAD"; - our $SRCROOT = "$ENV{SRCROOT}"; our @archs = split (/\s+/, $ENV{ARCHS}); my $os_release = 11; @@ -64,12 +60,12 @@ } else { -print "Checking out llvm sources from revision $llvm_revision...\n"; -do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1); -print "Checking out clang sources from revision $clang_revision...\n"; -do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1); -#print "Checking out compiler-rt sources from revision $compiler_rt_revision...\n"; -#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet --revision $compiler_rt_revision http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt", "checking out compiler-rt from repository", 1); +print "Checking out llvm sources from release_38...\n"; +do_command ("cd '$SRCROOT' && svn co --quiet http://llvm.org/svn/llvm-project/llvm/branches/release_38 llvm", "checking out llvm from repository", 1); +print "Checking out clang sources from release_38...\n"; +do_command ("cd '$llvm_srcroot/tools' && svn co --quiet http://llvm.org/svn/llvm-project/cfe/branches/release_38 clang", "checking out clang from repository", 1); +#print "Checking out compiler-rt sources from release_38...\n"; +#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet http://llvm.org/svn/llvm-project/compiler-rt/branches/release_38 compiler-rt", "checking out compiler-rt from repository", 1); print "Applying any local patches to LLVM/Clang..."; my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff"); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r267768 - Added a testcase for the IR interpreter, ensuring that it behaves like the JIT.
Author: spyffe Date: Wed Apr 27 14:37:42 2016 New Revision: 267768 URL: http://llvm.org/viewvc/llvm-project?rev=267768&view=rev Log: Added a testcase for the IR interpreter, ensuring that it behaves like the JIT. Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile Wed Apr 27 14:37:42 2016 @@ -0,0 +1,7 @@ +LEVEL = ../../make + +default: a.out + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Wed Apr 27 14:37:42 2016 @@ -0,0 +1,70 @@ +""" +Test the IR interpreter +""" + +from __future__ import print_function + +import unittest2 + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class IRInterpreterTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +# Find the line number to break for main.c. +self.line = line_number('main.c', +'// Set breakpoint here') + +# Disable confirmation prompt to avoid infinite wait +self.runCmd("settings set auto-confirm true") +self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm")) + +def build_and_run(self): +"""Test the IR interpreter""" +self.build() + +self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + +lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False) + +self.runCmd("run", RUN_SUCCEEDED) + +@add_test_categories(['pyapi']) +def test_ir_interpreter(self): +self.build_and_run() + +options = lldb.SBExpressionOptions() +options.SetLanguage(lldb.eLanguageTypeC_plus_plus) + +set_up_expressions = ["int $i = 9", "int $j = 3", "int $k = 5"] + +expressions = ["$i + $j", + "$i - $j", + "$i * $j", + "$i / $j", + "$i % $k", + "$i << $j", + "$i & $j", + "$i | $j", + "$i ^ $j"] + +for expression in set_up_expressions: +self.frame().EvaluateExpression(expression, options) + +for expression in expressions: +interp_expression = expression +jit_expression = "(int)getpid(); " + expression + +interp_result = self.frame().EvaluateExpression(interp_expression, options).GetValueAsSigned() +jit_result = self.frame().EvaluateExpression(jit_expression, options).GetValueAsSigned() + +self.assertEqual(interp_result, jit_result, "While evaluating " + expression) + Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c Wed Apr 27 14:37:42 2016 @@ -0,0 +1,7 @@ +#include + +int main() +{ +printf("This is a dummy\n"); // Set breakpoint here +return 0; +} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
clayborg added a comment. "offset" here must be a file address, or a virtual address as the file's sections know it. So if you take "offset" and look it up in the sections for the COFF file, it should be a correct address. I don't know what "m_coff_header_opt.image_base" is, but as along as entry + image_base is the address that should be looked up in the section list, then this would be correct. http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
zturner added a comment. image base is the address that the process should be loaded to in memory. But this is only a hint anyway, and a process might end up being loaded at a different address. So now that I think about it, this is wrong no matter what because even if you did want a virtual address, you would have to figure out the actual load address at runtime since it might not load at the desired address. http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
clayborg added a comment. Let me clarify a few things. A "file address" is an address (lldb::addr_t) that gets translated into a section + offset address (lldb_private::Address which contains a lldb_private::Section + offset. Any addresses coming from ObjectFile parsers must be made into lldb_private::Address objects. As you load shared libraries and executables the dynamic loader plugins will tell the lldb_private::Target where all sections are loaded. So the slide is automatically applied to the section offset address. So you will make "m_entry_point_address" into something that says ".text + 0x123". If we ever want to use this address so set a breakpoint, we will resolve the lldb_private::Address into a "load address" (also a lldb::addr_t), but we will ask the target for foo.exe's ".text" load address, and we will get some slide address like 0x1234 and then the load address would be "0x1234 + 0x123", or 0x12340123. So each object file must encode their addresses correctly. Does that make more sense? http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19603: Fix entry point lookup for ObjectFilePECOFF.
clayborg added a comment. Example code to resolve this would be: Address entry_addr = objfile->GetEntryPointAddress(); lldb::addr_t entry_load_addr = entry_addr.GetLoadAddress(target); if (entry_load_addr != LLDB_INVALID_ADDRESS) { // We were able to resolve the address as the target has the section loaded } else { // The section is not loaded in the target yet. We might have a target that hasn't // been launched yet, the process might have exited, or the address might be // from a shared library that will get loaded later in the process' lifetime } http://reviews.llvm.org/D19603 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19626: XFail TestIRInterpreter on Windows
amccarth created this revision. amccarth added a reviewer: spyffe. amccarth added a subscriber: lldb-commits. Test relies on a POSIX-only function `getpid()`, so the expression on Windows gets an undefined symbol. If you substitute `_getpid()`, the interpreter complains that it uses an opcode it doesn't support. http://reviews.llvm.org/D19626 Files: packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Index: packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py === --- packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py +++ packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py @@ -38,6 +38,7 @@ self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) +@expectedFailureAll(oslist=['windows']) # depends on POSIX getpid (and ir-interpreter can run substitute _getpid) def test_ir_interpreter(self): self.build_and_run() Index: packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py === --- packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py +++ packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py @@ -38,6 +38,7 @@ self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) +@expectedFailureAll(oslist=['windows']) # depends on POSIX getpid (and ir-interpreter can run substitute _getpid) def test_ir_interpreter(self): self.build_and_run() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r267800 - XFail TestIRInterpreter on Windows
Author: amccarth Date: Wed Apr 27 16:53:19 2016 New Revision: 267800 URL: http://llvm.org/viewvc/llvm-project?rev=267800&view=rev Log: XFail TestIRInterpreter on Windows There's an open bug with calling functions in the inferior. And Windows doesn't have the POSIX function getpid(). Differential Revision: http://reviews.llvm.org/D19626 Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py?rev=267800&r1=267799&r2=267800&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Wed Apr 27 16:53:19 2016 @@ -38,6 +38,7 @@ class IRInterpreterTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) +@expectedFailureAll(oslist=['windows'], bugnumber="21765") # getpid() is POSIX, among other problems, see bug def test_ir_interpreter(self): self.build_and_run() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19626: XFail TestIRInterpreter on Windows
This revision was automatically updated to reflect the committed changes. Closed by commit rL267800: XFail TestIRInterpreter on Windows (authored by amccarth). Changed prior to commit: http://reviews.llvm.org/D19626?vs=55326&id=55333#toc Repository: rL LLVM http://reviews.llvm.org/D19626 Files: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py === --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py @@ -38,6 +38,7 @@ self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) +@expectedFailureAll(oslist=['windows'], bugnumber="21765") # getpid() is POSIX, among other problems, see bug def test_ir_interpreter(self): self.build_and_run() Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py === --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py @@ -38,6 +38,7 @@ self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) +@expectedFailureAll(oslist=['windows'], bugnumber="21765") # getpid() is POSIX, among other problems, see bug def test_ir_interpreter(self): self.build_and_run() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
fjricci created this revision. fjricci added reviewers: granata.enrico, zturner. fjricci added subscribers: sas, lldb-commits. This should make TestCommandScriptImmediateOutput more consistent with the rest of the test suite. http://reviews.llvm.org/D19633 Files: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py @@ -13,28 +13,25 @@ from lldbsuite.test.lldbpexpect import * from lldbsuite.test import lldbutil -class CommandScriptImmediateOutputTestCase (PExpectTest): +class CommandScriptImmediateOutputTestCase (TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(). -PExpectTest.setUp(self) +TestBase.setUp(self) @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output (self): """Test that LLDB correctly allows scripted commands to set an immediate output file.""" -self.launch(timeout=60) - script = os.path.join(os.getcwd(), 'custom_command.py') -prompt = "\(lldb\) " -self.sendline('command script import %s' % script, patterns=[prompt]) -self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt]) -self.sendline('mycommand', patterns='this is a test string, just a test string') -self.sendline('command script delete mycommand', patterns=[prompt]) +self.runCmd('command script import %s' % script) +self.runCmd('command script add -f custom_command.command_function mycommand') +self.expect('mycommand', substrs = ['this is a test string, just a test string']) +self.runCmd('command script delete mycommand') test_files = {os.path.join(os.getcwd(), 'read.txt'):'r', os.path.join(os.getcwd(), 'write.txt') :'w', @@ -50,15 +47,12 @@ with open(path, 'w+') as init: init.write(starter_string) -self.sendline('command script add -f custom_command.write_file mywrite', patterns=[prompt]) +self.runCmd('command script add -f custom_command.write_file mywrite') +self.runCmd('command script list') for path, mode in test_files.iteritems(): -command = 'mywrite "' + path + '" ' + mode - -self.sendline(command, patterns=[prompt]) - -self.sendline('command script delete mywrite', patterns=[prompt]) +self.runCmd('mywrite ' + path + ' ' + mode) -self.quit(gracefully=False) +self.runCmd('command script delete mywrite') for path, mode in test_files.iteritems(): with open(path, 'r') as result: Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py @@ -13,28 +13,25 @@ from lldbsuite.test.lldbpexpect import * from lldbsuite.test import lldbutil -class CommandScriptImmediateOutputTestCase (PExpectTest): +class CommandScriptImmediateOutputTestCase (TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(). -PExpectTest.setUp(self) +TestBase.setUp(self) @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output (self): """Test that LLDB correctly allows scripted commands to set an immediate output file.""" -self.launch(timeout=60) - script = os.path.join(os.getcwd(), 'custom_command.py') -prompt = "\(lldb\) " -self.sendline('command script import %s' % script, patterns=[prompt]) -self.sendline('command script add -f c
Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
You can probably remove the expected failure windows if this is no longer going to be a pexpect test. On Wed, Apr 27, 2016 at 3:14 PM Francis Ricci wrote: > fjricci created this revision. > fjricci added reviewers: granata.enrico, zturner. > fjricci added subscribers: sas, lldb-commits. > > This should make TestCommandScriptImmediateOutput more consistent > with the rest of the test suite. > > http://reviews.llvm.org/D19633 > > Files: > > packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py > > Index: > packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py > === > --- > packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py > +++ > packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py > @@ -13,28 +13,25 @@ > from lldbsuite.test.lldbpexpect import * > from lldbsuite.test import lldbutil > > -class CommandScriptImmediateOutputTestCase (PExpectTest): > +class CommandScriptImmediateOutputTestCase (TestBase): > > mydir = TestBase.compute_mydir(__file__) > > def setUp(self): > # Call super's setUp(). > -PExpectTest.setUp(self) > +TestBase.setUp(self) > > @skipIfRemote # test not remote-ready llvm.org/pr24813 > @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: > need a pexpect replacement for windows") > @expectedFailureAll(oslist=["freebsd","linux"], bugnumber=" > llvm.org/pr26139") > def test_command_script_immediate_output (self): > """Test that LLDB correctly allows scripted commands to set an > immediate output file.""" > -self.launch(timeout=60) > - > script = os.path.join(os.getcwd(), 'custom_command.py') > -prompt = "\(lldb\) " > > -self.sendline('command script import %s' % script, > patterns=[prompt]) > -self.sendline('command script add -f > custom_command.command_function mycommand', patterns=[prompt]) > -self.sendline('mycommand', patterns='this is a test string, just > a test string') > -self.sendline('command script delete mycommand', > patterns=[prompt]) > +self.runCmd('command script import %s' % script) > +self.runCmd('command script add -f > custom_command.command_function mycommand') > +self.expect('mycommand', substrs = ['this is a test string, just > a test string']) > +self.runCmd('command script delete mycommand') > > test_files = {os.path.join(os.getcwd(), 'read.txt'):'r', >os.path.join(os.getcwd(), 'write.txt') :'w', > @@ -50,15 +47,12 @@ > with open(path, 'w+') as init: > init.write(starter_string) > > -self.sendline('command script add -f custom_command.write_file > mywrite', patterns=[prompt]) > +self.runCmd('command script add -f custom_command.write_file > mywrite') > +self.runCmd('command script list') > for path, mode in test_files.iteritems(): > -command = 'mywrite "' + path + '" ' + mode > - > -self.sendline(command, patterns=[prompt]) > - > -self.sendline('command script delete mywrite', patterns=[prompt]) > +self.runCmd('mywrite ' + path + ' ' + mode) > > -self.quit(gracefully=False) > +self.runCmd('command script delete mywrite') > > for path, mode in test_files.iteritems(): > with open(path, 'r') as result: > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
fjricci updated this revision to Diff 55340. fjricci added a comment. Remove windows expected failure http://reviews.llvm.org/D19633 Files: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py @@ -13,28 +13,24 @@ from lldbsuite.test.lldbpexpect import * from lldbsuite.test import lldbutil -class CommandScriptImmediateOutputTestCase (PExpectTest): +class CommandScriptImmediateOutputTestCase (TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(). -PExpectTest.setUp(self) +TestBase.setUp(self) @skipIfRemote # test not remote-ready llvm.org/pr24813 -@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output (self): """Test that LLDB correctly allows scripted commands to set an immediate output file.""" -self.launch(timeout=60) - script = os.path.join(os.getcwd(), 'custom_command.py') -prompt = "\(lldb\) " -self.sendline('command script import %s' % script, patterns=[prompt]) -self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt]) -self.sendline('mycommand', patterns='this is a test string, just a test string') -self.sendline('command script delete mycommand', patterns=[prompt]) +self.runCmd('command script import %s' % script) +self.runCmd('command script add -f custom_command.command_function mycommand') +self.expect('mycommand', substrs = ['this is a test string, just a test string']) +self.runCmd('command script delete mycommand') test_files = {os.path.join(os.getcwd(), 'read.txt'):'r', os.path.join(os.getcwd(), 'write.txt') :'w', @@ -50,15 +46,12 @@ with open(path, 'w+') as init: init.write(starter_string) -self.sendline('command script add -f custom_command.write_file mywrite', patterns=[prompt]) +self.runCmd('command script add -f custom_command.write_file mywrite') +self.runCmd('command script list') for path, mode in test_files.iteritems(): -command = 'mywrite "' + path + '" ' + mode - -self.sendline(command, patterns=[prompt]) - -self.sendline('command script delete mywrite', patterns=[prompt]) +self.runCmd('mywrite ' + path + ' ' + mode) -self.quit(gracefully=False) +self.runCmd('command script delete mywrite') for path, mode in test_files.iteritems(): with open(path, 'r') as result: Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py === --- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py +++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py @@ -13,28 +13,24 @@ from lldbsuite.test.lldbpexpect import * from lldbsuite.test import lldbutil -class CommandScriptImmediateOutputTestCase (PExpectTest): +class CommandScriptImmediateOutputTestCase (TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(). -PExpectTest.setUp(self) +TestBase.setUp(self) @skipIfRemote # test not remote-ready llvm.org/pr24813 -@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output (self): """Test that LLDB correctly allows scripted commands to set an immediate output file.""" -self.launch(timeout=60) - script = os.path.join(os.getcwd(), 'custom_command.py') -prompt = "\(lldb\) " -self.sendline('command script import %s' % script, patterns=[prompt]) -self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt]) -self.sendline('mycommand', patterns='this is a test
Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
granata.enrico added a comment. Why are we trying to do this in the first place? The entire purpose of this test is to verify the immediate output to the console. If you want to test the output to a file instead, make a separate test case, that would be fine. But I'd rather much leave this test alone. http://reviews.llvm.org/D19633 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
fjricci added a comment. As of r264351, this test already writes to both the console and to files (since the file writing is testing the same python file io bugs tested by the console writing). I can make another patch to split it out if that's preferable. However, this patch is intended to move the test off of PExpect, because I noticed that sendline() has some issues when running with older versions of lldb (like 3.8, for example), regardless of whether we're testing files or the console. http://reviews.llvm.org/D19633 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase
granata.enrico added a comment. My personal preference would be to split up the test cases. I'd really like to keep testing the immediate output to console scenario since it is interesting for - e.g. - kernel debugging at Apple. http://reviews.llvm.org/D19633 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r267833 - Fixed a bug where const this would cause parser errors about $__lldb_expr.
Author: spyffe Date: Wed Apr 27 20:36:21 2016 New Revision: 267833 URL: http://llvm.org/viewvc/llvm-project?rev=267833&view=rev Log: Fixed a bug where const this would cause parser errors about $__lldb_expr. In templated const functions, trying to run an expression would produce the error error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo' member declaration does not match because it is const qualified error: 1 error parsing expression which is no good. It turned out we don't actually need to worry about "const," we just need to be consistent about the declaration of the expression and the FunctionDecl we inject into the class for "this." Also added a test case. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp Modified: lldb/trunk/source/Core/Scalar.cpp lldb/trunk/source/Expression/ExpressionSourceCode.cpp lldb/trunk/source/Expression/LLVMUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile?rev=267833&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile Wed Apr 27 20:36:21 2016 @@ -0,0 +1,8 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +CXXFLAGS += -std=c++11 +include $(LEVEL)/Makefile.rules + +cleanup: + rm -f Makefile *.d + Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py?rev=267833&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py Wed Apr 27 20:36:21 2016 @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")] ) Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp?rev=267833&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp Wed Apr 27 20:36:21 2016 @@ -0,0 +1,23 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include + +class foo { +public: + template T func(T x) const { +return x+2; //% self.expect("expr 2+3", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["5"]) + } +}; + +int i; + +int main() { + return foo().func(i); +} Modified: lldb/trunk/source/Core/Scalar.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=267833&r1=267832&r2=267833&view=diff == --- lldb/trunk/source/Core/Scalar.cpp (original) +++ lldb/trunk/source/Core/Scalar.cpp Wed Apr 27 20:36:21 2016 @@ -78,6 +78,74 @@ PromoteToMaxType return Scalar::e_void; } +llvm::APInt +Scalar::APIntWithTypeAndValue(Scalar::Type type, uint64_t raw_value) +{ +// APInt(unsigned numBits, uint64_t val, bool isSigned = false) +unsigned num_bits = 1; +bool is_signed = false; + +switch (type) +{ +case Scalar::e_void: +break; +case Scalar::e_sint: +is_signed = true; +num_bits = sizeof(sint_t) * 8; +break; +case Scalar::e_uint: +is_signed = false; +num_bits = sizeof(uint_t) * 8; +break; +case Scalar::e_slong: +is_signed = true; +num_bits = sizeof(slong_t) * 8; +break; +case Scalar::e_ulong: +is_signed = false; +num_bits = sizeof(ulong_t) * 8;
[Lldb-commits] [lldb] r267834 - Add the ability to limit "source regexp" breakpoints to a particular function
Author: jingham Date: Wed Apr 27 20:40:57 2016 New Revision: 267834 URL: http://llvm.org/viewvc/llvm-project?rev=267834&view=rev Log: Add the ability to limit "source regexp" breakpoints to a particular function within a source file. This isn't done, I need to make the name match smarter (right now it requires an exact match which is annoying for methods of a class in a namespace. Also, though we use it in tests all over the place, it doesn't look like we have a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch. Modified: lldb/trunk/include/lldb/API/SBStringList.h lldb/trunk/include/lldb/API/SBTarget.h lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/scripts/interface/SBTarget.i lldb/trunk/source/API/SBStringList.cpp lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/API/SBStringList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBStringList.h?rev=267834&r1=267833&r2=267834&view=diff == --- lldb/trunk/include/lldb/API/SBStringList.h (original) +++ lldb/trunk/include/lldb/API/SBStringList.h Wed Apr 27 20:40:57 2016 @@ -45,6 +45,9 @@ public: const char * GetStringAtIndex (size_t idx); +const char * +GetStringAtIndex (size_t idx) const; + void Clear (); Modified: lldb/trunk/include/lldb/API/SBTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=267834&r1=267833&r2=267834&view=diff == --- lldb/trunk/include/lldb/API/SBTarget.h (original) +++ lldb/trunk/include/lldb/API/SBTarget.h Wed Apr 27 20:40:57 2016 @@ -694,6 +694,12 @@ public: const SBFileSpecList &source_file); lldb::SBBreakpoint +BreakpointCreateBySourceRegex (const char *source_regex, + const SBFileSpecList &module_list, + const SBFileSpecList &source_file, + const SBStringList &func_names); + +lldb::SBBreakpoint BreakpointCreateForException (lldb::LanguageType language, bool catch_bp, bool throw_bp); Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h?rev=267834&r1=267833&r2=267834&view=diff == --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h Wed Apr 27 20:40:57 2016 @@ -12,9 +12,11 @@ // C Includes // C++ Includes +#include // Other libraries and framework includes // Project includes #include "lldb/Breakpoint/BreakpointResolver.h" +#include "lldb/Core/ConstString.h" namespace lldb_private { @@ -30,6 +32,7 @@ class BreakpointResolverFileRegex : public: BreakpointResolverFileRegex (Breakpoint *bkpt, RegularExpression ®ex, + const std::unordered_set &func_name_set, bool exact_match); ~BreakpointResolverFileRegex() override; @@ -48,6 +51,9 @@ public: void Dump (Stream *s) const override; + +void +AddFunctionName(const char *func_name); /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverFileRegex *) { return true; } @@ -61,7 +67,8 @@ public: protected: friend class Breakpoint; RegularExpression m_regex; // This is the line expression that we are looking for. -bool m_exact_match; +bool m_exact_match;// If true, then if the source we match is in a comment, we won't set a location there. +std::unordered_set m_function_names; // Limit the search to functions in the comp_unit passed in. private: DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex); Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=267834&r1=267833&r2=267834&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Wed Apr 27 20:40:57 2016 @@ -797,9 +797,11 @@ public: LazyBool move_to_nearest_code); // Use this to create breakpoint that matches regex against the source lines in fil
[Lldb-commits] [lldb] r267842 - Fix an inefficiency in the handling of $__lldb_local_vars in expressions.
Author: jingham Date: Wed Apr 27 21:17:02 2016 New Revision: 267842 URL: http://llvm.org/viewvc/llvm-project?rev=267842&view=rev Log: Fix an inefficiency in the handling of $__lldb_local_vars in expressions. The code in ClangExpressionDeclMap::FindExternalVisibleDecls figures out what the token means, and adds the namespace to the lookup context, but since it doesn't mark it as special in the search context, we go on to pass the name $__lldb_local_vars to the ASTSource for further lookup. Unless we've done our job wrong, those lookups will always fail, but the can be costly. So I added a bit to m_found & use that to short-circuit the lookup. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h?rev=267842&r1=267841&r2=267842&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h Wed Apr 27 21:17:02 2016 @@ -430,6 +430,7 @@ struct NameSearchContext { bool variable : 1; bool function_with_type_info: 1; bool function : 1; +bool local_vars_nsp : 1; } m_found; //-- Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=267842&r1=267841&r2=267842&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp Wed Apr 27 21:17:02 2016 @@ -866,7 +866,7 @@ ClangExpressionDeclMap::FindExternalVisi current_id); } -if (!context.m_found.variable) +if (!context.m_found.variable && !context.m_found.local_vars_nsp) ClangASTSource::FindExternalVisibleDecls(context); } @@ -1199,6 +1199,7 @@ ClangExpressionDeclMap::FindExternalVisi context.AddNamedDecl(namespace_decl); clang::DeclContext *clang_decl_ctx = clang::Decl::castToDeclContext(namespace_decl); clang_decl_ctx->setHasExternalVisibleStorage(true); +context.m_found.local_vars_nsp = true; } } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits