[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types in the ObjC plugin

2017-12-06 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 125816.
vsk retitled this revision from "Disable warnings related to anonymous types" 
to "Disable warnings related to anonymous types in the ObjC plugin".
vsk edited the summary of this revision.
vsk added a comment.

- Thanks @labath! I've disabled the GNU warnings in a narrower way. PTAL.


https://reviews.llvm.org/D40757

Files:
  cmake/modules/AddLLDB.cmake
  cmake/modules/LLDBConfig.cmake
  source/Plugins/Language/ObjC/CMakeLists.txt


Index: source/Plugins/Language/ObjC/CMakeLists.txt
===
--- source/Plugins/Language/ObjC/CMakeLists.txt
+++ source/Plugins/Language/ObjC/CMakeLists.txt
@@ -1,3 +1,13 @@
+set(EXTRA_CXXFLAGS "")
+
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct)
+endif ()
+
+if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types)
+endif ()
+
 add_lldb_library(lldbPluginObjCLanguage PLUGIN
   ObjCLanguage.cpp
   CF.cpp
@@ -21,4 +31,6 @@
 lldbTarget
 lldbUtility
 lldbPluginAppleObjCRuntime
+
+  EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
 )
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -231,6 +231,12 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
 endif ()
 
+check_cxx_compiler_flag("-Wno-gnu-anonymous-struct"
+CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+
+check_cxx_compiler_flag("-Wno-nested-anon-types"
+CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+
 # Disable MSVC warnings
 if( MSVC )
   add_definitions(
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -4,7 +4,7 @@
   cmake_parse_arguments(PARAM
 "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
 ""
-"DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
 ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
   list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -35,6 +35,8 @@
   endif()
 
   #PIC not needed on Win
+  # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options
+  # or omit this logic instead.
   if (NOT WIN32)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
   endif()
@@ -78,6 +80,9 @@
   # headers without negatively impacting much of anything.
   add_dependencies(${name} clang-tablegen-targets)
 
+  # Add in any extra C++ compilation flags for this library.
+  target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
+
   set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
 endfunction(add_lldb_library)
 


Index: source/Plugins/Language/ObjC/CMakeLists.txt
===
--- source/Plugins/Language/ObjC/CMakeLists.txt
+++ source/Plugins/Language/ObjC/CMakeLists.txt
@@ -1,3 +1,13 @@
+set(EXTRA_CXXFLAGS "")
+
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct)
+endif ()
+
+if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types)
+endif ()
+
 add_lldb_library(lldbPluginObjCLanguage PLUGIN
   ObjCLanguage.cpp
   CF.cpp
@@ -21,4 +31,6 @@
 lldbTarget
 lldbUtility
 lldbPluginAppleObjCRuntime
+
+  EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
 )
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -231,6 +231,12 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
 endif ()
 
+check_cxx_compiler_flag("-Wno-gnu-anonymous-struct"
+CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+
+check_cxx_compiler_flag("-Wno-nested-anon-types"
+CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+
 # Disable MSVC warnings
 if( MSVC )
   add_definitions(
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -4,7 +4,7 @@
   cmake_parse_arguments(PARAM
 "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
 ""
-"DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
 ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
   list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -35,6 +35,8 @@
   endif()
 
   #PIC not needed on Win
+  # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options
+  # or omit this logic instead.
   if (NOT WIN32)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
   endif()
@@ -78,6 +80,9 @@
   # headers without negatively impacting much of anything.
   add_dependencies(${name} clang-tablegen-targets)
 
+  # Add 

[Lldb-commits] [lldb] r319953 - [lldb] Use PRIVATE in target_link_libraries

2017-12-06 Thread Shoaib Meenai via lldb-commits
Author: smeenai
Date: Wed Dec  6 12:53:03 2017
New Revision: 319953

URL: http://llvm.org/viewvc/llvm-project?rev=319953=rev
Log:
[lldb] Use PRIVATE in target_link_libraries

This is a follow-up to r319840. I guess none of the systems I'd tested
on before had LLDB_SYSTEM_LIBS set, which is why I didn't see any local
errors, but I'm surprised none of the bots caught it either.

Modified:
lldb/trunk/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=319953=319952=319953=diff
==
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed Dec  6 12:53:03 2017
@@ -54,4 +54,4 @@ add_lldb_tool(lldb-server INCLUDE_IN_FRA
   Support
 )
 
-target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
+target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})


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


[Lldb-commits] [lldb] r319943 - Fix the -Wunused-function warning properly (MachProcess.mm)

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:27:20 2017
New Revision: 319943

URL: http://llvm.org/viewvc/llvm-project?rev=319943=rev
Log:
Fix the -Wunused-function warning properly (MachProcess.mm)

r319938 was not NFC, because it got the preprocessor guard wrong. Check
WITH_FBS and WITH_BKS before defining SplitEventData.

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319943=319942=319943=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:27:20 2017
@@ -190,7 +190,7 @@ static bool CallBoardSystemServiceOpenAp
 }
 #endif
 
-#if defined(WITH_FBS) || defined(WITH_FBS)
+#if defined(WITH_BKS) || defined(WITH_FBS)
 static void SplitEventData(const char *data, std::vector 
)
 {
   elements.clear();


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


[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-06 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL319936: Remove no-op function pointer null checks, NFC 
(authored by vedantk).

Changed prior to commit:
  https://reviews.llvm.org/D40812?vs=125437=125773#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40812

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
  lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -600,10 +600,9 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so check that compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
-  (m_compression_type == CompressionType::ZlibDeflate ||
-   m_compression_type == CompressionType::LZFSE ||
-   m_compression_type == CompressionType::LZ4)) {
+  if (m_compression_type == CompressionType::ZlibDeflate ||
+  m_compression_type == CompressionType::LZFSE ||
+  m_compression_type == CompressionType::LZ4) {
 compression_algorithm compression_type;
 if (m_compression_type == CompressionType::LZFSE)
   compression_type = COMPRESSION_LZFSE;
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1022,10 +1022,7 @@
   std::string avail_name;
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzfse") {
 avail_type = CompressionType::LZFSE;
@@ -1037,10 +1034,7 @@
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "zlib-deflate") {
 avail_type = CompressionType::ZlibDeflate;
@@ -1064,10 +1058,7 @@
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lz4") {
 avail_type = CompressionType::LZ4;
@@ -1079,10 +1070,7 @@
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzma") {
 avail_type = CompressionType::LZMA;
Index: lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
===
--- lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
@@ -56,9 +56,7 @@
 }
 }
 
-DNBCallbackLog OsLogger::GetLogFunction() {
-  return _os_log_impl ? DarwinLogCallback : nullptr;
-}
+DNBCallbackLog OsLogger::GetLogFunction() { return DarwinLogCallback; }
 
 #else
 
Index: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
===
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp
@@ -710,26 +710,22 @@
   size_t compressed_size = 0;
 
 #if defined(HAVE_LIBCOMPRESSION)
-  if (compression_decode_buffer &&
-  compression_type == compression_types::lz4) {
+  if (compression_type == compression_types::lz4) {
 compressed_size = compression_encode_buffer(
 encoded_data.data(), encoded_data_buf_size, (uint8_t *)orig.c_str(),
 orig.size(), nullptr, COMPRESSION_LZ4_RAW);
   }
-  if (compression_decode_buffer &&
-  compression_type == compression_types::zlib_deflate) {
+  if (compression_type == compression_types::zlib_deflate) {
 compressed_size = 

Re: [Lldb-commits] [lldb] r319597 - Fix warning in DynamicLoaderDarwinKernel.cpp, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits

> On Dec 2, 2017, at 12:22 PM, Davide Italiano  wrote:
> 
> On Fri, Dec 1, 2017 at 3:53 PM, Vedant Kumar via lldb-commits
>  wrote:
>> Author: vedantk
>> Date: Fri Dec  1 15:53:01 2017
>> New Revision: 319597
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=319597=rev
>> Log:
>> Fix warning in DynamicLoaderDarwinKernel.cpp, NFC
>> 
>> Modified:
>>
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>> 
>> Modified: 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319597=319596=319597=diff
>> ==
>> --- 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>>  (original)
>> +++ 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>>  Fri Dec  1 15:53:01 2017
>> @@ -1407,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllK
>> void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
>>   if (log == NULL)
>> return;
>> -  const uint8_t *u = (uint8_t *)m_uuid.GetBytes();
>> +  const uint8_t *u = (const uint8_t *)m_uuid.GetBytes();
>> 
> 
> Nit: I'd rather use static_cast<> :)

Yes, done in r319935.

> 
>>   if (m_load_address == LLDB_INVALID_ADDRESS) {
>> if (u) {
>> 
>> 
>> ___
>> 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


[Lldb-commits] [PATCH] D40821: Fix const-correctness in RegisterContext methods, NFC

2017-12-06 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL319939: Fix const-correctness in RegisterContext methods, 
NFC (authored by vedantk).

Changed prior to commit:
  https://reviews.llvm.org/D40821?vs=125639=125774#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40821

Files:
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp

Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
@@ -43,17 +43,23 @@
 
 int RegisterContextMach_i386::DoWriteGPR(lldb::tid_t tid, int flavor,
  const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteFPU(lldb::tid_t tid, int flavor,
  const FPU ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  FPUWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteEXC(lldb::tid_t tid, int flavor,
  const EXC ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  EXCWordCount);
 }
 
 #endif
Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
@@ -50,22 +50,30 @@
 
 int RegisterContextMach_arm::DoWriteGPR(lldb::tid_t tid, int flavor,
 const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteFPU(lldb::tid_t tid, int flavor,
 const FPU ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  FPUWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteEXC(lldb::tid_t tid, int flavor,
 const EXC ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  EXCWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteDBG(lldb::tid_t tid, int flavor,
 const DBG ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), DBGWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  DBGWordCount);
 }
 
 #endif
Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
@@ -46,17 +46,23 @@
 
 int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_x86_64::DoWriteFPU(lldb::tid_t tid, int flavor,
const FPU ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  FPUWordCount);
 }
 
 int RegisterContextMach_x86_64::DoWriteEXC(lldb::tid_t tid, int flavor,
const EXC ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  EXCWordCount);
 }
 
 #endif
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r319934 - [MappedHash] Fix alignment violations

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:08 2017
New Revision: 319934

URL: http://llvm.org/viewvc/llvm-project?rev=319934=rev
Log:
[MappedHash] Fix alignment violations

This fixes a few alignment problems pointed out by UBSan, and is
otherwise NFC.

Modified:
lldb/trunk/include/lldb/Core/MappedHash.h

Modified: lldb/trunk/include/lldb/Core/MappedHash.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=319934=319933=319934=diff
==
--- lldb/trunk/include/lldb/Core/MappedHash.h (original)
+++ lldb/trunk/include/lldb/Core/MappedHash.h Wed Dec  6 11:21:08 2017
@@ -357,21 +357,24 @@ public:
 }
 
 uint32_t GetHashIndex(uint32_t bucket_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_indexes && bucket_idx < m_header.bucket_count)
-return m_hash_indexes[bucket_idx];
-  return UINT32_MAX;
+memcpy(, m_hash_indexes + bucket_idx, sizeof(uint32_t));
+  return result;
 }
 
 uint32_t GetHashValue(uint32_t hash_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_values && hash_idx < m_header.hashes_count)
-return m_hash_values[hash_idx];
-  return UINT32_MAX;
+memcpy(, m_hash_values + hash_idx, sizeof(uint32_t));
+  return result;
 }
 
 uint32_t GetHashDataOffset(uint32_t hash_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_offsets && hash_idx < m_header.hashes_count)
-return m_hash_offsets[hash_idx];
-  return UINT32_MAX;
+memcpy(, m_hash_offsets + hash_idx, sizeof(uint32_t));
+  return result;
 }
 
 bool Find(const char *name, Pair ) const {


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


[Lldb-commits] [lldb] r319935 - Use a static_cast instead of a C cast, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:09 2017
New Revision: 319935

URL: http://llvm.org/viewvc/llvm-project?rev=319935=rev
Log:
Use a static_cast instead of a C cast, NFC

Pointed out by Davide Italiano in post-commit review.

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319935=319934=319935=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Wed Dec  6 11:21:09 2017
@@ -1407,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllK
 void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
   if (log == NULL)
 return;
-  const uint8_t *u = (const uint8_t *)m_uuid.GetBytes();
+  const uint8_t *u = static_cast(m_uuid.GetBytes());
 
   if (m_load_address == LLDB_INVALID_ADDRESS) {
 if (u) {


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


[Lldb-commits] [lldb] r319939 - Fix const-correctness in RegisterContext methods, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:12 2017
New Revision: 319939

URL: http://llvm.org/viewvc/llvm-project?rev=319939=rev
Log:
Fix const-correctness in RegisterContext methods, NFC

A few methods in RegisterContext classes accept const objects which are
cast to a non-const thread_state_t. Drop const-ness more explicitly
where we mean to do so. This fixes a slew of warnings.

Differential Revision: https://reviews.llvm.org/D40821

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp?rev=319939=319938=319939=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp Wed 
Dec  6 11:21:12 2017
@@ -50,22 +50,30 @@ int RegisterContextMach_arm::DoReadDBG(l
 
 int RegisterContextMach_arm::DoWriteGPR(lldb::tid_t tid, int flavor,
 const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteFPU(lldb::tid_t tid, int flavor,
 const FPU ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  FPUWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteEXC(lldb::tid_t tid, int flavor,
 const EXC ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  EXCWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteDBG(lldb::tid_t tid, int flavor,
 const DBG ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), DBGWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  DBGWordCount);
 }
 
 #endif

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp?rev=319939=319938=319939=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp Wed 
Dec  6 11:21:12 2017
@@ -43,17 +43,23 @@ int RegisterContextMach_i386::DoReadEXC(
 
 int RegisterContextMach_i386::DoWriteGPR(lldb::tid_t tid, int flavor,
  const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteFPU(lldb::tid_t tid, int flavor,
  const FPU ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  FPUWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteEXC(lldb::tid_t tid, int flavor,
  const EXC ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  EXCWordCount);
 }
 
 #endif

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp?rev=319939=319938=319939=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp 
Wed Dec  6 11:21:12 2017
@@ -46,17 +46,23 @@ int RegisterContextMach_x86_64::DoReadEX
 
 int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
const GPR ) {
-  return ::thread_set_state(tid, flavor, (thread_state_t), GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast()),
+  GPRWordCount);
 }
 
 int RegisterContextMach_x86_64::DoWriteFPU(lldb::tid_t tid, int flavor,
const FPU ) {
-  return 

[Lldb-commits] [lldb] r319937 - Fix misc -Wcast-qual warnings, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:11 2017
New Revision: 319937

URL: http://llvm.org/viewvc/llvm-project?rev=319937=rev
Log:
Fix misc -Wcast-qual warnings, NFC

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBServices.cpp
lldb/trunk/tools/debugserver/source/RNBSocket.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319937=319936=319937=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:21:11 2017
@@ -3147,7 +3147,8 @@ pid_t MachProcess::PosixSpawnChildForPTr
   ::chdir(working_directory);
 
 err.SetError(::posix_spawnp(, path, _actions, ,
-(char *const *)argv, (char *const *)envp),
+const_cast(argv),
+const_cast(envp)),
  DNBError::POSIX);
 if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
   err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = 
"
@@ -3159,8 +3160,9 @@ pid_t MachProcess::PosixSpawnChildForPTr
 if (working_directory)
   ::chdir(working_directory);
 
-err.SetError(::posix_spawnp(, path, NULL, , (char *const *)argv,
-(char *const *)envp),
+err.SetError(::posix_spawnp(, path, NULL, ,
+const_cast(argv),
+const_cast(envp)),
  DNBError::POSIX);
 if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
   err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = 
"
@@ -3257,7 +3259,7 @@ pid_t MachProcess::ForkChildForPTraceDeb
   ::sleep(1);
 
   // Turn this process into
-  ::execv(path, (char *const *)argv);
+  ::execv(path, const_cast(argv));
 }
 // Exit with error code. Child process should have taken
 // over in above exec call and if the exec fails it will

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm?rev=319937=319936=319937=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Wed Dec  6 11:21:11 
2017
@@ -188,7 +188,7 @@ nub_size_t MachTask::WriteMemory(nub_add
  (uint64_t)addr, (uint64_t)size, buf, (uint64_t)n);
 if (DNBLogCheckLogBit(LOG_MEMORY_DATA_LONG) ||
 (DNBLogCheckLogBit(LOG_MEMORY_DATA_SHORT) && size <= 8)) {
-  DNBDataRef data((uint8_t *)buf, n, false);
+  DNBDataRef data((const uint8_t *)buf, n, false);
   data.Dump(0, static_cast(n), addr,
 DNBDataRef::TypeUInt8, 16);
 }

Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=319937=319936=319937=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp Wed Dec 
 6 11:21:11 2017
@@ -1886,7 +1886,7 @@ nub_size_t DNBArchImplI386::SetRegisterC
 if (size > buf_len)
   size = buf_len;
 
-uint8_t *p = (uint8_t *)buf;
+const uint8_t *p = (const uint8_t *)buf;
 // Copy the GPR registers
 memcpy(_state.context.gpr, p, sizeof(GPR));
 p += sizeof(GPR);
@@ -1927,7 +1927,7 @@ nub_size_t DNBArchImplI386::SetRegisterC
 p += sizeof(EXC);
 
 // make sure we end up with exactly what we think we should have
-size_t bytes_written = p - (uint8_t *)buf;
+size_t bytes_written = p - (const uint8_t *)buf;
 UNUSED_IF_ASSERT_DISABLED(bytes_written);
 assert(bytes_written == size);
 kern_return_t kret;

Modified: 
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=319937=319936=319937=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Wed 
Dec  6 11:21:11 2017
@@ -2164,7 

[Lldb-commits] [lldb] r319938 - Fix an -Wunused-function warning, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:11 2017
New Revision: 319938

URL: http://llvm.org/viewvc/llvm-project?rev=319938=rev
Log:
Fix an -Wunused-function warning, NFC

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319938=319937=319938=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:21:11 2017
@@ -45,26 +45,6 @@
 #include "CFBundle.h"
 #include "CFString.h"
 
-static void SplitEventData(const char *data, std::vector 
)
-{
-  elements.clear();
-  if (!data)
-return;
-
-  const char *start = data;
-
-  while (*start != '\0') {
-const char *token = strchr(start, ':');
-if (!token) {
-  elements.push_back(std::string(start));
-  return;
-}
-if (token != start)
-  elements.push_back(std::string(start, token - start));
-start = ++token;
-  }
-}
-
 #ifdef WITH_SPRINGBOARD
 
 #include 
@@ -210,6 +190,28 @@ static bool CallBoardSystemServiceOpenAp
 }
 #endif
 
+#if defined(WITH_FBS) || defined(WITH_FBS)
+static void SplitEventData(const char *data, std::vector 
)
+{
+  elements.clear();
+  if (!data)
+return;
+
+  const char *start = data;
+
+  while (*start != '\0') {
+const char *token = strchr(start, ':');
+if (!token) {
+  elements.push_back(std::string(start));
+  return;
+}
+if (token != start)
+  elements.push_back(std::string(start, token - start));
+start = ++token;
+  }
+}
+#endif
+
 #ifdef WITH_BKS
 #import 
 extern "C" {


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


[Lldb-commits] [lldb] r319936 - Remove no-op function pointer null checks, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:10 2017
New Revision: 319936

URL: http://llvm.org/viewvc/llvm-project?rev=319936=rev
Log:
Remove no-op function pointer null checks, NFC

Null-checking functions which aren't marked weak_import is a no-op
(the compiler rewrites the check to 'true'), regardless of whether a
library providing its definition is weak-linked. If the deployment
target is greater than the minimum requirement, the availability markup
on APIs does not lower to weak_import.

Remove no-op null checks to clean up the code and silence warnings.

Differential Revision: https://reviews.llvm.org/D40812

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=319936=319935=319936=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Wed 
Dec  6 11:21:10 2017
@@ -600,10 +600,9 @@ bool GDBRemoteCommunication::DecompressP
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so check that compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
-  (m_compression_type == CompressionType::ZlibDeflate ||
-   m_compression_type == CompressionType::LZFSE ||
-   m_compression_type == CompressionType::LZ4)) {
+  if (m_compression_type == CompressionType::ZlibDeflate ||
+  m_compression_type == CompressionType::LZFSE ||
+  m_compression_type == CompressionType::LZ4) {
 compression_algorithm compression_type;
 if (m_compression_type == CompressionType::LZFSE)
   compression_type = COMPRESSION_LZFSE;

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=319936=319935=319936=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Wed Dec  6 11:21:10 2017
@@ -1022,10 +1022,7 @@ void GDBRemoteCommunicationClient::Maybe
   std::string avail_name;
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzfse") {
 avail_type = CompressionType::LZFSE;
@@ -1037,10 +1034,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "zlib-deflate") {
 avail_type = CompressionType::ZlibDeflate;
@@ -1064,10 +1058,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lz4") {
 avail_type = CompressionType::LZ4;
@@ -1079,10 +1070,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzma") {
 avail_type = CompressionType::LZMA;

Modified: lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp?rev=319936=319935=319936=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp Wed Dec  6 

[Lldb-commits] [PATCH] D40557: Variable: Fix usage of uninitialised value

2017-12-06 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Sorry for the delay.  That bug has been present since this function was added, 
so it doesn't look like there was a use for these parameters that got lost as 
the code evolved.  So this seems like a fine change.


https://reviews.llvm.org/D40557



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


Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all tests with -fno-limit-debug-info

2017-12-06 Thread Davide Italiano via lldb-commits
I'll fix this now (my top priority :)

On Wed, Dec 6, 2017 at 9:44 AM, Adrian Prantl  wrote:
>
>
>> On Dec 6, 2017, at 9:35 AM, Robinson, Paul  wrote:
>>
>>> -Original Message-
>>> From: Pavel Labath [mailto:lab...@google.com]
>>> Sent: Wednesday, December 06, 2017 4:09 AM
>>> To: Jason Molenda
>>> Cc: lldb-commits@lists.llvm.org; Robinson, Paul
>>> Subject: Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all
>>> tests with -fno-limit-debug-info
>>>
>>> On 6 December 2017 at 01:54, Jason Molenda  wrote:
 It looks like the macos testsuite on the bot is broken with this -

 http://lab.llvm.org:8080/green/view/LLDB/job/lldb/3086/

 On my desktop with a recent clang, it works fine.  But it seems like
>>> every test? most tests? are failing with

 error: parsing line table prologue at 0x (parsing ended around
>>> 0x

 messages now.

 When I run one test by hand on my system, I have the -fno-limit-debug-
>>> info flag:

 ./dotest.py -t -v -v
>>> ../packages//Python/lldbsuite/test/functionalities/breakpoint/auto_continu
>>> e/



 stdout:
>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc
>>> hain/usr/bin/clang -g -O0 -fno-builtin -arch x86_64  -
>>> I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/../../../..
>>> /../include -include
>>> /Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/test_common.
>>> h -I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/  -fno-
>>> limit-debug-info  -std=c99   -c -o main.o main.c



 I'm not sure if the bots are building against too new or too new a
>>> compiler - if we're looking at a bug or it just does something weird when
>>> given -fno-limit-debug-info?
>>>
>>> I was able to reproduce this by running the tests against the
>>> top-of-tree clang (which is what that bot does). It's not all tests
>>> that break, just the ones using dSYM debug info.
>>>
>>> While this patch is a reasonable first guess, it is actually *not* the
>>> source of the breakage. The culprit is
>>> , which was present in the same
>>> patchset. It seems this change makes clang emit different line table
>>> headers. After that, dsymutil fails to process the files because it
>>> detects a header mismatch (and lldb breaks because it cannot find the
>>> line table or it is corrupt). I've cc'ed Paul in case he has any
>>> insight.
>>>
>>> Maybe dsymutil needs to be updated to handle the new line tables?
>>>
>>> pl
>>
>> When I committed D38002, it broke debuginfo-tests on greendragon
>> because it was using an older lldb and/or dsymutil that didn't know
>> how to parse v3 or v4 line-table headers.  Adrian Prantl pinned
>> the failing debuginfo-tests to v2 (change -g to -gdwarf-2) while that
>> gets sorted out.
>>
>> I expect the same thing is happening here.  The same workaround should
>> apply here; the long-term fix is to update dsymutil.
>>
>> I really would rather not make the compiler pin line tables at v2 as
>> a special case for Darwin, or whatever.
>
> Yeah, our plan is to just fix dsymutil and to pin the LLDB tests to -gdwarf-2 
> as a temporary workaround until we can deploy a new dsymutil to the bots.
>
> -- adrian
>
>> --paulr
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all tests with -fno-limit-debug-info

2017-12-06 Thread Adrian Prantl via lldb-commits


> On Dec 6, 2017, at 9:35 AM, Robinson, Paul  wrote:
> 
>> -Original Message-
>> From: Pavel Labath [mailto:lab...@google.com]
>> Sent: Wednesday, December 06, 2017 4:09 AM
>> To: Jason Molenda
>> Cc: lldb-commits@lists.llvm.org; Robinson, Paul
>> Subject: Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all
>> tests with -fno-limit-debug-info
>> 
>> On 6 December 2017 at 01:54, Jason Molenda  wrote:
>>> It looks like the macos testsuite on the bot is broken with this -
>>> 
>>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb/3086/
>>> 
>>> On my desktop with a recent clang, it works fine.  But it seems like
>> every test? most tests? are failing with
>>> 
>>> error: parsing line table prologue at 0x (parsing ended around
>> 0x
>>> 
>>> messages now.
>>> 
>>> When I run one test by hand on my system, I have the -fno-limit-debug-
>> info flag:
>>> 
>>> ./dotest.py -t -v -v
>> ../packages//Python/lldbsuite/test/functionalities/breakpoint/auto_continu
>> e/
>>> 
>>> 
>>> 
>>> stdout:
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc
>> hain/usr/bin/clang -g -O0 -fno-builtin -arch x86_64  -
>> I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/../../../..
>> /../include -include
>> /Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/test_common.
>> h -I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/  -fno-
>> limit-debug-info  -std=c99   -c -o main.o main.c
>>> 
>>> 
>>> 
>>> I'm not sure if the bots are building against too new or too new a
>> compiler - if we're looking at a bug or it just does something weird when
>> given -fno-limit-debug-info?
>> 
>> I was able to reproduce this by running the tests against the
>> top-of-tree clang (which is what that bot does). It's not all tests
>> that break, just the ones using dSYM debug info.
>> 
>> While this patch is a reasonable first guess, it is actually *not* the
>> source of the breakage. The culprit is
>> , which was present in the same
>> patchset. It seems this change makes clang emit different line table
>> headers. After that, dsymutil fails to process the files because it
>> detects a header mismatch (and lldb breaks because it cannot find the
>> line table or it is corrupt). I've cc'ed Paul in case he has any
>> insight.
>> 
>> Maybe dsymutil needs to be updated to handle the new line tables?
>> 
>> pl
> 
> When I committed D38002, it broke debuginfo-tests on greendragon
> because it was using an older lldb and/or dsymutil that didn't know
> how to parse v3 or v4 line-table headers.  Adrian Prantl pinned
> the failing debuginfo-tests to v2 (change -g to -gdwarf-2) while that 
> gets sorted out.
> 
> I expect the same thing is happening here.  The same workaround should
> apply here; the long-term fix is to update dsymutil.
> 
> I really would rather not make the compiler pin line tables at v2 as
> a special case for Darwin, or whatever.

Yeah, our plan is to just fix dsymutil and to pin the LLDB tests to -gdwarf-2 
as a temporary workaround until we can deploy a new dsymutil to the bots.

-- adrian

> --paulr

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


Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all tests with -fno-limit-debug-info

2017-12-06 Thread Robinson, Paul via lldb-commits
> -Original Message-
> From: Pavel Labath [mailto:lab...@google.com]
> Sent: Wednesday, December 06, 2017 4:09 AM
> To: Jason Molenda
> Cc: lldb-commits@lists.llvm.org; Robinson, Paul
> Subject: Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all
> tests with -fno-limit-debug-info
> 
> On 6 December 2017 at 01:54, Jason Molenda  wrote:
> > It looks like the macos testsuite on the bot is broken with this -
> >
> > http://lab.llvm.org:8080/green/view/LLDB/job/lldb/3086/
> >
> > On my desktop with a recent clang, it works fine.  But it seems like
> every test? most tests? are failing with
> >
> > error: parsing line table prologue at 0x (parsing ended around
> 0x
> >
> > messages now.
> >
> > When I run one test by hand on my system, I have the -fno-limit-debug-
> info flag:
> >
> > ./dotest.py -t -v -v
> ../packages//Python/lldbsuite/test/functionalities/breakpoint/auto_continu
> e/
> >
> >
> >
> > stdout:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc
> hain/usr/bin/clang -g -O0 -fno-builtin -arch x86_64  -
> I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/../../../..
> /../include -include
> /Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/test_common.
> h -I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/  -fno-
> limit-debug-info  -std=c99   -c -o main.o main.c
> >
> >
> >
> > I'm not sure if the bots are building against too new or too new a
> compiler - if we're looking at a bug or it just does something weird when
> given -fno-limit-debug-info?
> 
> I was able to reproduce this by running the tests against the
> top-of-tree clang (which is what that bot does). It's not all tests
> that break, just the ones using dSYM debug info.
> 
> While this patch is a reasonable first guess, it is actually *not* the
> source of the breakage. The culprit is
> , which was present in the same
> patchset. It seems this change makes clang emit different line table
> headers. After that, dsymutil fails to process the files because it
> detects a header mismatch (and lldb breaks because it cannot find the
> line table or it is corrupt). I've cc'ed Paul in case he has any
> insight.
> 
> Maybe dsymutil needs to be updated to handle the new line tables?
> 
> pl

When I committed D38002, it broke debuginfo-tests on greendragon
because it was using an older lldb and/or dsymutil that didn't know
how to parse v3 or v4 line-table headers.  Adrian Prantl pinned
the failing debuginfo-tests to v2 (change -g to -gdwarf-2) while that 
gets sorted out.

I expect the same thing is happening here.  The same workaround should
apply here; the long-term fix is to update dsymutil.

I really would rather not make the compiler pin line tables at v2 as
a special case for Darwin, or whatever.
--paulr
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40557: Variable: Fix usage of uninitialised value

2017-12-06 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Jim, could you have a quick look at this?

thanks.


https://reviews.llvm.org/D40557



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


Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all tests with -fno-limit-debug-info

2017-12-06 Thread Pavel Labath via lldb-commits
On 6 December 2017 at 01:54, Jason Molenda  wrote:
> It looks like the macos testsuite on the bot is broken with this -
>
> http://lab.llvm.org:8080/green/view/LLDB/job/lldb/3086/
>
> On my desktop with a recent clang, it works fine.  But it seems like every 
> test? most tests? are failing with
>
> error: parsing line table prologue at 0x (parsing ended around 
> 0x
>
> messages now.
>
> When I run one test by hand on my system, I have the -fno-limit-debug-info 
> flag:
>
> ./dotest.py -t -v -v  
> ../packages//Python/lldbsuite/test/functionalities/breakpoint/auto_continue/
>
>
>
> stdout: 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
>  -g -O0 -fno-builtin -arch x86_64  
> -I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/../../../../../include
>  -include 
> /Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/test_common.h 
> -I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/  
> -fno-limit-debug-info  -std=c99   -c -o main.o main.c
>
>
>
> I'm not sure if the bots are building against too new or too new a compiler - 
> if we're looking at a bug or it just does something weird when given 
> -fno-limit-debug-info?

I was able to reproduce this by running the tests against the
top-of-tree clang (which is what that bot does). It's not all tests
that break, just the ones using dSYM debug info.

While this patch is a reasonable first guess, it is actually *not* the
source of the breakage. The culprit is
, which was present in the same
patchset. It seems this change makes clang emit different line table
headers. After that, dsymutil fails to process the files because it
detects a header mismatch (and lldb breaks because it cannot find the
line table or it is corrupt). I've cc'ed Paul in case he has any
insight.

Maybe dsymutil needs to be updated to handle the new line tables?

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


Re: [Lldb-commits] [PATCH] D40745: Add a clang-ast subcommand to lldb-test

2017-12-06 Thread Pavel Labath via lldb-commits
On 5 December 2017 at 17:44, Greg Clayton  wrote:
> Didn't someone recently submit a patch to allow relocation of .o files? That 
> should have taken care of the issue, no?
>

I take it you mean D38142. This made sure that the memory we store the
object file in is writable, which makes sure that we are able to apply
at least some relocations. However, it does nothing about the fact
that we support only a handful of relocations that someone needed at
some point *and* the fact that we assume that all relocatoins are x86
relocations.

It will take some work before we can honestly claim that we support
relocating .o files.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits