[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-03-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

re-adding debugserver deps here: https://reviews.llvm.org/D98196


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-03-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: lldb/test/API/CMakeLists.txt:115
-set(LLDB_TEST_SERVER ${debugserver_path})
-add_lldb_test_dependency(debugserver)
-  elseif(TARGET lldb-server)

labath wrote:
> teemperor wrote:
> > I believe this removed line is causing us to have missing dependencies. I 
> > just did a clean build of LLDB and it turns out that `debugserver` is no 
> > longer a dependency of `check-lldb`, which causes a bunch of weird test 
> > failures such as:
> > 
> > ```
> > 
> > FAIL: lldb-unit :: 
> > tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs
> >  (2268 of 2282)
> >  TEST 'lldb-unit :: 
> > tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs'
> >  FAILED 
> > Note: Google Test filter = 
> > StandardStartupTest.TestStopReplyContainsThreadPcs
> > [==] Running 1 test from 1 test case.
> > [--] Global test environment set-up.
> > [--] 1 test from StandardStartupTest
> > [ RUN  ] StandardStartupTest.TestStopReplyContainsThreadPcs
> > /Users/teemperor/3llvm/llvm-project/lldb/unittests/tools/lldb-server/tests/TestBase.h:49:
> >  Failure
> > Value of: llvm::detail::TakeExpected(ClientOr)
> > Expected: succeeded
> >   Actual: failed  (executable doesn't exist: 
> > '/Users/teemperor/3llvm/rel/bin/debugserver')
> > [  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs (5 ms)
> > [--] 1 test from StandardStartupTest (5 ms total)
> > 
> > [--] Global test environment tear-down
> > [==] 1 test from 1 test case ran. (5 ms total)
> > [  PASSED  ] 0 tests.
> > [  FAILED  ] 1 test, listed below:
> > [  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs
> > 
> >  1 FAILED TEST
> > ```
> > 
> > I haven't bisected yet what exactly did remove the `debugserver` dependency 
> > but I'm pretty sure it's this patch (due to being landed recently and me 
> > not finding any other place where we added this dependency)
> Thanks for letting me know, and sorry about the breakage. Your analysis 
> sounds believable.
> I guess this should be replaced by something like
> ```
> if(TARGET debugserver)
>   add_lldb_test_dependency(debugserver)
> endif()
> if(TARGET lldb-server)
>   add_lldb_test_dependency(lldb-server)
> endif()
> ```
> 
> I can do that tomorrow.
I'm still in office for a while so I can do it now :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-03-08 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/test/API/CMakeLists.txt:115
-set(LLDB_TEST_SERVER ${debugserver_path})
-add_lldb_test_dependency(debugserver)
-  elseif(TARGET lldb-server)

teemperor wrote:
> I believe this removed line is causing us to have missing dependencies. I 
> just did a clean build of LLDB and it turns out that `debugserver` is no 
> longer a dependency of `check-lldb`, which causes a bunch of weird test 
> failures such as:
> 
> ```
> 
> FAIL: lldb-unit :: 
> tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs
>  (2268 of 2282)
>  TEST 'lldb-unit :: 
> tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs'
>  FAILED 
> Note: Google Test filter = StandardStartupTest.TestStopReplyContainsThreadPcs
> [==] Running 1 test from 1 test case.
> [--] Global test environment set-up.
> [--] 1 test from StandardStartupTest
> [ RUN  ] StandardStartupTest.TestStopReplyContainsThreadPcs
> /Users/teemperor/3llvm/llvm-project/lldb/unittests/tools/lldb-server/tests/TestBase.h:49:
>  Failure
> Value of: llvm::detail::TakeExpected(ClientOr)
> Expected: succeeded
>   Actual: failed  (executable doesn't exist: 
> '/Users/teemperor/3llvm/rel/bin/debugserver')
> [  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs (5 ms)
> [--] 1 test from StandardStartupTest (5 ms total)
> 
> [--] Global test environment tear-down
> [==] 1 test from 1 test case ran. (5 ms total)
> [  PASSED  ] 0 tests.
> [  FAILED  ] 1 test, listed below:
> [  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs
> 
>  1 FAILED TEST
> ```
> 
> I haven't bisected yet what exactly did remove the `debugserver` dependency 
> but I'm pretty sure it's this patch (due to being landed recently and me not 
> finding any other place where we added this dependency)
Thanks for letting me know, and sorry about the breakage. Your analysis sounds 
believable.
I guess this should be replaced by something like
```
if(TARGET debugserver)
  add_lldb_test_dependency(debugserver)
endif()
if(TARGET lldb-server)
  add_lldb_test_dependency(lldb-server)
endif()
```

I can do that tomorrow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-03-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: lldb/test/API/CMakeLists.txt:115
-set(LLDB_TEST_SERVER ${debugserver_path})
-add_lldb_test_dependency(debugserver)
-  elseif(TARGET lldb-server)

I believe this removed line is causing us to have missing dependencies. I just 
did a clean build of LLDB and it turns out that `debugserver` is no longer a 
dependency of `check-lldb`, which causes a bunch of weird test failures such as:

```

FAIL: lldb-unit :: 
tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs
 (2268 of 2282)
 TEST 'lldb-unit :: 
tools/lldb-server/tests/./LLDBServerTests/StandardStartupTest.TestStopReplyContainsThreadPcs'
 FAILED 
Note: Google Test filter = StandardStartupTest.TestStopReplyContainsThreadPcs
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from StandardStartupTest
[ RUN  ] StandardStartupTest.TestStopReplyContainsThreadPcs
/Users/teemperor/3llvm/llvm-project/lldb/unittests/tools/lldb-server/tests/TestBase.h:49:
 Failure
Value of: llvm::detail::TakeExpected(ClientOr)
Expected: succeeded
  Actual: failed  (executable doesn't exist: 
'/Users/teemperor/3llvm/rel/bin/debugserver')
[  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs (5 ms)
[--] 1 test from StandardStartupTest (5 ms total)

[--] Global test environment tear-down
[==] 1 test from 1 test case ran. (5 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] StandardStartupTest.TestStopReplyContainsThreadPcs

 1 FAILED TEST
```

I haven't bisected yet what exactly did remove the `debugserver` dependency but 
I'm pretty sure it's this patch (due to being landed recently and me not 
finding any other place where we added this dependency)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-22 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-76
 """
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 

goncharov wrote:
> hi @labath ! Sorry for ignorance but what is the reason to remove this 
> resolution through env? For me (due to complicated build system) lldb-server 
> is located in completely different location and "which lldb-server" finds 
> nothing. cc @rupprecht 
The main reason is that the variable was overloaded to mean both the path to 
the debugserver and lldb-server binaries (which meant that it was not possible 
to find both), though one could also argue this environment variable override 
is a gross hack in itself.

Where does `GetLLDBPath(lldb.ePathTypeSupportExecutableDir)` point to in your 
case? Could it be fixed (maybe via the new `SharedLibraryDirectoryHelper` 
(D96779)), or lldb-server moved so that the result is correct. If the support 
executable directory is not correct, then you're likely to run into other 
problems besides failing tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-22 Thread Mikhail Goncharov via Phabricator via lldb-commits
goncharov added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-76
 """
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 

hi @labath ! Sorry for ignorance but what is the reason to remove this 
resolution through env? For me (due to complicated build system) lldb-server is 
located in completely different location and "which lldb-server" finds nothing. 
cc @rupprecht 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-11 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D96202#2557365 , @stella.stamenova 
wrote:

> It looks like this change resulted in a failing test on the Windows LLDB bot:
>
> http://lab.llvm.org:8011/#/builders/83/builds/3602
>
> It seems like one of the tests is trying to re-use the same log names within 
> a single run and they are still being used by the previous instance from the 
> same test run. Can you have a look?

I don't understand yet what is going on, but it does seem like this patch is to 
blame. I'll revert while I try to understand this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-11 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

It looks like this change resulted in a failing test on the Windows LLDB bot:

http://lab.llvm.org:8011/#/builders/83/builds/3602

It seems like one of the tests is trying to re-use the same log names within a 
single run and they are still being used by the previous instance from the same 
test run. Can you have a look?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-11 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7df4eaaa9373: [lldb/test] Automatically find debug servers 
to test (authored by labath).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
  lldb/test/API/CMakeLists.txt
  lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
  lldb/test/API/lit.site.cfg.py.in
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -8,7 +8,6 @@
 executable = '@LLDB_TEST_EXECUTABLE_CONFIGURED@'
 compiler = '@LLDB_TEST_COMPILER_CONFIGURED@'
 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
-server = '@LLDB_TEST_SERVER_CONFIGURED@'
 lldb_build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
 lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
 lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
@@ -28,8 +27,6 @@
 cmd.extend(['--dsymutil', dsymutil])
 cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
 cmd.extend(['--llvm-tools-dir', llvm_tools_dir])
-if server:
-cmd.extend(['--server', server])
 if lldb_framework_dir:
 cmd.extend(['--framework', lldb_framework_dir])
 if lldb_build_intel_pt == "1":
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -19,7 +19,6 @@
   LLDB_TEST_EXECUTABLE
   LLDB_TEST_COMPILER
   LLDB_TEST_DSYMUTIL
-  LLDB_TEST_SERVER
   LLDB_LIBS_DIR
   LLVM_TOOLS_DIR
   )
Index: lldb/test/API/lit.site.cfg.py.in
===
--- lldb/test/API/lit.site.cfg.py.in
+++ lldb/test/API/lit.site.cfg.py.in
@@ -29,7 +29,6 @@
 config.test_arch = '@LLDB_TEST_ARCH@'
 config.test_compiler = '@LLDB_TEST_COMPILER@'
 config.dsymutil = '@LLDB_TEST_DSYMUTIL@'
-config.server = '@LLDB_TEST_SERVER@'
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
@@ -55,7 +54,6 @@
 config.lldb_executable = config.lldb_executable % lit_config.params
 config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params
 config.test_compiler = config.test_compiler % lit_config.params
-config.server = config.server % lit_config.params
 config.lldb_framework_dir = config.lldb_framework_dir % lit_config.params
 config.dotest_args_str = config.dotest_args_str % lit_config.params
 except KeyError as e:
Index: lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
===
--- lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
+++ lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
@@ -3,6 +3,7 @@
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
+from lldbgdbserverutils import get_debugserver_exe
 
 import os
 import platform
@@ -28,7 +29,7 @@
 TIMEOUT = 2
 
 def no_debugserver(self):
-if os.getenv('LLDB_DEBUGSERVER_PATH') is None:
+if get_debugserver_exe() is None:
 return 'no debugserver'
 return None
 
@@ -88,7 +89,7 @@
 shutil.move(exe, exe_sdk_path)
 
 # Attach to it with debugserver.
-debugserver = os.getenv('LLDB_DEBUGSERVER_PATH')
+debugserver = get_debugserver_exe()
 debugserver_args = [
 'localhost:{}'.format(self.PORT), '--attach={}'.format(pid)
 ]
Index: lldb/test/API/CMakeLists.txt
===
--- lldb/test/API/CMakeLists.txt
+++ lldb/test/API/CMakeLists.txt
@@ -108,18 +108,8 @@
 message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}")
 list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
 add_lldb_test_dependency(debugserver)
-  elseif(TARGET debugserver)
-set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver)
-message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}")
-set(LLDB_TEST_SERVER ${debugserver_path})
-add_lldb_test_dependency(debugserver)
-  elseif(TARGET lldb-server)
-set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server)
-message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}")
-set(LLDB_TEST_SERVER ${lldb_server_path})
-add_lldb_test_dependency(lldb-server)
   else()
-message(WARNING "LLDB Tests enabled, 

[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-11 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-79
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-return _get_debug_monitor_from_lldb(
-lldbtest_config.lldbExec, "lldb-server")

rupprecht wrote:
> labath wrote:
> > rupprecht wrote:
> > > labath wrote:
> > > > @rupprecht : I'm adding you mainly because my last attempt to change 
> > > > this function broke some google integration stuff.
> > > Thanks, patching this in now! (Sorry for the delay, I was out a couple 
> > > days)
> > Sure, np. Let me know how it works out.
> Everything I've tried to throw this against seems to be working. I'm not sure 
> exactly what the problem was before though. Seems fine to land and I can take 
> a closer look if something fails later. Thanks for the heads up!
Thanks for checking it out.

The previous patch simply removed the LLDB_DEBUGSERVER_PATH thingy, and left 
the original logic logic in place (which was calculating the lldb server 
location based on realpath(3) of the lldb binary, which does not work well 
inside google).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-10 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht accepted this revision.
rupprecht added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-79
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-return _get_debug_monitor_from_lldb(
-lldbtest_config.lldbExec, "lldb-server")

labath wrote:
> rupprecht wrote:
> > labath wrote:
> > > @rupprecht : I'm adding you mainly because my last attempt to change this 
> > > function broke some google integration stuff.
> > Thanks, patching this in now! (Sorry for the delay, I was out a couple days)
> Sure, np. Let me know how it works out.
Everything I've tried to throw this against seems to be working. I'm not sure 
exactly what the problem was before though. Seems fine to land and I can take a 
closer look if something fails later. Thanks for the heads up!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-10 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D96202#2551546 , @JDevlieghere 
wrote:

> In D96202#2550712 , @labath wrote:
>
>> What exactly is that use case? Do you want to run the tests with the 
>> debugserver that comes with that xcode install? If that's the case, then I 
>> would expect this to just work, as lldb knows that in a framework build, the 
>> "support executable directory" is located inside the framework: 
>> https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L138
>
> Even better, that's exactly the logic I had in mind, but I was going to add 
> it in dotest based on the `--framework` argument. Cool, cool, cool.

Cool, I'm glad that this works out.




Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-79
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-return _get_debug_monitor_from_lldb(
-lldbtest_config.lldbExec, "lldb-server")

rupprecht wrote:
> labath wrote:
> > @rupprecht : I'm adding you mainly because my last attempt to change this 
> > function broke some google integration stuff.
> Thanks, patching this in now! (Sorry for the delay, I was out a couple days)
Sure, np. Let me know how it works out.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-10 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-79
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-return _get_debug_monitor_from_lldb(
-lldbtest_config.lldbExec, "lldb-server")

labath wrote:
> @rupprecht : I'm adding you mainly because my last attempt to change this 
> function broke some google integration stuff.
Thanks, patching this in now! (Sorry for the delay, I was out a couple days)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D96202#2550712 , @labath wrote:

> In D96202#2549497 , @JDevlieghere 
> wrote:
>
>> This will break my "run the tests against an Xcode install", but it seems 
>> like I should be able to work around that looking for debugserver in the 
>> LLDB.framework in `get_debugserver_exe`. Overall this is a pretty nice 
>> cleanup so seems like a fair trade-off. LGTM.
>
> What exactly is that use case? Do you want to run the tests with the 
> debugserver that comes with that xcode install? If that's the case, then I 
> would expect this to just work, as lldb knows that in a framework build, the 
> "support executable directory" is located inside the framework: 
> https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L138

Even better, that's exactly the logic I had in mind, but I was going to add it 
in dotest based on the `--framework` argument. Cool, cool, cool.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-09 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D96202#2549497 , @JDevlieghere 
wrote:

> This will break my "run the tests against an Xcode install", but it seems 
> like I should be able to work around that looking for debugserver in the 
> LLDB.framework in `get_debugserver_exe`. Overall this is a pretty nice 
> cleanup so seems like a fair trade-off. LGTM.

What exactly is that use case? Do you want to run the tests with the 
debugserver that comes with that xcode install? If that's the case, then I 
would expect this to just work, as lldb knows that in a framework build, the 
"support executable directory" is located inside the framework: 
https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L138


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

This will break my "run the tests against an Xcode install", but it seems like 
I should be able to work around that looking for debugserver in the 
LLDB.framework in `get_debugserver_exe`. Overall this is a pretty nice cleanup 
so seems like a fair trade-off. LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-06 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py:75-79
-if "LLDB_DEBUGSERVER_PATH" in os.environ:
-return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-return _get_debug_monitor_from_lldb(
-lldbtest_config.lldbExec, "lldb-server")

@rupprecht : I'm adding you mainly because my last attempt to change this 
function broke some google integration stuff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96202/new/

https://reviews.llvm.org/D96202

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


[Lldb-commits] [PATCH] D96202: [lldb/test] Automatically find debug servers to test

2021-02-06 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, rupprecht.
Herald added a subscriber: mgorny.
labath requested review of this revision.
Herald added a project: LLDB.

Our test configuration logic assumes that the tests can be run either
with debugserver or with lldb-server. This is not entirely correct,
since lldb server has two "personalities" (platform server and debug
server) and debugserver is only a replacement for the latter.

A consequence of this is that it's not possible to test the platform
behavior of lldb-server on macos, as it is not possible to get a hold of
the lldb-server binary.

One solution to that would be to duplicate the server configuration
logic to be able to specify both executables. However, that seems
excessively redundant.

A well-behaved lldb should be able to find the debug server on its own,
and testing lldb with a different (lldb-|debug)server does not seem very
useful (even in the out-of-tree debugserver setup, we copy the server
into the build tree to make it appear "real").

Therefore, this patch deletes the configuration altogether and changes
the low-level server retrieval functions to be able to both lldb-server
and debugserver paths. They do this by consulting the "support
executable" directory of the lldb under test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96202

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
  lldb/test/API/CMakeLists.txt
  lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
  lldb/test/API/lit.site.cfg.py.in
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -8,7 +8,6 @@
 executable = '@LLDB_TEST_EXECUTABLE_CONFIGURED@'
 compiler = '@LLDB_TEST_COMPILER_CONFIGURED@'
 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
-server = '@LLDB_TEST_SERVER_CONFIGURED@'
 lldb_build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
 lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
 lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
@@ -28,8 +27,6 @@
 cmd.extend(['--dsymutil', dsymutil])
 cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
 cmd.extend(['--llvm-tools-dir', llvm_tools_dir])
-if server:
-cmd.extend(['--server', server])
 if lldb_framework_dir:
 cmd.extend(['--framework', lldb_framework_dir])
 if lldb_build_intel_pt == "1":
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -19,7 +19,6 @@
   LLDB_TEST_EXECUTABLE
   LLDB_TEST_COMPILER
   LLDB_TEST_DSYMUTIL
-  LLDB_TEST_SERVER
   LLDB_LIBS_DIR
   LLVM_TOOLS_DIR
   )
Index: lldb/test/API/lit.site.cfg.py.in
===
--- lldb/test/API/lit.site.cfg.py.in
+++ lldb/test/API/lit.site.cfg.py.in
@@ -29,7 +29,6 @@
 config.test_arch = '@LLDB_TEST_ARCH@'
 config.test_compiler = '@LLDB_TEST_COMPILER@'
 config.dsymutil = '@LLDB_TEST_DSYMUTIL@'
-config.server = '@LLDB_TEST_SERVER@'
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
@@ -55,7 +54,6 @@
 config.lldb_executable = config.lldb_executable % lit_config.params
 config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params
 config.test_compiler = config.test_compiler % lit_config.params
-config.server = config.server % lit_config.params
 config.lldb_framework_dir = config.lldb_framework_dir % lit_config.params
 config.dotest_args_str = config.dotest_args_str % lit_config.params
 except KeyError as e:
Index: lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
===
--- lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
+++ lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
@@ -3,6 +3,7 @@
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
+from lldbgdbserverutils import get_debugserver_exe
 
 import os
 import platform
@@ -28,7 +29,7 @@
 TIMEOUT = 2
 
 def no_debugserver(self):
-if os.getenv('LLDB_DEBUGSERVER_PATH') is None:
+if get_debugserver_exe() is None:
 return 'no debugserver'
 return None
 
@@ -88,7 +89,7 @@
 shutil.move(exe, exe_sdk_path)
 
 # Attach to it with debugserver.
-debugserver = os.getenv('LLDB_DEBUGSERVER_PATH')
+debugserver = get_debugserver_exe()
 debugserver_args = [