[Lldb-commits] [lldb] r330500 - FreeBSD: propagate error to user if memory access fails

2018-04-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Apr 21 04:23:56 2018
New Revision: 330500

URL: http://llvm.org/viewvc/llvm-project?rev=330500&view=rev
Log:
FreeBSD: propagate error to user if memory access fails

Previously, an attempt to read an unreadable address reported zeros.
Now, if DoReadMemory or DoWriteMemory encounters error then return 0
(bytes read or written) so that the error is reported to the user.

llvm.org/pr37190

Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=330500&r1=330499&r2=330500&view=diff
==
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sat Apr 21 
04:23:56 2018
@@ -159,8 +159,10 @@ static size_t DoReadMemory(lldb::pid_t p
   pi_desc.piod_addr = buf;
   pi_desc.piod_len = size;
 
-  if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0)
+  if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) {
 error.SetErrorToErrno();
+return 0;
+  }
   return pi_desc.piod_len;
 }
 
@@ -173,8 +175,10 @@ static size_t DoWriteMemory(lldb::pid_t
   pi_desc.piod_addr = (void *)buf;
   pi_desc.piod_len = size;
 
-  if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0)
+  if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) {
 error.SetErrorToErrno();
+return 0;
+  }
   return pi_desc.piod_len;
 }
 


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


[Lldb-commits] [lldb] r330504 - Temporarily skip Go TestExpressions on FreeBSD as it hangs

2018-04-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Apr 21 06:59:07 2018
New Revision: 330504

URL: http://llvm.org/viewvc/llvm-project?rev=330504&view=rev
Log:
Temporarily skip Go TestExpressions on FreeBSD as it hangs

llvm.org/pr37194

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py?rev=330504&r1=330503&r2=330504&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
 Sat Apr 21 06:59:07 2018
@@ -15,6 +15,7 @@ class TestGoUserExpression(TestBase):
 
 @add_test_categories(['pyapi'])
 @skipIfRemote  # Not remote test suit ready
+@skipIfFreeBSD  # Test hanging on FreeBSD - llvm.org/pr37194
 @skipUnlessGoInstalled
 def test_with_dsym_and_python_api(self):
 """Test GoASTUserExpress."""


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


[Lldb-commits] [lldb] r330518 - [lit] Generate a single lit cfg file for tests that require dotest.py

2018-04-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Sat Apr 21 11:23:04 2018
New Revision: 330518

URL: http://llvm.org/viewvc/llvm-project?rev=330518&view=rev
Log:
[lit] Generate a single lit cfg file for tests that require dotest.py

The current way that the lit configuration is generated for the LLDB
tests that run using dotest causes cmake to fail when using a generator
which supports multiple configurations (such as Visual Studio). The
failure is because file GENERATE will create a file *per possible
configuration* resulting in the same lit configuration file being
overwritten multiple times.

To fix the issue, we need to create a single lit file that is agnostic
of the configurations and can be used for any configuration.

Patch by: Stella Stamenova

Differential revision: https://reviews.llvm.org/D45918

Modified:
lldb/trunk/lit/Suite/lit.site.cfg.in
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/lit/Suite/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.site.cfg.in?rev=330518&r1=330517&r2=330518&view=diff
==
--- lldb/trunk/lit/Suite/lit.site.cfg.in (original)
+++ lldb/trunk/lit/Suite/lit.site.cfg.in Sat Apr 21 11:23:04 2018
@@ -12,13 +12,14 @@ config.lldb_src_root = "@LLDB_SOURCE_DIR
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
-config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
+config.dotest_args_str = "@LLDB_DOTEST_ARGS_STR@"
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
 try:
 config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
 config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+config.dotest_args_str = config.dotest_args_str % lit_config.params
 config.llvm_build_mode = config.llvm_build_mode % lit_config.params
 except KeyError as e:
 key, = e.args

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=330518&r1=330517&r2=330518&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Sat Apr 21 11:23:04 2018
@@ -51,8 +51,8 @@ endif ()
 
 # Allow the user to override the default by setting LLDB_TEST_ARCH
 set(LLDB_TEST_ARCH
-   ${LLDB_DEFAULT_TEST_ARCH}
-   CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64).  
Determines whether tests are compiled with -m32 or -m64")
+  ${LLDB_DEFAULT_TEST_ARCH}
+  CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64).  
Determines whether tests are compiled with -m32 or -m64")
 
 # Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to 
pass to the script
 set(LLDB_TEST_USER_ARGS
@@ -66,8 +66,6 @@ set(LLDB_TEST_USER_ARGS
 # the build directory.
 set(LLDB_TEST_COMMON_ARGS
   --arch=${LLDB_TEST_ARCH}
-  --executable $
-  --dsymutil $
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
   --build-dir
@@ -75,9 +73,30 @@ set(LLDB_TEST_COMMON_ARGS
   -S nm
   -u CXXFLAGS
   -u CFLAGS
+  )
+
+# We need two properties here, because they are used for different purposes. 
When we are generating
+# one file per configuration for lldb-dotest, we want the paths to be 
configuration specific. However,
+# when we are generating a single lit file, the file itself should not be per 
configuration and the paths
+# contained inside should be generic also.
+set(LLDB_EXECUTABLE_PATH_ARGS
+  --executable $
+  --dsymutil $
+  )
+set(LLDB_EXECUTABLE_PATH_ARGS_STR
+  --executable ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}
+  --dsymutil ${LLVM_RUNTIME_OUTPUT_INTDIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}
   -C ${LLDB_TEST_C_COMPILER}
   )
 
+# There's an additional complication which is that when the compiler is NOT a 
custom compiler, we need to
+# make sure to get the configuration specific path as well
+if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER)
+  list(APPEND LLDB_EXECUTABLE_PATH_ARGS -C $)
+else()
+  list(APPEND LLDB_EXECUTABLE_PATH_ARGS -C ${LLDB_TEST_C_COMPILER})
+endif()
+
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   # All tests are currently flaky on Windows, so rerun them all once when they 
fail.
   set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues)
@@ -103,6 +122,9 @@ if(LLDB_CODESIGN_IDENTITY)
   list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity 
"${LLDB_CODESIGN_IDENTITY}")
 endif()
 
+# The framework path is passed to the test arguments as 
$. This won't work in the
+# LLDB_DOTEST_ARGS_STR when using a generator that supports multiple 
configurations such as Visual Studio,
+# but since the framework is currently confined to Darwin/Apple, we can leave 
it as is.
 if(LLDB_BUILD_FRAMEWORK)
   list(APPEND LLDB_TEST_COMMON_ARGS --framework $)
 endif()
@@ -112,6 +13