Re: [Lldb-commits] [PATCH] D16423: test suite: fix exception if --platform-name is specified that doesn't start with "remote-"
labath accepted this revision. This revision is now accepted and ready to land. Comment at: packages/Python/lldbsuite/test/dosep.py:1145 @@ -1144,1 +1144,3 @@ +else: +target = None I think this should be `target = platform_name`, so that you can still match the ios-simulator platform below (the point of the regex was to remove the "remote-" prefix, I believe), but I guess it doesn't really matter, as we are getting rid of the whole function anyway... http://reviews.llvm.org/D16423 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private
labath updated this revision to Diff 45667. labath added a comment. Let's try a different approach. This should disable the logic of LINK_LLVM_DYLIB for lldb binaries, and thereby enabling that build to work. It should be the safest thing in the short term, and we can figure out a better fix later. http://reviews.llvm.org/D16293 Files: cmake/modules/AddLLDB.cmake Index: cmake/modules/AddLLDB.cmake === --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -56,7 +56,7 @@ if (PARAM_OBJECT) add_library(${name} ${libkind} ${srcs}) else() -llvm_add_library(${name} ${libkind} ${srcs}) +llvm_add_library(${name} ${libkind} DISABLE_LLVM_LINK_LLVM_DYLIB ${srcs}) lldb_link_common_libs(${name} "${libkind}") @@ -93,7 +93,7 @@ endmacro(add_lldb_library) macro(add_lldb_executable name) - add_llvm_executable(${name} ${ARGN}) + add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) set_target_properties(${name} PROPERTIES FOLDER "lldb executables") endmacro(add_lldb_executable) Index: cmake/modules/AddLLDB.cmake === --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -56,7 +56,7 @@ if (PARAM_OBJECT) add_library(${name} ${libkind} ${srcs}) else() -llvm_add_library(${name} ${libkind} ${srcs}) +llvm_add_library(${name} ${libkind} DISABLE_LLVM_LINK_LLVM_DYLIB ${srcs}) lldb_link_common_libs(${name} "${libkind}") @@ -93,7 +93,7 @@ endmacro(add_lldb_library) macro(add_lldb_executable name) - add_llvm_executable(${name} ${ARGN}) + add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) set_target_properties(${name} PROPERTIES FOLDER "lldb executables") endmacro(add_lldb_executable) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258501 - Revert "Enable test log collection from remote debug servers"
Author: labath Date: Fri Jan 22 08:50:29 2016 New Revision: 258501 URL: http://llvm.org/viewvc/llvm-project?rev=258501&view=rev Log: Revert "Enable test log collection from remote debug servers" Unfortunately, this turns out not to be working on the lldb-server tests, as there the server is started in a different way. Since this was a bit of a hack to start with, I am removing it until I can solve the problem more holistically. Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258501&r1=258500&r2=258501&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Jan 22 08:50:29 2016 @@ -1345,7 +1345,7 @@ class Base(unittest2.TestCase): else: categories = "default" -if channel == "gdb-remote" and lldb.remote_platform is None: +if channel == "gdb-remote": # communicate gdb-remote categories to debugserver os.environ["LLDB_DEBUGSERVER_LOG_FLAGS"] = categories @@ -1354,15 +1354,12 @@ class Base(unittest2.TestCase): raise Exception('log enable failed (check LLDB_LOG_OPTION env variable)') # Communicate log path name to debugserver & lldb-server -# For remote debugging, these variables need to be set when starting the platform -# instance. -if lldb.remote_platform is None: -server_log_path = "{}-server.log".format(log_basename) -open(server_log_path, 'w').close() -os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path +server_log_path = "{}-server.log".format(log_basename) +open(server_log_path, 'w').close() +os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path -# Communicate channels to lldb-server -os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels) +# Communicate channels to lldb-server +os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels) if len(lldbtest_config.channels) == 0: return @@ -1376,15 +1373,6 @@ class Base(unittest2.TestCase): if not self.res.Succeeded(): raise Exception('log disable failed (check LLDB_LOG_OPTION env variable)') -# Retrieve the server log (if any) from the remote system. It is assumed the server log -# is writing to the "server.log" file in the current test directory. This can be -# achieved by setting LLDB_DEBUGSERVER_LOG_FILE="server.log" when starting remote -# platform. If the remote logging is not enabled, then just let the Get() command silently -# fail. -if lldb.remote_platform: -lldb.remote_platform.Get(lldb.SBFileSpec("server.log"), - lldb.SBFileSpec(self.getLogBasenameForCurrentTest()+"-server.log")) - def setUp(self): """Fixture for unittest test case setup. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16476: XFail TestNamespaceLookup on Windows.
amccarth created this revision. amccarth added a reviewer: zturner. amccarth added a subscriber: lldb-commits. https://llvm.org/bugs/show_bug.cgi?id=25819 http://reviews.llvm.org/D16476 Files: packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py Index: packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py === --- packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py +++ packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py @@ -35,6 +35,7 @@ @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_with_run_command(self): """Test scope lookup of functions in lldb.""" self.build() @@ -145,6 +146,7 @@ self.expect("expr -- func()", startstr = "(int) $0 = 2") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_before_using_with_run_command(self): """Test scope lookup before using in lldb.""" self.build() @@ -158,9 +160,10 @@ self.expect("expr -- func()", startstr = "(int) $0 = 1") # NOTE: this test may fail on older systems that don't emit import -# emtries in DWARF - may need to add checks for compiler versions here. +# entries in DWARF - may need to add checks for compiler versions here. @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_after_using_directive_lookup_with_run_command(self): """Test scope lookup after using directive in lldb.""" self.build() @@ -205,6 +208,7 @@ @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_shadowed_by_using_with_run_command(self): """Test scope lookup shadowed by using in lldb.""" self.build() Index: packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py === --- packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py +++ packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py @@ -35,6 +35,7 @@ @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_with_run_command(self): """Test scope lookup of functions in lldb.""" self.build() @@ -145,6 +146,7 @@ self.expect("expr -- func()", startstr = "(int) $0 = 2") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_before_using_with_run_command(self): """Test scope lookup before using in lldb.""" self.build() @@ -158,9 +160,10 @@ self.expect("expr -- func()", startstr = "(int) $0 = 1") # NOTE: this test may fail on older systems that don't emit import -# emtries in DWARF - may need to add checks for compiler versions here. +# entries in DWARF - may need to add checks for compiler versions here. @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_after_using_directive_lookup_with_run_command(self): """Test scope lookup after using directive in lldb.""" self.build() @@ -205,6 +208,7 @@ @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_shadowed_by_using_with_run_command(self): """Test scope lookup shadowed by using in lldb.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16477: Make all x86 target builds on MSVC use the amd64_x86 toolchain
zturner created this revision. zturner added a reviewer: gkistanova. zturner added a subscriber: lldb-commits. x86 builds of libclang.dll are failing with out of memory errors (Example: http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/14604). This patch is a global change against every MSVC build running on zorg to use the x64 -> x86 cross compilation toolchain when the target is x86, so that the linker will never run out of memory. This amd64_x86 toolchain was introduced in VS2013 so it's guaranteed to be present on all versions of MSVC that we support. http://reviews.llvm.org/D16477 Files: zorg/buildbot/builders/Util.py Index: zorg/buildbot/builders/Util.py === --- zorg/buildbot/builders/Util.py +++ zorg/buildbot/builders/Util.py @@ -1,7 +1,9 @@ import buildbot.status.results def getVisualStudioEnvironment(vs=r"""%VS120COMNTOOLS%""", target_arch=None): -arch_arg = {'x86': 'x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, '%PROCESSOR_ARCHITECTURE%') +# x86 builds should use the 64 bit -> x86 cross compilation toolchain to avoid +# out of memory linker errors +arch_arg = {'x86': 'amd64_x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, '%PROCESSOR_ARCHITECTURE%') vcvars_command = "\"" + "\\".join((vs, '..','..','VC', 'vcvarsall.bat')) + "\"" vcvars_command = "%s %s && set" % (vcvars_command, arch_arg) return vcvars_command Index: zorg/buildbot/builders/Util.py === --- zorg/buildbot/builders/Util.py +++ zorg/buildbot/builders/Util.py @@ -1,7 +1,9 @@ import buildbot.status.results def getVisualStudioEnvironment(vs=r"""%VS120COMNTOOLS%""", target_arch=None): -arch_arg = {'x86': 'x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, '%PROCESSOR_ARCHITECTURE%') +# x86 builds should use the 64 bit -> x86 cross compilation toolchain to avoid +# out of memory linker errors +arch_arg = {'x86': 'amd64_x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, '%PROCESSOR_ARCHITECTURE%') vcvars_command = "\"" + "\\".join((vs, '..','..','VC', 'vcvarsall.bat')) + "\"" vcvars_command = "%s %s && set" % (vcvars_command, arch_arg) return vcvars_command ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16423: test suite: fix exception if --platform-name is specified that doesn't start with "remote-"
tfiala added inline comments. Comment at: packages/Python/lldbsuite/test/dosep.py:1145 @@ -1144,1 +1144,3 @@ +else: +target = None labath wrote: > I think this should be `target = platform_name`, so that you can still match > the ios-simulator platform below (the point of the regex was to remove the > "remote-" prefix, I believe), but I guess it doesn't really matter, as we are > getting rid of the whole function anyway... Yep, I agree on both counts: 1. I'll change, 2. It won't matter if/when Ed has a look at this since I don't think we'll need to call out expected timeouts this way. I'll adjust and submit the adjustment after I test it. Thanks! http://reviews.llvm.org/D16423 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258542 - fixed test suite crash when --platform-name doesn't start with 'remote-'
Author: tfiala Date: Fri Jan 22 14:20:48 2016 New Revision: 258542 URL: http://llvm.org/viewvc/llvm-project?rev=258542&view=rev Log: fixed test suite crash when --platform-name doesn't start with 'remote-' Also removes Darwin test case files from the expectedTimeout hard-coded file list. See: http://reviews.llvm.org/D16423 Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=258542&r1=258541&r2=258542&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Fri Jan 22 14:20:48 2016 @@ -1135,12 +1135,17 @@ def walk_and_invoke(test_files, dotest_a def getExpectedTimeouts(platform_name): # returns a set of test filenames that might timeout # are we running against a remote target? -host = sys.platform + +# Figure out the target system for which we're collecting +# the set of expected timeout test filenames. if platform_name is None: target = sys.platform else: m = re.search(r'remote-(\w+)', platform_name) -target = m.group(1) +if m is not None: +target = m.group(1) +else: +target = platform_name expected_timeout = set() @@ -1151,13 +1156,6 @@ def getExpectedTimeouts(platform_name): "TestValueObjectRecursion.py", "TestWatchpointConditionAPI.py", } -elif target.startswith("darwin"): -expected_timeout |= { -# times out on MBP Retina, Mid 2012 -"TestThreadSpecificBreakpoint.py", -"TestExitDuringStep.py", -"TestIntegerTypesExpr.py", -} return expected_timeout ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258547 - Target: fix -Wcast-qual warning
Author: compnerd Date: Fri Jan 22 14:26:32 2016 New Revision: 258547 URL: http://llvm.org/viewvc/llvm-project?rev=258547&view=rev Log: Target: fix -Wcast-qual warning We were unnecessarily stripping the const qualifier on the temporary variable. Restore the constness to avoid the warning. NFC. Modified: lldb/trunk/source/Target/UnixSignals.cpp Modified: lldb/trunk/source/Target/UnixSignals.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/UnixSignals.cpp?rev=258547&r1=258546&r2=258547&view=diff == --- lldb/trunk/source/Target/UnixSignals.cpp (original) +++ lldb/trunk/source/Target/UnixSignals.cpp Fri Jan 22 14:26:32 2016 @@ -180,7 +180,7 @@ UnixSignals::GetShortName(ConstString na { if (name) { - char* signame = (char*)(name.AsCString()); + const char* signame = name.AsCString(); return ConstString(signame + 3); // Remove "SIG" from name } return name; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258546 - Silence -Wreturn-type warnings
Author: compnerd Date: Fri Jan 22 14:26:30 2016 New Revision: 258546 URL: http://llvm.org/viewvc/llvm-project?rev=258546&view=rev Log: Silence -Wreturn-type warnings Address a couple of instances of -Wreturn-type warning from GCC. The switches are covered, add an llvm_unreachable to the end of the functions to silence the warning. NFC. Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionSourceCode.cpp?rev=258546&r1=258545&r2=258546&view=diff == --- lldb/trunk/source/Expression/ExpressionSourceCode.cpp (original) +++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp Fri Jan 22 14:26:30 2016 @@ -119,6 +119,7 @@ public: default: return false; } +llvm_unreachable("unhandled state"); } private: Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=258546&r1=258545&r2=258546&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Fri Jan 22 14:26:30 2016 @@ -1501,6 +1501,7 @@ Process::IsAlive () default: return false; } +llvm_unreachable("unhandled state"); } // This static callback can be used to watch for local child processes on ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258548 - Commands: silence dumb -Wextra warning from GCC
Author: compnerd Date: Fri Jan 22 14:26:34 2016 New Revision: 258548 URL: http://llvm.org/viewvc/llvm-project?rev=258548&view=rev Log: Commands: silence dumb -Wextra warning from GCC This is a rather unhelpful warning indicating that the ternary operator return types are mismatched, returning an integer and an enumeral type. Since the integeral type is shorter to type, cast the enumeral type to `int`. Silences the -Wextra warning from GCC. Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=258548&r1=258547&r2=258548&view=diff == --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Fri Jan 22 14:26:34 2016 @@ -4083,11 +4083,11 @@ public: case eLookupTypeAddress: if (m_options.m_addr != LLDB_INVALID_ADDRESS) { -if (LookupAddressInModule (m_interpreter, - result.GetOutputStream(), - module, - eSymbolContextEverything | (m_options.m_verbose ? eSymbolContextVariable : 0), - m_options.m_addr, +if (LookupAddressInModule (m_interpreter, + result.GetOutputStream(), + module, + eSymbolContextEverything | (m_options.m_verbose ? static_cast(eSymbolContextVariable) : 0), + m_options.m_addr, m_options.m_offset, m_options.m_verbose)) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16423: test suite: fix exception if --platform-name is specified that doesn't start with "remote-"
tfiala closed this revision. tfiala added a comment. Closed by svn commit r258542. http://reviews.llvm.org/D16423 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258565 - added test fixture to EditlineTest gtest
Author: tfiala Date: Fri Jan 22 15:58:55 2016 New Revision: 258565 URL: http://llvm.org/viewvc/llvm-project?rev=258565&view=rev Log: added test fixture to EditlineTest gtest Primarily a trial test for me to try out the git clang-format integration. Works like a charm! This change adds a gtest fixture for the EditlineTest common setup and teardown code. Modified: lldb/trunk/unittests/Editline/EditlineTest.cpp Modified: lldb/trunk/unittests/Editline/EditlineTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Editline/EditlineTest.cpp?rev=258565&r1=258564&r2=258565&view=diff == --- lldb/trunk/unittests/Editline/EditlineTest.cpp (original) +++ lldb/trunk/unittests/Editline/EditlineTest.cpp Fri Jan 22 15:58:55 2016 @@ -1,4 +1,4 @@ -//===-- EditlineTest.cpp -*- C++ -*-===// +//===-- EditlineTest.cpp *- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -293,49 +293,55 @@ EditlineAdapter::ConsumeAllOutput () } } -TEST (EditlineTest, EditlineReceivesSingleLineText) +class EditlineTestFixture : public ::testing::Test { -setenv ("TERM", "vt100", 1); +private: +EditlineAdapter _el_adapter; +std::shared_ptr _sp_output_thread; -// Create an editline. -EditlineAdapter el_adapter; -EXPECT_TRUE (el_adapter.IsValid ()); -if (!el_adapter.IsValid ()) -return; +public: +void SetUp() +{ +// We need a TERM set properly for editline to work as expected. +setenv("TERM", "vt100", 1); + +// Validate the editline adapter. +EXPECT_TRUE(_el_adapter.IsValid()); +if (!_el_adapter.IsValid()) +return; + +// Dump output. +_sp_output_thread.reset(new std::thread([&] { _el_adapter.ConsumeAllOutput(); })); +} + +void TearDown() +{ +_el_adapter.CloseInput(); +if (_sp_output_thread) +_sp_output_thread->join(); +} -// Dump output. -std::thread el_output_thread( [&] { el_adapter.ConsumeAllOutput (); }); +EditlineAdapter &GetEditlineAdapter() { return _el_adapter; } +}; +TEST_F(EditlineTestFixture, EditlineReceivesSingleLineText) +{ // Send it some text via our virtual keyboard. const std::string input_text ("Hello, world"); -EXPECT_TRUE (el_adapter.SendLine (input_text)); +EXPECT_TRUE(GetEditlineAdapter().SendLine(input_text)); // Verify editline sees what we put in. std::string el_reported_line; bool input_interrupted = false; -const bool received_line = el_adapter.GetLine (el_reported_line, input_interrupted, TIMEOUT_MILLIS); +const bool received_line = GetEditlineAdapter().GetLine(el_reported_line, input_interrupted, TIMEOUT_MILLIS); EXPECT_TRUE (received_line); EXPECT_FALSE (input_interrupted); EXPECT_EQ (input_text, el_reported_line); - -el_adapter.CloseInput(); -el_output_thread.join(); } -TEST (EditlineTest, EditlineReceivesMultiLineText) +TEST_F(EditlineTestFixture, EditlineReceivesMultiLineText) { -setenv ("TERM", "vt100", 1); - -// Create an editline. -EditlineAdapter el_adapter; -EXPECT_TRUE (el_adapter.IsValid ()); -if (!el_adapter.IsValid ()) -return; - -// Stick editline output/error dumpers on separate threads. -std::thread el_output_thread( [&] { el_adapter.ConsumeAllOutput (); }); - // Send it some text via our virtual keyboard. std::vector input_lines; input_lines.push_back ("int foo()"); @@ -344,13 +350,13 @@ TEST (EditlineTest, EditlineReceivesMult input_lines.push_back ("}"); input_lines.push_back (""); -EXPECT_TRUE (el_adapter.SendLines (input_lines)); +EXPECT_TRUE(GetEditlineAdapter().SendLines(input_lines)); // Verify editline sees what we put in. lldb_private::StringList el_reported_lines; bool input_interrupted = false; -EXPECT_TRUE (el_adapter.GetLines (el_reported_lines, input_interrupted, TIMEOUT_MILLIS)); +EXPECT_TRUE(GetEditlineAdapter().GetLines(el_reported_lines, input_interrupted, TIMEOUT_MILLIS)); EXPECT_FALSE (input_interrupted); // Without any auto indentation support, our output should directly match our input. @@ -360,9 +366,6 @@ TEST (EditlineTest, EditlineReceivesMult for (auto i = 0; i < input_lines.size(); ++i) EXPECT_EQ (input_lines[i], el_reported_lines[i]); } - -el_adapter.CloseInput(); -el_output_thread.join(); } #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258578 - XFail a test from TestConditionalBreak.py on Windows.
Author: amccarth Date: Fri Jan 22 17:05:47 2016 New Revision: 258578 URL: http://llvm.org/viewvc/llvm-project?rev=258578&view=rev Log: XFail a test from TestConditionalBreak.py on Windows. Filed a bug to investigate later: llvm.org/pr26265 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py?rev=258578&r1=258577&r2=258578&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py Fri Jan 22 17:05:47 2016 @@ -32,6 +32,7 @@ class ConditionalBreakTestCase(TestBase) self.build() self.simulate_conditional_break_by_user() +@expectedFailureWindows("llvm.org/pr26265") # args in frames other than #0 are not evaluated correctly def do_conditional_break(self): """Exercise some thread and frame APIs to break if c() is called by a().""" exe = os.path.join(os.getcwd(), "a.out") @@ -83,8 +84,8 @@ class ConditionalBreakTestCase(TestBase) # And the local variable 'val' should have a value of (int) 3. val = frame1.FindVariable("val") -self.assertTrue(val.GetTypeName() == "int", "'val' has int type") -self.assertTrue(val.GetValue() == "3", "'val' has a value of 3") +self.assertEqual("int", val.GetTypeName()) +self.assertEqual("3", val.GetValue()) break process.Continue() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258577 - XFail TestNamespaceLookup tests on Windows.
Author: amccarth Date: Fri Jan 22 17:05:29 2016 New Revision: 258577 URL: http://llvm.org/viewvc/llvm-project?rev=258577&view=rev Log: XFail TestNamespaceLookup tests on Windows. There's already a pr: https://llvm.org/bugs/show_bug.cgi?id=25819 Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py?rev=258577&r1=258576&r2=258577&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py Fri Jan 22 17:05:29 2016 @@ -35,6 +35,7 @@ class NamespaceLookupTestCase(TestBase): @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_with_run_command(self): """Test scope lookup of functions in lldb.""" self.build() @@ -145,6 +146,7 @@ class NamespaceLookupTestCase(TestBase): self.expect("expr -- func()", startstr = "(int) $0 = 2") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_before_using_with_run_command(self): """Test scope lookup before using in lldb.""" self.build() @@ -158,9 +160,10 @@ class NamespaceLookupTestCase(TestBase): self.expect("expr -- func()", startstr = "(int) $0 = 1") # NOTE: this test may fail on older systems that don't emit import -# emtries in DWARF - may need to add checks for compiler versions here. +# entries in DWARF - may need to add checks for compiler versions here. @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_after_using_directive_lookup_with_run_command(self): """Test scope lookup after using directive in lldb.""" self.build() @@ -205,6 +208,7 @@ class NamespaceLookupTestCase(TestBase): @expectedFailureFreeBSD("llvm.org/pr25819") @expectedFailureLinux("llvm.org/pr25819") +@expectedFailureWindows("llvm.org/pr25819") def test_scope_lookup_shadowed_by_using_with_run_command(self): """Test scope lookup shadowed by using in lldb.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258584 - Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field
Author: enrico Date: Fri Jan 22 17:50:46 2016 New Revision: 258584 URL: http://llvm.org/viewvc/llvm-project?rev=258584&view=rev Log: Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field Modified: lldb/trunk/include/lldb/Utility/ProcessStructReader.h Modified: lldb/trunk/include/lldb/Utility/ProcessStructReader.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/ProcessStructReader.h?rev=258584&r1=258583&r2=258584&view=diff == --- lldb/trunk/include/lldb/Utility/ProcessStructReader.h (original) +++ lldb/trunk/include/lldb/Utility/ProcessStructReader.h Fri Jan 22 17:50:46 2016 @@ -94,6 +94,15 @@ namespace lldb_private { return fail_value; return (RetType)(m_data.GetMaxU64(&offset, size)); } + +size_t +GetOffsetOf(ConstString name, size_t fail_value = SIZE_MAX) +{ +auto iter = m_fields.find(name), end = m_fields.end(); +if (iter == end) +return fail_value; +return iter->second.offset; +} }; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258585 - candidate fix for Green Dragon lldb testbot
Author: tfiala Date: Fri Jan 22 17:50:57 2016 New Revision: 258585 URL: http://llvm.org/viewvc/llvm-project?rev=258585&view=rev Log: candidate fix for Green Dragon lldb testbot The python test run target started failing recently. I tracked it down to what looks like the passing of environment variables into the python script. This locally fixes the vast majority of errors that were ultimately inferior test build command failures. Not sure what caused that to start happening. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=258585&r1=258584&r2=258585&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Jan 22 17:50:57 2016 @@ -5919,7 +5919,7 @@ dependencies = ( ); name = "lldb-python-test-suite"; - passBuildSettingsInEnvironment = 1; + passBuildSettingsInEnvironment = 0; productName = "LLDB Python Test Suite"; }; 2687EAC51508110B00DD8C2E /* install-headers */ = { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258586 - More fixes related to counting threads on Windows.
Author: zturner Date: Fri Jan 22 17:54:41 2016 New Revision: 258586 URL: http://llvm.org/viewvc/llvm-project?rev=258586&view=rev Log: More fixes related to counting threads on Windows. The Windows 10 loader spawns threads at startup, so tests which count threads or assume that a given user thread will be at a specific index are incorrect in this case. The fix here is to use the standard mechanisms for getting the stopped thread (which is all we are really interested in anyway) and correlating them with the breakpoints that were set, and doing checks against those things. This fixes about 6 tests on Windows 10. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py?rev=258586&r1=258585&r2=258586&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py Fri Jan 22 17:54:41 2016 @@ -18,14 +18,12 @@ class ExitDuringStepTestCase(TestBase): @expectedFailureDarwin("llvm.org/pr15824") # thread states not properly maintained @expectedFailureFreeBSD("llvm.org/pr18190") # thread states not properly maintained @expectedFailureLinux("llvm.org/pr15824") # thread states not properly maintained -@expectedFailureWindows("llvm.org/pr24681") def test_thread_state_is_stopped(self): """Test thread exit during step handling.""" self.build(dictionary=self.getBuildFlags()) self.exit_during_step_base("thread step-in -m all-threads", 'stop reason = step in', True) @skipIfFreeBSD # llvm.org/pr21411: test is hanging -@expectedFailureWindows("llvm.org/pr24681") @expectedFlakeyAndroid("llvm.org/pr26206") def test(self): """Test thread exit during step handling.""" @@ -33,7 +31,6 @@ class ExitDuringStepTestCase(TestBase): self.exit_during_step_base("thread step-inst -m all-threads", 'stop reason = instruction step', False) @skipIfFreeBSD # llvm.org/pr21411: test is hanging -@expectedFailureWindows("llvm.org/pr24681") @expectedFlakeyAndroid("llvm.org/pr26206") def test_step_over(self): """Test thread exit during step-over handling.""" @@ -41,7 +38,6 @@ class ExitDuringStepTestCase(TestBase): self.exit_during_step_base("thread step-over -m all-threads", 'stop reason = step over', False) @skipIfFreeBSD # llvm.org/pr21411: test is hanging -@expectedFailureWindows("llvm.org/pr24681") @expectedFlakeyAndroid("llvm.org/pr26206") def test_step_in(self): """Test thread exit during step-in handling.""" @@ -79,37 +75,16 @@ class ExitDuringStepTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() -# Get the number of threads num_threads = process.GetNumThreads() - # Make sure we see all three threads -self.assertTrue(num_threads == 3, 'Number of expected threads and actual threads do not match.') +self.assertGreaterEqual(num_threads, 3, 'Number of expected threads and actual threads do not match.') -# Get the thread objects -thread1 = process.GetThreadAtIndex(0) -thread2 = process.GetThreadAtIndex(1) -thread3 = process.GetThreadAtIndex(2) - -# Make sure all threads are stopped -if test_thread_state: -self.assertTrue(thread1.IsStopped(), "Thread 1 didn't stop during breakpoint") -self.assertTrue(thread2.IsStopped(), "Thread 2 didn't stop during breakpoint") -self.assertTrue(thread3.IsStopped(), "Thread 3 didn't stop during breakpoint") -return - -# Find the thread that is stopped at the breakpoint -stepping_thread = None -for thread in process: -expected_bp_desc = "breakpoint %s." % self.bp_num -stop_desc = thread.GetStopDescription(100) -if stop_desc and (expected_bp_desc in stop_desc): -stepping_thread = thread -break -self.assertTrue(stepping_thread != None, "unable to find thread stopped at %s" % expected_bp_desc) +stepping_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, self.bp_num) +self.assertIsNotNone(stepping_thread, "Could not find a thread stopped at the breakpoint") current_line = self.breakpoint
[Lldb-commits] [lldb] r258587 - Un xfail TestSettings.test_run_args_and_env_vars_with_dwarf
Author: zturner Date: Fri Jan 22 17:54:45 2016 New Revision: 258587 URL: http://llvm.org/viewvc/llvm-project?rev=258587&view=rev Log: Un xfail TestSettings.test_run_args_and_env_vars_with_dwarf Modified: lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py Modified: lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py?rev=258587&r1=258586&r2=258587&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py Fri Jan 22 17:54:45 2016 @@ -208,7 +208,6 @@ class SettingsCommandTestCase(TestBase): self.expect("disassemble -n numberfn", substrs = ["5ah"]) -@expectedFailureWindows("llvm.org/pr24579") def test_run_args_and_env_vars(self): """Test that run-args and env-vars are passed to the launched process.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258588 - Decode files with UTF-8 in lldbutil.line_number.
Author: zturner Date: Fri Jan 22 17:54:49 2016 New Revision: 258588 URL: http://llvm.org/viewvc/llvm-project?rev=258588&view=rev Log: Decode files with UTF-8 in lldbutil.line_number. Since Unicode support is different in Py2 and Py3, Py3 was throwing exceptions about being unable to decode the file with the default encoding. Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258588&r1=258587&r2=258588&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Jan 22 17:54:49 2016 @@ -41,6 +41,7 @@ from distutils.version import LooseVersi import gc import glob import inspect +import io import os, sys, traceback import os.path import re @@ -201,7 +202,7 @@ def EnvArray(): def line_number(filename, string_to_match): """Helper function to return the line number of the first matched string.""" -with open(filename, 'r') as f: +with io.open(filename, mode='r', encoding="utf-8") as f: for i, line in enumerate(f): if line.find(string_to_match) != -1: # Found our match. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r258586 - More fixes related to counting threads on Windows.
Would you mind adding a comment telling people how to do this correctly to the "Writing test cases" section of the README-testsuite? Jim > On Jan 22, 2016, at 3:54 PM, Zachary Turner via lldb-commits > wrote: > > Author: zturner > Date: Fri Jan 22 17:54:41 2016 > New Revision: 258586 > > URL: http://llvm.org/viewvc/llvm-project?rev=258586&view=rev > Log: > More fixes related to counting threads on Windows. > > The Windows 10 loader spawns threads at startup, so > tests which count threads or assume that a given user > thread will be at a specific index are incorrect in > this case. The fix here is to use the standard mechanisms > for getting the stopped thread (which is all we are > really interested in anyway) and correlating them with > the breakpoints that were set, and doing checks against > those things. > > This fixes about 6 tests on Windows 10. > > Modified: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py >lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py?rev=258586&r1=258585&r2=258586&view=diff > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > (original) > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > Fri Jan 22 17:54:41 2016 > @@ -18,14 +18,12 @@ class ExitDuringStepTestCase(TestBase): > @expectedFailureDarwin("llvm.org/pr15824") # thread states not properly > maintained > @expectedFailureFreeBSD("llvm.org/pr18190") # thread states not properly > maintained > @expectedFailureLinux("llvm.org/pr15824") # thread states not properly > maintained > -@expectedFailureWindows("llvm.org/pr24681") > def test_thread_state_is_stopped(self): > """Test thread exit during step handling.""" > self.build(dictionary=self.getBuildFlags()) > self.exit_during_step_base("thread step-in -m all-threads", 'stop > reason = step in', True) > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > -@expectedFailureWindows("llvm.org/pr24681") > @expectedFlakeyAndroid("llvm.org/pr26206") > def test(self): > """Test thread exit during step handling.""" > @@ -33,7 +31,6 @@ class ExitDuringStepTestCase(TestBase): > self.exit_during_step_base("thread step-inst -m all-threads", 'stop > reason = instruction step', False) > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > -@expectedFailureWindows("llvm.org/pr24681") > @expectedFlakeyAndroid("llvm.org/pr26206") > def test_step_over(self): > """Test thread exit during step-over handling.""" > @@ -41,7 +38,6 @@ class ExitDuringStepTestCase(TestBase): > self.exit_during_step_base("thread step-over -m all-threads", 'stop > reason = step over', False) > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > -@expectedFailureWindows("llvm.org/pr24681") > @expectedFlakeyAndroid("llvm.org/pr26206") > def test_step_in(self): > """Test thread exit during step-in handling.""" > @@ -79,37 +75,16 @@ class ExitDuringStepTestCase(TestBase): > target = self.dbg.GetSelectedTarget() > process = target.GetProcess() > > -# Get the number of threads > num_threads = process.GetNumThreads() > - > # Make sure we see all three threads > -self.assertTrue(num_threads == 3, 'Number of expected threads and > actual threads do not match.') > +self.assertGreaterEqual(num_threads, 3, 'Number of expected threads > and actual threads do not match.') > > -# Get the thread objects > -thread1 = process.GetThreadAtIndex(0) > -thread2 = process.GetThreadAtIndex(1) > -thread3 = process.GetThreadAtIndex(2) > - > -# Make sure all threads are stopped > -if test_thread_state: > -self.assertTrue(thread1.IsStopped(), "Thread 1 didn't stop > during breakpoint") > -self.assertTrue(thread2.IsStopped(), "Thread 2 didn't stop > during breakpoint") > -self.assertTrue(thread3.IsStopped(), "Thread 3 didn't stop > during breakpoint") > -return > - > -# Find the thread that is stopped at the breakpoint > -stepping_thread = None > -for thread in process: > -expected_bp_desc = "breakpoint %s." % self.bp_num > -stop_desc = thread.GetStopDescription(100) > -if stop_desc and (expected_bp_desc in stop_desc): > -
Re: [Lldb-commits] [lldb] r258586 - More fixes related to counting threads on Windows.
Yea, that's a good idea. Thanks for the suggestion On Fri, Jan 22, 2016 at 4:05 PM Jim Ingham wrote: > Would you mind adding a comment telling people how to do this correctly to > the "Writing test cases" section of the README-testsuite? > > Jim > > > On Jan 22, 2016, at 3:54 PM, Zachary Turner via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > > > Author: zturner > > Date: Fri Jan 22 17:54:41 2016 > > New Revision: 258586 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=258586&view=rev > > Log: > > More fixes related to counting threads on Windows. > > > > The Windows 10 loader spawns threads at startup, so > > tests which count threads or assume that a given user > > thread will be at a specific index are incorrect in > > this case. The fix here is to use the standard mechanisms > > for getting the stopped thread (which is all we are > > really interested in anyway) and correlating them with > > the breakpoints that were set, and doing checks against > > those things. > > > > This fixes about 6 tests on Windows 10. > > > > Modified: > > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py > >lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py > > > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py?rev=258586&r1=258585&r2=258586&view=diff > > > == > > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > (original) > > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > Fri Jan 22 17:54:41 2016 > > @@ -18,14 +18,12 @@ class ExitDuringStepTestCase(TestBase): > > @expectedFailureDarwin("llvm.org/pr15824") # thread states not > properly maintained > > @expectedFailureFreeBSD("llvm.org/pr18190") # thread states not > properly maintained > > @expectedFailureLinux("llvm.org/pr15824") # thread states not > properly maintained > > -@expectedFailureWindows("llvm.org/pr24681") > > def test_thread_state_is_stopped(self): > > """Test thread exit during step handling.""" > > self.build(dictionary=self.getBuildFlags()) > > self.exit_during_step_base("thread step-in -m all-threads", > 'stop reason = step in', True) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test(self): > > """Test thread exit during step handling.""" > > @@ -33,7 +31,6 @@ class ExitDuringStepTestCase(TestBase): > > self.exit_during_step_base("thread step-inst -m all-threads", > 'stop reason = instruction step', False) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test_step_over(self): > > """Test thread exit during step-over handling.""" > > @@ -41,7 +38,6 @@ class ExitDuringStepTestCase(TestBase): > > self.exit_during_step_base("thread step-over -m all-threads", > 'stop reason = step over', False) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test_step_in(self): > > """Test thread exit during step-in handling.""" > > @@ -79,37 +75,16 @@ class ExitDuringStepTestCase(TestBase): > > target = self.dbg.GetSelectedTarget() > > process = target.GetProcess() > > > > -# Get the number of threads > > num_threads = process.GetNumThreads() > > - > > # Make sure we see all three threads > > -self.assertTrue(num_threads == 3, 'Number of expected threads > and actual threads do not match.') > > +self.assertGreaterEqual(num_threads, 3, 'Number of expected > threads and actual threads do not match.') > > > > -# Get the thread objects > > -thread1 = process.GetThreadAtIndex(0) > > -thread2 = process.GetThreadAtIndex(1) > > -thread3 = process.GetThreadAtIndex(2) > > - > > -# Make sure all threads are stopped > > -if test_thread_state: > > -self.assertTrue(thread1.IsStopped(), "Thread 1 didn't stop > during breakpoint") > > -self.assertTrue(thread2.IsStopped(), "Thread 2 didn't stop > during breakpoint") > > -self.assertTrue(thread3.IsStopped(), "Thread 3 didn't stop > during breakpoint") > > -return > > - > > -# Find the thread that is stopped at the breakp
Re: [Lldb-commits] [lldb] r258586 - More fixes related to counting threads on Windows.
By the way, I'm reminded of a discussion we had on an old bug report where we said that an even better way to do this would be to name threads from inside the debugger and have the test fetch threads with specific names. That's probably still a better way to do this (especially when multiple threads are involved as opposed to just the main thread) On Fri, Jan 22, 2016 at 4:10 PM Zachary Turner wrote: > Yea, that's a good idea. Thanks for the suggestion > > On Fri, Jan 22, 2016 at 4:05 PM Jim Ingham wrote: > >> Would you mind adding a comment telling people how to do this correctly >> to the "Writing test cases" section of the README-testsuite? >> >> Jim >> >> > On Jan 22, 2016, at 3:54 PM, Zachary Turner via lldb-commits < >> lldb-commits@lists.llvm.org> wrote: >> > >> > Author: zturner >> > Date: Fri Jan 22 17:54:41 2016 >> > New Revision: 258586 >> > >> > URL: http://llvm.org/viewvc/llvm-project?rev=258586&view=rev >> > Log: >> > More fixes related to counting threads on Windows. >> > >> > The Windows 10 loader spawns threads at startup, so >> > tests which count threads or assume that a given user >> > thread will be at a specific index are incorrect in >> > this case. The fix here is to use the standard mechanisms >> > for getting the stopped thread (which is all we are >> > really interested in anyway) and correlating them with >> > the breakpoints that were set, and doing checks against >> > those things. >> > >> > This fixes about 6 tests on Windows 10. >> > >> > Modified: >> > >> lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py >> > >> lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py >> >lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py >> > >> > Modified: >> lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py >> > URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py?rev=258586&r1=258585&r2=258586&view=diff >> > >> == >> > --- >> lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py >> (original) >> > +++ >> lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py >> Fri Jan 22 17:54:41 2016 >> > @@ -18,14 +18,12 @@ class ExitDuringStepTestCase(TestBase): >> > @expectedFailureDarwin("llvm.org/pr15824") # thread states not >> properly maintained >> > @expectedFailureFreeBSD("llvm.org/pr18190") # thread states not >> properly maintained >> > @expectedFailureLinux("llvm.org/pr15824") # thread states not >> properly maintained >> > -@expectedFailureWindows("llvm.org/pr24681") >> > def test_thread_state_is_stopped(self): >> > """Test thread exit during step handling.""" >> > self.build(dictionary=self.getBuildFlags()) >> > self.exit_during_step_base("thread step-in -m all-threads", >> 'stop reason = step in', True) >> > >> > @skipIfFreeBSD # llvm.org/pr21411: test is hanging >> > -@expectedFailureWindows("llvm.org/pr24681") >> > @expectedFlakeyAndroid("llvm.org/pr26206") >> > def test(self): >> > """Test thread exit during step handling.""" >> > @@ -33,7 +31,6 @@ class ExitDuringStepTestCase(TestBase): >> > self.exit_during_step_base("thread step-inst -m all-threads", >> 'stop reason = instruction step', False) >> > >> > @skipIfFreeBSD # llvm.org/pr21411: test is hanging >> > -@expectedFailureWindows("llvm.org/pr24681") >> > @expectedFlakeyAndroid("llvm.org/pr26206") >> > def test_step_over(self): >> > """Test thread exit during step-over handling.""" >> > @@ -41,7 +38,6 @@ class ExitDuringStepTestCase(TestBase): >> > self.exit_during_step_base("thread step-over -m all-threads", >> 'stop reason = step over', False) >> > >> > @skipIfFreeBSD # llvm.org/pr21411: test is hanging >> > -@expectedFailureWindows("llvm.org/pr24681") >> > @expectedFlakeyAndroid("llvm.org/pr26206") >> > def test_step_in(self): >> > """Test thread exit during step-in handling.""" >> > @@ -79,37 +75,16 @@ class ExitDuringStepTestCase(TestBase): >> > target = self.dbg.GetSelectedTarget() >> > process = target.GetProcess() >> > >> > -# Get the number of threads >> > num_threads = process.GetNumThreads() >> > - >> > # Make sure we see all three threads >> > -self.assertTrue(num_threads == 3, 'Number of expected threads >> and actual threads do not match.') >> > +self.assertGreaterEqual(num_threads, 3, 'Number of expected >> threads and actual threads do not match.') >> > >> > -# Get the thread objects >> > -thread1 = process.GetThreadAtIndex(0) >> > -thread2 = process.GetThreadAtIndex(1) >> > -
Re: [Lldb-commits] [lldb] r258586 - More fixes related to counting threads on Windows.
That would be fine as an additional test. There isn't an SBThread::SetName, but that would be trivial to add. Also, if we are going to rely on this, we should improve how SetName is done. Right now the default implementation does nothing, so it relies on the particular implementation to set the name. But Thread has an m_thread_name variable, so regardless of whether the plugin Thread implementation can actually set the name, the base class should update that variable. Jim > On Jan 22, 2016, at 4:13 PM, Zachary Turner wrote: > > By the way, I'm reminded of a discussion we had on an old bug report where we > said that an even better way to do this would be to name threads from inside > the debugger and have the test fetch threads with specific names. That's > probably still a better way to do this (especially when multiple threads are > involved as opposed to just the main thread) > > On Fri, Jan 22, 2016 at 4:10 PM Zachary Turner wrote: > Yea, that's a good idea. Thanks for the suggestion > > On Fri, Jan 22, 2016 at 4:05 PM Jim Ingham wrote: > Would you mind adding a comment telling people how to do this correctly to > the "Writing test cases" section of the README-testsuite? > > Jim > > > On Jan 22, 2016, at 3:54 PM, Zachary Turner via lldb-commits > > wrote: > > > > Author: zturner > > Date: Fri Jan 22 17:54:41 2016 > > New Revision: 258586 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=258586&view=rev > > Log: > > More fixes related to counting threads on Windows. > > > > The Windows 10 loader spawns threads at startup, so > > tests which count threads or assume that a given user > > thread will be at a specific index are incorrect in > > this case. The fix here is to use the standard mechanisms > > for getting the stopped thread (which is all we are > > really interested in anyway) and correlating them with > > the breakpoints that were set, and doing checks against > > those things. > > > > This fixes about 6 tests on Windows 10. > > > > Modified: > > > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py > >lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py > > > > Modified: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > URL: > > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py?rev=258586&r1=258585&r2=258586&view=diff > > == > > --- > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > (original) > > +++ > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py > > Fri Jan 22 17:54:41 2016 > > @@ -18,14 +18,12 @@ class ExitDuringStepTestCase(TestBase): > > @expectedFailureDarwin("llvm.org/pr15824") # thread states not properly > > maintained > > @expectedFailureFreeBSD("llvm.org/pr18190") # thread states not > > properly maintained > > @expectedFailureLinux("llvm.org/pr15824") # thread states not properly > > maintained > > -@expectedFailureWindows("llvm.org/pr24681") > > def test_thread_state_is_stopped(self): > > """Test thread exit during step handling.""" > > self.build(dictionary=self.getBuildFlags()) > > self.exit_during_step_base("thread step-in -m all-threads", 'stop > > reason = step in', True) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test(self): > > """Test thread exit during step handling.""" > > @@ -33,7 +31,6 @@ class ExitDuringStepTestCase(TestBase): > > self.exit_during_step_base("thread step-inst -m all-threads", 'stop > > reason = instruction step', False) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test_step_over(self): > > """Test thread exit during step-over handling.""" > > @@ -41,7 +38,6 @@ class ExitDuringStepTestCase(TestBase): > > self.exit_during_step_base("thread step-over -m all-threads", 'stop > > reason = step over', False) > > > > @skipIfFreeBSD # llvm.org/pr21411: test is hanging > > -@expectedFailureWindows("llvm.org/pr24681") > > @expectedFlakeyAndroid("llvm.org/pr26206") > > def test_step_in(self): > > """Test thread exit during step-in handling.""" > > @@ -79,37 +75,16 @@ class ExitDuringStepTestCase(TestBase): > > target = self.dbg.GetSelectedTarget() > > process = target.GetProcess() > > > > -# Get the number of threads > >
[Lldb-commits] [lldb] r258592 - Fix missing function argument passthrough.
Author: zturner Date: Fri Jan 22 18:49:11 2016 New Revision: 258592 URL: http://llvm.org/viewvc/llvm-project?rev=258592&view=rev Log: Fix missing function argument passthrough. Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py?rev=258592&r1=258591&r2=258592&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Fri Jan 22 18:49:11 2016 @@ -579,7 +579,7 @@ def get_one_thread_stopped_at_breakpoint return threads[0] def get_one_thread_stopped_at_breakpoint(process, bkpt, require_exactly_one = True): -return get_one_thread_stopped_at_breakpoint_id(bkpt.GetID(), require_exactly_one) +return get_one_thread_stopped_at_breakpoint_id(process, bkpt.GetID(), require_exactly_one) def is_thread_crashed (test, thread): """In the test suite we dereference a null pointer to simulate a crash. The way this is ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258601 - fixed TestConsecutiveBreakpoints test on OS X
Author: tfiala Date: Fri Jan 22 20:24:41 2016 New Revision: 258601 URL: http://llvm.org/viewvc/llvm-project?rev=258601&view=rev Log: fixed TestConsecutiveBreakpoints test on OS X Also renamed directory and class name to fix typos. Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile - copied, changed from r258592, lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py - copied, changed from r258592, lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp - copied, changed from r258592, lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/main.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/main.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile?rev=258600&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile (removed) @@ -1,9 +0,0 @@ -LEVEL = ../../../make - -CXX_SOURCES := main.cpp - -ifneq (,$(findstring icc,$(CC))) -CXXFLAGS += -debug inline-debug-info -endif - -include $(LEVEL)/Makefile.rules Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py?rev=258600&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py (removed) @@ -1,59 +0,0 @@ -""" -Test continue from a breakpoint when there is a breakpoint on the next instruction also. -""" - -from __future__ import print_function - - - -import unittest2 -import lldb -import lldbsuite.test.lldbutil as lldbutil -from lldbsuite.test.lldbtest import * - -class ConsecutiveBreakpoitsTestCase(TestBase): - -mydir = TestBase.compute_mydir(__file__) - -@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"])) -def test (self): -self.build () -self.consecutive_breakpoints_tests() - -def consecutive_breakpoints_tests(self): -exe = os.path.join (os.getcwd(), "a.out") - -# Create a target by the debugger. -target = self.dbg.CreateTarget(exe) -self.assertTrue(target, VALID_TARGET) - -breakpoint1 = target.BreakpointCreateBySourceRegex("Set breakpoint here", lldb.SBFileSpec("main.cpp")) -self.assertTrue(breakpoint and -breakpoint.GetNumLocations() == 1, -VALID_BREAKPOINT) - -# Now launch the process, and do not stop at entry point. -process = target.LaunchSimple (None, None, self.get_process_working_directory()) -self.assertTrue(process, PROCESS_IS_VALID) - -# We should be stopped at the first breakpoint -thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint1) -self.assertIsNotNone(thread, "Expected one thread to be stopped at breakpoint 1") - -# Set breakpoint to the next instruction -frame = thread.GetFrameAtIndex(0) - -address = frame.GetPCAddress() -instructions = target.ReadInstructions(address, 2) -self.assertTrue(len(instructions) == 2) -address = instructions[1].GetAddress() - -breakpoint2 = target.BreakpointCreateByAddress(address.GetLoadAddress(target)) -process.Continue() - -# We should be stopped at the second breakpoint -thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint2) -
[Lldb-commits] [lldb] r258602 - Skipped IncompleteModulesTestCase on OS X
Author: tfiala Date: Fri Jan 22 20:34:16 2016 New Revision: 258602 URL: http://llvm.org/viewvc/llvm-project?rev=258602&view=rev Log: Skipped IncompleteModulesTestCase on OS X This is hitting an assert in clang when evaluating the module load. I am seeing it locally on Xcode 7.3 public Beta 1 and on the llvm.org Green Dragon buildbot supposedly running Xcode 7.0. Tracked by: https://llvm.org/bugs/show_bug.cgi?id=26267 Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py?rev=258602&r1=258601&r2=258602&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py Fri Jan 22 20:34:16 2016 @@ -5,8 +5,6 @@ from __future__ import print_function import unittest2 -import os, time -import lldb import platform import lldbsuite.test.lldbutil as lldbutil @@ -27,6 +25,7 @@ class IncompleteModulesTestCase(TestBase @skipUnlessDarwin @unittest2.expectedFailure("rdar://20416388") @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+") +@skipIfDarwin # llvm.org/pr26267 def test_expr(self): self.build() exe = os.path.join(os.getcwd(), "a.out") ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16477: Make all x86 target builds on MSVC use the amd64_x86 toolchain
cray added a subscriber: cray. cray added a comment. The amd64_x86 toolchain is not present on the community edition of visual studio. I am not sure if any build bots use this version though. http://reviews.llvm.org/D16477 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits