[Lldb-commits] [lldb] r255237 - Differential Revision: http://reviews.llvm.org/D15333

2015-12-10 Thread Aidan Dodds via lldb-commits
Author: aidandodds
Date: Thu Dec 10 04:11:49 2015
New Revision: 255237

URL: http://llvm.org/viewvc/llvm-project?rev=255237&view=rev
Log:
Differential Revision: http://reviews.llvm.org/D15333

Modified:
lldb/trunk/source/Core/DataExtractor.cpp

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=255237&r1=255236&r2=255237&view=diff
==
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Dec 10 04:11:49 2015
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clang/AST/ASTContext.h"
 
@@ -1405,24 +1406,21 @@ DumpAPInt (Stream *s, const DataExtracto
 return offset;
 }
 
-static float half2float (uint16_t half)
+static float
+half2float (uint16_t half)
 {
-#ifdef _MSC_VER
-llvm_unreachable("half2float not implemented for MSVC");
-#else
-union{ float   f; uint32_tu;}u;
+union { float f; uint32_t u; } u;
 int32_t v = (int16_t) half;
-
-if( 0 == (v & 0x7c00))
+
+if (0 == (v & 0x7c00))
 {
 u.u = v & 0x80007FFFU;
 return u.f * ldexpf(1, 125);
 }
-
+
 v <<= 13;
 u.u = v | 0x7000U;
 return u.f * ldexpf(1, -112);
-#endif
 }
 
 lldb::offset_t


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


Re: [Lldb-commits] [PATCH] D15333: Enable half2float() on windows.

2015-12-10 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255237: Differential Revision: 
http://reviews.llvm.org/D15333 (authored by aidandodds).

Changed prior to commit:
  http://reviews.llvm.org/D15333?vs=42167&id=42401#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15333

Files:
  lldb/trunk/source/Core/DataExtractor.cpp

Index: lldb/trunk/source/Core/DataExtractor.cpp
===
--- lldb/trunk/source/Core/DataExtractor.cpp
+++ lldb/trunk/source/Core/DataExtractor.cpp
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clang/AST/ASTContext.h"
 
@@ -1405,24 +1406,21 @@
 return offset;
 }
 
-static float half2float (uint16_t half)
+static float
+half2float (uint16_t half)
 {
-#ifdef _MSC_VER
-llvm_unreachable("half2float not implemented for MSVC");
-#else
-union{ float   f; uint32_tu;}u;
+union { float f; uint32_t u; } u;
 int32_t v = (int16_t) half;
-
-if( 0 == (v & 0x7c00))
+
+if (0 == (v & 0x7c00))
 {
 u.u = v & 0x80007FFFU;
 return u.f * ldexpf(1, 125);
 }
-
+
 v <<= 13;
 u.u = v | 0x7000U;
 return u.f * ldexpf(1, -112);
-#endif
 }
 
 lldb::offset_t


Index: lldb/trunk/source/Core/DataExtractor.cpp
===
--- lldb/trunk/source/Core/DataExtractor.cpp
+++ lldb/trunk/source/Core/DataExtractor.cpp
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clang/AST/ASTContext.h"
 
@@ -1405,24 +1406,21 @@
 return offset;
 }
 
-static float half2float (uint16_t half)
+static float
+half2float (uint16_t half)
 {
-#ifdef _MSC_VER
-llvm_unreachable("half2float not implemented for MSVC");
-#else
-union{ float   f; uint32_tu;}u;
+union { float f; uint32_t u; } u;
 int32_t v = (int16_t) half;
-
-if( 0 == (v & 0x7c00))
+
+if (0 == (v & 0x7c00))
 {
 u.u = v & 0x80007FFFU;
 return u.f * ldexpf(1, 125);
 }
-
+
 v <<= 13;
 u.u = v | 0x7000U;
 return u.f * ldexpf(1, -112);
-#endif
 }
 
 lldb::offset_t
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255238 - [RenderScript] Refactor condition deciding when to JIT RS runtime

2015-12-10 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Thu Dec 10 04:20:39 2015
New Revision: 255238

URL: http://llvm.org/viewvc/llvm-project?rev=255238&view=rev
Log:
[RenderScript] Refactor condition deciding when to JIT RS runtime

Patch creates a member function that decides when to JIT all the details about 
an allocation.
By checking for zero pointers we can avoid the situation where we store 
uninitialised data from previously inspecting the allocation during creation.

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=255238&r1=255237&r2=255238&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 Thu Dec 10 04:20:39 2015
@@ -184,6 +184,13 @@ struct RenderScriptRuntime::Element
 
 static const ConstString &GetFallbackStructName();   // Print this as the 
type name of a struct Element
  // If we can't 
resolve the actual struct name
+
+bool shouldRefresh() const
+{
+const bool valid_ptr = element_ptr.isValid() && *element_ptr.get() != 
0x0;
+const bool valid_type = type.isValid() && type_vec_size.isValid() && 
type_kind.isValid();
+return !valid_ptr || !valid_type || !datum_size.isValid();
+}
 };
 
 // This AllocationDetails class collects data associated with a single
@@ -248,6 +255,13 @@ struct RenderScriptRuntime::AllocationDe
 AllocationDetails(): id(ID++)
 {
 }
+
+bool shouldRefresh() const
+{
+bool valid_ptrs = data_ptr.isValid() && *data_ptr.get() != 0x0;
+valid_ptrs = valid_ptrs && type_ptr.isValid() && *type_ptr.get() != 
0x0;
+return !valid_ptrs || !dimension.isValid() || !size.isValid() || 
element.shouldRefresh();
+}
 };
 
 
@@ -1871,8 +1885,7 @@ RenderScriptRuntime::GetAllocationData(A
 Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
 
 // JIT all the allocation details
-if (!allocation->data_ptr.isValid() || !allocation->element.type.isValid()
-|| !allocation->element.type_vec_size.isValid() || 
!allocation->size.isValid())
+if (allocation->shouldRefresh())
 {
 if (log)
 log->Printf("RenderScriptRuntime::GetAllocationData - Allocation 
details not calculated yet, jitting info");
@@ -1930,8 +1943,7 @@ RenderScriptRuntime::LoadAllocation(Stre
 log->Printf("RenderScriptRuntime::LoadAllocation - Found allocation 
0x%" PRIx64, *alloc->address.get());
 
 // JIT all the allocation details
-if (!alloc->data_ptr.isValid() || !alloc->element.type.isValid() || 
!alloc->element.datum_size.isValid()
-|| !alloc->element.type_vec_size.isValid() || !alloc->size.isValid())
+if (alloc->shouldRefresh())
 {
 if (log)
 log->Printf("RenderScriptRuntime::LoadAllocation - Allocation 
details not calculated yet, jitting info");
@@ -2044,8 +2056,7 @@ RenderScriptRuntime::SaveAllocation(Stre
 log->Printf("RenderScriptRuntime::SaveAllocation - Found allocation 
0x%" PRIx64, *alloc->address.get());
 
  // JIT all the allocation details
-if (!alloc->data_ptr.isValid() || !alloc->element.type.isValid() || 
!alloc->element.type_vec_size.isValid()
-|| !alloc->element.type_kind.isValid() || !alloc->dimension.isValid())
+if (alloc->shouldRefresh())
 {
 if (log)
 log->Printf("RenderScriptRuntime::SaveAllocation - Allocation 
details not calculated yet, jitting info");
@@ -2458,8 +2469,7 @@ RenderScriptRuntime::DumpAllocation(Stre
 log->Printf("RenderScriptRuntime::DumpAllocation - Found allocation 
0x%" PRIx64, *alloc->address.get());
 
 // Check we have information about the allocation, if not calculate it
-if (!alloc->data_ptr.isValid() || !alloc->element.type.isValid() ||
-!alloc->element.type_vec_size.isValid() || !alloc->dimension.isValid() 
|| !alloc->element.datum_size.isValid())
+if (alloc->shouldRefresh())
 {
 if (log)
 log->Printf("RenderScriptRuntime::DumpAllocation - Allocation 
details not calculated yet, jitting info");
@@ -2602,7 +2612,7 @@ RenderScriptRuntime::ListAllocations(Str
 for (auto &alloc : m_allocations)
 {
 // JIT the allocation info if we haven't done it, or the user forces 
us to.
-bool do_refresh = !alloc->data_ptr.isValid() || recompute;
+bool do_refresh = alloc->shouldRefresh() || recompute;
 
 // JIT current allocation information
 if (do_refresh && !Re

Re: [Lldb-commits] [PATCH] D15379: Switch to gold linker on android x86, x86_64, arm

2015-12-10 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: cmake/platforms/Android.cmake:124
@@ -123,1 +123,3 @@
 
+# Use gold linker and enable safe ICF in case of x86, x86_64 and arm
+if ( ANDROID_ABI STREQUAL "x86"OR

ovyalov wrote:
> Just out of curiosity - you haven't included arm64, it's not supported by 
> gold? 
There were some issues when we tried to change the android framework over to 
using gold on arm64 so we went back to the default linker util it can get 
fixed. Most likely it wouldn't affect lldb-server but better to be safe.


http://reviews.llvm.org/D15379



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


[Lldb-commits] [lldb] r255240 - Switch to gold linker on android x86, x86_64, arm

2015-12-10 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Dec 10 05:02:51 2015
New Revision: 255240

URL: http://llvm.org/viewvc/llvm-project?rev=255240&view=rev
Log:
Switch to gold linker on android x86, x86_64, arm

These architectures already using the gold linker for the android
framework and switching to gold gives us the opportunity to enable ICF.

Safe ICF (identical code folding) reduces the size of an optimized and
striped binary by ~5%.

Differential revision: http://reviews.llvm.org/D15379

Modified:
lldb/trunk/cmake/platforms/Android.cmake

Modified: lldb/trunk/cmake/platforms/Android.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=255240&r1=255239&r2=255240&view=diff
==
--- lldb/trunk/cmake/platforms/Android.cmake (original)
+++ lldb/trunk/cmake/platforms/Android.cmake Thu Dec 10 05:02:51 2015
@@ -121,6 +121,13 @@ elseif( ANDROID_ABI STREQUAL "mips" )
  endif()
 endif()
 
+# Use gold linker and enable safe ICF in case of x86, x86_64 and arm
+if ( ANDROID_ABI STREQUAL "x86"OR
+ ANDROID_ABI STREQUAL "x86_64" OR
+ ANDROID_ABI STREQUAL "armeabi")
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold 
-Wl,--icf=safe" )
+endif()
+
 if( NOT LLVM_BUILD_STATIC )
  # PIE is required for API 21+ so we enable it if we're not statically linking
  # unfortunately, it is not supported before API 16 so we need to do something


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


Re: [Lldb-commits] [PATCH] D15379: Switch to gold linker on android x86, x86_64, arm

2015-12-10 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255240: Switch to gold linker on android x86, x86_64, arm 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D15379?vs=42295&id=42407#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15379

Files:
  lldb/trunk/cmake/platforms/Android.cmake

Index: lldb/trunk/cmake/platforms/Android.cmake
===
--- lldb/trunk/cmake/platforms/Android.cmake
+++ lldb/trunk/cmake/platforms/Android.cmake
@@ -121,6 +121,13 @@
  endif()
 endif()
 
+# Use gold linker and enable safe ICF in case of x86, x86_64 and arm
+if ( ANDROID_ABI STREQUAL "x86"OR
+ ANDROID_ABI STREQUAL "x86_64" OR
+ ANDROID_ABI STREQUAL "armeabi")
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold 
-Wl,--icf=safe" )
+endif()
+
 if( NOT LLVM_BUILD_STATIC )
  # PIE is required for API 21+ so we enable it if we're not statically linking
  # unfortunately, it is not supported before API 16 so we need to do something


Index: lldb/trunk/cmake/platforms/Android.cmake
===
--- lldb/trunk/cmake/platforms/Android.cmake
+++ lldb/trunk/cmake/platforms/Android.cmake
@@ -121,6 +121,13 @@
  endif()
 endif()
 
+# Use gold linker and enable safe ICF in case of x86, x86_64 and arm
+if ( ANDROID_ABI STREQUAL "x86"OR
+ ANDROID_ABI STREQUAL "x86_64" OR
+ ANDROID_ABI STREQUAL "armeabi")
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold -Wl,--icf=safe" )
+endif()
+
 if( NOT LLVM_BUILD_STATIC )
  # PIE is required for API 21+ so we enable it if we're not statically linking
  # unfortunately, it is not supported before API 16 so we need to do something
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255237 - Differential Revision: http://reviews.llvm.org/D15333

2015-12-10 Thread Tamas Berghammer via lldb-commits
Hi Aidan,

Next time please add a commit message describing the change itself (next to
the review link). In general I think copying the review title and the
summary into the commit message is a good baseline. It will help us
understand your change when somebody looking at git logs as we don't have
to open an external link also.

Thanks,
Tamas

On Thu, Dec 10, 2015 at 10:14 AM Aidan Dodds via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: aidandodds
> Date: Thu Dec 10 04:11:49 2015
> New Revision: 255237
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255237&view=rev
> Log:
> Differential Revision: http://reviews.llvm.org/D15333
>
> Modified:
> lldb/trunk/source/Core/DataExtractor.cpp
>
> Modified: lldb/trunk/source/Core/DataExtractor.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=255237&r1=255236&r2=255237&view=diff
>
> ==
> --- lldb/trunk/source/Core/DataExtractor.cpp (original)
> +++ lldb/trunk/source/Core/DataExtractor.cpp Thu Dec 10 04:11:49 2015
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include "clang/AST/ASTContext.h"
>
> @@ -1405,24 +1406,21 @@ DumpAPInt (Stream *s, const DataExtracto
>  return offset;
>  }
>
> -static float half2float (uint16_t half)
> +static float
> +half2float (uint16_t half)
>  {
> -#ifdef _MSC_VER
> -llvm_unreachable("half2float not implemented for MSVC");
> -#else
> -union{ float   f; uint32_tu;}u;
> +union { float f; uint32_t u; } u;
>  int32_t v = (int16_t) half;
> -
> -if( 0 == (v & 0x7c00))
> +
> +if (0 == (v & 0x7c00))
>  {
>  u.u = v & 0x80007FFFU;
>  return u.f * ldexpf(1, 125);
>  }
> -
> +
>  v <<= 13;
>  u.u = v | 0x7000U;
>  return u.f * ldexpf(1, -112);
> -#endif
>  }
>
>  lldb::offset_t
>
>
> ___
> 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] D15415: Add modules downloaded by ModuleCache to the global ModuleList

2015-12-10 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added a reviewer: ovyalov.
tberghammer added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer.

Add modules downloaded by ModuleCache to the global ModuleList

Adding the modules to the global module list eliminate issues in the
case when a module is unloaded from the target but some object (e.g.
breakpoint) still referencing them with weak pointers. It also speeds
up the case when we load, unload, load the same shared library because
the global module cache will keep the parsed debug info around between
the 2 load (this scenario happens for some code on android).

http://reviews.llvm.org/D15415

Files:
  source/Utility/ModuleCache.cpp

Index: source/Utility/ModuleCache.cpp
===
--- source/Utility/ModuleCache.cpp
+++ source/Utility/ModuleCache.cpp
@@ -11,6 +11,7 @@
 
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSystem.h"
@@ -234,23 +235,28 @@
 return Error ("Module %s has invalid file size", 
module_file_path.GetPath ().c_str ());
 
 // We may have already cached module but downloaded from an another host - 
in this case let's create a link to it.
-const auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
+auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
 if (error.Fail ())
 return Error ("Failed to create link to %s: %s", 
module_file_path.GetPath().c_str(), error.AsCString());
 
 auto cached_module_spec (module_spec);
 cached_module_spec.GetUUID ().Clear ();  // Clear UUID since it may 
contain md5 content hash instead of real UUID.
 cached_module_spec.GetFileSpec () = module_file_path;
 cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
-cached_module_sp.reset (new Module (cached_module_spec));
+
+error = ModuleList::GetSharedModule(cached_module_spec,
+cached_module_sp,
+nullptr,
+nullptr,
+did_create_ptr,
+false);
+if (error.Fail())
+return error;
 
 FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec 
());
 if (symfile_spec.Exists ())
 cached_module_sp->SetSymbolFileFileSpec (symfile_spec);
 
-if (did_create_ptr)
-*did_create_ptr = true;
-
 m_loaded_modules.insert (std::make_pair (module_spec.GetUUID 
().GetAsString (), cached_module_sp));
 
 return Error ();


Index: source/Utility/ModuleCache.cpp
===
--- source/Utility/ModuleCache.cpp
+++ source/Utility/ModuleCache.cpp
@@ -11,6 +11,7 @@
 
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSystem.h"
@@ -234,23 +235,28 @@
 return Error ("Module %s has invalid file size", module_file_path.GetPath ().c_str ());
 
 // We may have already cached module but downloaded from an another host - in this case let's create a link to it.
-const auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, module_spec.GetFileSpec(), module_file_path, false);
+auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, module_spec.GetFileSpec(), module_file_path, false);
 if (error.Fail ())
 return Error ("Failed to create link to %s: %s", module_file_path.GetPath().c_str(), error.AsCString());
 
 auto cached_module_spec (module_spec);
 cached_module_spec.GetUUID ().Clear ();  // Clear UUID since it may contain md5 content hash instead of real UUID.
 cached_module_spec.GetFileSpec () = module_file_path;
 cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
-cached_module_sp.reset (new Module (cached_module_spec));
+
+error = ModuleList::GetSharedModule(cached_module_spec,
+cached_module_sp,
+nullptr,
+nullptr,
+did_create_ptr,
+false);
+if (error.Fail())
+return error;
 
 FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec ());
 if (symfile_spec.Exists ())
 cached_module_sp->SetSymbolFileFileSpec (symfile_spec);
 
-if (did_create_ptr)
-*did_create_ptr = true;
-
 m_loaded_modules.insert (std::make_pair (module_spec.GetUUID ().GetAsString (), cached_module_sp));
 
 return Err

Re: [Lldb-commits] [lldb] r255237 - Differential Revision: http://reviews.llvm.org/D15333

2015-12-10 Thread Aidan Dodds via lldb-commits

Hi Tamas,

Your right, sorry about that, I will be sure to add a commit message in 
the future.


Thanks,
Aidan

On 10/12/2015 11:10, Tamas Berghammer wrote:

Hi Aidan,

Next time please add a commit message describing the change itself 
(next to the review link). In general I think copying the review title 
and the summary into the commit message is a good baseline. It will 
help us understand your change when somebody looking at git logs as we 
don't have to open an external link also.


Thanks,
Tamas

On Thu, Dec 10, 2015 at 10:14 AM Aidan Dodds via lldb-commits 
mailto:lldb-commits@lists.llvm.org>> wrote:


Author: aidandodds
Date: Thu Dec 10 04:11:49 2015
New Revision: 255237

URL: http://llvm.org/viewvc/llvm-project?rev=255237&view=rev
Log:
Differential Revision: http://reviews.llvm.org/D15333

Modified:
lldb/trunk/source/Core/DataExtractor.cpp

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL:

http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=255237&r1=255236&r2=255237&view=diff

==
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Dec 10 04:11:49 2015
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "clang/AST/ASTContext.h"

@@ -1405,24 +1406,21 @@ DumpAPInt (Stream *s, const DataExtracto
 return offset;
 }

-static float half2float (uint16_t half)
+static float
+half2float (uint16_t half)
 {
-#ifdef _MSC_VER
-llvm_unreachable("half2float not implemented for MSVC");
-#else
-union{ float   f; uint32_tu;}u;
+union { float f; uint32_t u; } u;
 int32_t v = (int16_t) half;
-
-if( 0 == (v & 0x7c00))
+
+if (0 == (v & 0x7c00))
 {
 u.u = v & 0x80007FFFU;
 return u.f * ldexpf(1, 125);
 }
-
+
 v <<= 13;
 u.u = v | 0x7000U;
 return u.f * ldexpf(1, -112);
-#endif
 }

 lldb::offset_t


___
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] D15116: Fix for evaluating a function with an ambiguous symbol

2015-12-10 Thread Ewan Crawford via lldb-commits
EwanCrawford added a comment.

ping


Repository:
  rL LLVM

http://reviews.llvm.org/D15116



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


Re: [Lldb-commits] [PATCH] D15415: Add modules downloaded by ModuleCache to the global ModuleList

2015-12-10 Thread Oleksiy Vyalov via lldb-commits
ovyalov accepted this revision.
ovyalov added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D15415



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


[Lldb-commits] [lldb] r255260 - Add modules downloaded by ModuleCache to the global ModuleList

2015-12-10 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Dec 10 11:08:23 2015
New Revision: 255260

URL: http://llvm.org/viewvc/llvm-project?rev=255260&view=rev
Log:
Add modules downloaded by ModuleCache to the global ModuleList

Adding the modules to the global module list eleminate issues in the
case when a module is unloaded from the target but some object (e.g.
breakpoint) still referencing them with weak pointers. It also speeds
up the case when we load, unload, load the same shared library because
the global module cache will keep the parsed debug info around between
the 2 load (this scenario happens for some code on android).

Differential revision: http://reviews.llvm.org/D15415

Modified:
lldb/trunk/source/Utility/ModuleCache.cpp

Modified: lldb/trunk/source/Utility/ModuleCache.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ModuleCache.cpp?rev=255260&r1=255259&r2=255260&view=diff
==
--- lldb/trunk/source/Utility/ModuleCache.cpp (original)
+++ lldb/trunk/source/Utility/ModuleCache.cpp Thu Dec 10 11:08:23 2015
@@ -11,6 +11,7 @@
 
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSystem.h"
@@ -234,7 +235,7 @@ ModuleCache::Get (const FileSpec &root_d
 return Error ("Module %s has invalid file size", 
module_file_path.GetPath ().c_str ());
 
 // We may have already cached module but downloaded from an another host - 
in this case let's create a link to it.
-const auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
+auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
 if (error.Fail ())
 return Error ("Failed to create link to %s: %s", 
module_file_path.GetPath().c_str(), error.AsCString());
 
@@ -242,15 +243,20 @@ ModuleCache::Get (const FileSpec &root_d
 cached_module_spec.GetUUID ().Clear ();  // Clear UUID since it may 
contain md5 content hash instead of real UUID.
 cached_module_spec.GetFileSpec () = module_file_path;
 cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
-cached_module_sp.reset (new Module (cached_module_spec));
+
+error = ModuleList::GetSharedModule(cached_module_spec,
+cached_module_sp,
+nullptr,
+nullptr,
+did_create_ptr,
+false);
+if (error.Fail())
+return error;
 
 FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec 
());
 if (symfile_spec.Exists ())
 cached_module_sp->SetSymbolFileFileSpec (symfile_spec);
 
-if (did_create_ptr)
-*did_create_ptr = true;
-
 m_loaded_modules.insert (std::make_pair (module_spec.GetUUID 
().GetAsString (), cached_module_sp));
 
 return Error ();


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


Re: [Lldb-commits] [PATCH] D15415: Add modules downloaded by ModuleCache to the global ModuleList

2015-12-10 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255260: Add modules downloaded by ModuleCache to the global 
ModuleList (authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D15415?vs=42422&id=42433#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15415

Files:
  lldb/trunk/source/Utility/ModuleCache.cpp

Index: lldb/trunk/source/Utility/ModuleCache.cpp
===
--- lldb/trunk/source/Utility/ModuleCache.cpp
+++ lldb/trunk/source/Utility/ModuleCache.cpp
@@ -11,6 +11,7 @@
 
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSystem.h"
@@ -234,23 +235,28 @@
 return Error ("Module %s has invalid file size", 
module_file_path.GetPath ().c_str ());
 
 // We may have already cached module but downloaded from an another host - 
in this case let's create a link to it.
-const auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
+auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, 
module_spec.GetFileSpec(), module_file_path, false);
 if (error.Fail ())
 return Error ("Failed to create link to %s: %s", 
module_file_path.GetPath().c_str(), error.AsCString());
 
 auto cached_module_spec (module_spec);
 cached_module_spec.GetUUID ().Clear ();  // Clear UUID since it may 
contain md5 content hash instead of real UUID.
 cached_module_spec.GetFileSpec () = module_file_path;
 cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
-cached_module_sp.reset (new Module (cached_module_spec));
+
+error = ModuleList::GetSharedModule(cached_module_spec,
+cached_module_sp,
+nullptr,
+nullptr,
+did_create_ptr,
+false);
+if (error.Fail())
+return error;
 
 FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec 
());
 if (symfile_spec.Exists ())
 cached_module_sp->SetSymbolFileFileSpec (symfile_spec);
 
-if (did_create_ptr)
-*did_create_ptr = true;
-
 m_loaded_modules.insert (std::make_pair (module_spec.GetUUID 
().GetAsString (), cached_module_sp));
 
 return Error ();


Index: lldb/trunk/source/Utility/ModuleCache.cpp
===
--- lldb/trunk/source/Utility/ModuleCache.cpp
+++ lldb/trunk/source/Utility/ModuleCache.cpp
@@ -11,6 +11,7 @@
 
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSystem.h"
@@ -234,23 +235,28 @@
 return Error ("Module %s has invalid file size", module_file_path.GetPath ().c_str ());
 
 // We may have already cached module but downloaded from an another host - in this case let's create a link to it.
-const auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, module_spec.GetFileSpec(), module_file_path, false);
+auto error = CreateHostSysRootModuleLink(root_dir_spec, hostname, module_spec.GetFileSpec(), module_file_path, false);
 if (error.Fail ())
 return Error ("Failed to create link to %s: %s", module_file_path.GetPath().c_str(), error.AsCString());
 
 auto cached_module_spec (module_spec);
 cached_module_spec.GetUUID ().Clear ();  // Clear UUID since it may contain md5 content hash instead of real UUID.
 cached_module_spec.GetFileSpec () = module_file_path;
 cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
-cached_module_sp.reset (new Module (cached_module_spec));
+
+error = ModuleList::GetSharedModule(cached_module_spec,
+cached_module_sp,
+nullptr,
+nullptr,
+did_create_ptr,
+false);
+if (error.Fail())
+return error;
 
 FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec ());
 if (symfile_spec.Exists ())
 cached_module_sp->SetSymbolFileFileSpec (symfile_spec);
 
-if (did_create_ptr)
-*did_create_ptr = true;
-
 m_loaded_modules.insert (std::make_pair (module_spec.GetUUID ().GetAsString (), cached_module_sp));
 
 return Error ();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.

2015-12-10 Thread Greg Clayton via lldb-commits
clayborg added a subscriber: clayborg.
clayborg added a comment.

I like the clang specific patch here better. Mainly because if you add a 
function like this to TypeSystem.h:

  virtual uint32_t
  DeclContextCountDeclLevels (void *opaque_decl_ctx,
  void *opaque_find_decl_ctx,
  ConstString *find_name = nullptr,
  CompilerType *find_type = nullptr) = 0;

It means that you will have a function in the CompilerDeclContext named 
"CountDeclLevels(...)". The "DeclContext" prefix is the convention in 
TypeSystem.h that says "I will add a corresponding function to 
CompilerDeclContext that will call through to this function.

I still like the clang specific version better because I still think it doesn't 
make a sensible API for CompilerDeclContext.

Greg


Repository:
  rL LLVM

http://reviews.llvm.org/D15312



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


Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.

2015-12-10 Thread Greg Clayton via lldb-commits
I like the clang specific patch here better. Mainly because if you add a 
function like this to TypeSystem.h:

virtual uint32_t
DeclContextCountDeclLevels (void *opaque_decl_ctx,
void *opaque_find_decl_ctx,
ConstString *find_name = nullptr,
CompilerType *find_type = nullptr) = 0;


It means that you will have a function in the CompilerDeclContext named 
"CountDeclLevels(...)". The "DeclContext" prefix is the convention in 
TypeSystem.h that says "I will add a corresponding function to 
CompilerDeclContext that will call through to this function.

I still like the clang specific version better because I still think it doesn't 
make a sensible API for CompilerDeclContext.

Greg

> On Dec 9, 2015, at 9:19 PM, Dawn Perchik  wrote:
> 
> dawn updated this revision to Diff 42375.
> dawn added a comment.
> 
> This version of the patch makes the API specific to clang.
> 
> 
> Repository:
>  rL LLVM
> 
> http://reviews.llvm.org/D15312
> 
> Files:
>  include/lldb/Symbol/ClangASTContext.h
>  packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile
>  packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
>  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
>  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
>  packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
>  packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
>  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
>  source/Symbol/ClangASTContext.cpp
> 
> 

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


[Lldb-commits] [lldb] r255268 - Add Hexagon ABI to System Initialization

2015-12-10 Thread Ted Woodward via lldb-commits
Author: ted
Date: Thu Dec 10 11:53:07 2015
New Revision: 255268

URL: http://llvm.org/viewvc/llvm-project?rev=255268&view=rev
Log:
Add Hexagon ABI to System Initialization

Summary: When the Hexagon ABI was added, it was inadvertently left out of 
initialization/termination. This patch adds it.

Reviewers: clayborg

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/API/SystemInitializerFull.cpp

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=255268&r1=255267&r2=255268&view=diff
==
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu Dec 10 11:53:07 2015
@@ -32,6 +32,7 @@
 #include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h"
 #include "Plugins/ABI/SysV-arm/ABISysV_arm.h"
 #include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h"
+#include "Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h"
 #include "Plugins/ABI/SysV-i386/ABISysV_i386.h"
 #include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
 #include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"
@@ -277,6 +278,7 @@ SystemInitializerFull::Initialize()
 ABIMacOSX_arm64::Initialize();
 ABISysV_arm::Initialize();
 ABISysV_arm64::Initialize();
+ABISysV_hexagon::Initialize();
 ABISysV_i386::Initialize();
 ABISysV_x86_64::Initialize();
 ABISysV_ppc::Initialize();
@@ -395,6 +397,7 @@ SystemInitializerFull::Terminate()
 ABIMacOSX_arm64::Terminate();
 ABISysV_arm::Terminate();
 ABISysV_arm64::Terminate();
+ABISysV_hexagon::Terminate();
 ABISysV_i386::Terminate();
 ABISysV_x86_64::Terminate();
 ABISysV_ppc::Terminate();


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


Re: [Lldb-commits] [PATCH] D15422: Change finishSwigPythonLLDB.py to copy six.py instead of simlink it

2015-12-10 Thread Ted Woodward via lldb-commits
ted added a comment.

Oops! :-)

-

Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
Foundation Collaborative Project


http://reviews.llvm.org/D15422



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


[Lldb-commits] [lldb] r255275 - Remove -w option from dotest.py.

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:50:32 2015
New Revision: 255275

URL: http://llvm.org/viewvc/llvm-project?rev=255275&view=rev
Log:
Remove -w option from dotest.py.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255275&r1=255274&r2=255275&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Dec 10 12:50:32 2015
@@ -371,9 +371,6 @@ def parseOptionsAndInitTestdirs():
 if args.v:
 configuration.verbose = 2
 
-if args.w:
-os.environ['LLDB_WAIT_BETWEEN_TEST_CASES'] = 'YES'
-
 if args.x:
 if args.x.startswith('-'):
 usage(parser)

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255275&r1=255274&r2=255275&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Dec 10 
12:50:32 2015
@@ -94,7 +94,6 @@ def create_parser():
 group.add_argument('-u', dest='unset_env_varnames', metavar='variable', 
action='append', help='Specify an environment variable to unset before running 
the test cases. e.g., -u DYLD_INSERT_LIBRARIES -u MallocScribble')
 group.add_argument('--env', dest='set_env_vars', metavar='variable', 
action='append', help='Specify an environment variable to set to the given 
value before running the test cases e.g.: --env CXXFLAGS=-O3 --env 
DYLD_INSERT_LIBRARIES')
 X('-v', 'Do verbose mode of unittest framework (print out each test case 
invocation)')
-X('-w', 'Insert some wait time (currently 0.5 sec) between consecutive 
test cases')
 X('-T', 'Obtain and dump svn information for this checkout of LLDB (off by 
default)')
 group.add_argument('--enable-crash-dialog', dest='disable_crash_dialog', 
action='store_false', help='(Windows only) When LLDB crashes, display the 
Windows crash dialog.')
 group.add_argument('--show-inferior-console', 
dest='hide_inferior_console', action='store_false', help='(Windows only) When 
launching an inferior, dont hide its console window.')

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255275&r1=255274&r2=255275&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Dec 10 12:50:32 
2015
@@ -2358,15 +2358,6 @@ class TestBase(Base):
 # Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
 timeWaitNextLaunch = 1.0;
 
-def doDelay(self):
-"""See option -w of dotest.py."""
-if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and
-os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] == 'YES'):
-waitTime = 1.0
-if "LLDB_TIME_WAIT_BETWEEN_TEST_CASES" in os.environ:
-waitTime = 
float(os.environ["LLDB_TIME_WAIT_BETWEEN_TEST_CASES"])
-time.sleep(waitTime)
-
 # Returns the list of categories to which this test case belongs
 # by default, look for a ".categories" file, and read its contents
 # if no such file exists, traverse the hierarchy - we guarantee
@@ -2398,9 +2389,6 @@ class TestBase(Base):
 # Works with the test driver to conditionally skip tests via 
decorators.
 Base.setUp(self)
 
-# Insert some delay between successive test cases if specified.
-self.doDelay()
-
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])
 


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


[Lldb-commits] [lldb] r255278 - Remove deprecated command line options from dotest.py

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:51:21 2015
New Revision: 255278

URL: http://llvm.org/viewvc/llvm-project?rev=255278&view=rev
Log:
Remove deprecated command line options from dotest.py

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255278&r1=255277&r2=255278&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Dec 10 12:51:21 2015
@@ -289,16 +289,6 @@ def parseOptionsAndInitTestdirs():
 elif args.N == 'dsym':
 configuration.dont_do_dsym_test = True
 
-if args.a or args.plus_a:
-print("Options '-a' and '+a' have been deprecated. Please use the test 
category\n"
-  "functionality (-G pyapi, --skip-category pyapi) instead.")
-sys.exit(1)
-
-if args.m or args.plus_m:
-print("Options '-m' and '+m' have been deprecated. Please use the test 
category\n"
-  "functionality (-G lldb-mi, --skip-category lldb-mi) instead.")
-sys.exit(1)
-
 if args.d:
 sys.stdout.write("Suspending the process %d to wait for debugger to 
attach...\n" % os.getpid())
 sys.stdout.flush()

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255278&r1=255277&r2=255278&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Dec 10 
12:51:21 2015
@@ -167,15 +167,6 @@ def create_parser():
 # Remove the reference to our helper function
 del X
 
-D = lambda optstr, **kwargs: group.add_argument(optstr, 
action='store_true', **kwargs)
-group = parser.add_argument_group('Deprecated options (do not use)')
-# Deprecated on 23.10.2015. Remove completely after a grace period.
-D('-a')
-D('+a', dest='plus_a')
-D('-m')
-D('+m', dest='plus_m')
-del D
-
 group = parser.add_argument_group('Test directories')
 group.add_argument('args', metavar='test-dir', nargs='*', help='Specify a 
list of directory names to search for test modules named after Test*.py (test 
discovery). If empty, search from the current working directory instead.')
 


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


[Lldb-commits] [lldb] r255279 - Remove the -x option from dotest.py.

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:51:40 2015
New Revision: 255279

URL: http://llvm.org/viewvc/llvm-project?rev=255279&view=rev
Log:
Remove the -x option from dotest.py.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py?rev=255279&r1=255278&r2=255279&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
 Thu Dec 10 12:51:40 2015
@@ -17,10 +17,7 @@ class FrameVariableResponseBench(BenchBa
 def setUp(self):
 BenchBase.setUp(self)
 self.exe = lldbtest_config.lldbExec
-if configuration.bmBreakpointSpec:
-self.break_spec = configuration.bmBreakpointSpec
-else:
-self.break_spec = '-n main'
+self.break_spec = '-n main'
 
 self.count = configuration.bmIterationCount
 if self.count <= 0:

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py?rev=255279&r1=255278&r2=255279&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
 Thu Dec 10 12:51:40 2015
@@ -22,10 +22,7 @@ class StartupDelaysBench(BenchBase):
 # Create self.stopwatch3 for measuring "run to breakpoint".
 self.stopwatch3 = Stopwatch()
 self.exe = lldbtest_config.lldbExec
-if configuration.bmBreakpointSpec:
-self.break_spec = configuration.bmBreakpointSpec
-else:
-self.break_spec = '-n main'
+self.break_spec = '-n main'
 
 self.count = configuration.bmIterationCount
 if self.count <= 0:

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py?rev=255279&r1=255278&r2=255279&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
 Thu Dec 10 12:51:40 2015
@@ -15,10 +15,7 @@ class SteppingSpeedBench(BenchBase):
 def setUp(self):
 BenchBase.setUp(self)
 self.exe = lldbtest_config.lldbExec
-if configuration.bmBreakpointSpec:
-self.break_spec = configuration.bmBreakpointSpec
-else:
-self.break_spec = '-n main'
+self.break_spec = '-n main'
 
 self.count = configuration.bmIterationCount
 if self.count <= 0:

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255279&r1=255278&r2=255279&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Dec 10 
12:51:40 2015
@@ -86,8 +86,6 @@ compilers = None# Must be initialize
 # just that.
 cflags_extras = ''
 
-# The breakpoint specification of the benchmark exe, as specified by the '-x' 
option.
-bmBreakpointSpec = None
 # The benchmark iteration count, as specified by the '-y' option.
 bmIterationCount = -1
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255279&r1=255278&r2=255279&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Dec 10 12:51:40 2015
@@ -358,11 +358,6 @@ def parseOptionsAndInitTestdirs():
 if args.v:
 configuration.v

[Lldb-commits] [lldb] r255276 - Remove the -T option from dotest.py.

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:50:49 2015
New Revision: 255276

URL: http://llvm.org/viewvc/llvm-project?rev=255276&view=rev
Log:
Remove the -T option from dotest.py.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255276&r1=255275&r2=255276&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Dec 10 
12:50:49 2015
@@ -124,9 +124,6 @@ sdir_has_content = False
 # svn_info stores the output from 'svn info lldb.base.dir'.
 svn_info = ''
 
-# svn_silent means do not try to obtain svn status
-svn_silent = True
-
 # Default verbosity is 0.
 verbose = 1
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255276&r1=255275&r2=255276&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Dec 10 12:50:49 2015
@@ -365,9 +365,6 @@ def parseOptionsAndInitTestdirs():
 if args.t:
 os.environ['LLDB_COMMAND_TRACE'] = 'YES'
 
-if args.T:
-configuration.svn_silent = False
-
 if args.v:
 configuration.verbose = 2
 
@@ -701,16 +698,6 @@ def setupSysPath():
 else:
 os.environ["LLDBMI_EXEC"] = lldbMiExec
 
-# Skip printing svn/git information when running in parsable (lit-test 
compatibility) mode
-if not configuration.svn_silent and not configuration.parsable:
-if os.path.isdir(os.path.join(lldbRootDirectory, '.svn')) and 
which("svn") is not None:
-pipe = subprocess.Popen([which("svn"), "info", lldbRootDirectory], 
stdout = subprocess.PIPE)
-configuration.svn_info = pipe.stdout.read()
-elif os.path.isdir(os.path.join(lldbRootDirectory, '.git')) and 
which("git") is not None:
-pipe = subprocess.Popen([which("git"), "svn", "info", 
lldbRootDirectory], stdout = subprocess.PIPE)
-configuration.svn_info = pipe.stdout.read()
-print(configuration.svn_info)
-
 lldbPythonDir = None # The directory that contains 'lldb/__init__.py'
 if configuration.lldbFrameworkPath:
 candidatePath = os.path.join(configuration.lldbFrameworkPath, 
'Resources', 'Python')

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255276&r1=255275&r2=255276&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Dec 10 
12:50:49 2015
@@ -94,7 +94,6 @@ def create_parser():
 group.add_argument('-u', dest='unset_env_varnames', metavar='variable', 
action='append', help='Specify an environment variable to unset before running 
the test cases. e.g., -u DYLD_INSERT_LIBRARIES -u MallocScribble')
 group.add_argument('--env', dest='set_env_vars', metavar='variable', 
action='append', help='Specify an environment variable to set to the given 
value before running the test cases e.g.: --env CXXFLAGS=-O3 --env 
DYLD_INSERT_LIBRARIES')
 X('-v', 'Do verbose mode of unittest framework (print out each test case 
invocation)')
-X('-T', 'Obtain and dump svn information for this checkout of LLDB (off by 
default)')
 group.add_argument('--enable-crash-dialog', dest='disable_crash_dialog', 
action='store_false', help='(Windows only) When LLDB crashes, display the 
Windows crash dialog.')
 group.add_argument('--show-inferior-console', 
dest='hide_inferior_console', action='store_false', help='(Windows only) When 
launching an inferior, dont hide its console window.')
 group.set_defaults(disable_crash_dialog=True)


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


[Lldb-commits] [lldb] r255280 - Remove the -y option from dotest.py.

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:52:09 2015
New Revision: 255280

URL: http://llvm.org/viewvc/llvm-project?rev=255280&view=rev
Log:
Remove the -y option from dotest.py.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py?rev=255280&r1=255279&r2=255280&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
 Thu Dec 10 12:52:09 2015
@@ -36,9 +36,7 @@ class DisassembleDriverMainLoop(BenchBas
 self.function = 'Driver::MainLoop()'
 self.lldb_avg = None
 self.gdb_avg = None
-self.count = configuration.bmIterationCount
-if self.count <= 0:
-self.count = 5
+self.count = 5
 
 @benchmarks_test
 @no_debug_info_test

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py?rev=255280&r1=255279&r2=255280&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
 Thu Dec 10 12:52:09 2015
@@ -18,9 +18,7 @@ class AttachThenDisassemblyBench(BenchBa
 def setUp(self):
 BenchBase.setUp(self)
 self.exe = lldbtest_config.lldbExec
-self.count = configuration.bmIterationCount
-if self.count <= 0:
-self.count = 10
+self.count = 10
 
 @benchmarks_test
 @no_debug_info_test

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py?rev=255280&r1=255279&r2=255280&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
 Thu Dec 10 12:52:09 2015
@@ -21,9 +21,7 @@ class XCode41Vs42GDBDisassembly(BenchBas
 self.function = 'Driver::MainLoop()'
 self.gdb_41_avg = None
 self.gdb_42_avg = None
-self.count = configuration.bmIterationCount
-if self.count <= 0:
-self.count = 5
+self.count = 5
 
 @benchmarks_test
 @no_debug_info_test

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py?rev=255280&r1=255279&r2=255280&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
 Thu Dec 10 12:52:09 2015
@@ -17,9 +17,7 @@ class ExpressionEvaluationCase(BenchBase
 BenchBase.setUp(self)
 self.source = 'main.cpp'
 self.line_to_break = line_number(self.source, '// Set breakpoint 
here.')
-self.count = configuration.bmIterationCount
-if self.count <= 0:
-self.count = 25
+self.count = 25
 
 @benchmarks_test
 @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")

[Lldb-commits] [lldb] r255277 - Remove the --output-on-success command line argument from dotest.

2015-12-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Dec 10 12:51:02 2015
New Revision: 255277

URL: http://llvm.org/viewvc/llvm-project?rev=255277&view=rev
Log:
Remove the --output-on-success command line argument from dotest.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255277&r1=255276&r2=255277&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Dec 10 
12:51:02 2015
@@ -146,7 +146,6 @@ lldb_platform_working_dir = None
 is_inferior_test_runner = False
 multiprocess_test_subdir = None
 num_threads = None
-output_on_success = False
 no_multiprocess_test_runner = False
 test_runner_name = None
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=255277&r1=255276&r2=255277&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Thu Dec 10 12:51:02 2015
@@ -72,7 +72,6 @@ test_counter = None
 total_tests = None
 test_name_len = None
 dotest_options = None
-output_on_success = False
 RESULTS_FORMATTER = None
 RUNNER_PROCESS_ASYNC_MAP = None
 RESULTS_LISTENER_CHANNEL = None
@@ -120,13 +119,8 @@ def report_test_failure(name, command, o
 
 
 def report_test_pass(name, output):
-global output_lock, output_on_success
+global output_lock
 with output_lock:
-if not (RESULTS_FORMATTER and RESULTS_FORMATTER.is_using_terminal()):
-if output_on_success:
-print(file=sys.stderr)
-print(output, file=sys.stderr)
-print("[%s PASSED]" % name, file=sys.stderr)
 update_progress(name)
 
 
@@ -1425,15 +1419,9 @@ def default_test_runner_name(num_threads
 return test_runner_name
 
 
-def main(print_details_on_success, num_threads, test_subdir,
- test_runner_name, results_formatter):
+def main(num_threads, test_subdir, test_runner_name, results_formatter):
 """Run dotest.py in inferior mode in parallel.
 
-@param print_details_on_success the parsed value of the output-on-success
-command line argument.  When True, details of a successful dotest inferior
-are printed even when everything succeeds.  The normal behavior is to
-not print any details when all the inferior tests pass.
-
 @param num_threads the parsed value of the num-threads command line
 argument.
 
@@ -1460,8 +1448,7 @@ def main(print_details_on_success, num_t
 
 dotest_argv = sys.argv[1:]
 
-global output_on_success, RESULTS_FORMATTER
-output_on_success = print_details_on_success
+global RESULTS_FORMATTER
 RESULTS_FORMATTER = results_formatter
 
 # We can't use sys.path[0] to determine the script directory

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255277&r1=255276&r2=255277&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Dec 10 12:51:02 2015
@@ -383,7 +383,7 @@ def parseOptionsAndInitTestdirs():
 
 if sys.platform.startswith('win32'):
 os.environ['LLDB_DISABLE_CRASH_DIALOG'] = 
str(args.disable_crash_dialog)
-os.environ['LLDB_LAUNCH_INFERIORS_WITHOUT_CONSOLE'] = 
str(args.hide_inferior_console)
+os.environ['LLDB_LAUNCH_INFERIORS_WITHOUT_CONSOLE'] = str(True)
 
 if do_help == True:
 usage(parser)
@@ -394,10 +394,6 @@ def parseOptionsAndInitTestdirs():
 if args.inferior:
 configuration.is_inferior_test_runner = True
 
-# Turn on output_on_sucess if either explicitly added or -v specified.
-if args.output_on_success or args.v:
-configuration.output_on_success = True
-
 if args.num_threads:
 configuration.num_threads = args.num_threads
 
@@ -975,8 +971,7 @@ def run_suite():
 # multiprocess test runner here.
 if isMultiprocessTestRunner():
 from . import dosep
-dosep.main(configuration.output_on_success, configuration.num_threads,
-   configuration.multiprocess_test_subdir,
+dosep.main(configuration.num_threads, 
configuration.multiprocess_test_subdir,
configuration.test_runner_name, 
configuration.results_formatter_object)

[Lldb-commits] [PATCH] D15428: Make debug info specification use categories system

2015-12-10 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: labath, tberghammer.
zturner added a subscriber: lldb-commits.

I'm not sure if I did this right, but the end result of this CL is removal of 
the -N command line option, and making people go through the categories system 
instead.

http://reviews.llvm.org/D15428

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  
packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
  packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
  
packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/test_categories.py

Index: packages/Python/lldbsuite/test/test_categories.py
===
--- packages/Python/lldbsuite/test/test_categories.py
+++ packages/Python/lldbsuite/test/test_categories.py
@@ -13,6 +13,9 @@
 
 all_categories = {
 'dataformatters': 'Tests related to the type command and the data formatters subsystem',
+'dwarf' : 'Tests that can be run with DWARF debug information',
+'dwo'   : 'Tests that can be run with DWO debug information',
+'dsym'  : 'Tests that can be run with DSYM debug information',
 'expression': 'Tests related to the expression parser',
 'objc'  : 'Tests related to the Objective-C programming language support',
 'pyapi' : 'Tests related to the Python API',
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -541,48 +541,6 @@
 wrapper.__no_debug_info_test__ = True
 return wrapper
 
-def dsym_test(func):
-"""Decorate the item as a dsym test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dsym_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dsym_test:
-self.skipTest("dsym tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dsym_test__ = True
-return wrapper
-
-def dwarf_test(func):
-"""Decorate the item as a dwarf test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwarf_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwarf_test:
-self.skipTest("dwarf tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwarf_test__ = True
-return wrapper
-
-def dwo_test(func):
-"""Decorate the item as a dwo test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwo_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwo_test:
-self.skipTest("dwo tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwo_test__ = True
-return wrapper
-
 def debugserver_test(func):
 """Decorate the item as a debugserver test."""
 if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -2266,16 +2224,22 @@
 newattrs = {}
 for attrname, attrvalue in attrs.items():
 if attrname.startswith("test") and not getattr(attrvalue, "__no_debug_info_test__", False):
-@dsym_test
-@wraps(attrvalue)
-def dsym_test_method(self, attrvalue=attrvalue):
-self.debug_info = "dsym"
-return attrvalue(self)
-dsym_method_name = attrname + "_dsym"
-dsym_test_method.__name__ = dsym_method_name
-newattrs[dsym_method_name] = dsym_test_method
-
-@dwarf_test
+target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
+
+dont_do_dsym_test = any(platform in target_platform for platform in ["linux", "freebsd", "windows"])
+dont_do_dwo_test = any(platform in target_platform for platform in ["darwin", "macosx", "ios"])
+
+if not dont_do_dsym_test:
+@add_test_categories(["dsym"])
+@wraps(attrvalue)
+def dsym_test_method(self, attrvalue=attrvalue):
+self.debug_info = "dsym"
+return attrvalue(self)
+dsym_method_name = attrname + "_dsym"
+dsym_test_m

Re: [Lldb-commits] [PATCH] D15428: Make debug info specification use categories system

2015-12-10 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 42452.
zturner added a comment.

Actually remove the -N command line option as well.


http://reviews.llvm.org/D15428

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  
packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
  packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
  
packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/test_categories.py

Index: packages/Python/lldbsuite/test/test_categories.py
===
--- packages/Python/lldbsuite/test/test_categories.py
+++ packages/Python/lldbsuite/test/test_categories.py
@@ -13,6 +13,9 @@
 
 all_categories = {
 'dataformatters': 'Tests related to the type command and the data formatters subsystem',
+'dwarf' : 'Tests that can be run with DWARF debug information',
+'dwo'   : 'Tests that can be run with DWO debug information',
+'dsym'  : 'Tests that can be run with DSYM debug information',
 'expression': 'Tests related to the expression parser',
 'objc'  : 'Tests related to the Objective-C programming language support',
 'pyapi' : 'Tests related to the Python API',
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -541,48 +541,6 @@
 wrapper.__no_debug_info_test__ = True
 return wrapper
 
-def dsym_test(func):
-"""Decorate the item as a dsym test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dsym_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dsym_test:
-self.skipTest("dsym tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dsym_test__ = True
-return wrapper
-
-def dwarf_test(func):
-"""Decorate the item as a dwarf test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwarf_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwarf_test:
-self.skipTest("dwarf tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwarf_test__ = True
-return wrapper
-
-def dwo_test(func):
-"""Decorate the item as a dwo test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwo_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwo_test:
-self.skipTest("dwo tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwo_test__ = True
-return wrapper
-
 def debugserver_test(func):
 """Decorate the item as a debugserver test."""
 if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -2266,16 +2224,22 @@
 newattrs = {}
 for attrname, attrvalue in attrs.items():
 if attrname.startswith("test") and not getattr(attrvalue, "__no_debug_info_test__", False):
-@dsym_test
-@wraps(attrvalue)
-def dsym_test_method(self, attrvalue=attrvalue):
-self.debug_info = "dsym"
-return attrvalue(self)
-dsym_method_name = attrname + "_dsym"
-dsym_test_method.__name__ = dsym_method_name
-newattrs[dsym_method_name] = dsym_test_method
-
-@dwarf_test
+target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
+
+dont_do_dsym_test = any(platform in target_platform for platform in ["linux", "freebsd", "windows"])
+dont_do_dwo_test = any(platform in target_platform for platform in ["darwin", "macosx", "ios"])
+
+if not dont_do_dsym_test:
+@add_test_categories(["dsym"])
+@wraps(attrvalue)
+def dsym_test_method(self, attrvalue=attrvalue):
+self.debug_info = "dsym"
+return attrvalue(self)
+dsym_method_name = attrname + "_dsym"
+dsym_test_method.__name__ = dsym_method_name
+newattrs[dsym_method_name] = dsym_test_method
+
+

Re: [Lldb-commits] [PATCH] D15374: Add NetBSD support in the buildDriver and buildLibrary routines

2015-12-10 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255308: Add NetBSD support in the buildDriver and 
buildLibrary routines (authored by kamil).

Changed prior to commit:
  http://reviews.llvm.org/D15374?vs=42372&id=42467#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15374

Files:
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -2073,7 +2073,7 @@
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s" % (dsym, lib_dir),
 }
-elif sys.platform.startswith('freebsd') or 
sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 
'Makefile':
+elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 
'netbsd') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'CXX_SOURCES' : sources,
  'EXE' : exe_name,
  'CFLAGS_EXTRAS' : "%s %s -I%s" % (stdflag, stdlibflag, 
os.path.join(os.environ["LLDB_SRC"], "include")),
@@ -2102,7 +2102,7 @@
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s -dynamiclib" % (dsym, 
lib_dir),
 }
-elif self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux' 
or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+elif self.getPlatform() in ('freebsd', 'linux', 'netbsd') or 
os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'DYLIB_CXX_SOURCES' : sources,
  'DYLIB_NAME' : lib_name,
  'CFLAGS_EXTRAS' : "%s -I%s -fPIC" % (stdflag, 
os.path.join(os.environ["LLDB_SRC"], "include")),


Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -2073,7 +2073,7 @@
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s" % (dsym, lib_dir),
 }
-elif sys.platform.startswith('freebsd') or sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'CXX_SOURCES' : sources,
  'EXE' : exe_name,
  'CFLAGS_EXTRAS' : "%s %s -I%s" % (stdflag, stdlibflag, os.path.join(os.environ["LLDB_SRC"], "include")),
@@ -2102,7 +2102,7 @@
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s -dynamiclib" % (dsym, lib_dir),
 }
-elif self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux' or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+elif self.getPlatform() in ('freebsd', 'linux', 'netbsd') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'DYLIB_CXX_SOURCES' : sources,
  'DYLIB_NAME' : lib_name,
  'CFLAGS_EXTRAS' : "%s -I%s -fPIC" % (stdflag, os.path.join(os.environ["LLDB_SRC"], "include")),
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255308 - Add NetBSD support in the buildDriver and buildLibrary routines

2015-12-10 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Dec 10 16:56:56 2015
New Revision: 255308

URL: http://llvm.org/viewvc/llvm-project?rev=255308&view=rev
Log:
Add NetBSD support in the buildDriver and buildLibrary routines

Summary: NetBSD is like FreeBSD and Linux in these routines.

Reviewers: clay.chang, tfiala, emaste, joerg

Subscribers: lldb-commits, emaste

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255308&r1=255307&r2=255308&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Dec 10 16:56:56 
2015
@@ -2073,7 +2073,7 @@ class Base(unittest2.TestCase):
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s" % (dsym, lib_dir),
 }
-elif sys.platform.startswith('freebsd') or 
sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 
'Makefile':
+elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 
'netbsd') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'CXX_SOURCES' : sources,
  'EXE' : exe_name,
  'CFLAGS_EXTRAS' : "%s %s -I%s" % (stdflag, stdlibflag, 
os.path.join(os.environ["LLDB_SRC"], "include")),
@@ -2102,7 +2102,7 @@ class Base(unittest2.TestCase):
  'FRAMEWORK_INCLUDES' : "-F%s" % lib_dir,
  'LD_EXTRAS' : "%s -Wl,-rpath,%s -dynamiclib" % (dsym, 
lib_dir),
 }
-elif self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux' 
or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+elif self.getPlatform() in ('freebsd', 'linux', 'netbsd') or 
os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
 d = {'DYLIB_CXX_SOURCES' : sources,
  'DYLIB_NAME' : lib_name,
  'CFLAGS_EXTRAS' : "%s -I%s -fPIC" % (stdflag, 
os.path.join(os.environ["LLDB_SRC"], "include")),


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


Re: [Lldb-commits] [PATCH] D15374: Add NetBSD support in the buildDriver and buildLibrary routines

2015-12-10 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thanks!


Repository:
  rL LLVM

http://reviews.llvm.org/D15374



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


[Lldb-commits] [lldb] r255310 - test result details now print module.class.test_name in verbose mode.

2015-12-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Dec 10 17:14:24 2015
New Revision: 255310

URL: http://llvm.org/viewvc/llvm-project?rev=255310&view=rev
Log:
test result details now print module.class.test_name in verbose mode.

And, turns off verbose mode by default.  This must have been switched
on as the default when somebody was testing.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
lldb/trunk/packages/Python/lldbsuite/test/configuration.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py?rev=255310&r1=255309&r2=255310&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py Thu 
Dec 10 17:14:24 2015
@@ -13,6 +13,7 @@ from __future__ import print_function
 import os
 
 # Our imports
+from . import configuration
 from . import result_formatter
 from .result_formatter import EventBuilder
 import lldbsuite
@@ -272,6 +273,13 @@ class BasicResultsFormatter(result_forma
 extra_info,
 event["test_filename"]))
 else:
+# Figure out the identity we will use for this test.
+if configuration.verbose and ("test_class" in event):
+test_id = "{}.{}".format(
+event["test_class"], event["test_name"])
+else:
+test_id = event["test_name"]
+
 # Test-method events have richer detail, use that here.
 test_relative_path = os.path.relpath(
 os.path.realpath(event["test_filename"]),
@@ -279,7 +287,7 @@ class BasicResultsFormatter(result_forma
 self.out_file.write("{}: {}{} ({})\n".format(
 detail_label,
 extra_info,
-event["test_name"],
+test_id,
 test_relative_path))
 
 def _finish_output_no_lock(self):

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255310&r1=255309&r2=255310&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Dec 10 
17:14:24 2015
@@ -120,7 +120,7 @@ sdir_has_content = False
 svn_info = ''
 
 # Default verbosity is 0.
-verbose = 1
+verbose = 0
 
 # By default, search from the script directory.
 # We can't use sys.path[0] to determine the script directory


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


Re: [Lldb-commits] [lldb] r255310 - test result details now print module.class.test_name in verbose mode.

2015-12-10 Thread Zachary Turner via lldb-commits
That probably got turned on by default by me on accident when I removed
some of the command line options that mucked with the verbosity setting.
Thanks!

On Thu, Dec 10, 2015 at 3:17 PM Todd Fiala via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: tfiala
> Date: Thu Dec 10 17:14:24 2015
> New Revision: 255310
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255310&view=rev
> Log:
> test result details now print module.class.test_name in verbose mode.
>
> And, turns off verbose mode by default.  This must have been switched
> on as the default when somebody was testing.
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
> lldb/trunk/packages/Python/lldbsuite/test/configuration.py
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py?rev=255310&r1=255309&r2=255310&view=diff
>
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
> (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
> Thu Dec 10 17:14:24 2015
> @@ -13,6 +13,7 @@ from __future__ import print_function
>  import os
>
>  # Our imports
> +from . import configuration
>  from . import result_formatter
>  from .result_formatter import EventBuilder
>  import lldbsuite
> @@ -272,6 +273,13 @@ class BasicResultsFormatter(result_forma
>  extra_info,
>  event["test_filename"]))
>  else:
> +# Figure out the identity we will use for this test.
> +if configuration.verbose and ("test_class" in event):
> +test_id = "{}.{}".format(
> +event["test_class"], event["test_name"])
> +else:
> +test_id = event["test_name"]
> +
>  # Test-method events have richer detail, use that
> here.
>  test_relative_path = os.path.relpath(
>  os.path.realpath(event["test_filename"]),
> @@ -279,7 +287,7 @@ class BasicResultsFormatter(result_forma
>  self.out_file.write("{}: {}{} ({})\n".format(
>  detail_label,
>  extra_info,
> -event["test_name"],
> +test_id,
>  test_relative_path))
>
>  def _finish_output_no_lock(self):
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255310&r1=255309&r2=255310&view=diff
>
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Dec 10
> 17:14:24 2015
> @@ -120,7 +120,7 @@ sdir_has_content = False
>  svn_info = ''
>
>  # Default verbosity is 0.
> -verbose = 1
> +verbose = 0
>
>  # By default, search from the script directory.
>  # We can't use sys.path[0] to determine the script directory
>
>
> ___
> 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] D15435: Add tests to inspect a stack and local variables from a mini dump

2015-12-10 Thread Adrian McCarthy via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.

More mini dump tests to make sure we can see a stack with several levels and 
inspect local variables.

http://reviews.llvm.org/D15435

Files:
  packages/Python/lldbsuite/test/functionalities/postmortem/minidump/Makefile
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
  packages/Python/lldbsuite/test/functionalities/postmortem/minidump/main.cpp

Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/functionalities/postmortem/minidump/main.cpp
@@ -0,0 +1,21 @@
+int global = 42;
+
+int
+bar(int x)
+{
+  int y = 4*x + global;
+  return y;
+}
+
+int
+foo(int x)
+{
+  int y = 2*bar(3*x);
+  return y;
+}
+
+int
+main()
+{
+  return 0 * foo(1);
+}
Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
===
--- packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -34,7 +34,7 @@
 
 @no_debug_info_test
 def test_stack_info_in_mini_dump(self):
-"""Test that we can see the stack."""
+"""Test that we can see a trivial stack."""
 self.assertEqual(self.process.GetNumThreads(), 1)
 thread = self.process.GetThreadAtIndex(0)
 # The crash is in main, so there should be one frame on the stack.
@@ -46,6 +46,73 @@
 self.assertTrue(eip.IsValid())
 self.assertEqual(pc, eip.GetValueAsUnsigned())
 
+@not_remote_testsuite_ready
+@skipUnlessWindows
+def test_deeper_stack_in_mini_dump(self):
+"""Test that we can examine a more interesting stack in a mini dump."""
+self.build()
+exe = os.path.join(os.getcwd(), "a.out")
+core = os.path.join(os.getcwd(), "core.dmp")
+try:
+# Set a breakpoint and capture a mini dump.
+target = self.dbg.CreateTarget(exe)
+breakpoint = target.BreakpointCreateByName("bar")
+process = target.LaunchSimple(None, None, self.get_process_working_directory())
+self.assertEqual(process.GetState(), lldb.eStateStopped)
+self.assertTrue(process.SaveCore(core))
+self.assertTrue(os.path.isfile(core))
+self.assertTrue(process.Kill().Success())
+
+# Launch with the mini dump, and inspect the stack.
+target = self.dbg.CreateTarget(None)
+process = target.LoadCore(core)
+thread = process.GetThreadAtIndex(0)
+
+expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' }
+self.assertEqual(thread.GetNumFrames(), len(expected_stack))
+for index, name in expected_stack.iteritems():
+frame = thread.GetFrameAtIndex(index)
+self.assertTrue(frame.IsValid())
+function_name = frame.GetFunctionName()
+self.assertTrue(name in function_name)
+
+finally:
+# Clean up the mini dump file.
+self.assertTrue(self.dbg.DeleteTarget(target))
+if (os.path.isfile(core)):
+os.unlink(core)
+
+@not_remote_testsuite_ready
+@skipUnlessWindows
+def test_local_variables_in_mini_dump(self):
+"""Test that we can examine local variables in a mini dump."""
+self.build()
+exe = os.path.join(os.getcwd(), "a.out")
+core = os.path.join(os.getcwd(), "core.dmp")
+try:
+# Set a breakpoint and capture a mini dump.
+target = self.dbg.CreateTarget(exe)
+breakpoint = target.BreakpointCreateByName("bar")
+process = target.LaunchSimple(None, None, self.get_process_working_directory())
+self.assertEqual(process.GetState(), lldb.eStateStopped)
+self.assertTrue(process.SaveCore(core))
+self.assertTrue(os.path.isfile(core))
+self.assertTrue(process.Kill().Success())
+
+# Launch with the mini dump, and inspect a local variable.
+target = self.dbg.CreateTarget(None)
+process = target.LoadCore(core)
+thread = process.GetThreadAtIndex(0)
+frame = thread.GetFrameAtIndex(0)
+value = frame.EvaluateExpression('x')
+self.assertEqual(value.GetValueAsSigned(), 3)
+
+finally:
+# Clean up the mini dump file.
+self.assertTrue(self.dbg.DeleteTarget(target))
+if (os.path.isfile(core)):
+os.unlink(core)
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/Makefile
===

Re: [Lldb-commits] [PATCH] D15435: Add tests to inspect a stack and local variables from a mini dump

2015-12-10 Thread Zachary Turner via lldb-commits
zturner added a comment.

Would it make sense to check in a minidump?  I agree we should have at least 
one test somewhere that creates a minidump and loads it up and verifies it can 
do something.  But by making every minidump test use that same flow, then if 
that first test ever fails for whatever reason, every other test is 
automatically guaranteed to fail.  Seems like it would be better to test the 
minimum amount of functionality possible, which in this case would mean 
removing the step that creates the minidump.


http://reviews.llvm.org/D15435



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


Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.

2015-12-10 Thread Dawn Perchik via lldb-commits
dawn updated this revision to Diff 42476.
dawn added a comment.

Updated Clang-specific version of patch.


Repository:
  rL LLVM

http://reviews.llvm.org/D15312

Files:
  include/lldb/Symbol/ClangASTContext.h
  packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile
  packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9224,6 +9224,123 @@
 return found_decls;
 }
 
+// Look for child_decl_ctx's lookup scope in frame_decl_ctx and its parents,
+// and return the number of levels it took to find it, or LLDB_INVALID_DECL_LEVEL
+// if not found.  If the decl was imported via a using declaration, its name and/or
+// type, if set, will be used to check that the decl found in the scope is a match.
+//
+// The optional name is required by languages (like C++) to handle using declarations
+// like:
+//
+// void poo();
+// namespace ns {
+// void foo();
+// void goo();
+// }
+// void bar() {
+// using ns::foo;
+// // CountDeclLevels returns 0 for 'foo', 1 for 'poo', and
+// // LLDB_INVALID_DECL_LEVEL for 'goo'.
+// }
+//
+// The optional type is useful in the case that there's a specific overload
+// that we're looking for that might otherwise be shadowed, like:
+//
+// void foo(int);
+// namespace ns {
+// void foo();
+// }
+// void bar() {
+// using ns::foo;
+// // CountDeclLevels returns 0 for { 'foo', void() },
+// // 1 for { 'foo', void(int) }, and
+// // LLDB_INVALID_DECL_LEVEL for { 'foo', void(int, int) }.
+// }
+//
+// NOTE: Because file statics are at the TranslationUnit along with globals, a
+// function at file scope will return the same level as a function at global scope.
+// Ideally we'd like to treat the file scope as an additional scope just below the
+// global scope.  More work needs to be done to recognise that, if the decl we're
+// trying to look up is static, we should compare its source file with that of the
+// current scope and return a lower number for it.
+uint32_t
+ClangASTContext::CountDeclLevels (clang::DeclContext *frame_decl_ctx,
+  clang::DeclContext *child_decl_ctx,
+  ConstString *child_name,
+  CompilerType *child_type)
+{
+if (frame_decl_ctx)
+{
+std::set searched;
+std::multimap search_queue;
+SymbolFile *symbol_file = GetSymbolFile();
+
+// Get the lookup scope for the decl we're trying to find.
+clang::DeclContext *parent_decl_ctx = child_decl_ctx->getParent();
+
+// Look for it in our scope's decl context and its parents.
+uint32_t level = 0;
+for (clang::DeclContext *decl_ctx = frame_decl_ctx; decl_ctx != nullptr; decl_ctx = decl_ctx->getParent())
+{
+if (!decl_ctx->isLookupContext())
+continue;
+if (decl_ctx == parent_decl_ctx)
+// Found it!
+return level;
+search_queue.insert(std::make_pair(decl_ctx, decl_ctx));
+for (auto it = search_queue.find(decl_ctx); it != search_queue.end(); it++)
+{
+if (searched.find(it->second) != searched.end())
+continue;
+searched.insert(it->second);
+symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second));
+
+for (clang::Decl *child : it->second->decls())
+{
+if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(child))
+{
+clang::DeclContext *ns = ud->getNominatedNamespace();
+if (ns == parent_decl_ctx)
+// Found it!
+return level;
+clang::DeclContext *from = ud->getCommonAncestor();
+if (searched.find(ns) == searched.end())
+search_queue.insert(std::make_pair(from, ns));
+}
+else if (child_name)
+{
+if (clang::UsingDecl *ud = llvm::dyn_cast(child))
+{
+for (clang::UsingShadowDecl *usd : ud->shadows())
+{
+clang::Decl *target = usd->getTargetDecl();
+clang::Name

Re: [Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.

2015-12-10 Thread Dawn Perchik via lldb-commits
dawn added a comment.

ping?


Repository:
  rL LLVM

http://reviews.llvm.org/D15326



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


Re: [Lldb-commits] [PATCH] D15435: Add tests to inspect a stack and local variables from a mini dump

2015-12-10 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

It's a fair question, but I wonder if it's a bit premature.

The tests are still pretty speedy.  This way it's easy to change 
(update/improve) the test and the code in parallel and get immediate results.

(There is a checked-in mini dump in this same directory, but that was to 
demonstrate that we could open a mini dump created by Visual Studio on an 
inferior built with VC++, so there's not really a choice in that case.)


http://reviews.llvm.org/D15435



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


Re: [Lldb-commits] [PATCH] D15435: Add tests to inspect a stack and local variables from a mini dump

2015-12-10 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

Conceivably, you might want to create multiple dumps of the same inferior 
stopped at different points.  Having to update all these when you want to 
change the inferior code becomes a more manual task.


http://reviews.llvm.org/D15435



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


Re: [Lldb-commits] [PATCH] D15435: Add tests to inspect a stack and local variables from a mini dump

2015-12-10 Thread Zachary Turner via lldb-commits
zturner added a comment.

It's not so much about the speed as it is about the general principle of 
exercising as little functionality as possible within a given test.  This way 
when a test fails, you already know exactly what the problem is.  When this 
test fails, is it in the step that creates the core or the step that reads the 
core?  If you have one test that creates a core and another test that reads a 
pre-generated core, and only the second one fails, you know where to look to 
find the problem.

Also, we shouldn't be be tied to a single program for all minidump tests.  If 
they need different programs, just put them in different directories.  That way 
you don't have to worry about needing to change this program and check in a new 
dump.  You'd only have to do that if you needed to change this specific test.  
But when the test tests as little functionality is possible, it's rare that you 
will need to change it.

Anyway, up to you with this CL (I don't know off the top of my head how many 
minidump tests we already have and how many others do this).  I kind of don't 
think it should be come the norm going forward though.  I know there's a 
balance when checking in binary files, but unless there's a very compelling 
reason like core files being prohibitively large or something like that, I 
think we should err on the side of having each test test the minimal amount of 
functionality possible.


http://reviews.llvm.org/D15435



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


[Lldb-commits] [PATCH] D15437: Read macro info from .debug_macro section and use it for expression evaluation.

2015-12-10 Thread Siva Chandra via lldb-commits
sivachandra created this revision.
sivachandra added reviewers: clayborg, tberghammer, spyffe.
sivachandra added a subscriber: lldb-commits.

DWARF 5 proposes a reinvented .debug_macro section. This change follows
that spec.

Currently, only GCC produces the .debug_macro section and hence
the added test is annottated with expectedFailureClang.

http://reviews.llvm.org/D15437

Files:
  include/lldb/Symbol/CompileUnit.h
  include/lldb/Symbol/DebugMacros.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/SymbolVendor.h
  include/lldb/lldb-enumerations.h
  packages/Python/lldbsuite/test/expression_command/macros/Makefile
  packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
  packages/Python/lldbsuite/test/expression_command/macros/macro1.h
  packages/Python/lldbsuite/test/expression_command/macros/macro2.h
  packages/Python/lldbsuite/test/expression_command/macros/main.cpp
  packages/Python/lldbsuite/test/make/Makefile.rules
  source/Expression/ExpressionSourceCode.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
  source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
  source/Symbol/CMakeLists.txt
  source/Symbol/CompileUnit.cpp
  source/Symbol/DebugMacros.cpp
  source/Symbol/ObjectFile.cpp
  source/Symbol/SymbolVendor.cpp
  source/Utility/ConvertEnum.cpp

Index: source/Utility/ConvertEnum.cpp
===
--- source/Utility/ConvertEnum.cpp
+++ source/Utility/ConvertEnum.cpp
@@ -77,6 +77,8 @@
 return "dwarf-loc";
 case eSectionTypeDWARFDebugMacInfo:
 return "dwarf-macinfo";
+case eSectionTypeDWARFDebugMacro:
+return "dwarf-macro";
 case eSectionTypeDWARFDebugPubNames:
 return "dwarf-pubnames";
 case eSectionTypeDWARFDebugPubTypes:
Index: source/Symbol/SymbolVendor.cpp
===
--- source/Symbol/SymbolVendor.cpp
+++ source/Symbol/SymbolVendor.cpp
@@ -186,6 +186,18 @@
 }
 
 bool
+SymbolVendor::ParseCompileUnitDebugMacros (const SymbolContext &sc)
+{
+ModuleSP module_sp(GetModule());
+if (module_sp)
+{
+lldb_private::Mutex::Locker locker(module_sp->GetMutex());
+if (m_sym_file_ap.get())
+return m_sym_file_ap->ParseCompileUnitDebugMacros(sc);
+}
+return false;
+}
+bool
 SymbolVendor::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files)
 {
 ModuleSP module_sp(GetModule());
Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -362,6 +362,7 @@
 case eSectionTypeDWARFDebugLine:
 case eSectionTypeDWARFDebugLoc:
 case eSectionTypeDWARFDebugMacInfo:
+case eSectionTypeDWARFDebugMacro:
 case eSectionTypeDWARFDebugPubNames:
 case eSectionTypeDWARFDebugPubTypes:
 case eSectionTypeDWARFDebugRanges:
Index: source/Symbol/DebugMacros.cpp
===
--- /dev/null
+++ source/Symbol/DebugMacros.cpp
@@ -0,0 +1,57 @@
+//===-- DebugMacros.cpp -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "lldb/Symbol/DebugMacros.h"
+
+using namespace lldb_private;
+
+DebugMacroEntry::DebugMacroEntry(EntryType type,
+ uint64_t line,
+ const char *str,
+ const char *file_name)
+: m_type(type),
+  m_line(line),
+  m_str(str),
+  m_file(file_name)
+{ }
+
+DebugMacroEntry::DebugMacroEntry(EntryType type,
+ const DebugMacrosSP &debug_macros_sp)
+: m_type(type), m_debug_macros_sp(debug_macros_sp)
+{ }
+
+DebugMacroEntry *
+DebugMacroEntry::NewDefineEntry(uint64_t line, const char *str)
+{
+return new DebugMacroEntry(DebugMacroEntry::DEFINE, line, str, NULL);
+}
+
+DebugMacroEntry *
+DebugMacroEntry::NewUndefEntry(uint64_t line, const char *str)
+{
+return new DebugMacroEntry(DebugMacroEntry::UNDEF, line, str, NULL);
+}
+
+

Re: [Lldb-commits] [PATCH] D15437: Read macro info from .debug_macro section and use it for expression evaluation.

2015-12-10 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

The dwo_test_method fails for the added test as I think there is some GCC bug 
with the combination of -gsplit-dwarf and -g3.


http://reviews.llvm.org/D15437



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


Re: [Lldb-commits] [PATCH] D15437: Read macro info from .debug_macro section and use it for expression evaluation.

2015-12-10 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

I should also mention that I did not implement the complete spec as I do not 
know of any producer which produces all the flavors of the new spec.


http://reviews.llvm.org/D15437



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