Re: [Lldb-commits] [PATCH] D13578: Allow generic arm ArchSpec to merge with specific arm ArchSpec; allow Cortex M0-7's to always force thumb mode

2015-10-10 Thread Renato Golin via lldb-commits
rengolin added a comment.

In http://reviews.llvm.org/D13578#264072, @jasonmolenda wrote:

> I'm trying to rewrite IsAlwaysThumbInstructions() to use the information that 
> llvm already has, as per Renato's suggestion.  The MCSubtargetInfo has a 
> getFeatureBits() method which can indicate ARM::FeatureNoARM.  I'm still 
> having a little bit of trouble getting it to build, the ARMFeatures.h is in 
> an unusual location and it indirectly pulls in ARMGenRegisterInfo.inc, 
> ARMGenInstrInfo.inc, and ARMGenSubtargetInfo.inc from the build dir - I'll 
> need to update xcode and cmake to add the $(llvm-build-dir)/lib/Target/ARM/ 
> to the include path for these to be found.  I might not have time to finish 
> this tonight, we'll see.


The target information classes depend on table-generated files, so if you were 
not building them before, you'll need to do that now. I though LLDB was doing 
this already, that's why I suggested lightly. But ultimately, I believe you 
*don't* want to have your own target description anyway, so it's a move that 
you'd have to do anyway.

> I'm not sure how expensive it is to make an llvm::Target and get the 
> MCSubtargetInfo out of that every call; I may need to save something in an 
> ArchSpec ivar.  Maybe just the results of the FeatureBits check.


I'm not sure you should be doing that. Those calls normally involve traversing 
tables and correlating information. Even though that gets optimised pretty 
well, it's not something that you want to be delaying delicate hardware 
handling of breakpoints, run states etc.

I'd guess you could have a local cache with only the information you need, and 
you initialise it from the target description classes once. You may end up with 
some duplication, but hopefully, it won't be too much and it'll be a lot faster.

--renato


Repository:
  rL LLVM

http://reviews.llvm.org/D13578



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


[Lldb-commits] [PATCH] D13625: Support RHEL 7 and similar systems that use architecture-specific Python lib dirs.

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala created this revision.
tfiala added reviewers: labath, dawn.
tfiala added a subscriber: lldb-commits.

This change fixes 'lldb -P' (retrieve lldb-module python path) to work 
correctly on cmake-based builds on POSIX systems.

Previously, this would assume the python module installation path was in the 
lldb lib directory.  This is not accurate for RHEL, which uses an 
architecture-specific directory name (i.e. lib64 for x86_64 versions).

Now, with this change, the python identified during build is called with a 
script at configure time and builds with a #define for the relative directory 
path used for this system's particular python style.  On RHEL, this turns into 
lib64/python{maj}.{min}/..., while it will be lib/python{maj}.{min}/... on 
other systems.  This removes the lldb code from guessing it in this case.

The old behavior is preserved in the event that the configure-time python 
script fails to determine the relative python module lib dir.

This fixes:
https://llvm.org/bugs/show_bug.cgi?id=25134

http://reviews.llvm.org/D13625

Files:
  scripts/get_relative_lib_dir.py
  source/Host/CMakeLists.txt
  source/Host/posix/HostInfoPosix.cpp
  www/build.html

Index: www/build.html
===
--- www/build.html
+++ www/build.html
@@ -202,7 +202,7 @@
   http://www.python.org";>Python
 
 So for example, on a Fedora system one might run:
-> yum install swig python-devel libedit-devel
+> yum install libedit-devel libxml2-devel ncurses-devel python-devel swig
 On a Debian or Ubuntu system one might run:
 > sudo apt-get install build-essential subversion swig python2.7-dev libedit-dev libncurses5-dev 
 or
Index: source/Host/posix/HostInfoPosix.cpp
===
--- source/Host/posix/HostInfoPosix.cpp
+++ source/Host/posix/HostInfoPosix.cpp
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -214,6 +215,19 @@
 char raw_path[PATH_MAX];
 lldb_file_spec.GetPath(raw_path, sizeof(raw_path));
 
+#if defined(LLDB_PYTHON_RELATIVE_LIBDIR)
+// Build the path by backing out of the lib dir, then building
+// with whatever the real python interpreter uses.  (e.g. lib
+// for most, lib64 on RHEL x86_64).
+char python_path[PATH_MAX];
+::snprintf(python_path, sizeof(python_path), "%s/../%s", raw_path, LLDB_PYTHON_RELATIVE_LIBDIR);
+
+char final_path[PATH_MAX];
+realpath(python_path, final_path);
+file_spec.GetDirectory().SetCString(final_path);
+
+return true;
+#else
 llvm::SmallString<256> python_version_dir;
 llvm::raw_svector_ostream os(python_version_dir);
 os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION << "/site-packages";
@@ -223,6 +237,7 @@
 
 file_spec.GetDirectory().SetCString(raw_path);
 return true;
+#endif
 #else
 return false;
 #endif
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -41,6 +41,11 @@
   common/XML.cpp
   )
 
+# Keep track of whether we want to provide a define for the
+# Python's architecture-specific lib path (i.e. where a
+# Python lldb module would go).
+set (get_python_libdir 0)
+
 if (NOT LLDB_DISABLE_LIBEDIT)
   add_host_subdirectory(common
 common/Editline.cpp
@@ -70,6 +75,11 @@
 windows/Windows.cpp
 )
 else()
+  if (NOT LLDB_DISABLE_PYTHON)
+# We'll grab the arch-specific python libdir on POSIX systems.
+set (get_python_libdir 1)
+  endif()
+
   add_host_subdirectory(posix
 posix/FileSystem.cpp
 posix/HostInfoPosix.cpp
@@ -133,4 +143,17 @@
   endif()
 endif()
 
+if (${get_python_libdir})
+  # Call a python script to gather the arch-specific libdir for
+  # modules like the lldb module.
+  execute_process(
+COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/get_relative_lib_dir.py
+RESULT_VARIABLE get_libdir_status
+OUTPUT_VARIABLE relative_libdir
+)
+  if (get_libdir_status EQUAL 0)
+add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${relative_libdir}")
+  endif()
+endif()
+
 add_lldb_library(lldbHost ${HOST_SOURCES})
Index: scripts/get_relative_lib_dir.py
===
--- /dev/null
+++ scripts/get_relative_lib_dir.py
@@ -0,0 +1,44 @@
+import distutils.sysconfig
+import os
+import platform
+import re
+import sys
+
+
+def get_python_relative_libdir():
+"""Returns the appropropriate python libdir relative to the build directory.
+
+@param exe_path the path to the lldb executable
+
+@return the python path that needs to be added to sys.path (PYTHONPATH)
+in order to find the lldb python module.
+"""
+if platform.system() != 'Linux':
+return None
+
+# We currently have a bug in lldb -P that does n

Re: [Lldb-commits] [PATCH] D13555: Cap test threads on Windows to avoid open file limit

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala added a comment.

LGTM, Adrian!


http://reviews.llvm.org/D13555



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


Re: [Lldb-commits] [PATCH] D12416: Parse dotest.py/dosep.py output, providing general stats and skip reason breakdown by counts.

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala abandoned this revision.
tfiala added a comment.

I'm going to redo this some time in the future based on the test event 
architecture.


http://reviews.llvm.org/D12416



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


Re: [Lldb-commits] [PATCH] D12612: Fix dotest on Windows after multiprocessing refactor

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Did this go in, Zachary?  I'm just looking to clear out my reviews and this one 
seems to still be open.


http://reviews.llvm.org/D12612



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


Re: [Lldb-commits] [PATCH] D13448: Update swig generation shell scripts to run under Python 3.x

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Hey Zachary, I think this one went in, didn't it?  Can you close it out if so?  
Thanks!


http://reviews.llvm.org/D13448



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


Re: [Lldb-commits] [PATCH] D5503: Very minimal non-8-bit byte support for diverse kalimba architectures

2015-10-10 Thread Todd Fiala via lldb-commits
tfiala closed this revision.
tfiala added a comment.

I'm going ahead and closing this one out.  It either went in or is not 
interesting to the author any more.  Last ping was over a couple weeks ago.


http://reviews.llvm.org/D5503



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