Re: [Lldb-commits] [PATCH] D19685: Fix NetBSD build with CMake 3.5.2

2016-05-01 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

I like this solution.


Repository:
  rL LLVM

http://reviews.llvm.org/D19685



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


Re: [Lldb-commits] [PATCH] D19772: Detect Python's executable on NetBSD

2016-05-01 Thread Pavel Labath via lldb-commits
labath added a comment.

In http://reviews.llvm.org/D19772#417954, @krytarowski wrote:

> I think I can close this report and http://reviews.llvm.org/D19685, and put 
> all the standalone CMake code mentioned here and in 
> http://reviews.llvm.org/D19685 as a patch in http://reviews.llvm.org/D15067. 
> The code for regex will get its dedicated patch by myself (or someone else if 
> he or she will be quicker) in future.
>
> Are you fine with it? It will reduce cost of maintainership downstream 
> significantly.


Sounds like a plan.


Repository:
  rL LLVM

http://reviews.llvm.org/D19772



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


Re: [Lldb-commits] [PATCH] D19685: Fix NetBSD build with CMake 3.5.2

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thanks, since it has been accepted. I will commit it and move to LLDBStandalone.


Repository:
  rL LLVM

http://reviews.llvm.org/D19685



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


[Lldb-commits] [lldb] r268191 - Fix NetBSD build with CMake 3.5.2

2016-05-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sun May  1 05:23:24 2016
New Revision: 268191

URL: http://llvm.org/viewvc/llvm-project?rev=268191&view=rev
Log:
Fix NetBSD build with CMake 3.5.2

Summary:
Building HEAD of LLDB fails in linking against DebugInfoPDB. It also prints the 
following warning:

```
CMake Warning (dev) in source/Plugins/SymbolFile/PDB/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "lldbPluginSymbolFilePDB" has an INTERFACE_LINK_LIBRARIES property.
  This should be preferred as the source of the link interface for this
  library but because CMP0022 is not set CMake is ignoring the property and
  using the link implementation as the link interface instead.

  INTERFACE_LINK_LIBRARIES:

LLVMDebugInfoPDB

  Link implementation:

(empty)
```

CMP0022 was introduced in CMake-2.8.11, bump minimal required version from 2.8 
to 3.0 to gain more useful features like libexecinfo(3) detection on NetBSD.

Reviewers: emaste, zturner, labath

Subscribers: zturner, lldb-commits, joerg

Differential Revision: http://reviews.llvm.org/D19685

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=268191&r1=268190&r2=268191&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Sun May  1 05:23:24 2016
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12.2)
 
 include(cmake/modules/LLDBStandalone.cmake)
 include(cmake/modules/LLDBConfig.cmake)

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=268191&r1=268190&r2=268191&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Sun May  1 05:23:24 2016
@@ -2,7 +2,7 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-  cmake_minimum_required(VERSION 2.8)
+  cmake_minimum_required(VERSION 2.8.12.2)
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
 


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


Re: [Lldb-commits] [PATCH] D19772: Detect Python's executable on NetBSD

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

This change will be merged into  http://reviews.llvm.org/D15067


Repository:
  rL LLVM

http://reviews.llvm.org/D19772



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


[Lldb-commits] [lldb] r268192 - Add thread numbers into ASan thread names.

2016-05-01 Thread Kuba Brecka via lldb-commits
Author: kuba.brecka
Date: Sun May  1 06:23:04 2016
New Revision: 268192

URL: http://llvm.org/viewvc/llvm-project?rev=268192&view=rev
Log:
Add thread numbers into ASan thread names.


Modified:
lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp

Modified: lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp?rev=268192&r1=268191&r2=268192&view=diff
==
--- lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp 
(original)
+++ lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp Sun May  
1 06:23:04 2016
@@ -24,6 +24,8 @@
 #include "Plugins/Process/Utility/HistoryThread.h"
 #include "lldb/Core/ValueObject.h"
 
+#include 
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -123,7 +125,7 @@ static void CreateHistoryThreadFromValue
 return;
 
 int count = count_sp->GetValueAsUnsigned(0);
-tid_t tid = tid_sp->GetValueAsUnsigned(0);
+tid_t tid = tid_sp->GetValueAsUnsigned(0) + 1;
 
 if (count <= 0)
 return;
@@ -144,8 +146,9 @@ static void CreateHistoryThreadFromValue
 
 HistoryThread *history_thread = new HistoryThread(*process_sp, tid, pcs, 
0, false);
 ThreadSP new_thread_sp(history_thread);
-// let's use thread name for the type of history thread, since history 
threads don't have names anyway
-history_thread->SetThreadName(thread_name);
+std::ostringstream thread_name_with_number;
+thread_name_with_number << thread_name << " Thread " << tid;
+history_thread->SetThreadName(thread_name_with_number.str().c_str());
 // Save this in the Process' ExtendedThreadList so a strong pointer 
retains the object
 process_sp->GetExtendedThreadList().AddThread (new_thread_sp);
 result.push_back(new_thread_sp);
@@ -198,8 +201,8 @@ MemoryHistoryASan::GetHistoryThreads(lld
 if (!return_value_sp)
 return result;
 
-CreateHistoryThreadFromValueObject(process_sp, return_value_sp, "free", 
"Memory deallocated at", result);
-CreateHistoryThreadFromValueObject(process_sp, return_value_sp, "alloc", 
"Memory allocated at", result);
+CreateHistoryThreadFromValueObject(process_sp, return_value_sp, "free", 
"Memory deallocated by", result);
+CreateHistoryThreadFromValueObject(process_sp, return_value_sp, "alloc", 
"Memory allocated by", result);
 
 return result;
 }


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


[Lldb-commits] [lldb] r268193 - Improve wording and capitalization of TSan thread names.

2016-05-01 Thread Kuba Brecka via lldb-commits
Author: kuba.brecka
Date: Sun May  1 06:26:06 2016
New Revision: 268193

URL: http://llvm.org/viewvc/llvm-project?rev=268193&view=rev
Log:
Improve wording and capitalization of TSan thread names.


Modified:

lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp

Modified: 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp?rev=268193&r1=268192&r2=268193&view=diff
==
--- 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
 Sun May  1 06:26:06 2016
@@ -636,10 +636,10 @@ ThreadSanitizerRuntime::GetLocationDescr
 result = Sprintf("Location is a %ld-byte heap object at 0x%llx", 
size, addr);
 } else if (type == "stack") {
 int tid = 
loc->GetAsDictionary()->GetValueForKey("thread_id")->GetAsInteger()->GetValue();
-result = Sprintf("Location is stack of thread %d", tid);
+result = Sprintf("Location is stack of Thread %d", tid);
 } else if (type == "tls") {
 int tid = 
loc->GetAsDictionary()->GetValueForKey("thread_id")->GetAsInteger()->GetValue();
-result = Sprintf("Location is TLS of thread %d", tid);
+result = Sprintf("Location is TLS of Thread %d", tid);
 } else if (type == "fd") {
 int fd = 
loc->GetAsDictionary()->GetValueForKey("file_descriptor")->GetAsInteger()->GetValue();
 result = Sprintf("Location is file descriptor %d", fd);
@@ -766,12 +766,12 @@ GenerateThreadName(std::string path, Str
 bool is_atomic = 
o->GetObjectForDotSeparatedPath("is_atomic")->GetBooleanValue();
 addr_t addr = 
o->GetObjectForDotSeparatedPath("address")->GetIntegerValue();
 
-result = Sprintf("%s%s of size %d at 0x%llx by thread %d", is_atomic ? 
"atomic " : "", is_write ? "write" : "read", size, addr, thread_id);
+result = Sprintf("%s%s of size %d at 0x%llx by Thread %d", is_atomic ? 
"atomic " : "", is_write ? "write" : "read", size, addr, thread_id);
 }
 
 if (path == "threads") {
 int thread_id = 
o->GetObjectForDotSeparatedPath("thread_id")->GetIntegerValue();
-result = Sprintf("thread %d created at", thread_id);
+result = Sprintf("Thread %d created", thread_id);
 }
 
 if (path == "locs") {
@@ -779,16 +779,16 @@ GenerateThreadName(std::string path, Str
 int thread_id = 
o->GetObjectForDotSeparatedPath("thread_id")->GetIntegerValue();
 int fd = 
o->GetObjectForDotSeparatedPath("file_descriptor")->GetIntegerValue();
 if (type == "heap") {
-result = Sprintf("Heap block allocated by thread %d at", 
thread_id);
+result = Sprintf("Heap block allocated by Thread %d", thread_id);
 } else if (type == "fd") {
-result = Sprintf("File descriptor %d created by thread %t at", fd, 
thread_id);
+result = Sprintf("File descriptor %d created by Thread %t", fd, 
thread_id);
 }
 }
 
 if (path == "mutexes") {
 int mutex_id = 
o->GetObjectForDotSeparatedPath("mutex_id")->GetIntegerValue();
 
-result = Sprintf("mutex M%d created at", mutex_id);
+result = Sprintf("Mutex M%d created", mutex_id);
 }
 
 if (path == "stacks") {


___
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

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 55742.
krytarowski added a comment.

Revamp the patch and reduce it only to the CMake part.

Leave regex code for later.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067

Files:
  cmake/modules/LLDBStandalone.cmake

Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -6,57 +6,78 @@
 
   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}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  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()
+  find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
+NO_DEFAULT_PATH)
 
-  if (LLDB_PATH_TO_CLANG_BUILD)
-get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
-   ABSOLUTE)
+  set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
+  if(EXISTS ${LLVMCONFIG_FILE})
+list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+include(${LLVMCONFIG_FILE})
   else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
-"directory of Clang build or install site.")
+message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()
 
-
-  # These variables are used by add_llvm_library.
+  # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+  if(WIN32 

[Lldb-commits] [lldb] r268194 - Update test for r268192.

2016-05-01 Thread Kuba Brecka via lldb-commits
Author: kuba.brecka
Date: Sun May  1 06:32:10 2016
New Revision: 268194

URL: http://llvm.org/viewvc/llvm-project?rev=268194&view=rev
Log:
Update test for r268192.


Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py?rev=268194&r1=268193&r2=268194&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
 Sun May  1 06:32:10 2016
@@ -62,8 +62,8 @@ class AsanTestCase(TestBase):
 # test the 'memory history' command
 self.expect("memory history 'pointer'",
 substrs = [
-'Memory allocated at', 'a.out`f1', 'main.c:%d' % 
self.line_malloc,
-'Memory deallocated at', 'a.out`f2', 'main.c:%d' % 
self.line_free])
+'Memory allocated by Thread', 'a.out`f1', 'main.c:%d' % 
self.line_malloc,
+'Memory deallocated by Thread', 'a.out`f2', 'main.c:%d' % 
self.line_free])
 
 # do the same using SB API
 process = self.dbg.GetSelectedTarget().process
@@ -97,4 +97,4 @@ class AsanTestCase(TestBase):
 # make sure the 'memory history' command still works even when we're 
generating a report now
 self.expect("memory history 'another_pointer'",
 substrs = [
-'Memory allocated at', 'a.out`f1', 'main.c:%d' % 
self.line_malloc2])
+'Memory allocated by Thread', 'a.out`f1', 'main.c:%d' % 
self.line_malloc2])


___
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

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

please take a look @zturner @labath


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

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: cmake/modules/LLDBStandalone.cmake:85
@@ -63,3 +84,3 @@
 
   if (PYTHON_EXECUTABLE STREQUAL "")
 set(Python_ADDITIONAL_VERSIONS 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5)

When I am including conditionally `include(FindPythonInterp)` with this 
`PYTHON_EXECUTABLE STREQUAL ""` conditional I'm facing the said issue with:

```
CMake Error at scripts/cmake_install.cmake:31 (file):
  file INSTALL cannot find
  "/tmp/pkgsrc-tmp/wip/lldb-git/work/build/lib/python.".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)
  


*** Error code 1
```

If I put here `include(FindPythonInterp)` unconditionally, there is no error in 
`cmake_install.cmake:37`.


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] D19086: [clang-analyzer] fix warnings emitted on lldb code base

2016-05-01 Thread Apelete Seketeli via lldb-commits
apelete updated this revision to Diff 55753.
apelete added a comment.

[clang-analyzer] fix warnings emitted on lldb code base

Changes since last revision:

- fast forward rebase on git master branch.


http://reviews.llvm.org/D19086

Files:
  include/lldb/Utility/LLDBAssert.h
  source/API/SBThread.cpp
  source/Core/DynamicLoader.cpp
  source/Core/FormatEntity.cpp
  source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
@@ -468,7 +468,6 @@
 DWARFFormValue encoding_uid;
 uint32_t member_byte_offset = UINT32_MAX;
 DWARFExpression member_location_expression(dwarf_cu);
-bool artificial = true;
 
 DWARFAttributes attributes;
 size_t num_attributes = die.GetAttributes(attributes);
@@ -494,7 +493,7 @@
 member_byte_offset = form_value.Unsigned();
 break;
 case DW_AT_artificial:
-artificial = form_value.Boolean();
+// TODO: Handle when needed
 break;
 case DW_AT_accessibility:
 // TODO: Handle when needed
@@ -506,7 +505,7 @@
 }
 }
 
-if (strcmp(name, ".dynamic_type") == 0)
+if (name && strcmp(name, ".dynamic_type") == 0)
 m_ast.SetDynamicTypeId(compiler_type, member_location_expression);
 else
 {
Index: source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
===
--- source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
+++ source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
@@ -283,8 +283,11 @@
 RegisterContext *reg_ctx = thread->GetRegisterContext().get();
 
 if (!reg_ctx)
+{
 error.SetErrorString("no registers are available");
-
+return error;
+}
+
 DataExtractor data;
 Error data_error;
 size_t num_bytes = new_value_sp->GetData(data, data_error);
@@ -307,6 +310,7 @@
 if (num_bytes <= 16)
 {
 const RegisterInfo *r2_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+
 if (num_bytes <= 8)
 {
 uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
Index: source/Core/FormatEntity.cpp
===
--- source/Core/FormatEntity.cpp
+++ source/Core/FormatEntity.cpp
@@ -1013,7 +1013,8 @@
 
 if (special_directions.empty())
 {
-success &= item->DumpPrintableRepresentation(s,val_obj_display, custom_format);
+if (item)
+success &= item->DumpPrintableRepresentation(s,val_obj_display, custom_format);
 }
 else
 {
Index: source/Core/DynamicLoader.cpp
===
--- source/Core/DynamicLoader.cpp
+++ source/Core/DynamicLoader.cpp
@@ -194,7 +194,7 @@
 {
 // Try to fetch the load address of the file from the process as we need absolute load
 // address to read the file out of the memory instead of a load bias.
-bool is_loaded;
+bool is_loaded = false;
 lldb::addr_t load_addr;
 Error error = m_process->GetFileLoadAddress(file, is_loaded, load_addr);
 if (error.Success() && is_loaded)
Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -923,7 +923,7 @@
 bool abort_other_plans = false;
 bool stop_other_threads = false;
 Thread *thread = exe_ctx.GetThreadPtr();
-if (sb_frame.GetThread().GetThreadID() != thread->GetID())
+if (log && sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
 log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
Index: include/lldb/Utility/LLDBAssert.h
===
--- include/lldb/Utility/LLDBAssert.h
+++ include/lldb/Utility/LLDBAssert.h
@@ -24,7 +24,7 @@
  const char* expr_text,
  const char* func,
  const char* file,
- unsigned int line);
+ unsigned int line) __attribute__((__noreturn__));
 }
 
 #endif // utility_LLDBAss

Re: [Lldb-commits] [PATCH] D19086: [clang-analyzer] fix warnings emitted on lldb code base

2016-05-01 Thread Apelete Seketeli via lldb-commits
apelete added a comment.

Waiting for review, could someone please have a look at this one ?


http://reviews.llvm.org/D19086



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


[Lldb-commits] [lldb] r268208 - Add support for synthetic child providers to optionally return a customized typename for display

2016-05-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Sun May  1 19:41:24 2016
New Revision: 268208

URL: http://llvm.org/viewvc/llvm-project?rev=268208&view=rev
Log:
Add support for synthetic child providers to optionally return a customized 
typename for display


Modified:
lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/source/DataFormatters/TypeSynthetic.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=268208&r1=268207&r2=268208&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Sun May  1 19:41:24 
2016
@@ -91,6 +91,11 @@ namespace lldb_private {
 virtual lldb::ValueObjectSP
 GetSyntheticValue () { return nullptr; }
 
+// if this function returns a non-empty ConstString, then clients are 
expected to use the return
+// as the name of the type of this ValueObject for display purposes
+virtual ConstString
+GetSyntheticTypeName () { return ConstString(); }
+
 typedef std::shared_ptr SharedPointer;
 typedef std::unique_ptr AutoPointer;
 
@@ -607,6 +612,9 @@ namespace lldb_private {
 lldb::ValueObjectSP
 GetSyntheticValue() override;
 
+ConstString
+GetSyntheticTypeName () override;
+
 typedef std::shared_ptr SharedPointer;
 
 private:

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h?rev=268208&r1=268207&r2=268208&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Sun May  1 19:41:24 
2016
@@ -380,6 +380,12 @@ public:
 {
 return nullptr;
 }
+
+virtual ConstString
+GetSyntheticTypeName (const StructuredData::ObjectSP &implementor)
+{
+return ConstString();
+}
 
 virtual bool
 RunScriptBasedCommand (const char* impl_function,

Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=268208&r1=268207&r2=268208&view=diff
==
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Sun May  1 19:41:24 
2016
@@ -99,6 +99,9 @@ ValueObjectSynthetic::GetQualifiedTypeNa
 ConstString
 ValueObjectSynthetic::GetDisplayTypeName()
 {
+if (ConstString synth_name = m_synth_filter_ap->GetSyntheticTypeName())
+return synth_name;
+
 return m_parent->GetDisplayTypeName();
 }
 

Modified: lldb/trunk/source/DataFormatters/TypeSynthetic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=268208&r1=268207&r2=268208&view=diff
==
--- lldb/trunk/source/DataFormatters/TypeSynthetic.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeSynthetic.cpp Sun May  1 19:41:24 2016
@@ -246,6 +246,15 @@ ScriptedSyntheticChildren::FrontEnd::Get
 return m_interpreter->GetSyntheticValue(m_wrapper_sp);
 }
 
+ConstString
+ScriptedSyntheticChildren::FrontEnd::GetSyntheticTypeName ()
+{
+if (!m_wrapper_sp || m_interpreter == NULL)
+return ConstString();
+
+return m_interpreter->GetSyntheticTypeName(m_wrapper_sp);
+}
+
 std::string
 ScriptedSyntheticChildren::GetDescription()
 {

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=268208&r1=268207&r2=268208&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Sun May  1 19:41:24 2016
@@ -2349,6 +2349,72 @@ ScriptInterpreterPython::GetSyntheticVal
 return ret_val;
 }
 
+ConstString
+ScriptInterpreterPython::GetSyntheticTypeName (const StructuredData::ObjectSP 
&implementor_sp)
+{
+Locker py_lock(this, Locker::AcquireLock | Locker::InitSession | 
Locke