Re: [Lldb-commits] [PATCH] D15065: Define new builder_netbsd

2015-11-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D15065#298279, @zturner wrote:

> This doesn't look substantially different than builder_freebsd.  Assuming
>  there is no practical difference, how about just using that for both
>  freebsd and netbsd?


The linux2, win32 and freebsd targets have the files with the same content. I 
dislike the idea to share it only between FreeBSD and NetBSD.


Repository:
  rL LLVM

http://reviews.llvm.org/D15065



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


[Lldb-commits] [PATCH] D15065: Define new builder_netbsd

2015-11-29 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: emaste, tfiala.
krytarowski added subscribers: joerg, lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

This is used in tests.

Repository:
  rL LLVM

http://reviews.llvm.org/D15065

Files:
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/plugins/builder_netbsd.py

Index: packages/Python/lldbsuite/test/plugins/builder_netbsd.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/plugins/builder_netbsd.py
@@ -0,0 +1,4 @@
+from builder_base import *
+
+def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, 
clean=True):
+return False
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -430,6 +430,8 @@
 def builder_module():
 if sys.platform.startswith("freebsd"):
 return __import__("builder_freebsd")
+if sys.platform.startswith("netbsd"):
+return __import__("builder_netbsd")
 return __import__("builder_" + sys.platform)
 
 def run_adb_command(cmd, device_id):


Index: packages/Python/lldbsuite/test/plugins/builder_netbsd.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/plugins/builder_netbsd.py
@@ -0,0 +1,4 @@
+from builder_base import *
+
+def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True):
+return False
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -430,6 +430,8 @@
 def builder_module():
 if sys.platform.startswith("freebsd"):
 return __import__("builder_freebsd")
+if sys.platform.startswith("netbsd"):
+return __import__("builder_netbsd")
 return __import__("builder_" + sys.platform)
 
 def run_adb_command(cmd, device_id):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15066: Plug-in PlatformNetBSD initializer and terminator

2015-11-29 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: clayborg, emaste.
krytarowski added subscribers: joerg, lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

Other platform parts needed to build this code are already merged.

2nd attempt.

Repository:
  rL LLVM

http://reviews.llvm.org/D15066

Files:
  lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Index: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
===
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
@@ -115,6 +115,7 @@
 DynamicLoaderWindowsDYLD::Initialize();
 platform_freebsd::PlatformFreeBSD::Initialize();
 platform_linux::PlatformLinux::Initialize();
+platform_netbsd::PlatformNetBSD::Initialize();
 PlatformWindows::Initialize();
 PlatformKalimba::Initialize();
 platform_android::PlatformAndroid::Initialize();
@@ -162,6 +163,7 @@
 DynamicLoaderWindowsDYLD::Terminate();
 platform_freebsd::PlatformFreeBSD::Terminate();
 platform_linux::PlatformLinux::Terminate();
+platform_netbsd::PlatformNetBSD::Terminate();
 PlatformWindows::Terminate();
 PlatformKalimba::Terminate();
 platform_android::PlatformAndroid::Terminate();


Index: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
===
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
@@ -115,6 +115,7 @@
 DynamicLoaderWindowsDYLD::Initialize();
 platform_freebsd::PlatformFreeBSD::Initialize();
 platform_linux::PlatformLinux::Initialize();
+platform_netbsd::PlatformNetBSD::Initialize();
 PlatformWindows::Initialize();
 PlatformKalimba::Initialize();
 platform_android::PlatformAndroid::Initialize();
@@ -162,6 +163,7 @@
 DynamicLoaderWindowsDYLD::Terminate();
 platform_freebsd::PlatformFreeBSD::Terminate();
 platform_linux::PlatformLinux::Terminate();
+platform_netbsd::PlatformNetBSD::Terminate();
 PlatformWindows::Terminate();
 PlatformKalimba::Terminate();
 platform_android::PlatformAndroid::Terminate();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15065: Define new builder_netbsd

2015-11-29 Thread Zachary Turner via lldb-commits
Ok, if there's already precedent for duplicating the files then go ahead
and follow the pattern.  Although I'm not sure I'm crazy about duplicating
files on the off chance that something might be different someday.

In any case, lgtm.

On Sun, Nov 29, 2015 at 8:01 PM Kamil Rytarowski  wrote:

> krytarowski added a comment.
>
> In http://reviews.llvm.org/D15065#298279, @zturner wrote:
>
> > This doesn't look substantially different than builder_freebsd.  Assuming
> >  there is no practical difference, how about just using that for both
> >  freebsd and netbsd?
>
>
> The linux2, win32 and freebsd targets have the files with the same
> content. I dislike the idea to share it only between FreeBSD and NetBSD.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D15065
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15061: Correction in TestFrames.py test for arm targets in thumb mode

2015-11-29 Thread Muhammad Omair Javaid via lldb-commits
omjavaid created this revision.
omjavaid added a reviewer: tberghammer.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: rengolin, aemerson.

This patch adds required correction in TestFrames.py for arm targets in thumb 
mode.

On arm hardware thumb mode is identified by setting the least significant bit. 
In such case when we read PC we ll end up getting an unaligned address which 
has last bit set and will cause a mismatch between address read from dwarf 
frame information. I have corrected this by adding an appropriate check in 
TestFrames.py.



http://reviews.llvm.org/D15061

Files:
  packages/Python/lldbsuite/test/python_api/frame/TestFrames.py

Index: packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
===
--- packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -80,9 +80,12 @@
 gpr_reg_set = lldbutil.get_GPRs(frame)
 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
 self.assertTrue (pc_value, "We should have a valid PC.")
-pc_value_str = pc_value.GetValue()
-self.assertTrue (pc_value_str, "We should have a valid PC 
string.")
-self.assertTrue (int(pc_value_str, 0) == frame.GetPC(), "PC 
gotten as a value should equal frame's GetPC")
+pc_value_int = int(pc_value.GetValue(), 0)
+# Make sure on arm targets we dont mismatch PC value on the 
basis of thumb bit.
+# Frame PC will not have thumb bit set in case of a thumb 
instruction as PC.
+if self.getArchitecture() in ['arm']:
+pc_value_int &= ~1
+self.assertTrue (pc_value_int == frame.GetPC(), "PC gotten as 
a value should equal frame's GetPC")
 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
 self.assertTrue (sp_value, "We should have a valid Stack 
Pointer.")
 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), 
"SP gotten as a value should equal frame's GetSP")


Index: packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
===
--- packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -80,9 +80,12 @@
 gpr_reg_set = lldbutil.get_GPRs(frame)
 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
 self.assertTrue (pc_value, "We should have a valid PC.")
-pc_value_str = pc_value.GetValue()
-self.assertTrue (pc_value_str, "We should have a valid PC string.")
-self.assertTrue (int(pc_value_str, 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
+pc_value_int = int(pc_value.GetValue(), 0)
+# Make sure on arm targets we dont mismatch PC value on the basis of thumb bit.
+# Frame PC will not have thumb bit set in case of a thumb instruction as PC.
+if self.getArchitecture() in ['arm']:
+pc_value_int &= ~1
+self.assertTrue (pc_value_int == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
 self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15065: Define new builder_netbsd

2015-11-29 Thread Zachary Turner via lldb-commits
zturner added a subscriber: zturner.
zturner added a comment.

This doesn't look substantially different than builder_freebsd.  Assuming
there is no practical difference, how about just using that for both
freebsd and netbsd?


Repository:
  rL LLVM

http://reviews.llvm.org/D15065



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


Re: [Lldb-commits] [PATCH] D15065: Define new builder_netbsd

2015-11-29 Thread Zachary Turner via lldb-commits
This doesn't look substantially different than builder_freebsd.  Assuming
there is no practical difference, how about just using that for both
freebsd and netbsd?

On Sun, Nov 29, 2015 at 6:17 PM Kamil Rytarowski via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> krytarowski created this revision.
> krytarowski added reviewers: emaste, tfiala.
> krytarowski added subscribers: joerg, lldb-commits.
> krytarowski set the repository for this revision to rL LLVM.
>
> This is used in tests.
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D15065
>
> Files:
>   packages/Python/lldbsuite/test/lldbtest.py
>   packages/Python/lldbsuite/test/plugins/builder_netbsd.py
>
> Index: packages/Python/lldbsuite/test/plugins/builder_netbsd.py
> ===
> --- /dev/null
> +++ packages/Python/lldbsuite/test/plugins/builder_netbsd.py
> @@ -0,0 +1,4 @@
> +from builder_base import *
> +
> +def buildDsym(sender=None, architecture=None, compiler=None,
> dictionary=None, clean=True):
> +return False
> Index: packages/Python/lldbsuite/test/lldbtest.py
> ===
> --- packages/Python/lldbsuite/test/lldbtest.py
> +++ packages/Python/lldbsuite/test/lldbtest.py
> @@ -430,6 +430,8 @@
>  def builder_module():
>  if sys.platform.startswith("freebsd"):
>  return __import__("builder_freebsd")
> +if sys.platform.startswith("netbsd"):
> +return __import__("builder_netbsd")
>  return __import__("builder_" + sys.platform)
>
>  def run_adb_command(cmd, device_id):
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2015-11-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

@labath feel free to disagree with the regex files. It was copied from LLVM. If 
you disagree, help me please to export it in LLVM build for everybody or find a 
better solution.

pkgsrc-wip commit affirming that it works:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commit;h=85621c794d26ed60844215ae16d3b4a4309d969e

Without this patch I'm falling asleep in front of the computer waiting for 
build to be finished.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2015-11-29 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 41366.
krytarowski added a comment.

Upload the proper latest patch.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067

Files:
  cmake/modules/LLDBStandalone.cmake
  scripts/CMakeLists.txt
  source/Utility/CMakeLists.txt
  tools/lldb-mi/MIUtilParse.h

Index: tools/lldb-mi/MIUtilParse.h
===
--- tools/lldb-mi/MIUtilParse.h
+++ tools/lldb-mi/MIUtilParse.h
@@ -9,8 +9,7 @@
  
 #pragma once
  
-// Third party headers:
-#include "../lib/Support/regex_impl.h"
+#include "lldb/Utility/regex_impl.h"
 
 // In-house headers:
 #include "MIUtilString.h"
Index: source/Utility/CMakeLists.txt
===
--- source/Utility/CMakeLists.txt
+++ source/Utility/CMakeLists.txt
@@ -17,4 +17,9 @@
   TaskPool.cpp
   TimeSpecTimeout.cpp
   UriParser.cpp
+  regcomp.c
+  regerror.c
+  regexec.c
+  regfree.c
+  regstrlcpy.c
   )
Index: scripts/CMakeLists.txt
===
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -9,6 +9,8 @@
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h
 )
 
+include(FindPythonInterp)
+
 find_package(SWIG REQUIRED)
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -6,57 +6,77 @@
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
-  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
-"Path to LLVM source code. Not necessary if using an installed LLVM.")
-  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
-"Path to the directory where LLVM was built or installed.")
-
-  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
-"Path to Clang source code. Not necessary if using an installed Clang.")
-  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
-"Path to the directory where Clang was built or installed.")
-
-  if (LLDB_PATH_TO_LLVM_SOURCE)
-if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
-  message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
-  "directory of LLVM source code.")
+  # Rely on llvm-config.
+  set(CONFIG_OUTPUT)
+  find_program(LLVM_CONFIG "llvm-config")
+  if(LLVM_CONFIG)
+message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+set(CONFIG_COMMAND ${LLVM_CONFIG}
+  "--assertion-mode"
+  "--bindir"
+  "--libdir"
+  "--includedir"
+  "--prefix"
+  "--src-root")
+execute_process(
+  COMMAND ${CONFIG_COMMAND}
+  RESULT_VARIABLE HAD_ERROR
+  OUTPUT_VARIABLE CONFIG_OUTPUT
+)
+if(NOT HAD_ERROR)
+  string(REGEX REPLACE
+"[ \t]*[\r\n]+[ \t]*" ";"
+CONFIG_OUTPUT ${CONFIG_OUTPUT})
 else()
-  get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
- ABSOLUTE)
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
-  list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
+  message(STATUS "${CONFIG_COMMAND_STR}")
+  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
+  else()
+message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
   endif()
 
-  if (LLDB_PATH_TO_CLANG_SOURCE)
-  get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
- ABSOLUTE)
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
+  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+
+  if(NOT MSVC_IDE)
+set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
+  CACHE BOOL "Enable assertions")
+# Assertions should follow llvm-config's.
+mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
+  set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
+  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
+  set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+  set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
+  set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  if (LLDB_PATH_TO_LLVM_BUILD)
-get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
-   ABSOLUTE)
-  else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
-"directory of LLVM build or install site.")
-  endif()
+