[Lldb-commits] [PATCH] D44502: Fix a bug in "target.source-map" where we would resolve unmapped paths incorrectly

2018-03-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I think a .ll file would be better abstraction level for this test. You can 
still hardcode all the paths needed for the test while avoiding spelling out 
the irrelevant details like debug info abbreviations. But I guess this will 
work as well...


Repository:
  rL LLVM

https://reviews.llvm.org/D44502



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327611 - @skipUnlessDarwin TestTargetSourceMap

2018-03-15 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Mar 15 02:16:15 2018
New Revision: 327611

URL: http://llvm.org/viewvc/llvm-project?rev=327611&view=rev
Log:
@skipUnlessDarwin TestTargetSourceMap

Our MachO parser works only on darwin.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py?rev=327611&r1=327610&r2=327611&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py
 Thu Mar 15 02:16:15 2018
@@ -7,6 +7,7 @@ class TestTargetSourceMap(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipUnlessDarwin
 @no_debug_info_test
 def test_source_map(self):
 """Test target.source-map' functionality."""


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44306: Move Args::StringToAddress to Target::EvaluateAddressExpression

2018-03-15 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 138540.
labath added a comment.

s/toAddress/ToAddress/


https://reviews.llvm.org/D44306

Files:
  include/lldb/Interpreter/Args.h
  include/lldb/Interpreter/OptionArgParser.h
  include/lldb/Interpreter/Options.h
  source/API/SBDebugger.cpp
  source/Commands/CommandObjectBreakpoint.cpp
  source/Commands/CommandObjectBreakpointCommand.cpp
  source/Commands/CommandObjectCommands.cpp
  source/Commands/CommandObjectDisassemble.cpp
  source/Commands/CommandObjectExpression.cpp
  source/Commands/CommandObjectLog.cpp
  source/Commands/CommandObjectMemory.cpp
  source/Commands/CommandObjectProcess.cpp
  source/Commands/CommandObjectSource.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Commands/CommandObjectThread.cpp
  source/Commands/CommandObjectType.cpp
  source/Commands/CommandObjectWatchpointCommand.cpp
  source/Interpreter/Args.cpp
  source/Interpreter/CMakeLists.txt
  source/Interpreter/OptionArgParser.cpp
  source/Interpreter/OptionGroupValueObjectDisplay.cpp
  source/Interpreter/OptionGroupWatchpoint.cpp
  source/Interpreter/OptionValueBoolean.cpp
  source/Interpreter/OptionValueChar.cpp
  source/Interpreter/OptionValueFormat.cpp
  source/Interpreter/Property.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  source/Target/Process.cpp
  unittests/Interpreter/CMakeLists.txt
  unittests/Interpreter/TestArgs.cpp
  unittests/Interpreter/TestOptionArgParser.cpp

Index: unittests/Interpreter/TestOptionArgParser.cpp
===
--- /dev/null
+++ unittests/Interpreter/TestOptionArgParser.cpp
@@ -0,0 +1,121 @@
+//===-- ArgsTest.cpp *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+#include "lldb/Interpreter/OptionArgParser.h"
+
+using namespace lldb_private;
+
+TEST(OptionArgParserTest, toBoolean) {
+  bool success = false;
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("true"), false, nullptr));
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("on"), false, nullptr));
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("yes"), false, nullptr));
+  EXPECT_TRUE(OptionArgParser::ToBoolean(llvm::StringRef("1"), false, nullptr));
+
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("true"), false, &success));
+  EXPECT_TRUE(success);
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("on"), false, &success));
+  EXPECT_TRUE(success);
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("yes"), false, &success));
+  EXPECT_TRUE(success);
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("1"), false, &success));
+  EXPECT_TRUE(success);
+
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("false"), true, nullptr));
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("off"), true, nullptr));
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("no"), true, nullptr));
+  EXPECT_FALSE(OptionArgParser::ToBoolean(llvm::StringRef("0"), true, nullptr));
+
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("false"), true, &success));
+  EXPECT_TRUE(success);
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("off"), true, &success));
+  EXPECT_TRUE(success);
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("no"), true, &success));
+  EXPECT_TRUE(success);
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("0"), true, &success));
+  EXPECT_TRUE(success);
+
+  EXPECT_FALSE(
+  OptionArgParser::ToBoolean(llvm::StringRef("10"), false, &success));
+  EXPECT_FALSE(success);
+  EXPECT_TRUE(
+  OptionArgParser::ToBoolean(llvm::StringRef("10"), true, &success));
+  EXPECT_FALSE(success);
+  EXPECT_TRUE(OptionArgParser::ToBoolean(llvm::StringRef(""), true, &success));
+  EXPECT_FALSE(success);
+}
+
+TEST(OptionArgParserTest, toChar) {
+  bool success = false;
+
+  EXPECT_EQ('A', OptionArgParser::ToChar("A", 'B', nullptr));
+  EXPECT_EQ('B', OptionArgParser::ToChar("B", 'A', nullptr));
+
+  EXPECT_EQ('A', OptionArgParser::ToChar("A", 'B', &success));
+  EXPECT_TRUE(success);
+  EXPECT_EQ('B', OptionArgParser::ToChar("B", 'A', &success));
+  EXPECT_TRUE(success);
+
+  EXPECT_EQ('A', OptionArgParser::ToChar("", 'A', &success));
+  EXPECT_FALSE(success);
+  EXPECT_EQ('A', OptionArgParser::ToChar("ABC", 'A', &success));
+  EXPECT_FA

[Lldb-commits] [PATCH] D44472: Add and fix some tests for PPC64

2018-03-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I wonder if we shouldn't just fix the TestDisassembleBreakpoint to not require 
adding every single architecture. That test was added because lldb-server was 
not removing the traps from the memory read packets. This is something that is 
completely independent of us later trying to disassemble the memory we got 
back. To test that, it should be sufficient to compare the memory contents 
before and after setting a breakpoint.

Guessing what instructions will the compiler emit for a particular piece of C 
will just make the test fragile...




Comment at: packages/Python/lldbsuite/test/make/Makefile.rules:189
endif
+   ifeq "$(ARCH)" "ppc64le"
+   override ARCH := $(subst ppc64le,64,$(ARCH))

Why do you need both powerpc64le and ppc64le?


https://reviews.llvm.org/D44472



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Mar 15 06:47:09 2018
New Revision: 327625

URL: http://llvm.org/viewvc/llvm-project?rev=327625&view=rev
Log:
Next batch of test-tree-cleaning changes

Summary:
The changes here fall into several categories.

- some tests were redirecting inferior stdout/err to a file. For these I
  make sure we use an absolute path for the file. I also create a
  lldbutil.read_file_on_target helper function to encapsulate the
  differences between reading a file locally and remotely.
- some tests were redirecting the pexpect I/O into a file. For these I
  use a python StringIO object to avoid creating a file altogether.
- the TestSettings inferior was creating a file. Here, I make sure the
  inferior is launched with pwd=build-dir so that the files end up
  created there.
- lldb-mi --log (used by some tests) creates a log file in PWD without
  the ability say differently. To make this work I make sure to run
  lldb-mi with PWD=build_dir. This in turn necessitated a couple of
  changes in other lldb-mi tests, which were using relative paths to
  access the source tree.

Reviewers: aprantl

Subscribers: ki.stfu, mehdi_amini, lldb-commits

Differential Revision: https://reviews.llvm.org/D44159

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327625&r1=327624&r2=327625&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
 Thu Mar 15 06:47:09 2018
@@ -19,6 +19,7 @@ import six
 class ProcessLaunchTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
 
 def setUp(self):
 # Call super's setUp().
@@ -38,8 +39,8 @@ class ProcessLaunchTestCase(TestBase):
 patterns=["Current executable set to .*a.out"])
 
 in_file = "input-file.txt"
-out_file = "output-test.out"
-err_file = "output-test.err"
+out_file = lldbutil.append_to_process_working_directory(self, 
"output-test.out")
+err_file = lldbutil.append_to_process_working_directory(self, 
"output-test.err")
 
 # Make sure the output files do not exist before launching the process
 try:
@@ -52,8 +53,8 @@ class ProcessLaunchTestCase(TestBase):
 except OSError:
 pass
 
-launch_command = "process launch -i " + \
-in_file + " -o " + out_file + " -e " + err_file
+launch_command = "process launch -i '{0}' -o '{1}' -e '{2}' -w 
'{3}'".format(
+in_file, out_file, err_file, 
self.get_process_working_directory())
 
 if lldb.remote_platform:
 self.runCmd('platform put-file "{local}" "{remote}"'.format(
@@ -62,55 +63,19 @@ class ProcessLaunchTestCase(TestBase):
 self.expect(launch_command,
 patterns=["Process .* launched: .*a.out"])
 
-if lldb.remote_platform:
-self.runCmd('platform get-file "{remote}" "{local}"'.format(
-remote=out_file, local=out_file))
-self.runCmd('platform get-file "{remote}" "{local}"'.format(
-remote=err_file, local=err_file))
-
 success = True
 err_msg = ""
 
-# Check to see if the 'stdout' file was created
-try:
-out_f = open(out_file)
-except IOError:
+out = lldbutil.read_file_on_target(self, out_file)
+if out != "This should go to stdout.\n":
 success = False
-err_msg = err_msg + "   ERROR: stdout file was not created.\n"
-else:
-# Check to see if the 'stdout' file contains the right output
-line = out_f.readline()
-if line != "This should go to stdout.\n":
-success = False
-err_msg = err_msg + "ERROR: stdout file does not contain 
correct output.\n"
-out

[Lldb-commits] [PATCH] D44159: Next batch of test-tree-cleaning changes

2018-03-15 Thread Pavel Labath via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL327625: Next batch of test-tree-cleaning changes (authored 
by labath, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D44159

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
  lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
  lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
@@ -1321,6 +1321,21 @@
  target))
 
 
+def read_file_on_target(test, remote):
+if lldb.remote_platform:
+local = test.getBuildArtifact("file_from_target")
+error = lldb.remote_platform.Get(lldb.SBFileSpec(remote, False),
+lldb.SBFileSpec(local, True))
+test.assertTrue(error.Success(), "Reading file {0} failed: {1}".format(remote, error))
+else:
+local = remote
+with open(local, 'r') as f:
+return f.read()
+
+def read_file_from_process_wd(test, name):
+path = append_to_process_working_directory(test, name)
+return read_file_on_target(test, path)
+
 def wait_for_file_on_target(testcase, file_path, max_attempts=6):
 for i in range(max_attempts):
 err, retcode, msg = testcase.run_platform_command("ls %s" % file_path)
@@ -1335,9 +1350,4 @@
 "File %s not found even after %d attempts." %
 (file_path, max_attempts))
 
-err, retcode, data = testcase.run_platform_command("cat %s" % (file_path))
-
-testcase.assertTrue(
-err.Success() and retcode == 0, "Failed to read file %s: %s, retcode: %d" %
-(file_path, err.GetCString(), retcode))
-return data
+return read_file_on_target(testcase, file_path)
Index: lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
+++ lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
@@ -7,6 +7,7 @@
 
 import os
 import lldb
+import six
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
@@ -58,13 +59,10 @@
 child.expect(expect_prompt)
 
 # Turn on loggings for input/output to/from the child.
-with open('child_send1.txt', 'w') as f_send1:
-with open('child_read1.txt', 'w') as f_read1:
-child.logfile_send = f_send1
-child.logfile_read = f_read1
-
-child.sendline('stty -a')
-child.expect(expect_prompt)
+child.logfile_send = child_send1 = six.StringIO()
+child.logfile_read = child_read1 = six.StringIO()
+child.sendline('stty -a')
+child.expect(expect_prompt)
 
 # Now that the stage1 logging is done, restore logfile to None to
 # stop further logging.
@@ -79,43 +77,30 @@
 child.sendline('quit')
 child.expect(expect_prompt)
 
-with open('child_send2.txt', 'w') as f_send2:
-with open('child_read2.txt', 'w') as f_read2:
-child.logfile_send = f_send2
-child.logfile_read = f_read2
-
-child.sendline('stty -a')
-child.expect(expect_prompt)
+child.logfile_send = child_send2 = six.StringIO()
+child.logfile_read = child_read2 = six.StringIO()
+child.sendline('stty -a')
+child.expect(expect_prompt)
 
-child.sendline('exit')
+child.sendline('exit')
 
 # Now that the stage2 logging is done, restore logfile to None to
 # stop further logging.
 child.logfile_send = None
 child.logfile_read = None
 
-with open('child_send1.txt', 'r') as fs:
-if self.TraceOn():
-print("\n\nContents of child_send1.txt:")
-print(fs.read())
-with open('child_read1.txt', 'r') as fr:
-from_child1 = fr.read()
-if self.TraceOn():
-print("\n\nContents of chi

Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Davide Italiano via lldb-commits
This is the most likely cause for the failures we're starting to see
on both our bots on greendragon.
Can you please take a look?

http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/5791/


Thanks!

--
Davide

On Thu, Mar 15, 2018 at 6:47 AM, Pavel Labath via lldb-commits
 wrote:
> Author: labath
> Date: Thu Mar 15 06:47:09 2018
> New Revision: 327625
>
> URL: http://llvm.org/viewvc/llvm-project?rev=327625&view=rev
> Log:
> Next batch of test-tree-cleaning changes
>
> Summary:
> The changes here fall into several categories.
>
> - some tests were redirecting inferior stdout/err to a file. For these I
>   make sure we use an absolute path for the file. I also create a
>   lldbutil.read_file_on_target helper function to encapsulate the
>   differences between reading a file locally and remotely.
> - some tests were redirecting the pexpect I/O into a file. For these I
>   use a python StringIO object to avoid creating a file altogether.
> - the TestSettings inferior was creating a file. Here, I make sure the
>   inferior is launched with pwd=build-dir so that the files end up
>   created there.
> - lldb-mi --log (used by some tests) creates a log file in PWD without
>   the ability say differently. To make this work I make sure to run
>   lldb-mi with PWD=build_dir. This in turn necessitated a couple of
>   changes in other lldb-mi tests, which were using relative paths to
>   access the source tree.
>
> Reviewers: aprantl
>
> Subscribers: ki.stfu, mehdi_amini, lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D44159
>
> Modified:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
> lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
> lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
>
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327625&r1=327624&r2=327625&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>  Thu Mar 15 06:47:09 2018
> @@ -19,6 +19,7 @@ import six
>  class ProcessLaunchTestCase(TestBase):
>
>  mydir = TestBase.compute_mydir(__file__)
> +NO_DEBUG_INFO_TESTCASE = True
>
>  def setUp(self):
>  # Call super's setUp().
> @@ -38,8 +39,8 @@ class ProcessLaunchTestCase(TestBase):
>  patterns=["Current executable set to .*a.out"])
>
>  in_file = "input-file.txt"
> -out_file = "output-test.out"
> -err_file = "output-test.err"
> +out_file = lldbutil.append_to_process_working_directory(self, 
> "output-test.out")
> +err_file = lldbutil.append_to_process_working_directory(self, 
> "output-test.err")
>
>  # Make sure the output files do not exist before launching the 
> process
>  try:
> @@ -52,8 +53,8 @@ class ProcessLaunchTestCase(TestBase):
>  except OSError:
>  pass
>
> -launch_command = "process launch -i " + \
> -in_file + " -o " + out_file + " -e " + err_file
> +launch_command = "process launch -i '{0}' -o '{1}' -e '{2}' -w 
> '{3}'".format(
> +in_file, out_file, err_file, 
> self.get_process_working_directory())
>
>  if lldb.remote_platform:
>  self.runCmd('platform put-file "{local}" "{remote}"'.format(
> @@ -62,55 +63,19 @@ class ProcessLaunchTestCase(TestBase):
>  self.expect(launch_command,
>  patterns=["Process .* launched: .*a.out"])
>
> -if lldb.remote_platform:
> -self.runCmd('platform get-file "{remote}" "{local}"'.format(
> -remote=out_file, local=out_file))
> -self.runCmd('platform get-file "{remote}" "{local}"'.format(
> -remote=err_file, local=err_file))
> -
>  success = True
>  err_msg = ""
>
> -# Check to see if the 'stdout' file was created
> -try:
> -out_f = open(out_file)
> -except IOError:
> +out = lldbutil.read_file_on_target(self, out_file)

Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Pavel Labath via lldb-commits
Yes, it certainly looks that way. Taking a look now.

PS: I didn't get any email about this.

On Thu, 15 Mar 2018 at 15:04, Davide Italiano  wrote:

> This is the most likely cause for the failures we're starting to see
> on both our bots on greendragon.
> Can you please take a look?
>
> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/5791/
>
>
> Thanks!
>
> --
> Davide
>
> On Thu, Mar 15, 2018 at 6:47 AM, Pavel Labath via lldb-commits
>  wrote:
> > Author: labath
> > Date: Thu Mar 15 06:47:09 2018
> > New Revision: 327625
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=327625&view=rev
> > Log:
> > Next batch of test-tree-cleaning changes
> >
> > Summary:
> > The changes here fall into several categories.
> >
> > - some tests were redirecting inferior stdout/err to a file. For these I
> >   make sure we use an absolute path for the file. I also create a
> >   lldbutil.read_file_on_target helper function to encapsulate the
> >   differences between reading a file locally and remotely.
> > - some tests were redirecting the pexpect I/O into a file. For these I
> >   use a python StringIO object to avoid creating a file altogether.
> > - the TestSettings inferior was creating a file. Here, I make sure the
> >   inferior is launched with pwd=build-dir so that the files end up
> >   created there.
> > - lldb-mi --log (used by some tests) creates a log file in PWD without
> >   the ability say differently. To make this work I make sure to run
> >   lldb-mi with PWD=build_dir. This in turn necessitated a couple of
> >   changes in other lldb-mi tests, which were using relative paths to
> >   access the source tree.
> >
> > Reviewers: aprantl
> >
> > Subscribers: ki.stfu, mehdi_amini, lldb-commits
> >
> > Differential Revision: https://reviews.llvm.org/D44159
> >
> > Modified:
> >
>  
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> >
>  
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
> > lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
> > lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
> >
>  lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
> >
>  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
> >
>  
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
> >
>  
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
> >
> > Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> > URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327625&r1=327624&r2=327625&view=diff
> >
> ==
> > ---
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> (original)
> > +++
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> Thu Mar 15 06:47:09 2018
> > @@ -19,6 +19,7 @@ import six
> >  class ProcessLaunchTestCase(TestBase):
> >
> >  mydir = TestBase.compute_mydir(__file__)
> > +NO_DEBUG_INFO_TESTCASE = True
> >
> >  def setUp(self):
> >  # Call super's setUp().
> > @@ -38,8 +39,8 @@ class ProcessLaunchTestCase(TestBase):
> >  patterns=["Current executable set to .*a.out"])
> >
> >  in_file = "input-file.txt"
> > -out_file = "output-test.out"
> > -err_file = "output-test.err"
> > +out_file = lldbutil.append_to_process_working_directory(self,
> "output-test.out")
> > +err_file = lldbutil.append_to_process_working_directory(self,
> "output-test.err")
> >
> >  # Make sure the output files do not exist before launching the
> process
> >  try:
> > @@ -52,8 +53,8 @@ class ProcessLaunchTestCase(TestBase):
> >  except OSError:
> >  pass
> >
> > -launch_command = "process launch -i " + \
> > -in_file + " -o " + out_file + " -e " + err_file
> > +launch_command = "process launch -i '{0}' -o '{1}' -e '{2}' -w
> '{3}'".format(
> > +in_file, out_file, err_file,
> self.get_process_working_directory())
> >
> >  if lldb.remote_platform:
> >  self.runCmd('platform put-file "{local}" "{remote}"'.format(
> > @@ -62,55 +63,19 @@ class ProcessLaunchTestCase(TestBase):
> >  self.expect(launch_command,
> >  patterns=["Process .* launched: .*a.out"])
> >
> > -if lldb.remote_platform:
> > -self.runCmd('platform get-file "{remote}" "{local}"'.format(
> > -remote=out_file, local=out_file))
> > -self.runCmd('platform get-file "{remote}" "{lo

Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Davide Italiano via lldb-commits
I don't seem to receive mails either (although I should).
Vedant is babysitting the bots this week. Vedant, are you receiving
blame mails or the mail notification is disabled altogether?

On Thu, Mar 15, 2018 at 8:06 AM, Pavel Labath  wrote:
> Yes, it certainly looks that way. Taking a look now.
>
> PS: I didn't get any email about this.
>
> On Thu, 15 Mar 2018 at 15:04, Davide Italiano  wrote:
>>
>> This is the most likely cause for the failures we're starting to see
>> on both our bots on greendragon.
>> Can you please take a look?
>>
>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/5791/
>>
>>
>> Thanks!
>>
>> --
>> Davide
>>
>> On Thu, Mar 15, 2018 at 6:47 AM, Pavel Labath via lldb-commits
>>  wrote:
>> > Author: labath
>> > Date: Thu Mar 15 06:47:09 2018
>> > New Revision: 327625
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=327625&view=rev
>> > Log:
>> > Next batch of test-tree-cleaning changes
>> >
>> > Summary:
>> > The changes here fall into several categories.
>> >
>> > - some tests were redirecting inferior stdout/err to a file. For these I
>> >   make sure we use an absolute path for the file. I also create a
>> >   lldbutil.read_file_on_target helper function to encapsulate the
>> >   differences between reading a file locally and remotely.
>> > - some tests were redirecting the pexpect I/O into a file. For these I
>> >   use a python StringIO object to avoid creating a file altogether.
>> > - the TestSettings inferior was creating a file. Here, I make sure the
>> >   inferior is launched with pwd=build-dir so that the files end up
>> >   created there.
>> > - lldb-mi --log (used by some tests) creates a log file in PWD without
>> >   the ability say differently. To make this work I make sure to run
>> >   lldb-mi with PWD=build_dir. This in turn necessitated a couple of
>> >   changes in other lldb-mi tests, which were using relative paths to
>> >   access the source tree.
>> >
>> > Reviewers: aprantl
>> >
>> > Subscribers: ki.stfu, mehdi_amini, lldb-commits
>> >
>> > Differential Revision: https://reviews.llvm.org/D44159
>> >
>> > Modified:
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
>> > lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
>> > lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
>> >
>> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
>> >
>> > Modified:
>> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327625&r1=327624&r2=327625&view=diff
>> >
>> > ==
>> > ---
>> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>> > (original)
>> > +++
>> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
>> > Thu Mar 15 06:47:09 2018
>> > @@ -19,6 +19,7 @@ import six
>> >  class ProcessLaunchTestCase(TestBase):
>> >
>> >  mydir = TestBase.compute_mydir(__file__)
>> > +NO_DEBUG_INFO_TESTCASE = True
>> >
>> >  def setUp(self):
>> >  # Call super's setUp().
>> > @@ -38,8 +39,8 @@ class ProcessLaunchTestCase(TestBase):
>> >  patterns=["Current executable set to .*a.out"])
>> >
>> >  in_file = "input-file.txt"
>> > -out_file = "output-test.out"
>> > -err_file = "output-test.err"
>> > +out_file = lldbutil.append_to_process_working_directory(self,
>> > "output-test.out")
>> > +err_file = lldbutil.append_to_process_working_directory(self,
>> > "output-test.err")
>> >
>> >  # Make sure the output files do not exist before launching the
>> > process
>> >  try:
>> > @@ -52,8 +53,8 @@ class ProcessLaunchTestCase(TestBase):
>> >  except OSError:
>> >  pass
>> >
>> > -launch_command = "process launch -i " + \
>> > -in_file + " -o " + out_file + " -e " + err_file
>> > +launch_command = "process launch -i '{0}' -o '{1}' -e '{2}' -w
>> > '{3}'".format(
>> > +in_file, out_file, err_file,
>> > self.get_process_working_directory())
>> >
>> >  if lldb.remote_platform:
>> >  self.runCmd('platform put-file "{local}"
>> > "{remote}"'.format(
>> > @@ -62,55 +63,19 @@

[Lldb-commits] [lldb] r327633 - Fix TestProcessLaunch breakage on MacOS

2018-03-15 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Mar 15 08:21:54 2018
New Revision: 327633

URL: http://llvm.org/viewvc/llvm-project?rev=327633&view=rev
Log:
Fix TestProcessLaunch breakage on MacOS

This test started failing after r327625. The cause seems difference in the
treatment of relative --stdin paths between MacOS (debugserver?) and linux
(lldb-server?). Linux treats this as relative to the debuggers PWD, while MacOS
as relative to (I think) the future PWD of the launched process.

This fixes the issue by using absolute paths, which should work everywhere, but
we should probably unify this path handling as well. I'll ask around about what
is the expected behavior here.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327633&r1=327632&r2=327633&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
 Thu Mar 15 08:21:54 2018
@@ -38,7 +38,7 @@ class ProcessLaunchTestCase(TestBase):
 self.expect("file " + exe,
 patterns=["Current executable set to .*a.out"])
 
-in_file = "input-file.txt"
+in_file = os.path.join(self.getSourceDir(), "input-file.txt")
 out_file = lldbutil.append_to_process_working_directory(self, 
"output-test.out")
 err_file = lldbutil.append_to_process_working_directory(self, 
"output-test.err")
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Pavel Labath via lldb-commits
Yea, this is strange. The bot does not even appear to be red. It's just
yellow.

Anyway, r327633 ought to fix the breakage. As I said in the commit message,
the cause is different treatment of relative paths to "process launch
--stdin". Do you guys have any opinion on which behavior makes more sense?

On Thu, 15 Mar 2018 at 15:21, Davide Italiano  wrote:

> I don't seem to receive mails either (although I should).
> Vedant is babysitting the bots this week. Vedant, are you receiving
> blame mails or the mail notification is disabled altogether?
>
> On Thu, Mar 15, 2018 at 8:06 AM, Pavel Labath  wrote:
> > Yes, it certainly looks that way. Taking a look now.
> >
> > PS: I didn't get any email about this.
> >
> > On Thu, 15 Mar 2018 at 15:04, Davide Italiano 
> wrote:
> >>
> >> This is the most likely cause for the failures we're starting to see
> >> on both our bots on greendragon.
> >> Can you please take a look?
> >>
> >> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/5791/
> >>
> >>
> >> Thanks!
> >>
> >> --
> >> Davide
> >>
> >> On Thu, Mar 15, 2018 at 6:47 AM, Pavel Labath via lldb-commits
> >>  wrote:
> >> > Author: labath
> >> > Date: Thu Mar 15 06:47:09 2018
> >> > New Revision: 327625
> >> >
> >> > URL: http://llvm.org/viewvc/llvm-project?rev=327625&view=rev
> >> > Log:
> >> > Next batch of test-tree-cleaning changes
> >> >
> >> > Summary:
> >> > The changes here fall into several categories.
> >> >
> >> > - some tests were redirecting inferior stdout/err to a file. For
> these I
> >> >   make sure we use an absolute path for the file. I also create a
> >> >   lldbutil.read_file_on_target helper function to encapsulate the
> >> >   differences between reading a file locally and remotely.
> >> > - some tests were redirecting the pexpect I/O into a file. For these I
> >> >   use a python StringIO object to avoid creating a file altogether.
> >> > - the TestSettings inferior was creating a file. Here, I make sure the
> >> >   inferior is launched with pwd=build-dir so that the files end up
> >> >   created there.
> >> > - lldb-mi --log (used by some tests) creates a log file in PWD without
> >> >   the ability say differently. To make this work I make sure to run
> >> >   lldb-mi with PWD=build_dir. This in turn necessitated a couple of
> >> >   changes in other lldb-mi tests, which were using relative paths to
> >> >   access the source tree.
> >> >
> >> > Reviewers: aprantl
> >> >
> >> > Subscribers: ki.stfu, mehdi_amini, lldb-commits
> >> >
> >> > Differential Revision: https://reviews.llvm.org/D44159
> >> >
> >> > Modified:
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
> >> > lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
> >> > lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
> >> >
> >> > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
> >> >
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
> >> >
> >> > Modified:
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> >> > URL:
> >> >
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=327625&r1=327624&r2=327625&view=diff
> >> >
> >> >
> ==
> >> > ---
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> >> > (original)
> >> > +++
> >> >
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
> >> > Thu Mar 15 06:47:09 2018
> >> > @@ -19,6 +19,7 @@ import six
> >> >  class ProcessLaunchTestCase(TestBase):
> >> >
> >> >  mydir = TestBase.compute_mydir(__file__)
> >> > +NO_DEBUG_INFO_TESTCASE = True
> >> >
> >> >  def setUp(self):
> >> >  # Call super's setUp().
> >> > @@ -38,8 +39,8 @@ class ProcessLaunchTestCase(TestBase):
> >> >  patterns=["Current executable set to .*a.out"])
> >> >
> >> >  in_file = "input-file.txt"
> >> > -out_file = "output-test.out"
> >> > -err_file = "output-test.err"
> >> > +out_file = lldbutil.append_to_process_working_directory(self,
> >> > "output-test.out")
> >> > +err_file = lldbutil.append_to_process_working_directory(self,
> >> > "output-test.err")
> >> >
> >> >  # Make sure the output files do not exist before launching
> the
> >> > process
> >

Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Davide Italiano via lldb-commits
On Thu, Mar 15, 2018 at 8:28 AM, Pavel Labath  wrote:
> Yea, this is strange. The bot does not even appear to be red. It's just
> yellow.
>

This is historical. We ought to change this. We just delayed this
because we wanted to be *really sure* things were green for a while.
Also, UNEXPECTED SUCCESSES should be failures (we ought to change that as well).

> Anyway, r327633 ought to fix the breakage. As I said in the commit message,
> the cause is different treatment of relative paths to "process launch
> --stdin". Do you guys have any opinion on which behavior makes more sense?
>

I don't have strong opinion on this, your fix seems reasonable.

Thanks,

--
Davide
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r327356 - [ExpressionParser] Fix crash when evaluating invalid expresssions.

2018-03-15 Thread Davide Italiano via lldb-commits
On Wed, Mar 14, 2018 at 1:52 AM, Pavel Labath  wrote:
> I'm not familiar with all of the magic we do when we synthesize clang Decls,
> but I feel I should point out that we can't get out of business of
> sanity-checking the declarations we inject into clang. The reason for that
> is, even if we had debug info for operator==, the debug info itself could
> describe it's prototype as operator==(...) (due to a compiler bug, corrupt
> file, or whatever). So we still need to make sure that the declarations we
> synthesize from debug info don't violate clang's invariants (and that's what
> we try to do at present, cf.
> ClangASTContext::CheckOverloadedOperatorParameterCount).
>
> So maybe the solution here is not to refuse injecting any declarations
> without debug info, but instead to make sure that whatever declarations we
> inject that way satisfy the same validity criteria as the ones we synthesize
> from the debug info?
>

I'll think about this more. On a more practical note, I was a able to
reproduce this with a fairly self contained C++ program :)

dcci@Davides-MacBook-Pro ~/w/l/b/bin> cat patatino.cpp
class Patatino {
public:
  double _blah;
  Patatino(int blah) : _blah(blah) {}
};

bool operator==(const Patatino& a, const Patatino& b) {
  return a._blah < b._blah;
}


dcci@Davides-MacBook-Pro ~/w/l/b/bin> cat patatuccio.cpp
class Baciotto {
public:
  int _meh;
  Baciotto(int meh) : _meh(meh) {}
};

int main(void) {
  Baciotto x(12);
  return 0;
}


$ ./clang++ patatuccio.cpp -o patatuccio.o -c -g
$ ./clang++ patatino.cpp -o patatino.o -c
$ ./clang++ patatino.o patatuccio.o -o patatuccio

$ nm ./patatuccio
00010f70 t __ZN8BaciottoC1Ei
00010fa0 t __ZN8BaciottoC2Ei.
00010f10 T __ZeqRK8PatatinoS1_.  <--- this is the wrong symbol picked up
0001 T __mh_execute_header
00010f40 T _main
 U dyld_stub_binder

$ echo '__ZeqRK8PatatinoS1_' | c++filt
operator==(Patatino const&, Patatino const&)

And in lldb:

(lldb) n
Process 35027 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x00010f5f patatuccio`main at patatuccio.cpp:9
   6
   7   int main(void) {
   8Baciotto x(12);
-> 9return 0;
   10   }
(lldb) expr x == nil
Assertion failed: (i < getNumParams() && "Illegal param #"), function
getParamDecl, file
/Users/dcci/work/llvm/llvm/tools/clang/include/clang/AST/Decl.h, line
2232.
fish: './lldb' terminated by signal SIGABRT (Abort)


I'll try debugging this more.

Thanks!

--
Davide
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327643 - [dotest] remove confirm_directory_exclusivity remnants

2018-03-15 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Mar 15 09:52:37 2018
New Revision: 327643

URL: http://llvm.org/viewvc/llvm-project?rev=327643&view=rev
Log:
[dotest] remove confirm_directory_exclusivity remnants

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=327643&r1=327642&r2=327643&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Mar 15 09:52:37 
2018
@@ -70,15 +70,6 @@ from . import test_categories
 from lldbsuite.support import encoded_file
 from lldbsuite.support import funcutils
 
-# dosep.py starts lots and lots of dotest instances
-# This option helps you find if two (or more) dotest instances are using the 
same
-# directory at the same time
-# Enable it to cause test failures and stderr messages if dotest instances try 
to run in
-# the same directory simultaneously
-# it is disabled by default because it litters the test directories with
-# ".dirlock" files
-debug_confirm_directory_exclusivity = False
-
 # See also dotest.parseOptionsAndInitTestdirs(), where the environment 
variables
 # LLDB_COMMAND_TRACE and LLDB_DO_CLEANUP are set from '-t' and '-r dir'
 # options.
@@ -586,10 +577,6 @@ class Base(unittest2.TestCase):
 exc_type, exc_value, exc_tb = sys.exc_info()
 traceback.print_exception(exc_type, exc_value, exc_tb)
 
-if debug_confirm_directory_exclusivity:
-cls.dir_lock.release()
-del cls.dir_lock
-
 # Restore old working directory.
 if traceAlways:
 print("Restore dir to:", cls.oldcwd, file=sys.stderr)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327644 - Split skipIf decorator, the condition is supposed to be OR

2018-03-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Mar 15 10:07:05 2018
New Revision: 327644

URL: http://llvm.org/viewvc/llvm-project?rev=327644&view=rev
Log:
Split skipIf decorator, the condition is supposed to be OR

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py?rev=327644&r1=327643&r2=327644&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
 Thu Mar 15 10:07:05 2018
@@ -26,7 +26,8 @@ class ObjCModulesAutoImportTestCase(Test
 self.line = line_number('main.m', '// Set breakpoint 0 here.')
 
 @skipUnlessDarwin
-@skipIf(macos_version=["<", "10.12"], debug_info=no_match(["gmodules"]))
+@skipIf(macos_version=["<", "10.12"])
+@skipIf(debug_info=no_match(["gmodules"]))
 def test_expr(self):
 self.build()
 exe = self.getBuildArtifact("a.out")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44526: [dotest] Clean up test folder clean-up

2018-03-15 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added a reviewer: aprantl.
Herald added subscribers: eraman, mgorny, ki.stfu, emaste.

This patch implements a unified way of cleaning the build folder of each
test. This is done by completely removing the build folder before each
test, in the respective setUp() method. Previously, we were using a
combination of several methods, each with it's own drawbacks:

- nuking the entire build tree before running dotest: the issue here is that 
this did not take place if you ran dotest manually
- running "make clean" before the main "make" target: this relied on the clean 
command being correctly implemented. This was usually true, but not always.
- for files which were not produced by make, each python file was responsible 
for ensuring their deleting, using a variety of methods.

With this approach, the previous methods become redundant. I remove the
first two, since they are centralized. For the other various bits of
clean-up code in python files, I indend to delete it when I come
across it.


https://reviews.llvm.org/D44526

Files:
  
packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
  packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
  
packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
  
packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
  packages/Python/lldbsuite/test/lldbinline.py
  packages/Python/lldbsuite/test/lldbtest.py
  
packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
  packages/Python/lldbsuite/test/plugins/builder_base.py
  packages/Python/lldbsuite/test/plugins/builder_darwin.py
  packages/Python/lldbsuite/test/plugins/builder_freebsd.py
  packages/Python/lldbsuite/test/plugins/builder_linux.py
  packages/Python/lldbsuite/test/plugins/builder_netbsd.py
  packages/Python/lldbsuite/test/plugins/builder_win32.py
  packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
  packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
  test/CMakeLists.txt

Index: test/CMakeLists.txt
===
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -7,7 +7,6 @@
 
   add_custom_target(${name}
 # Clear the test directory first.
-COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/lldb-test-build.noindex
 COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
 COMMENT "${comment}"
 DEPENDS ${LLDB_TEST_DEPS}
Index: packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
===
--- packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
+++ packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
@@ -28,14 +28,14 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
 
 # Insert some delay and then call the program generator to produce
 # main.cpp, version 2.
 time.sleep(5)
 self.generate_main_cpp(version=101)
 # Now call make again, but this time don't generate the dSYM.
-self.buildDefault(clean=False, dictionary={'MAKE_DSYM':'NO'})
+self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_error(self.exe_name)
@@ -46,7 +46,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_success(self.exe_name)
@@ -57,7 +57,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_dSYM_bundle(self.exe_name)
@@ -72,7 +72,6 @@
 '%ADD_EXTRA_CODE%',
 'printf("This is version %d\\n");' %
 version)
-self.makeBuildDir()
 src = os.path.join(self.getBuildDir(), self.source)
 with open(src, 'w') as f:
 f.write(new_content)
Index: packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
@@ -27,7 +27,6 @@
 raise("mydir is empty")
 
   

[Lldb-commits] [PATCH] D44526: [dotest] Clean up test folder clean-up

2018-03-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Thanks! I think this makes sense.




Comment at: packages/Python/lldbsuite/test/lldbtest.py:707
+"""Create the test-specific working directory, deleting any previous
+contents."""
 # See also dotest.py which sets up ${LLDB_BUILD}.

I was thinking whether this was necessary, since we could just `rm -rf` the 
entire --build-dir, but for running individual tests, doing it this way makes 
it easier.



Comment at: test/CMakeLists.txt:9
   add_custom_target(${name}
 # Clear the test directory first.
 COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}

That comment is obsolete now?


https://reviews.llvm.org/D44526



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44507: [cmake] Copy system debugserver from the right place when only CommandLineTools are installed

2018-03-15 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thank you, lgtm.


https://reviews.llvm.org/D44507



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Vedant Kumar via lldb-commits
I haven't received any greendragon bot failure notifications. I'll look into 
that.

vedant

> On Mar 15, 2018, at 8:32 AM, Davide Italiano  wrote:
> 
> On Thu, Mar 15, 2018 at 8:28 AM, Pavel Labath  wrote:
>> Yea, this is strange. The bot does not even appear to be red. It's just
>> yellow.
>> 
> 
> This is historical. We ought to change this. We just delayed this
> because we wanted to be *really sure* things were green for a while.
> Also, UNEXPECTED SUCCESSES should be failures (we ought to change that as 
> well).
> 
>> Anyway, r327633 ought to fix the breakage. As I said in the commit message,
>> the cause is different treatment of relative paths to "process launch
>> --stdin". Do you guys have any opinion on which behavior makes more sense?
>> 
> 
> I don't have strong opinion on this, your fix seems reasonable.
> 
> Thanks,
> 
> --
> Davide

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r327625 - Next batch of test-tree-cleaning changes

2018-03-15 Thread Vedant Kumar via lldb-commits
All right, I've configured greendragon's cmake/xcode builds to become unstable 
when there are test failures. I've also enabled email notifications for the 
'default set of recipients'. From what I've gathered, Jenkins determines this 
set by looking at the changelist.

Let me know if there continue to be issues with failure notifications.

thanks,
vedant

> On Mar 15, 2018, at 11:02 AM, Vedant Kumar  wrote:
> 
> I haven't received any greendragon bot failure notifications. I'll look into 
> that.
> 
> vedant
> 
>> On Mar 15, 2018, at 8:32 AM, Davide Italiano  wrote:
>> 
>> On Thu, Mar 15, 2018 at 8:28 AM, Pavel Labath  wrote:
>>> Yea, this is strange. The bot does not even appear to be red. It's just
>>> yellow.
>>> 
>> 
>> This is historical. We ought to change this. We just delayed this
>> because we wanted to be *really sure* things were green for a while.
>> Also, UNEXPECTED SUCCESSES should be failures (we ought to change that as 
>> well).
>> 
>>> Anyway, r327633 ought to fix the breakage. As I said in the commit message,
>>> the cause is different treatment of relative paths to "process launch
>>> --stdin". Do you guys have any opinion on which behavior makes more sense?
>>> 
>> 
>> I don't have strong opinion on this, your fix seems reasonable.
>> 
>> Thanks,
>> 
>> --
>> Davide
> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44472: Add and fix some tests for PPC64

2018-03-15 Thread Alexandre Yukio Yamashita via Phabricator via lldb-commits
alexandreyy updated this revision to Diff 138610.
alexandreyy added a comment.

Modified TestDisassembleBreakpoint.py to consider multiple architectures.


https://reviews.llvm.org/D44472

Files:
  packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
  
packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
  packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
  packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
  
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
  
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
  
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py

Index: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,6 +31,9 @@
 elif re.match("mips", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "mips")
 raw_bytes = bytearray([0x03, 0xa0, 0xf0, 0x21])
+elif re.match("powerpc64le", arch):
+target = self.dbg.CreateTargetWithFileAndTargetTriple("", "powerpc64le")
+raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
 else:
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "x86_64")
 raw_bytes = bytearray([0x48, 0x89, 0xe5])
@@ -48,6 +51,9 @@
 self.assertTrue(inst.GetMnemonic(target) == "move")
 self.assertTrue(inst.GetOperands(target) ==
 '$' + "fp, " + '$' + "sp")
+elif re.match("powerpc64le", arch):
+self.assertTrue(inst.GetMnemonic(target) == "li")
+self.assertTrue(inst.GetOperands(target) == "4, 0")
 else:
 self.assertTrue(inst.GetMnemonic(target) == "movq")
 self.assertTrue(inst.GetOperands(target) ==
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -81,7 +81,7 @@
 # Most of the MIPS boards provide only one H/W watchpoints, and S/W
 # watchpoints are not supported yet
 arch = self.getArchitecture()
-if re.match("^mips", arch):
+if re.match("^mips", arch) or re.match("powerpc64le", arch):
 self.runCmd("watchpoint delete 1")
 
 # resolve_location=True, read=False, write=True
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
@@ -39,8 +39,8 @@
 # Most of the MIPS boards provide only one H/W watchpoints, and S/W
 # watchpoints are not supported yet
 @expectedFailureAll(triple=re.compile('^mips'))
-# SystemZ also currently supports only one H/W watchpoint
-@expectedFailureAll(archs=['s390x'])
+# SystemZ and PowerPC also currently supports only one H/W watchpoint
+@expectedFailureAll(archs=['powerpc64le', 's390x'])
 @skipIfDarwin
 def test_hello_watchlocation(self):
 """Test watching a location with '-s size' option."""
Index: packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
===
--- packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
+++ packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
@@ -1,6 +1,18 @@
 void func() {
 
-#ifndef __mips__
+#ifdef __powerpc64__
+  __asm__ (
+"mflr 0;"
+"std 0,16(1);"
+"addi 1,1,-24;"
+"mr 31,1;"
+".cfi_def_cfa_offset 24;"
+"addi 0,0,0;"
+"addi 1,1,24;"
+"ld 0,16(1);"
+".cfi_def_cfa_offset 0;"
+  );
+#elif !defined __mips__
 	__asm__ (
 		"pushq $0x10;"
 		".cfi_def_cfa_offset 16;"
Index: packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -50,8 +50,11 @@
 self.do_min_test(self.mark3, self.mark2, "i", "5")
 # Try the doub

[Lldb-commits] [PATCH] D44472: Add and fix some tests for PPC64

2018-03-15 Thread Alexandre Yukio Yamashita via Phabricator via lldb-commits
alexandreyy added a comment.

In https://reviews.llvm.org/D44472#1038656, @labath wrote:

> I wonder if we shouldn't just fix the TestDisassembleBreakpoint to not 
> require adding every single architecture. That test was added because 
> lldb-server was not removing the traps from the memory read packets. This is 
> something that is completely independent of us later trying to disassemble 
> the memory we got back. To test that, it should be sufficient to compare the 
> memory contents before and after setting a breakpoint.
>
> Guessing what instructions will the compiler emit for a particular piece of C 
> will just make the test fragile...


I executed the tests again and we don't really need both powerpc64le and 
ppc64le.
Some tests required "ppc64le" to be built. But they are working now without it.
I modified the disassemble test as you suggested.


https://reviews.llvm.org/D44472



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44507: [cmake] Copy system debugserver from the right place when only CommandLineTools are installed

2018-03-15 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

@vsk Would you mind committing this for me when you get the chance? I don't 
have commit access. :)


https://reviews.llvm.org/D44507



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327691 - [cmake] Copy system debugserver from the right place when only CommandLineTools

2018-03-15 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Mar 15 20:31:16 2018
New Revision: 327691

URL: http://llvm.org/viewvc/llvm-project?rev=327691&view=rev
Log:
[cmake] Copy system debugserver from the right place when only CommandLineTools
are installed

Instead of building debugserver when building lldb, I'd rather pass
LLDB_CODESIGN_IDENTITY="" to cmake and use the one already on my system.
However, on one of my machines I only have the CommandLineTools installed, and
so the hardcoded path to the system debugserver does not work for me.
Additionally, we should verify the LLDB framework exists on the machine before
trying to set the path to debugserver. This allows us to warn the user at
configure time that a system debugserver can't be found if they choose not to
build it themselves.

Patch by Alex Langford!

Differential Revision: https://reviews.llvm.org/D44507

Modified:
lldb/trunk/tools/debugserver/source/CMakeLists.txt

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=327691&r1=327690&r2=327691&view=diff
==
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Thu Mar 15 20:31:16 2018
@@ -106,8 +106,15 @@ else()
 COMMAND xcode-select -p
 OUTPUT_VARIABLE XCODE_DEV_DIR)
   string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-  set(DEBUGSERVER_PATH
-
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
+  if(EXISTS "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
+  elseif(EXISTS "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/Resources/debugserver"
 CACHE PATH "Path to debugserver.")
+  else()
+message(SEND_ERROR "Cannot find debugserver on system.")
+  endif()
   set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server")
 endif()
 message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D44507: [cmake] Copy system debugserver from the right place when only CommandLineTools are installed

2018-03-15 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL327691: [cmake] Copy system debugserver from the right place 
when only CommandLineTools (authored by vedantk, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D44507

Files:
  lldb/trunk/tools/debugserver/source/CMakeLists.txt


Index: lldb/trunk/tools/debugserver/source/CMakeLists.txt
===
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt
@@ -106,8 +106,15 @@
 COMMAND xcode-select -p
 OUTPUT_VARIABLE XCODE_DEV_DIR)
   string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-  set(DEBUGSERVER_PATH
-
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
+  if(EXISTS "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
+  elseif(EXISTS "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/Resources/debugserver"
 CACHE PATH "Path to debugserver.")
+  else()
+message(SEND_ERROR "Cannot find debugserver on system.")
+  endif()
   set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server")
 endif()
 message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")


Index: lldb/trunk/tools/debugserver/source/CMakeLists.txt
===
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt
@@ -106,8 +106,15 @@
 COMMAND xcode-select -p
 OUTPUT_VARIABLE XCODE_DEV_DIR)
   string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-  set(DEBUGSERVER_PATH
-"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.")
+  if(EXISTS "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.")
+  elseif(EXISTS "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/")
+set(DEBUGSERVER_PATH
+  "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.")
+  else()
+message(SEND_ERROR "Cannot find debugserver on system.")
+  endif()
   set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server")
 endif()
 message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327692 - Skip more lldb-mi tests which time out on Darwin

2018-03-15 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Mar 15 21:11:03 2018
New Revision: 327692

URL: http://llvm.org/viewvc/llvm-project?rev=327692&view=rev
Log:
Skip more lldb-mi tests which time out on Darwin

Bot failure: 
https://ci.swift.org/job/oss-lldb-incremental-osx/1097/testReport/junit/TestMiTarget/MiTargetTestCase/test_lldbmi_target_attach_wait_for/

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py?rev=327692&r1=327691&r2=327692&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py 
Thu Mar 15 21:11:03 2018
@@ -18,6 +18,7 @@ class MiTargetTestCase(lldbmi_testcase.M
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfLinux  # cannot attach to process on linux
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_target_attach_wait_for(self):
 """Test that 'lldb-mi --interpreter' works for -target-attach -n 
 --waitfor."""
 
@@ -61,6 +62,7 @@ class MiTargetTestCase(lldbmi_testcase.M
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfLinux  # cannot attach to process on linux
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_target_attach_name(self):
 """Test that 'lldb-mi --interpreter' works for -target-attach -n 
."""
 
@@ -97,6 +99,7 @@ class MiTargetTestCase(lldbmi_testcase.M
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfLinux  # cannot attach to process on linux
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_target_attach_pid(self):
 """Test that 'lldb-mi --interpreter' works for -target-attach ."""
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits