[Lldb-commits] [PATCH] D43506: Fix a couple of more tests to not create files in the source tree

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In https://reviews.llvm.org/D43506#1013276, @aprantl wrote:

> Thanks!
>
> By the way, just in case you are motivated :-), one outstanding task is also 
> to replace all uses of the `clean` target in the makefiles with simply 
> removing the test build directory.


I think I'll get around to that eventually if someone doesn't beat me to it 
(right now my goal is to be able to run the tests with the source tree mounted 
read-only). I'm thinking of nuking the build dir *before* the test and just 
deleting the post-test cleanup, so you can inspect the built binaries if the 
test fails for some reason.


https://reviews.llvm.org/D43506



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


[Lldb-commits] [lldb] r325690 - Fix a couple of more tests to not create files in the source tree

2018-02-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Feb 21 07:33:53 2018
New Revision: 325690

URL: http://llvm.org/viewvc/llvm-project?rev=325690&view=rev
Log:
Fix a couple of more tests to not create files in the source tree

Summary:
These were not being flaky, but they're still making the tree dirty.

These tests were using lldbutil.append_to_process_working_directory to
derive the file path so I fix them by modifying the function to return
the build directory for local tests.

Technically, now the path returned by this function does not point to
the process working directory for local tests, but I think it makes
sense to keep the function name, as I think we should move towards
launching the process in the build directory (and I intend to change
this for the handful of inferiors that actually care about their PWD,
for example because they need to create files there).

Reviewers: davide, aprantl

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py?rev=325690&r1=325689&r2=325690&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
 Wed Feb 21 07:33:53 2018
@@ -18,6 +18,7 @@ exe_name = 'AttachDenied'  # Must match
 class AttachDeniedTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
 
 @skipIfWindows
 @skipIfiOSSimulator
@@ -28,7 +29,7 @@ class AttachDeniedTestCase(TestBase):
 exe = self.getBuildArtifact(exe_name)
 
 # Use a file as a synchronization point between test and inferior.
-pid_file_path = lldbutil.append_to_process_working_directory(
+pid_file_path = lldbutil.append_to_process_working_directory(self,
 "pid_file_%d" % (int(time.time(
 self.addTearDownHook(
 lambda: self.run_platform_command(

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py?rev=325690&r1=325689&r2=325690&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
 Wed Feb 21 07:33:53 2018
@@ -13,6 +13,7 @@ from lldbsuite.test import lldbutil
 class ChangeProcessGroupTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
 
 def setUp(self):
 # Call super's setUp().
@@ -29,7 +30,7 @@ class ChangeProcessGroupTestCase(TestBas
 exe = self.getBuildArtifact("a.out")
 
 # Use a file as a synchronization point between test and inferior.
-pid_file_path = lldbutil.append_to_process_working_directory(
+pid_file_path = lldbutil.append_to_process_working_directory(self,
 "pid_file_%d" % (int(time.time(
 self.addTearDownHook(
 lambda: self.run_platform_command(

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=325690&r1=325689&r2=325690&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed Feb 21 07:33:53 
2018
@@ -369,8 +369,8 @@ class _RemoteProcess(_BaseProcess):
 def launch(self, executable, args):
 if self._install_remote:
 src_path = executable
-dst_path = lldbutil.append_to_process_working_directory(
-os.path.basename(executable))
+dst_path = lldbutil.join_remote_paths(
+  

[Lldb-commits] [PATCH] D43506: Fix a couple of more tests to not create files in the source tree

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325690: Fix a couple of more tests to not create files in 
the source tree (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43506?vs=135040&id=135256#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43506

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
  lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Index: lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
@@ -61,12 +61,6 @@
 self.get_description()
 
 @add_test_categories(['pyapi'])
-def test_launch_new_process_and_redirect_stdout(self):
-"""Exercise SBTarget.Launch() API."""
-self.build()
-self.launch_new_process_and_redirect_stdout()
-
-@add_test_categories(['pyapi'])
 def test_resolve_symbol_context_with_address(self):
 """Exercise SBTarget.ResolveSymbolContextForAddress() API."""
 self.build()
@@ -268,8 +262,11 @@
 substrs=['a.out', 'Target', 'Module', 'Breakpoint'])
 
 @not_remote_testsuite_ready
-def launch_new_process_and_redirect_stdout(self):
+@add_test_categories(['pyapi'])
+@no_debug_info_test
+def test_launch_new_process_and_redirect_stdout(self):
 """Exercise SBTaget.Launch() API with redirected stdout."""
+self.build()
 exe = self.getBuildArtifact("a.out")
 
 # Create a target by the debugger.
@@ -285,9 +282,12 @@
 # Now launch the process, do not stop at entry point, and redirect stdout to "stdout.txt" file.
 # The inferior should run to completion after "process.Continue()"
 # call.
-local_path = "stdout.txt"
+local_path = self.getBuildArtifact("stdout.txt")
+if os.path.exists(local_path):
+os.remove(local_path)
+
 if lldb.remote_platform:
-stdout_path = lldbutil.append_to_process_working_directory(
+stdout_path = lldbutil.append_to_process_working_directory(self,
 "lldb-stdout-redirect.txt")
 else:
 stdout_path = local_path
@@ -313,20 +313,13 @@
 
 # The 'stdout.txt' file should now exist.
 self.assertTrue(
-os.path.isfile("stdout.txt"),
+os.path.isfile(local_path),
 "'stdout.txt' exists due to redirected stdout via SBTarget.Launch() API.")
 
 # Read the output file produced by running the program.
-with open('stdout.txt', 'r') as f:
+with open(local_path, 'r') as f:
 output = f.read()
 
-# Let's delete the 'stdout.txt' file as a cleanup step.
-try:
-os.remove("stdout.txt")
-pass
-except OSError:
-pass
-
 self.expect(output, exe=False,
 substrs=["a(1)", "b(2)", "a(3)"])
 
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
@@ -1249,11 +1249,11 @@
 return os.path.join(*paths).replace(os.path.sep, '/')
 
 
-def append_to_process_working_directory(*paths):
+def append_to_process_working_directory(test, *paths):
 remote = lldb.remote_platform
 if remote:
 return join_remote_paths(remote.GetWorkingDirectory(), *paths)
-return os.path.join(os.getcwd(), *paths)
+return os.path.join(test.getBuildDir(), *paths)
 
 # ==
 # Utility functions to get the correct signal number
Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -369,8 +369,8 @@
 def launch(self, executable, args):
 if self._install_remote:
 src_path = executable
-dst_path = lldbutil.append_to_process_working_directory(
-os.path.basename(executable))
+dst_path = lldbutil.join_remote_paths(
+lldb.remote_platfo

[Lldb-commits] [PATCH] D43577: Fix TestUbsanBasic

2018-02-21 Thread Frederic Riss via Phabricator via lldb-commits
friss created this revision.
friss added a reviewer: vsk.
Herald added a subscriber: kubamracek.

Potentially due to the recent testuite refactorings, this test now reports
a full absolute path but expect just the filename. For some reason this
test is skipped on GreenDragon so we've never seen the issue.


https://reviews.llvm.org/D43577

Files:
  packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py


Index: 
packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
===
--- packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
+++ packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
@@ -84,7 +84,7 @@
 
 self.assertEqual(data["instrumentation_class"], 
"UndefinedBehaviorSanitizer")
 self.assertEqual(data["description"], "misaligned-pointer-use")
-self.assertEqual(data["filename"], "main.c")
+self.assertEqual(data["filename"].endswith("main.c"), True)
 self.assertEqual(data["line"], self.line_align)
 
 self.runCmd("continue")


Index: packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
===
--- packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
+++ packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
@@ -84,7 +84,7 @@
 
 self.assertEqual(data["instrumentation_class"], "UndefinedBehaviorSanitizer")
 self.assertEqual(data["description"], "misaligned-pointer-use")
-self.assertEqual(data["filename"], "main.c")
+self.assertEqual(data["filename"].endswith("main.c"), True)
 self.assertEqual(data["line"], self.line_align)
 
 self.runCmd("continue")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43419: Fix TestBreakpointInGlobalConstructor for Windows

2018-02-21 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth added a comment.

By unconditional, do you mean allowing any value for `out_num_locations` in 
these cases?  I'm happy to do that, but I'm not sure if I've understood you 
correctly.


https://reviews.llvm.org/D43419



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


[Lldb-commits] [PATCH] D43419: Fix TestBreakpointInGlobalConstructor for Windows

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Yes, regardless of the target platform, if you specify num_locations = -2, then 
we just don't check the number of locations.


https://reviews.llvm.org/D43419



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


[Lldb-commits] [PATCH] D43512: DWZ 11/11: Fix for symlinked .build-id/**.debug files

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/Host/common/Symbols.cpp:288-290
 if (llvm::sys::fs::equivalent(file_spec.GetPath(),
   module_file_spec.GetPath()))
   continue;

Do we need to check the equivalentness twice? My impression is that this 
function "sees through" symlinks (and even if it didn't, doing it post-resolve 
should be enough).


https://reviews.llvm.org/D43512



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


[Lldb-commits] [PATCH] D42955: Make Module::GetSectionList output consistent

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Greg, with my last comment in mind, how do you feel about this patch?


https://reviews.llvm.org/D42955



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


[Lldb-commits] [PATCH] D43419: Fix TestBreakpointInGlobalConstructor for Windows

2018-02-21 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth updated this revision to Diff 135272.
amccarth added a comment.

Per Pavel's suggestion, change special value to mean don't check the number of 
locations found.


https://reviews.llvm.org/D43419

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
  lldb/packages/Python/lldbsuite/test/lldbutil.py


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -343,7 +343,8 @@
 
 If extra_options is not None, then we append it to the breakpoint set 
command.
 
-If num_expected_locations is -1 we check that we got AT LEAST one 
location, otherwise we check that num_expected_locations equals the number of 
locations.
+If num_expected_locations is -1, we check that we got AT LEAST one 
location. If num_expected_locations is -2, we don't
+check the actual number at all. Otherwise, we check that 
num_expected_locations equals the number of locations.
 
 If loc_exact is true, we check that there is one location, and that 
location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
 if num_locations == -1:
 test.assertTrue(out_num_locations > 0,
 "Expecting one or more locations, got none.")
-else:
+elif num_locations != -2:
 test.assertTrue(
 num_locations == out_num_locations,
 "Expecting %d locations, got %d." %
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
+
 bp_foo = lldbutil.run_break_set_by_file_and_line(
-self, 'foo.cpp', self.line_foo)
+self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
 process = target.LaunchSimple(
 None, env, self.get_process_working_directory())


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -343,7 +343,8 @@
 
 If extra_options is not None, then we append it to the breakpoint set command.
 
-If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
+If num_expected_locations is -1, we check that we got AT LEAST one location. If num_expected_locations is -2, we don't
+check the actual number at all. Otherwise, we check that num_expected_locations equals the number of locations.
 
 If loc_exact is true, we check that there is one location, and that location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
 if num_locations == -1:
 test.assertTrue(out_num_locations > 0,
 "Expecting one or more locations, got none.")
-else:
+elif num_locations != -2:
 test.assertTrue(
 num_locations == out_num_locations,
 "Expecting %d locations, got %d." %
Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
+
 bp_foo = lldbutil.run_break_set_by_file_and_line(
-self, 'foo.cpp', self.line_foo)
+self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
 process = target.LaunchSimple(
 None, env, self.get_process_working_directory())
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43577: Fix TestUbsanBasic

2018-02-21 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

I wonder whether we could use something like

  >>> import os
  >>> os.path.basename('/patatino/ino/main.c')
  'main.c'

to make this slightly more robust against files which end in `main.c` but we 
don't want to really match, e.g. `blahmain.c`.


https://reviews.llvm.org/D43577



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


[Lldb-commits] [PATCH] D42955: Make Module::GetSectionList output consistent

2018-02-21 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM.




Comment at: source/Core/Module.cpp:1286
+if (SymbolVendor *vendor = GetSymbolVendor())
+  vendor->CreateSections(*GetUnifiedSectionList());
   }

labath wrote:
> clayborg wrote:
> > should we pass "obj_file" down into the SymbolVendor::CreateSections(...) 
> > call for the case where the symbol vendor is using the same ObjectFile that 
> > it can just return?
> I don't think an extra parameter is needed to achieve this, as this is 
> something that the symbol vendor should already know about based on how it 
> was constructed.
> 
> And after looking up the implementation, it seems this is already how it 
> works right now: SymbolVendorELF (the only non-trivial implementation of this 
> function) is only constructed if it manages to find debug info in an 
> alternative symbol file (there's an `if 
> (llvm::sys::fs::equivalent(candidate_file_spec.GetPath(), 
> module_file_spec.GetPath()))` check in 
> `Symbols::LocateExecutableSymbolFile`). If we fail to construct a 
> SymbolVendorELF then a default SymbolVendor instance is created in 
> `SymbolVendor::FindPlugin` (and that one has a no-op implementation of this 
> function).
> 
I agree with Pavel's reasoning here.


https://reviews.llvm.org/D42955



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


[Lldb-commits] [lldb] r325701 - llgs-tests: Fix r325511 for debugserver

2018-02-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Feb 21 09:38:38 2018
New Revision: 325701

URL: http://llvm.org/viewvc/llvm-project?rev=325701&view=rev
Log:
llgs-tests: Fix r325511 for debugserver

Debugserver sends the thread-pcs field with leading zeroes omitted. Teach
parseRegisterValue to pad these as necessary.

Modified:
lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp
lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h

Modified: lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp?rev=325701&r1=325700&r2=325701&view=diff
==
--- lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp Wed Feb 21 
09:38:38 2018
@@ -203,7 +203,15 @@ Expected RegisterInfoParse
 
 Expected parseRegisterValue(const RegisterInfo &Info,
StringRef HexValue,
-   llvm::support::endianness Endian) {
+   llvm::support::endianness Endian,
+   bool ZeroPad) {
+  SmallString<128> Storage;
+  if (ZeroPad && HexValue.size() < Info.byte_size * 2) {
+Storage.insert(Storage.begin(), Info.byte_size * 2 - HexValue.size(), '0');
+Storage += HexValue;
+HexValue = Storage;
+  }
+
   SmallVector Bytes(HexValue.size() / 2);
   StringExtractor(HexValue).GetHexBytes(Bytes, '\xcc');
   RegisterValue Value;
@@ -301,7 +309,8 @@ StopReplyStop::create(StringRef Response
   return make_parsing_error("StopReply: Thread id '{0}'",
 std::get<0>(ThreadPc));
 
-auto PcOr = parseRegisterValue(*PcInfo, std::get<1>(ThreadPc), Endian);
+auto PcOr = parseRegisterValue(*PcInfo, std::get<1>(ThreadPc), Endian,
+   /*ZeroPad*/ true);
 if (!PcOr)
   return PcOr.takeError();
 ThreadPcs[Id] = std::move(*PcOr);

Modified: lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h?rev=325701&r1=325700&r2=325701&view=diff
==
--- lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h Wed Feb 21 
09:38:38 2018
@@ -87,7 +87,8 @@ struct RegisterInfoParser : public Parse
 
 llvm::Expected
 parseRegisterValue(const lldb_private::RegisterInfo &Info,
-   llvm::StringRef HexValue, llvm::support::endianness Endian);
+   llvm::StringRef HexValue, llvm::support::endianness Endian,
+   bool ZeroPad = false);
 
 class StopReply {
 public:


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


[Lldb-commits] [lldb] r325702 - Fix remote tests broken by r325690

2018-02-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Feb 21 09:55:22 2018
New Revision: 325702

URL: http://llvm.org/viewvc/llvm-project?rev=325702&view=rev
Log:
Fix remote tests broken by r325690

The patch added an extra argument to the append_to_process_working_directory
function. I have somehow missed updating this test, and it did not show up
because the code was only run in remote mode.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py?rev=325702&r1=325701&r2=325702&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py Wed Feb 21 
09:55:22 2018
@@ -95,7 +95,7 @@ class GenericTester(TestBase):
 if lldb.remote_platform:
 # process launch -o requires a path that is valid on the target
 self.assertIsNotNone(lldb.remote_platform.GetWorkingDirectory())
-remote_path = lldbutil.append_to_process_working_directory(
+remote_path = lldbutil.append_to_process_working_directory(self,
 "lldb-stdout-redirect.txt")
 self.runCmd(
 'process launch -- {remote}'.format(remote=remote_path))


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


[Lldb-commits] [PATCH] D43419: Fix TestBreakpointInGlobalConstructor for Windows

2018-02-21 Thread Adrian McCarthy 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 rL325704: Fix TestBreakpointInGlobalConstructor for Windows 
(authored by amccarth, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43419?vs=135272&id=135281#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43419

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
+
 bp_foo = lldbutil.run_break_set_by_file_and_line(
-self, 'foo.cpp', self.line_foo)
+self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
 process = target.LaunchSimple(
 None, env, self.get_process_working_directory())
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
@@ -343,7 +343,8 @@
 
 If extra_options is not None, then we append it to the breakpoint set 
command.
 
-If num_expected_locations is -1 we check that we got AT LEAST one 
location, otherwise we check that num_expected_locations equals the number of 
locations.
+If num_expected_locations is -1, we check that we got AT LEAST one 
location. If num_expected_locations is -2, we don't
+check the actual number at all. Otherwise, we check that 
num_expected_locations equals the number of locations.
 
 If loc_exact is true, we check that there is one location, and that 
location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
 if num_locations == -1:
 test.assertTrue(out_num_locations > 0,
 "Expecting one or more locations, got none.")
-else:
+elif num_locations != -2:
 test.assertTrue(
 num_locations == out_num_locations,
 "Expecting %d locations, got %d." %


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
+
 bp_foo = lldbutil.run_break_set_by_file_and_line(
-self, 'foo.cpp', self.line_foo)
+self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
 process = target.LaunchSimple(
 None, env, self.get_process_working_directory())
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
@@ -343,7 +343,8 @@
 
 If extra_options is not None, then we append it to the breakpoint set command.
 
-If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
+If num_expected_locations is -1, we check that we got AT LEAST one location. If num_expected_locations is -2, we don't
+check the actual number at all. Otherwise, we check that num_expected_locations equals the number of locations.
 
 If loc_exact is true, we check that there is one location, and that location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
 if num_locations == -1:
 test.assertTrue(out_num_locations > 0,
 "Expecting one or more locations, got none.")
-else:
+elif num_locations != -2:
 test.assertTrue(
 num_locations == out_num_locations,
 "Expecting %d locations, got %d." %
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r325704 - Fix TestBreakpointInGlobalConstructor for Windows

2018-02-21 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Wed Feb 21 10:08:23 2018
New Revision: 325704

URL: http://llvm.org/viewvc/llvm-project?rev=325704&view=rev
Log:
Fix TestBreakpointInGlobalConstructor for Windows

Summary:
This test was failing on Windows because it expected the breakpoint in the
dynamic library to be resolved before the process is launched.  Since the DLL
isn't loaded until the process is launched this didn't work.

The fix creates a special value (-2) for num_expected_locations that ignores
the actual number of breakpoint locations found.

Reviewers: jasonmolenda

Subscribers: sanjoy, lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py?rev=325704&r1=325703&r2=325704&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 Wed Feb 21 10:08:23 2018
@@ -29,8 +29,9 @@ class TestBreakpointInGlobalConstructors
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
+
 bp_foo = lldbutil.run_break_set_by_file_and_line(
-self, 'foo.cpp', self.line_foo)
+self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
 process = target.LaunchSimple(
 None, env, self.get_process_working_directory())

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=325704&r1=325703&r2=325704&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Wed Feb 21 10:08:23 
2018
@@ -343,7 +343,8 @@ def run_break_set_by_file_and_line(
 
 If extra_options is not None, then we append it to the breakpoint set 
command.
 
-If num_expected_locations is -1 we check that we got AT LEAST one 
location, otherwise we check that num_expected_locations equals the number of 
locations.
+If num_expected_locations is -1, we check that we got AT LEAST one 
location. If num_expected_locations is -2, we don't
+check the actual number at all. Otherwise, we check that 
num_expected_locations equals the number of locations.
 
 If loc_exact is true, we check that there is one location, and that 
location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@ def check_breakpoint_result(
 if num_locations == -1:
 test.assertTrue(out_num_locations > 0,
 "Expecting one or more locations, got none.")
-else:
+elif num_locations != -2:
 test.assertTrue(
 num_locations == out_num_locations,
 "Expecting %d locations, got %d." %


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


[Lldb-commits] [PATCH] D43577: Fix TestUbsanBasic

2018-02-21 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.

I'd be fine with this version of the patch, or one which uses path.basename to 
be more stringent.

This test is skipped on green dragon because I have not upstreamed the debugger 
integration for ubsan in compiler-rt yet.


https://reviews.llvm.org/D43577



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


[Lldb-commits] [lldb] r325708 - [testsuite/decorators] Get rid of some `expectFlakey` variants.

2018-02-21 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Feb 21 11:18:49 2018
New Revision: 325708

URL: http://llvm.org/viewvc/llvm-project?rev=325708&view=rev
Log:
[testsuite/decorators] Get rid of some `expectFlakey` variants.

These seem to be pretty much dead.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=325708&r1=325707&r2=325708&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Feb 21 11:18:49 
2018
@@ -436,12 +436,6 @@ def expectedFlakey(expected_fn, bugnumbe
 return expectedFailure_impl
 
 
-def expectedFlakeyDwarf(bugnumber=None):
-def fn(self):
-return self.getDebugInfo() == "dwarf"
-return expectedFlakey(fn, bugnumber)
-
-
 def expectedFlakeyDsym(bugnumber=None):
 def fn(self):
 return self.getDebugInfo() == "dwarf"
@@ -476,27 +470,6 @@ def expectedFlakeyNetBSD(bugnumber=None,
 return expectedFlakeyOS(['netbsd'], bugnumber, compilers)
 
 
-def expectedFlakeyCompiler(compiler, compiler_version=None, bugnumber=None):
-if compiler_version is None:
-compiler_version = ['=', None]
-
-def fn(self):
-return compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version)
-return expectedFlakey(fn, bugnumber)
-
-# @expectedFlakeyClang('bugnumber', ['<=', '3.4'])
-
-
-def expectedFlakeyClang(bugnumber=None, compiler_version=None):
-return expectedFlakeyCompiler('clang', compiler_version, bugnumber)
-
-# @expectedFlakeyGcc('bugnumber', ['<=', '3.4'])
-
-
-def expectedFlakeyGcc(bugnumber=None, compiler_version=None):
-return expectedFlakeyCompiler('gcc', compiler_version, bugnumber)
-
-
 def expectedFlakeyAndroid(bugnumber=None, api_levels=None, archs=None):
 return expectedFlakey(
 _skip_for_android(


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


Re: [Lldb-commits] [lldb] r325666 - Fix TestAppleTypesIsProduced after r324226

2018-02-21 Thread Davide Italiano via lldb-commits
On Tue, Feb 20, 2018 at 10:20 PM, Frederic Riss via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: friss
> Date: Tue Feb 20 22:20:03 2018
> New Revision: 325666
>
> URL: http://llvm.org/viewvc/llvm-project?rev=325666&view=rev
> Log:
> Fix TestAppleTypesIsProduced after r324226
>
> This test was accessing self.debug_info, which doesn't exist anymore. For
> some reason the macOS bots are skipping this test because they think the
> compiler is not clang. We'll look into this separately.
>

I stumbled upon something similar this morning so I decided to take a look.
The reason why this fails is that the test run is conditional to:

if not self.getCompiler().endswith('clang'):

If you run with an in-tree clang, you might end up with getCompiler()
returning:

/Users/davide/work/llvm-monorepo/build/bin/clang-7.0

which fails the check.

The reason why you're seeing this only locally is maybe because you're
running with the clang provided by the system instead of the one provided
in-tree.
The mismatch has been a cause of headache for me in the past already.

Regardless, the way this test was setup was good to understand this mistake
(so we should probably audit all the tests looking for this pattern), but I
have my concerns about the place where the test is located.
The program is just making sure clang emits the correct sections, so we
might consider moving this test to clang.

Thanks,

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


[Lldb-commits] [PATCH] D43591: [testsuite] Run lit tests as part of `check-lldb`

2018-02-21 Thread Davide Italiano via Phabricator via lldb-commits
davide created this revision.
davide added reviewers: friss, vsk, JDevlieghere, labath, zturner.
Herald added a subscriber: mgorny.

Also, fix a missing dependency, as lit requires `llvm-config` to run.
This is becoming more and more important as we write more FileCheck style tests 
(see Jonas' last fix to the expression parser)


https://reviews.llvm.org/D43591

Files:
  lldb/lit/CMakeLists.txt
  lldb/test/CMakeLists.txt


Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -144,6 +144,9 @@
   endif ()
 endif ()

+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -40,6 +40,7 @@
   LLDBUnitTests
   lldb
   lldb-test
+  llvm-config
   )

 if(NOT LLDB_BUILT_STANDALONE)


Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -144,6 +144,9 @@
   endif ()
 endif ()

+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -40,6 +40,7 @@
   LLDBUnitTests
   lldb
   lldb-test
+  llvm-config
   )

 if(NOT LLDB_BUILT_STANDALONE)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43592: [DWARFASTParserClang] Always complete types read from a module/PCH AST context.

2018-02-21 Thread Frederic Riss via Phabricator via lldb-commits
friss created this revision.
friss added a reviewer: clayborg.
Herald added subscribers: JDevlieghere, aprantl.

The modified test would just crash without the code change. The reason is that
we would try to extend the Foo type imported from the PCH debug info when 
adding the
Foo::Bar definitiion to it. This will crash if the type is not complete.

I pondered moving the CompleteType call inside of CopyType, but CopytType seems
to be used as a lower-level building block in other places so I decided not to.

ClangASTImporter is kinda scary. It has no comments and interacts with the Clang
ASTs which are not exactly easy to deal with. Any insight appreciated.


https://reviews.llvm.org/D43592

Files:
  packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
  packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
  packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -179,10 +179,9 @@
   lldb_private::CompilerType type =
   GetClangASTImporter().CopyType(m_ast, dwo_type);
 
-  // printf ("copied_qual_type: ast = %p, clang_type = %p, name =
-  // '%s'\n", m_ast, copied_qual_type.getAsOpaquePtr(),
-  // external_type->GetName().GetCString());
-  if (!type)
+  // The type we retrieve from the PCM debug info needs to be
+  // complete, otherwise we might crash when trying to extend it.
+  if (!type || !GetClangASTImporter().CompleteType(type))
 return TypeSP();
 
   SymbolFileDWARF *dwarf = die.GetDWARF();
Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
===
--- packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
+++ packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
@@ -10,3 +10,8 @@
 };
 
 typedef GenericContainer IntContainer;
+
+struct Foo {
+  class Bar;
+  Bar *bar;
+};
Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
===
--- packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
+++ packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
@@ -1,5 +1,8 @@
+class Foo::Bar { int i = 123; };
+
 int main(int argc, const char * argv[])
 {
 IntContainer test(42);
+Foo::Bar bar;
 return 0; // break here
 }
Index: 
packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
===
--- packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -69,3 +69,26 @@
 42,
 memberValue.GetValueAsSigned(),
 "Member value incorrect")
+
+testValue = frame.EvaluateExpression("bar")
+self.assertTrue(
+testValue.GetError().Success(),
+"Test expression value invalid: %s" %
+(testValue.GetError().GetCString()))
+self.assertTrue(
+testValue.GetTypeName() == "Foo::Bar",
+"Test expression type incorrect")
+
+memberValue = testValue.GetChildMemberWithName("i")
+self.assertTrue(
+memberValue.GetError().Success(),
+"Member value missing or invalid: %s" %
+(testValue.GetError().GetCString()))
+self.assertTrue(
+memberValue.GetTypeName() == "int",
+"Member type incorrect")
+self.assertEqual(
+123,
+memberValue.GetValueAsSigned(),
+"Member value incorrect")
+


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -179,10 +179,9 @@
   lldb_private::CompilerType type =
   GetClangASTImporter().CopyType(m_ast, dwo_type);
 
-  // printf ("copied_qual_type: ast = %p, clang_type = %p, name =
-  // '%s'\n", m_ast, copied_qual_type.getAsOpaquePtr(),
-  // external_type->GetName().GetCString());
-  if (!type)
+  // The type we retrieve from the PCM debug info needs to be
+  // complete, otherwise we might crash when trying to extend it.
+  if (!type || !GetClangASTImporter().CompleteType(type))
 return TypeSP();
 
   SymbolFileDWARF *dwarf = die.GetDWARF();
Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
===
--- packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
+++ packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
@@ -10,3 +10,8 @@
 };
 
 typedef GenericContainer IntContainer;
+
+struct Foo {
+  class Bar;
+  Bar *bar;
+};
In

[Lldb-commits] [PATCH] D43591: [testsuite] Run lit tests as part of `check-lldb`

2018-02-21 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.

LGTM


https://reviews.llvm.org/D43591



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


[Lldb-commits] [lldb] r325719 - [testsuite] Run lit tests as part of `check-lldb`.

2018-02-21 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Feb 21 13:10:44 2018
New Revision: 325719

URL: http://llvm.org/viewvc/llvm-project?rev=325719&view=rev
Log:
[testsuite] Run lit tests as part of `check-lldb`.

Also, fix a missing dependency, as lit requires llvm-config
to run. This is becoming more and more important as we
write more FileCheck style tests.

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

Modified:
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=325719&r1=325718&r2=325719&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Wed Feb 21 13:10:44 2018
@@ -40,6 +40,7 @@ set(LLDB_TEST_DEPS
   LLDBUnitTests
   lldb
   lldb-test
+  llvm-config
   )
 
 if(NOT LLDB_BUILT_STANDALONE)

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=325719&r1=325718&r2=325719&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Wed Feb 21 13:10:44 2018
@@ -144,6 +144,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
   endif ()
 endif ()
 
+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.


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


[Lldb-commits] [PATCH] D43591: [testsuite] Run lit tests as part of `check-lldb`

2018-02-21 Thread Davide Italiano via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325719: [testsuite] Run lit tests as part of `check-lldb`. 
(authored by davide, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43591?vs=135313&id=135317#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43591

Files:
  lldb/trunk/lit/CMakeLists.txt
  lldb/trunk/test/CMakeLists.txt


Index: lldb/trunk/lit/CMakeLists.txt
===
--- lldb/trunk/lit/CMakeLists.txt
+++ lldb/trunk/lit/CMakeLists.txt
@@ -40,6 +40,7 @@
   LLDBUnitTests
   lldb
   lldb-test
+  llvm-config
   )
 
 if(NOT LLDB_BUILT_STANDALONE)
Index: lldb/trunk/test/CMakeLists.txt
===
--- lldb/trunk/test/CMakeLists.txt
+++ lldb/trunk/test/CMakeLists.txt
@@ -144,6 +144,9 @@
   endif ()
 endif ()
 
+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.


Index: lldb/trunk/lit/CMakeLists.txt
===
--- lldb/trunk/lit/CMakeLists.txt
+++ lldb/trunk/lit/CMakeLists.txt
@@ -40,6 +40,7 @@
   LLDBUnitTests
   lldb
   lldb-test
+  llvm-config
   )
 
 if(NOT LLDB_BUILT_STANDALONE)
Index: lldb/trunk/test/CMakeLists.txt
===
--- lldb/trunk/test/CMakeLists.txt
+++ lldb/trunk/test/CMakeLists.txt
@@ -144,6 +144,9 @@
   endif ()
 endif ()
 
+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43546: Fix TestMultithreaded when specifying an alternative debugserver.

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

The LLDB_DEBUGSERVER_PATH is the "official" way to force a debugserver path in 
lldb. So unless you want to change the implementation in 
GDBRemoteCommunication, I don't think there is anything better you can do than 
this patch.

(I guess you could launch the executable in an inherited environment (which 
would then automatically contain this var) instead of adding it manually, but I 
don't have a strong opinion on which way is better).


https://reviews.llvm.org/D43546



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


[Lldb-commits] [lldb] r325728 - [LLDB][PPC64] Fixed next blocked forever at same line

2018-02-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Feb 21 13:56:18 2018
New Revision: 325728

URL: http://llvm.org/viewvc/llvm-project?rev=325728&view=rev
Log:
[LLDB][PPC64] Fixed next blocked forever at same line

Summary:
The PC corresponding to the breakpoint was being calculated wrongly,
which was causing LLDB to never go past the first breakpoint, when
there was a second one adjacent to it.

Reviewers: clayborg, labath

Reviewed By: clayborg, labath

Subscribers: anajuliapc, alexandreyy, lbianc

Differential Revision: https://reviews.llvm.org/D43344
Patch by Leandro Lupori .

Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=325728&r1=325727&r2=325728&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Feb 21 
13:56:18 2018
@@ -1518,7 +1518,6 @@ Status NativeProcessLinux::GetSoftwareBr
   // set per architecture.  Need ARM, MIPS support here.
   static const uint8_t g_i386_opcode[] = {0xCC};
   static const uint8_t g_s390x_opcode[] = {0x00, 0x01};
-  static const uint8_t g_ppc64le_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap
 
   switch (m_arch.GetMachine()) {
   case llvm::Triple::x86:
@@ -1530,16 +1529,13 @@ Status NativeProcessLinux::GetSoftwareBr
 actual_opcode_size = static_cast(sizeof(g_s390x_opcode));
 return Status();
 
-  case llvm::Triple::ppc64le:
-actual_opcode_size = static_cast(sizeof(g_ppc64le_opcode));
-return Status();
-
   case llvm::Triple::arm:
   case llvm::Triple::aarch64:
   case llvm::Triple::mips64:
   case llvm::Triple::mips64el:
   case llvm::Triple::mips:
   case llvm::Triple::mipsel:
+  case llvm::Triple::ppc64le:
 // On these architectures the PC don't get updated for breakpoint hits
 actual_opcode_size = 0;
 return Status();


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


[Lldb-commits] [PATCH] D43596: Replace HashStringUsingDJB with llvm::djbHash

2018-02-21 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: aprantl, davide.
Herald added a subscriber: JDevlieghere.

The llvm function is equivalent to this one. Where possible I tried to
replace const char* with llvm::StringRef to avoid extra strlen
computations. In most places, I was able to track the c string back to
the ConstString it was created from.

This also removes the unused ExportTable class.


https://reviews.llvm.org/D43596

Files:
  include/lldb/Core/MappedHash.h
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Target/ObjCLanguageRuntime.cpp

Index: source/Target/ObjCLanguageRuntime.cpp
===
--- source/Target/ObjCLanguageRuntime.cpp
+++ source/Target/ObjCLanguageRuntime.cpp
@@ -23,6 +23,7 @@
 #include "lldb/Utility/Timer.h"
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/DJB.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -45,8 +46,7 @@
   if (isa != 0) {
 m_isa_to_descriptor[isa] = descriptor_sp;
 // class_name is assumed to be valid
-m_hash_to_isa_map.insert(
-std::make_pair(MappedHash::HashStringUsingDJB(class_name), isa));
+m_hash_to_isa_map.insert(std::make_pair(llvm::djbHash(class_name), isa));
 return true;
   }
   return false;
@@ -180,8 +180,7 @@
 } else {
   // Name hashes were provided, so use them to efficiently lookup name to
   // isa/descriptor
-  const uint32_t name_hash =
-  MappedHash::HashStringUsingDJB(name.GetCString());
+  const uint32_t name_hash = llvm::djbHash(name.GetStringRef());
   std::pair range =
   m_hash_to_isa_map.equal_range(name_hash);
   for (HashToISAIterator range_pos = range.first; range_pos != range.second;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1510,7 +1510,8 @@
   method_die_offsets.clear();
   if (m_using_apple_tables) {
 if (m_apple_objc_ap.get())
-  m_apple_objc_ap->FindByName(class_name.GetCString(), method_die_offsets);
+  m_apple_objc_ap->FindByName(class_name.GetStringRef(),
+  method_die_offsets);
   } else {
 if (!m_indexed)
   Index();
@@ -2183,7 +2184,7 @@
   basename))
 basename = name_cstr;
 
-  m_apple_names_ap->FindByName(basename.data(), die_offsets);
+  m_apple_names_ap->FindByName(basename, die_offsets);
 }
   } else {
 // Index the DWARF if we haven't already
@@ -2489,8 +2490,6 @@
   // Remember how many sc_list are in the list before we search in case
   // we are appending the results to a variable list.
 
-  const char *name_cstr = name.GetCString();
-
   const uint32_t original_size = sc_list.GetSize();
 
   DWARFDebugInfo *info = DebugInfo();
@@ -2511,7 +2510,8 @@
 // want to canonicalize this (strip double spaces, etc.  For now, we
 // just add all the
 // dies that we find by exact match.
-num_matches = m_apple_names_ap->FindByName(name_cstr, die_offsets);
+num_matches =
+m_apple_names_ap->FindByName(name.GetStringRef(), die_offsets);
 for (uint32_t i = 0; i < num_matches; i++) {
   const DIERef &die_ref = die_offsets[i];
   DWARFDIE die = info->GetDIE(die_ref);
@@ -2527,16 +2527,17 @@
 GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
 "the DWARF debug information has been modified (.apple_names "
 "accelerator table had bad die 0x%8.8x for '%s')",
-die_ref.die_offset, name_cstr);
+die_ref.die_offset, name.GetCString());
   }
 }
   }
 
   if (name_type_mask & eFunctionNameTypeSelector) {
 if (parent_decl_ctx && parent_decl_ctx->IsValid())
   return 0; // no selectors in namespaces
 
-num_matches = m_apple_names_ap->FindByName(name_cstr, die_offsets);
+num_matches =
+m_apple_names_ap->FindByName(name.GetStringRef(), die_offsets);
 // Now make sure these are actually ObjC methods.  In this case we can
 // simply look up the name,
 // and if it is an ObjC method name, we're good.
@@ -2556,7 +2557,7 @@
 GetObjectFile()->GetModule()->ReportError(
 "the DWARF debug information has been modified (.apple_names "
 "accelerator table had bad die 0x%8.8x for '%s')",
-die_ref.die_offset, name_cstr);
+die_ref.die_offset, name.GetCString());
   }
 }
 die_offsets.clear();
@@ -2572,7 +2573,8 @@
 
 // FIXME: Arrange the logic above so that we don't calculate the base
 // name t

[Lldb-commits] [PATCH] D43596: Replace HashStringUsingDJB with llvm::djbHash

2018-02-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.



Comment at: include/lldb/Core/MappedHash.h:156
-  template 
-  class ExportTable {
-  public:

Yeah this looks like it was a dead end dating back to 2011.



Comment at: source/Target/ObjCLanguageRuntime.cpp:49
 // class_name is assumed to be valid
-m_hash_to_isa_map.insert(
-std::make_pair(MappedHash::HashStringUsingDJB(class_name), isa));
+m_hash_to_isa_map.insert(std::make_pair(llvm::djbHash(class_name), isa));
 return true;

`m_hash_to_isa_map.insert({llvm::djbHash(class_name), isa});`


https://reviews.llvm.org/D43596



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


[Lldb-commits] [PATCH] D43596: Replace HashStringUsingDJB with llvm::djbHash

2018-02-21 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.

Thanks.


https://reviews.llvm.org/D43596



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


[Lldb-commits] [PATCH] D43599: FFix TestSBData.py on Windows (which uses Python 3)

2018-02-21 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
Herald added a subscriber: sanjoy.

This test uses the SB API to set and read back bytes of data, and it works fine
when Python 2 is the scripting language. On Windows, however, Python 3 is the
default.

Note this line from the test:

  addr_data = '\x11\x22\x33\x44\x55\x66\x77\x88'

The intent here is to create an array of eight bytes as a string literal. This
works in Python 2, but Python 3 treats those as a series Unicode code points,
and the CPython implementation happens to encode those code points as UTF-8.
The first seven characters encode directly as single bytes of the same value,
but the UTF-8 encoding of 0x88 is two bytes long: 0xC2 0x88.  Thus the input
array doesn't have the intended data at the end, and tests that rely on the
byte fails.

Adding the b prefix tells Python 3 that we want a byte array rather than a
string. With this change, the test now passes on Windows.

Fix TestMoveNearest on Windows

The header file for the DLL tried to declare inline functions and a local
function as dllexport which broke the compile and link.  Removing the bad
declarations solves the problem, and the test passes on Windows now.


https://reviews.llvm.org/D43599

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
  lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py


Index: lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
===
--- lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
+++ lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
@@ -25,7 +25,7 @@
 def test_byte_order_and_address_byte_size(self):
 """Test the SBData::SetData() to ensure the byte order and address 
 byte size are obeyed"""
-addr_data = '\x11\x22\x33\x44\x55\x66\x77\x88'
+addr_data = b'\x11\x22\x33\x44\x55\x66\x77\x88'
 error = lldb.SBError()
 data = lldb.SBData()
 data.SetData(error, addr_data, lldb.eByteOrderBig, 4)
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
@@ -1,6 +1,5 @@
-LLDB_TEST_API inline int foo1() { return 1; } // !BR1
+inline int foo1() { return 1; } // !BR1
 
-LLDB_TEST_API inline int foo2() { return 2; } // !BR2
+inline int foo2() { return 2; } // !BR2
 
 LLDB_TEST_API extern int call_foo1();
-LLDB_TEST_API extern int call_foo2();


Index: lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
===
--- lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
+++ lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
@@ -25,7 +25,7 @@
 def test_byte_order_and_address_byte_size(self):
 """Test the SBData::SetData() to ensure the byte order and address 
 byte size are obeyed"""
-addr_data = '\x11\x22\x33\x44\x55\x66\x77\x88'
+addr_data = b'\x11\x22\x33\x44\x55\x66\x77\x88'
 error = lldb.SBError()
 data = lldb.SBData()
 data.SetData(error, addr_data, lldb.eByteOrderBig, 4)
Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
===
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
+++ lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
@@ -1,6 +1,5 @@
-LLDB_TEST_API inline int foo1() { return 1; } // !BR1
+inline int foo1() { return 1; } // !BR1
 
-LLDB_TEST_API inline int foo2() { return 2; } // !BR2
+inline int foo2() { return 2; } // !BR2
 
 LLDB_TEST_API extern int call_foo1();
-LLDB_TEST_API extern int call_foo2();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43600: Fix TestMoveNearest on Windows

2018-02-21 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
Herald added a subscriber: sanjoy.

The header file for the DLL tried to declare inline functions and a local
function as dllexport which broke the compile and link.  Removing the bad
declarations solves the problem, and the test passes on Windows now.


https://reviews.llvm.org/D43600

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h


Index: 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
@@ -1,6 +1,5 @@
-LLDB_TEST_API inline int foo1() { return 1; } // !BR1
+inline int foo1() { return 1; } // !BR1
 
-LLDB_TEST_API inline int foo2() { return 2; } // !BR2
+inline int foo2() { return 2; } // !BR2
 
 LLDB_TEST_API extern int call_foo1();
-LLDB_TEST_API extern int call_foo2();


Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
===
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
+++ lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
@@ -1,6 +1,5 @@
-LLDB_TEST_API inline int foo1() { return 1; } // !BR1
+inline int foo1() { return 1; } // !BR1
 
-LLDB_TEST_API inline int foo2() { return 2; } // !BR2
+inline int foo2() { return 2; } // !BR2
 
 LLDB_TEST_API extern int call_foo1();
-LLDB_TEST_API extern int call_foo2();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43599: FFix TestSBData.py on Windows (which uses Python 3)

2018-02-21 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth abandoned this revision.
amccarth added a comment.

Please ignore.  I'm still trying to figure out arc.


https://reviews.llvm.org/D43599



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