[Lldb-commits] [lldb] r244846 - Convert GetNumTemplateArguments() and GetTemplateArgument() to be instance functions on the CompilerType and the TypeSystem

2015-08-12 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Aug 12 19:24:24 2015
New Revision: 244846

URL: http://llvm.org/viewvc/llvm-project?rev=244846&view=rev
Log:
Convert GetNumTemplateArguments() and GetTemplateArgument() to be instance 
functions on the CompilerType and the TypeSystem


Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp
lldb/trunk/source/DataFormatters/LibCxxList.cpp
lldb/trunk/source/DataFormatters/LibStdcpp.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerType.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=244846&r1=244845&r2=244846&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Aug 12 19:24:24 2015
@@ -805,13 +805,13 @@ public:
bool omit_empty_base_classes,
std::vector& child_indexes) 
override;
 
-static size_t
-GetNumTemplateArguments (const CompilerType& type);
+size_t
+GetNumTemplateArguments (void* type) override;
 
-static CompilerType
-GetTemplateArgument (const CompilerType& type,
+CompilerType
+GetTemplateArgument (void* type,
  size_t idx,
- lldb::TemplateArgumentKind &kind);
+ lldb::TemplateArgumentKind &kind) override;
 
 
 //--

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=244846&r1=244845&r2=244846&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Wed Aug 12 19:24:24 2015
@@ -370,6 +370,13 @@ public:
bool omit_empty_base_classes,
std::vector& child_indexes) const;
 
+size_t
+GetNumTemplateArguments () const;
+
+CompilerType
+GetTemplateArgument (size_t idx,
+ lldb::TemplateArgumentKind &kind) const;
+
 //--
 // Pointers & References
 //--

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=244846&r1=244845&r2=244846&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Wed Aug 12 19:24:24 2015
@@ -215,6 +215,14 @@ public:
bool omit_empty_base_classes,
std::vector& child_indexes) = 0;
 
+virtual size_t
+GetNumTemplateArguments (void * type) = 0;
+
+virtual CompilerType
+GetTemplateArgument (void * type,
+ size_t idx,
+ lldb::TemplateArgumentKind &kind) = 0;
+
 //--
 // Dumping types
 //--

Modified: lldb/trunk/source/API/SBType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=244846&r1=244845&r2=244846&view=diff
==
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Wed Aug 12 19:24:24 2015
@@ -533,7 +533,7 @@ uint32_t
 SBType::GetNumberOfTemplateArguments ()
 {
 if (IsValid())
-return 
ClangASTContext::GetNumTemplateArguments(m_opaque_sp->GetCompilerType(false));
+return m_opaque_sp->GetCompilerType(false).GetNumTemplateArguments();
 return 0;
 }
 
@@ -543,7 +543,7 @@ SBType::GetTemplateArgumentType (uint32_
 if (IsValid())
 {
 TemplateArgumentKind kind = eTemplateArgumentKindNull;
-CompilerType template_arg_type = 
ClangASTContext::GetTemplateArgument(m_opaque_sp->GetCompilerType(false), idx, 
kind);
+CompilerType template_arg_type = 
m_opaque_sp->GetCompilerType(false).GetTemplateArgument(idx, kind);
 if (template_arg_type.IsValid())
 return SBType(template_arg_type);
 }
@@ -556,7 +556,7 @@ SBType::GetTemplateArgumentKind (uint32_
 {
 TemplateArgumentKind kind = eT

Re: [Lldb-commits] [PATCH] D12092: [ValueObjectSynthetic] Override GetDeclaration.

2015-08-17 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

That looks reasonable

Does ValueObjectDynamic need the same change? You could have dynamic+synthetic 
combinations (e.g. NSArray/NSDictionary on Mac OS X) where the synthetic value 
sits on top of the dynamic value


http://reviews.llvm.org/D12092



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


Re: [Lldb-commits] [PATCH] D12092: [ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration

2015-08-17 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Assuming it passes the test suite, LGTM


http://reviews.llvm.org/D12092



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


[Lldb-commits] [lldb] r245993 - Rename all functionalities/data-formatter test case with radar bug numbers in them to more meaningful names

2015-08-25 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Aug 25 18:55:10 2015
New Revision: 245993

URL: http://llvm.org/viewvc/llvm-project?rev=245993&view=rev
Log:
Rename all functionalities/data-formatter test case with radar bug numbers in 
them to more meaningful names


Added:
lldb/trunk/test/functionalities/data-formatter/boolreference/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11773899/
lldb/trunk/test/functionalities/data-formatter/compactvectors/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/

lldb/trunk/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-proper-plurals/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-3534688/
lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-13338477/

lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py
lldb/trunk/test/functionalities/data-formatter/hexcaps/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/

lldb/trunk/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
lldb/trunk/test/functionalities/data-formatter/nsarraysynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11086338/

lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py
lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11988289/

lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 
11988289.py
lldb/trunk/test/functionalities/data-formatter/nssetsynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12529957/

lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12529957/TestRdar12529957.py
lldb/trunk/test/functionalities/data-formatter/ostypeformatting/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11628688/
lldb/trunk/test/functionalities/data-formatter/summary-string-onfail/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9974002/
lldb/trunk/test/functionalities/data-formatter/synthcapping/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10887661/

lldb/trunk/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py
lldb/trunk/test/functionalities/data-formatter/synthupdate/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12437442/

lldb/trunk/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py
lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9973865/

lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py
Removed:

lldb/trunk/test/functionalities/data-formatter/compactvectors/Test-rdar-10642615.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/Test-rdar-13338477.py
lldb/trunk/test/functionalities/data-formatter/hexcaps/Test-rdar-10449092.py

lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestRdar11086338.py
lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestRdar 
11988289.py

lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestRdar12529957.py
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/
lldb/trunk/test/functionalities/data-form

[Lldb-commits] [lldb] r246084 - Fix missing override warnings

2015-08-26 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Aug 26 16:39:52 2015
New Revision: 246084

URL: http://llvm.org/viewvc/llvm-project?rev=246084&view=rev
Log:
Fix missing override warnings

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h?rev=246084&r1=246083&r2=246084&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h 
Wed Aug 26 16:39:52 2015
@@ -47,29 +47,29 @@ public:
 //--
 
 virtual void
-DidAttach();
+DidAttach() override;
 
 virtual void
-DidLaunch();
+DidLaunch() override;
 
 virtual lldb::ThreadPlanSP
 GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
- bool stop_others);
+ bool stop_others) override;
 
 virtual lldb_private::Error
-CanLoadImage();
+CanLoadImage() override;
 
 virtual lldb::addr_t
-GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP 
thread);
+GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP 
thread) override;
 
 //--
 // PluginInterface protocol
 //--
 virtual lldb_private::ConstString
-GetPluginName();
+GetPluginName() override;
 
 virtual uint32_t
-GetPluginVersion();
+GetPluginVersion() override;
 
 virtual void
 GetPluginCommandHelp(const char *command, lldb_private::Stream *strm);
@@ -131,7 +131,7 @@ protected:
 ///
 /// @param module The module to traverse.
 void
-UnloadSections(const lldb::ModuleSP module);
+UnloadSections(const lldb::ModuleSP module) override;
 
 /// Locates or creates a module given by @p file and updates/loads the
 /// resulting module at the virtual base address @p base_addr.

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h?rev=246084&r1=246083&r2=246084&view=diff
==
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h 
(original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h 
Wed Aug 26 16:39:52 2015
@@ -49,29 +49,29 @@ public:
 //--
 
 virtual void
-DidAttach();
+DidAttach() override;
 
 virtual void
-DidLaunch();
+DidLaunch() override;
 
 virtual lldb::ThreadPlanSP
 GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
- bool stop_others);
+ bool stop_others) override;
 
 virtual lldb_private::Error
-CanLoadImage();
+CanLoadImage() override;
 
 virtual lldb::addr_t
-GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP 
thread);
+GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP 
thread) override;
 
 //--
 // PluginInterface protocol
 //--
 virtual lldb_private::ConstString
-GetPluginName();
+GetPluginName() override;
 
 virtual uint32_t
-GetPluginVersion();
+GetPluginVersion() override;
 
 virtual void
 GetPluginCommandHelp(const char *command, lldb_private::Stream *strm);


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


[Lldb-commits] [lldb] r246130 - Switch data formatters over to using std::function for their callbacks instead of raw function pointers. NFC

2015-08-26 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Aug 26 19:45:33 2015
New Revision: 246130

URL: http://llvm.org/viewvc/llvm-project?rev=246130&view=rev
Log:
Switch data formatters over to using std::function for their callbacks instead 
of raw function pointers. NFC

Modified:
lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
lldb/trunk/include/lldb/DataFormatters/TypeFormat.h
lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
lldb/trunk/include/lldb/DataFormatters/TypeValidator.h
lldb/trunk/source/API/SBTypeSummary.cpp
lldb/trunk/source/DataFormatters/TypeSummary.cpp
lldb/trunk/source/DataFormatters/TypeSynthetic.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=246130&r1=246129&r2=246130&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Wed Aug 26 
19:45:33 2015
@@ -12,6 +12,7 @@
 
 // C Includes
 // C++ Includes
+#include 
 
 // Other libraries and framework includes
 #include "clang/AST/DeclCXX.h"
@@ -92,7 +93,7 @@ public:
 typedef typename ValueType::SharedPointer ValueSP;
 typedef std::map MapType;
 typedef typename MapType::iterator MapIterator;
-typedef bool(*CallbackType)(void*, KeyType, const ValueSP&);
+typedef std::function CallbackType;
 
 FormatMap(IFormatChangeListener* lst) :
 m_map(),

Modified: lldb/trunk/include/lldb/DataFormatters/TypeFormat.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeFormat.h?rev=246130&r1=246129&r2=246130&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeFormat.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeFormat.h Wed Aug 26 19:45:33 2015
@@ -13,6 +13,7 @@
 // C Includes
 
 // C++ Includes
+#include 
 #include 
 #include 
 
@@ -150,7 +151,7 @@ namespace lldb_private {
 TypeFormatImpl (const Flags& flags = Flags());
 
 typedef std::shared_ptr SharedPointer;
-typedef bool(*ValueCallback)(void*, ConstString, const 
lldb::TypeFormatImplSP&);
+typedef std::function ValueCallback;
 
 virtual ~TypeFormatImpl ();
 
@@ -258,7 +259,7 @@ namespace lldb_private {
const TypeFormatImpl::Flags& flags = Flags());
 
 typedef std::shared_ptr SharedPointer;
-typedef bool(*ValueCallback)(void*, ConstString, const 
TypeFormatImpl_Format::SharedPointer&);
+typedef std::function ValueCallback;
 
 ~TypeFormatImpl_Format() override;
 
@@ -301,7 +302,7 @@ namespace lldb_private {
  const TypeFormatImpl::Flags& flags = Flags());
 
 typedef std::shared_ptr SharedPointer;
-typedef bool(*ValueCallback)(void*, ConstString, const 
TypeFormatImpl_EnumType::SharedPointer&);
+typedef std::function ValueCallback;
 
 ~TypeFormatImpl_EnumType() override;
 

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=246130&r1=246129&r2=246130&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h Wed Aug 26 19:45:33 
2015
@@ -14,6 +14,7 @@
 #include 
 
 // C++ Includes
+#include 
 #include 
 #include 
 
@@ -409,8 +410,8 @@ namespace lldb_private {
 }
 
 typedef std::shared_ptr SharedPointer;
-typedef bool(*SummaryCallback)(void*, ConstString, const 
lldb::TypeSummaryImplSP&);
-typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, 
const lldb::TypeSummaryImplSP&);
+typedef std::function SummaryCallback;
+typedef std::function RegexSummaryCallback;
 
 protected:
 uint32_t m_my_revision;
@@ -472,9 +473,9 @@ namespace lldb_private {
 {
 // we should convert these to SBValue and SBStream if we ever cross
 // the boundary towards the external world
-typedef bool (*Callback)(ValueObject&,
- Stream&,
- const TypeSummaryOptions&);
+typedef std::function Callback;
 
 Callback m_impl;
 std::string m_description;

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=246130&r1=246129&r2=246130&view=diff
==

[Lldb-commits] [lldb] r246131 - Add functionality to the platforms to figure out the proper name for a dynamic library on the system given a basename

2015-08-26 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Aug 26 19:53:57 2015
New Revision: 246131

URL: http://llvm.org/viewvc/llvm-project?rev=246131&view=rev
Log:
Add functionality to the platforms to figure out the proper name for a dynamic 
library on the system given a basename
This will do things like,
given mylibrary,
return

libmylibrary.dylib on OSX
mylibrary.dll on Windows

and so on for other platforms
It is currently implemented for Windows, Darwin, and Linux. Other platforms 
should fill in accordingly


Modified:
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h
lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=246131&r1=246130&r2=246131&view=diff
==
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Wed Aug 26 19:53:57 2015
@@ -268,6 +268,9 @@ class ModuleCache;
 
 virtual const char *
 GetHostname ();
+
+virtual ConstString
+GetFullNameForDylib (ConstString basename);
 
 virtual const char *
 GetDescription () = 0;

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=246131&r1=246130&r2=246131&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Wed Aug 26 
19:53:57 2015
@@ -854,3 +854,14 @@ PlatformLinux::ConvertMmapFlagsToPlatfor
 flags_platform |= map_anon;
 return flags_platform;
 }
+
+ConstString
+PlatformLinux::GetFullNameForDylib (ConstString basename)
+{
+if (basename.IsEmpty())
+return basename;
+
+StreamString stream;
+stream.Printf("lib%s.so", basename.GetCString());
+return ConstString(stream.GetData());
+}

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=246131&r1=246130&r2=246131&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Wed Aug 26 
19:53:57 2015
@@ -111,6 +111,9 @@ namespace platform_linux {
 uint64_t
 ConvertMmapFlagsToPlatform(const ArchSpec &arch, unsigned flags) 
override;
 
+ConstString
+GetFullNameForDylib (ConstString basename) override;
+
 private:
 DISALLOW_COPY_AND_ASSIGN (PlatformLinux);
 };

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=246131&r1=246130&r2=246131&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed Aug 26 
19:53:57 2015
@@ -1531,3 +1531,15 @@ PlatformDarwin::AddClangModuleCompilatio
 options.push_back(sysroot_spec.GetPath());
 }
 }
+
+ConstString
+PlatformDarwin::GetFullNameForDylib (ConstString basename)
+{
+if (basename.IsEmpty())
+return basename;
+
+StreamString stream;
+stream.Printf("lib%s.dylib", basename.GetCString());
+return ConstString(stream.GetData());
+}
+

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=246131&r1=246130&r2=246131&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Wed Aug 26 
19:53:57 2015
@@ -84,6 +84,9 @@ public:
 
 bool
 SupportsModules () override { return true; }
+
+lldb_private::ConstString
+GetFullNameForDylib (lldb_private::ConstString basename) override;
 
 protected:
 

Modified: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp?rev=246131&r1=246130&r2=246131&view=diff
=

[Lldb-commits] [lldb] r246177 - Remove class Language - the only thing it was actually being used for is provided by LanguageRuntime already

2015-08-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Aug 27 13:18:49 2015
New Revision: 246177

URL: http://llvm.org/viewvc/llvm-project?rev=246177&view=rev
Log:
Remove class Language - the only thing it was actually being used for is 
provided by LanguageRuntime already


Removed:
lldb/trunk/include/lldb/Core/Language.h
lldb/trunk/source/Core/Language.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Commands/CommandObjectArgs.h
lldb/trunk/source/Core/CMakeLists.txt
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Symbol/CompileUnit.cpp

Removed: lldb/trunk/include/lldb/Core/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Language.h?rev=246176&view=auto
==
--- lldb/trunk/include/lldb/Core/Language.h (original)
+++ lldb/trunk/include/lldb/Core/Language.h (removed)
@@ -1,117 +0,0 @@
-//===-- Language.h --*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#ifndef liblldb_Language_h_
-#define liblldb_Language_h_
-
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-//--
-/// @class Language Language.h "lldb/Core/Language.h"
-/// @brief Encapsulates the programming language for an lldb object.
-///
-/// Languages are represented by an enumeration value.
-///
-/// The enumeration values used when describing the programming language
-/// are the same values as the latest DWARF specification.
-//--
-class Language
-{
-public:
-//--
-/// Construct with optional language enumeration.
-//--
-Language(lldb::LanguageType language = lldb::eLanguageTypeUnknown);
-
-//--
-/// Destructor.
-///
-/// The destructor is virtual in case this class is subclassed.
-//--
-virtual
-~Language();
-
-//--
-/// Get the language value as a NULL termianted C string.
-///
-/// @return
-/// The C string representation of the language. The returned
-/// string does not need to be freed as it comes from constant
-/// strings. NULL can be returned when the language is set to
-/// a value that doesn't match of of the lldb::LanguageType
-/// enumerations.
-//--
-const char *
-AsCString (lldb::DescriptionLevel level = lldb::eDescriptionLevelBrief) 
const;
-
-void
-Clear();
-
-void
-GetDescription (Stream *s, lldb::DescriptionLevel level) const;
-
-//--
-/// Dump the language value to the stream \a s.
-///
-/// @param[in] s
-/// The stream to which to dump the language description.
-//--
-void
-Dump(Stream *s) const;
-
-//--
-/// Get accessor for the language.
-///
-/// @return
-/// The enumeration value that describes the programming
-/// language that an object is associated with.
-//--
-virtual lldb::LanguageType
-GetLanguage() const;
-
-//--
-/// Set accessor for the language.
-///
-/// @param[in] language
-/// The new enumeration value that describes the programming
-/// language that an object is associated with.
-//--
-void
-SetLanguage(lldb::LanguageType language);
-
-//--
-/// Set accessor for the language.
-///
-/// @param[in] language_cstr
-/// The language name as a C string.
-//--
-bool
-SetLanguageFromCString(const char *language_cstr);
-
-
-protected:
-//--
-// Member variables
-//--
-lldb::LanguageType m_language; ///< The programming language enumeration 
value.
-

[Lldb-commits] [lldb] r246212 - Add a new type of plugin: Language plugin

2015-08-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Aug 27 16:33:50 2015
New Revision: 246212

URL: http://llvm.org/viewvc/llvm-project?rev=246212&view=rev
Log:
Add a new type of plugin: Language plugin

The Language plugin is menat to answer language-specific questions that are not 
bound to the existence of a process. Those are still the domain of the 
LanguageRuntime plugin

The Language plugin will, instead, answer questions such as providing 
language-specific data formatters or expression evaluation

At the moment, the interface is hollowed out, and empty do-nothing plugins have 
been setup for ObjC, C++ and ObjC++


Added:
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Plugins/Language/
lldb/trunk/source/Plugins/Language/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/trunk/source/Plugins/Language/ObjC/
lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Plugins/Language/ObjCPlusPlus/
lldb/trunk/source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
lldb/trunk/source/Target/Language.cpp
Modified:
lldb/trunk/include/lldb/Core/PluginManager.h
lldb/trunk/include/lldb/DataFormatters/FormatCache.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/include/lldb/lldb-private-interfaces.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Core/PluginManager.cpp
lldb/trunk/source/Plugins/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Core/PluginManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=246212&r1=246211&r2=246212&view=diff
==
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)
+++ lldb/trunk/include/lldb/Core/PluginManager.h Thu Aug 27 16:33:50 2015
@@ -132,6 +132,23 @@ public:
 GetOperatingSystemCreateCallbackForPluginName (const ConstString &name);
 
 //--
+// Language
+//--
+static bool
+RegisterPlugin (const ConstString &name,
+const char *description,
+LanguageCreateInstance create_callback);
+
+static bool
+UnregisterPlugin (LanguageCreateInstance create_callback);
+
+static LanguageCreateInstance
+GetLanguageCreateCallbackAtIndex (uint32_t idx);
+
+static LanguageCreateInstance
+GetLanguageCreateCallbackForPluginName (const ConstString &name);
+
+//--
 // LanguageRuntime
 //--
 static bool

Modified: lldb/trunk/include/lldb/DataFormatters/FormatCache.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatCache.h?rev=246212&r1=246211&r2=246212&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatCache.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatCache.h Thu Aug 27 16:33:50 
2015
@@ -19,7 +19,6 @@
 #include "lldb/lldb-public.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Host/Mutex.h"
-#include "lldb/DataFormatters/FormatClasses.h"
 
 namespace lldb_private {
 class FormatCache

Added: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=246212&view=auto
==
--- lldb/trunk/include/lldb/Target/Language.h (added)
+++ lldb/trunk/include/lldb/Target/Language.h Thu Aug 27 16:33:50 2015
@@ -0,0 +1,55 @@
+//===-- Language.h ---*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_Language_h_
+#define liblldb_Language_h_
+
+// C Includes
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-public.h"
+#include "lldb/Core/PluginInterface.h"
+#include "lldb/lldb-private.h"
+
+namespace lldb_private {
+
+class Language :
+public PluginInterface
+{
+public:
+
+~Languag

[Lldb-commits] [lldb] r246216 - Added a missing file to the CMakeLists

2015-08-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Aug 27 16:45:59 2015
New Revision: 246216

URL: http://llvm.org/viewvc/llvm-project?rev=246216&view=rev
Log:
Added a missing file to the CMakeLists

Modified:
lldb/trunk/source/Target/CMakeLists.txt

Modified: lldb/trunk/source/Target/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/CMakeLists.txt?rev=246216&r1=246215&r2=246216&view=diff
==
--- lldb/trunk/source/Target/CMakeLists.txt (original)
+++ lldb/trunk/source/Target/CMakeLists.txt Thu Aug 27 16:45:59 2015
@@ -11,6 +11,7 @@ add_lldb_library(lldbTarget
   JITLoaderList.cpp
   InstrumentationRuntime.cpp
   InstrumentationRuntimeStopInfo.cpp
+  Language.cpp
   LanguageRuntime.cpp
   Memory.cpp
   MemoryHistory.cpp


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


[Lldb-commits] [lldb] r246220 - Fixup one of the CMakeLists

2015-08-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Aug 27 16:55:55 2015
New Revision: 246220

URL: http://llvm.org/viewvc/llvm-project?rev=246220&view=rev
Log:
Fixup one of the CMakeLists

Modified:
lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt?rev=246220&r1=246219&r2=246220&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt Thu Aug 27 16:55:55 
2015
@@ -1,5 +1,5 @@
 set(LLVM_NO_RTTI 1)
 
-add_lldb_library(lldbPluginAppleObjCLanguage
-  AppleObjCLanguage.cpp
+add_lldb_library(lldbPluginObjCLanguage
+  ObjCLanguage.cpp
 )


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


[Lldb-commits] [lldb] r246222 - Include

2015-08-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Aug 27 17:14:06 2015
New Revision: 246222

URL: http://llvm.org/viewvc/llvm-project?rev=246222&view=rev
Log:
Include 

Modified:
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=246222&r1=246221&r2=246222&view=diff
==
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Thu Aug 27 17:14:06 2015
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include "lldb/Target/Language.h"
 


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


[Lldb-commits] [lldb] r246512 - Make FormatEntity be a little bit smarter when printing function arguments

2015-08-31 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Aug 31 19:19:35 2015
New Revision: 246512

URL: http://llvm.org/viewvc/llvm-project?rev=246512&view=rev
Log:
Make FormatEntity be a little bit smarter when printing function arguments


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

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=246512&r1=246511&r2=246512&view=diff
==
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Mon Aug 31 19:19:35 2015
@@ -20,6 +20,7 @@
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/DataFormatters/DataVisualization.h"
 #include "lldb/DataFormatters/FormatManager.h"
+#include "lldb/DataFormatters/ValueObjectPrinter.h"
 #include "lldb/Expression/ClangExpressionVariable.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
@@ -1785,20 +1786,34 @@ FormatEntity::Format (const Entry &entry
 
 VariableSP var_sp (args.GetVariableAtIndex 
(arg_idx));
 ValueObjectSP var_value_sp 
(ValueObjectVariable::Create (exe_scope, var_sp));
+StreamString ss;
 const char *var_representation = nullptr;
 const char *var_name = 
var_value_sp->GetName().GetCString();
-if 
(var_value_sp->GetCompilerType().IsAggregateType() &&
-
DataVisualization::ShouldPrintAsOneLiner(*var_value_sp.get()))
+if (var_value_sp->GetCompilerType().IsValid())
 {
-static StringSummaryFormat 
format(TypeSummaryImpl::Flags()
-  
.SetHideItemNames(false)
-  
.SetShowMembersOneLiner(true),
-  "");
-format.FormatObject(var_value_sp.get(), 
buffer, TypeSummaryOptions());
-var_representation = buffer.c_str();
+if (var_value_sp && 
exe_scope->CalculateTarget())
+var_value_sp = 
var_value_sp->GetQualifiedRepresentationIfAvailable(exe_scope->CalculateTarget()->TargetProperties::GetPreferDynamicValue(),
+   

exe_scope->CalculateTarget()->TargetProperties::GetEnableSyntheticValue());
+if 
(var_value_sp->GetCompilerType().IsAggregateType() &&
+
DataVisualization::ShouldPrintAsOneLiner(*var_value_sp.get()))
+{
+static StringSummaryFormat 
format(TypeSummaryImpl::Flags()
+  
.SetHideItemNames(false)
+  
.SetShowMembersOneLiner(true),
+  "");
+
format.FormatObject(var_value_sp.get(), buffer, TypeSummaryOptions());
+var_representation = buffer.c_str();
+}
+else
+
var_value_sp->DumpPrintableRepresentation(ss,
+   
   
ValueObject::ValueObjectRepresentationStyle::eValueObjectRepresentationStyleSummary,
+   
   eFormatDefault,
+   
   
ValueObject::PrintableRepresentationSpecialCases::ePrintableRepresentationSpecialCasesAllow,
+   
   false);
 }
-else
-var_representation = 
var_value_sp->GetValueAsCString();
+
+if (ss.GetData() && ss.GetSize())
+var_representation = ss.GetData();
 if (arg_idx > 0)
 s.PutCString (", ");
 if (var_value_sp->GetError().Success())


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

[Lldb-commits] [lldb] r246515 - Add support for language plugins to provide data formatters

2015-08-31 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Aug 31 20:01:48 2015
New Revision: 246515

URL: http://llvm.org/viewvc/llvm-project?rev=246515&view=rev
Log:
Add support for language plugins to provide data formatters

Historically, data formatters all exist in a global repository (the category 
map)
On top of that, some formatters can be "hardcoded" when the conditions under 
which they apply are not expressible as a typename (or typename regex)

This change paves the way to move formatters into per-language buckets such 
that the C++ plugin is responsible for ownership of the C++ formatters, and so 
on
The advantages of this are:
a) language formatters only get created when they might apply
b) formatters for a language are clearly owned by the matching language plugin

The current model is one of static instantiation, that is a language knows the 
full set of formatters it vends and that is only asked-for once, and then 
handed off to the FormatManager
In a future revision it might be interesting to add similar ability to the 
language runtimes, and monitor for certain shared library events to add even 
more library-specific formatters

No formatters are moved as part of this change, so practically speaking this is 
NFC


Added:
lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
lldb/trunk/source/DataFormatters/LanguageCategory.cpp
Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/DataFormatters/CMakeLists.txt
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=246515&r1=246514&r2=246515&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Aug 31 20:01:48 
2015
@@ -21,11 +21,13 @@
 #include "lldb/DataFormatters/FormatCache.h"
 #include "lldb/DataFormatters/FormatClasses.h"
 #include "lldb/DataFormatters/FormattersContainer.h"
+#include "lldb/DataFormatters/LanguageCategory.h"
 #include "lldb/DataFormatters/TypeCategory.h"
 #include "lldb/DataFormatters/TypeCategoryMap.h"
 
 #include 
 #include 
+#include 
 
 namespace lldb_private {
 
@@ -48,6 +50,8 @@ public:
 template 
 using HardcodedFormatterFinders = 
std::vector>;
 
+typedef std::map 
LanguageCategories;
+
 typedef TypeCategoryMap::CallbackType CategoryCallback;
 
 FormatManager ();
@@ -123,11 +127,8 @@ public:
 }
 
 void
-LoopThroughCategories (CategoryCallback callback, void* param)
-{
-m_categories_map.LoopThrough(callback, param);
-}
-
+LoopThroughCategories (CategoryCallback callback, void* param);
+
 lldb::TypeCategoryImplSP
 GetCategory (const char* category_name = NULL,
  bool can_create = true)
@@ -258,6 +259,9 @@ public:
 true);
 return matches;
 }
+
+static ConstString
+GetTypeForCache (ValueObject&, lldb::DynamicValueType);
 
 private:
 
@@ -272,10 +276,14 @@ private:
 bool did_strip_typedef,
 bool root_level = false);
 
+LanguageCategory*
+GetCategoryForLanguage (lldb::LanguageType lang_type);
+
 FormatCache m_format_cache;
 NamedSummariesMap m_named_summaries_map;
 std::atomic m_last_revision;
 TypeCategoryMap m_categories_map;
+LanguageCategories m_language_categories_map;
 
 ConstString m_default_category_name;
 ConstString m_system_category_name;

Added: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=246515&view=auto
==
--- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (added)
+++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Aug 31 
20:01:48 2015
@@ -0,0 +1,67 @@
+//===-- LanguageCategory.h*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef lldb_LanguageCategory_h_
+#define lldb_LanguageCategory_h_
+
+// C Includes
+// C++ Include

[Lldb-commits] [lldb] r246519 - And of course, typos

2015-08-31 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Aug 31 20:23:22 2015
New Revision: 246519

URL: http://llvm.org/viewvc/llvm-project?rev=246519&view=rev
Log:
And of course, typos

Modified:
lldb/trunk/source/Plugins/Language/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Language/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CMakeLists.txt?rev=246519&r1=246518&r2=246519&view=diff
==
--- lldb/trunk/source/Plugins/Language/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/CMakeLists.txt Mon Aug 31 20:23:22 2015
@@ -1,3 +1,3 @@
 add_subdirectory(CPlusPlus)
 add_subdirectory(ObjC)
-add_subdirectory(ObjCPlusLus)
+add_subdirectory(ObjCPlusPlus)


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


[Lldb-commits] [lldb] r246518 - Attempt at fixing the CMake build

2015-08-31 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Aug 31 20:23:02 2015
New Revision: 246518

URL: http://llvm.org/viewvc/llvm-project?rev=246518&view=rev
Log:
Attempt at fixing the CMake build

Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/source/Plugins/Language/CMakeLists.txt

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=246518&r1=246517&r2=246518&view=diff
==
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Mon Aug 31 20:23:02 2015
@@ -20,6 +20,10 @@ set( LLDB_USED_LIBS
   lldbPluginDynamicLoaderPosixDYLD
   lldbPluginDynamicLoaderHexagonDYLD
   lldbPluginDynamicLoaderWindowsDYLD
+  
+  lldbPluginCPlusPlusLanguage
+  lldbPluginObjCLanguage
+  lldbPluginObjCPlusPlusLanguage
 
   lldbPluginObjectFileELF
   lldbPluginObjectFileJIT

Modified: lldb/trunk/source/Plugins/Language/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CMakeLists.txt?rev=246518&r1=246517&r2=246518&view=diff
==
--- lldb/trunk/source/Plugins/Language/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/CMakeLists.txt Mon Aug 31 20:23:02 2015
@@ -1,2 +1,3 @@
 add_subdirectory(CPlusPlus)
 add_subdirectory(ObjC)
+add_subdirectory(ObjCPlusLus)


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


Re: [Lldb-commits] [lldb] r246518 - Attempt at fixing the CMake build

2015-08-31 Thread Enrico Granata via lldb-commits

> On Aug 31, 2015, at 6:23 PM, Enrico Granata via lldb-commits 
>  wrote:
> 
> Author: enrico
> Date: Mon Aug 31 20:23:02 2015
> New Revision: 246518
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=246518&view=rev
> Log:
> Attempt at fixing the CMake build
> 
> Modified:
>lldb/trunk/cmake/LLDBDependencies.cmake
>lldb/trunk/source/Plugins/Language/CMakeLists.txt
> 
> Modified: lldb/trunk/cmake/LLDBDependencies.cmake
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=246518&r1=246517&r2=246518&view=diff
> ==
> --- lldb/trunk/cmake/LLDBDependencies.cmake (original)
> +++ lldb/trunk/cmake/LLDBDependencies.cmake Mon Aug 31 20:23:02 2015
> @@ -20,6 +20,10 @@ set( LLDB_USED_LIBS
>   lldbPluginDynamicLoaderPosixDYLD
>   lldbPluginDynamicLoaderHexagonDYLD
>   lldbPluginDynamicLoaderWindowsDYLD
> +  
> +  lldbPluginCPlusPlusLanguage
> +  lldbPluginObjCLanguage
> +  lldbPluginObjCPlusPlusLanguage
> 
>   lldbPluginObjectFileELF
>   lldbPluginObjectFileJIT
> 
> Modified: lldb/trunk/source/Plugins/Language/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CMakeLists.txt?rev=246518&r1=246517&r2=246518&view=diff
> ==
> --- lldb/trunk/source/Plugins/Language/CMakeLists.txt (original)
> +++ lldb/trunk/source/Plugins/Language/CMakeLists.txt Mon Aug 31 20:23:02 2015
> @@ -1,2 +1,3 @@
> add_subdirectory(CPlusPlus)
> add_subdirectory(ObjC)
> +add_subdirectory(ObjCPlusLus)
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

This commit - and the next - are my best guess at fixing the CMake build after 
my formatter changes in r 246515
If they were to prove insufficient, I would appreciate somebody with more 
CMake-fu than myself pointing me in the right direction

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r246568 - Add support for language plugins to provide data formatters (second attempt)

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 13:22:39 2015
New Revision: 246568

URL: http://llvm.org/viewvc/llvm-project?rev=246568&view=rev
Log:
Add support for language plugins to provide data formatters (second attempt)

Historically, data formatters all exist in a global repository (the category 
map)
On top of that, some formatters can be "hardcoded" when the conditions under 
which they apply are not expressible as a typename (or typename regex)

This change paves the way to move formatters into per-language buckets such 
that the C++ plugin is responsible for ownership of the C++ formatters, and so 
on
The advantages of this are:
a) language formatters only get created when they might apply
b) formatters for a language are clearly owned by the matching language plugin

The current model is one of static instantiation, that is a language knows the 
full set of formatters it vends and that is only asked-for once, and then 
handed off to the FormatManager
In a future revision it might be interesting to add similar ability to the 
language runtimes, and monitor for certain shared library events to add even 
more library-specific formatters

No formatters are moved as part of this change, so practically speaking this is 
NFC



Added:
lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
lldb/trunk/source/DataFormatters/LanguageCategory.cpp
Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/DataFormatters/CMakeLists.txt
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
lldb/trunk/source/Plugins/Language/CMakeLists.txt
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=246568&r1=246567&r2=246568&view=diff
==
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Sep  1 13:22:39 2015
@@ -20,6 +20,10 @@ set( LLDB_USED_LIBS
   lldbPluginDynamicLoaderPosixDYLD
   lldbPluginDynamicLoaderHexagonDYLD
   lldbPluginDynamicLoaderWindowsDYLD
+  
+  lldbPluginCPlusPlusLanguage
+  lldbPluginObjCLanguage
+  lldbPluginObjCPlusPlusLanguage
 
   lldbPluginObjectFileELF
   lldbPluginObjectFileJIT

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=246568&r1=246567&r2=246568&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Tue Sep  1 13:22:39 
2015
@@ -18,14 +18,18 @@
 #include "lldb/lldb-public.h"
 #include "lldb/lldb-enumerations.h"
 
+#include "lldb/Core/ThreadSafeDenseMap.h"
+
 #include "lldb/DataFormatters/FormatCache.h"
 #include "lldb/DataFormatters/FormatClasses.h"
 #include "lldb/DataFormatters/FormattersContainer.h"
+#include "lldb/DataFormatters/LanguageCategory.h"
 #include "lldb/DataFormatters/TypeCategory.h"
 #include "lldb/DataFormatters/TypeCategoryMap.h"
 
 #include 
 #include 
+#include 
 
 namespace lldb_private {
 
@@ -48,6 +52,8 @@ public:
 template 
 using HardcodedFormatterFinders = 
std::vector>;
 
+typedef std::map 
LanguageCategories;
+
 typedef TypeCategoryMap::CallbackType CategoryCallback;
 
 FormatManager ();
@@ -123,11 +129,8 @@ public:
 }
 
 void
-LoopThroughCategories (CategoryCallback callback, void* param)
-{
-m_categories_map.LoopThrough(callback, param);
-}
-
+LoopThroughCategories (CategoryCallback callback, void* param);
+
 lldb::TypeCategoryImplSP
 GetCategory (const char* category_name = NULL,
  bool can_create = true)
@@ -258,6 +261,9 @@ public:
 true);
 return matches;
 }
+
+static ConstString
+GetTypeForCache (ValueObject&, lldb::DynamicValueType);
 
 private:
 
@@ -272,10 +278,15 @@ private:
 bool did_strip_typedef,
 bool root_level = false);
 
+LanguageCategory*
+GetCategoryForLanguage (lldb::LanguageType lang_type);
+
 FormatCache m_format_cache;
 NamedSummariesMap m_named_summaries_map;
 std::atomic m_last_revision;
 TypeCategoryMap m_categories_map;
+LanguageCategories m_language_categories_map;
+Mutex m_language_categories_mutex;
 
 ConstString m_default_

[Lldb-commits] [lldb] r246580 - Add logging to a couple of regions of code

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 15:11:13 2015
New Revision: 246580

URL: http://llvm.org/viewvc/llvm-project?rev=246580&view=rev
Log:
Add logging to a couple of regions of code


Modified:
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp

Modified: lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp?rev=246580&r1=246579&r2=246580&view=diff
==
--- lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp Tue Sep  1 15:11:13 
2015
@@ -229,6 +229,19 @@ TypeCategoryMap::GetFormat (ValueObject&
 
 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
 
+if (log)
+{
+for (auto match : matches)
+{
+log->Printf("[CategoryMap::GetSummaryFormat] candidate match = %s 
%s %s %s reason = %" PRIu32,
+match.GetTypeName().GetCString(),
+match.DidStripPointer() ? "strip-pointers" : 
"no-strip-pointers",
+match.DidStripReference() ? "strip-reference" : 
"no-strip-reference",
+match.DidStripTypedef() ? "strip-typedef" : 
"no-strip-typedef",
+match.GetReason());
+}
+}
+
 for (begin = m_active_categories.begin(); begin != end; begin++)
 {
 lldb::TypeCategoryImplSP category_sp = *begin;
@@ -256,6 +269,19 @@ TypeCategoryMap::GetSummaryFormat (Value
 
 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
 
+if (log)
+{
+for (auto match : matches)
+{
+log->Printf("[CategoryMap::GetSummaryFormat] candidate match = %s 
%s %s %s reason = %" PRIu32,
+match.GetTypeName().GetCString(),
+match.DidStripPointer() ? "strip-pointers" : 
"no-strip-pointers",
+match.DidStripReference() ? "strip-reference" : 
"no-strip-reference",
+match.DidStripTypedef() ? "strip-typedef" : 
"no-strip-typedef",
+match.GetReason());
+}
+}
+
 for (begin = m_active_categories.begin(); begin != end; begin++)
 {
 lldb::TypeCategoryImplSP category_sp = *begin;
@@ -285,6 +311,19 @@ TypeCategoryMap::GetSyntheticChildren (V
 
 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
 
+if (log)
+{
+for (auto match : matches)
+{
+log->Printf("[CategoryMap::GetSummaryFormat] candidate match = %s 
%s %s %s reason = %" PRIu32,
+match.GetTypeName().GetCString(),
+match.DidStripPointer() ? "strip-pointers" : 
"no-strip-pointers",
+match.DidStripReference() ? "strip-reference" : 
"no-strip-reference",
+match.DidStripTypedef() ? "strip-typedef" : 
"no-strip-typedef",
+match.GetReason());
+}
+}
+
 for (begin = m_active_categories.begin(); begin != end; begin++)
 {
 lldb::TypeCategoryImplSP category_sp = *begin;
@@ -313,6 +352,19 @@ TypeCategoryMap::GetValidator (ValueObje
 
 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
 
+if (log)
+{
+for (auto match : matches)
+{
+log->Printf("[CategoryMap::GetSummaryFormat] candidate match = %s 
%s %s %s reason = %" PRIu32,
+match.GetTypeName().GetCString(),
+match.DidStripPointer() ? "strip-pointers" : 
"no-strip-pointers",
+match.DidStripReference() ? "strip-reference" : 
"no-strip-reference",
+match.DidStripTypedef() ? "strip-typedef" : 
"no-strip-typedef",
+match.GetReason());
+}
+}
+
 for (begin = m_active_categories.begin(); begin != end; begin++)
 {
 lldb::TypeCategoryImplSP category_sp = *begin;

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp?rev=246580&r1=246579&r2=246580&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
 Tue Sep  1 15:11:13 2015
@@ -8,6 +8,7 @@
 
//===--===//
 
 #include "AppleObjCClassDescriptorV2.h"
+#include "lldb/Core/Log.h"
 
 usin

[Lldb-commits] [lldb] r246597 - std::initializer_list is not safe to return from a function, as copies are not guaranteed to extend the lifetime of the underlying storage

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 17:24:35 2015
New Revision: 246597

URL: http://llvm.org/viewvc/llvm-project?rev=246597&view=rev
Log:
std::initializer_list is not safe to return from a function, as copies are not 
guaranteed to extend the lifetime of the underlying storage


Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=246597&r1=246596&r2=246597&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep  1 17:24:35 2015
@@ -636,7 +636,7 @@ FormatManager::GetTypeForCache (ValueObj
 return ConstString();
 }
 
-static std::initializer_list
+static std::vector
 GetCandidateLanguages (ValueObject& valobj)
 {
 lldb::LanguageType lang_type = valobj.GetObjectRuntimeLanguage();


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


[Lldb-commits] [lldb] r246612 - Move the functions that FormatManager uses to actually load formatters into their own file

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 20:21:31 2015
New Revision: 246612

URL: http://llvm.org/viewvc/llvm-project?rev=246612&view=rev
Log:
Move the functions that FormatManager uses to actually load formatters into 
their own file

These are useful helpers over the low-level API of the FormattersContainer, and 
since we're actually going to start moving formatters into plugins, it makes 
sense to simplify things


Added:
lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/DataFormatters/CMakeLists.txt
lldb/trunk/source/DataFormatters/FormatManager.cpp

Added: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=246612&view=auto
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (added)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Tue Sep  1 
20:21:31 2015
@@ -0,0 +1,76 @@
+//===-- FormattersHelpers.h --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef lldb_FormattersHelpers_h_
+#define lldb_FormattersHelpers_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-enumerations.h"
+
+#include "lldb/DataFormatters/TypeCategory.h"
+#include "lldb/DataFormatters/TypeFormat.h"
+#include "lldb/DataFormatters/TypeSummary.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
+
+namespace lldb_private {
+namespace formatters {
+void
+AddFormat (TypeCategoryImpl::SharedPointer category_sp,
+   lldb::Format format,
+   ConstString type_name,
+   TypeFormatImpl::Flags flags,
+   bool regex = false);
+
+void
+AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,
+ const char* string,
+ ConstString type_name,
+ TypeSummaryImpl::Flags flags,
+ bool regex = false);
+
+void
+AddOneLineSummary (TypeCategoryImpl::SharedPointer category_sp,
+   ConstString type_name,
+   TypeSummaryImpl::Flags flags,
+   bool regex = false);
+
+#ifndef LLDB_DISABLE_PYTHON
+void
+AddCXXSummary (TypeCategoryImpl::SharedPointer category_sp,
+   CXXFunctionSummaryFormat::Callback funct,
+   const char* description,
+   ConstString type_name,
+   TypeSummaryImpl::Flags flags,
+   bool regex = false);
+
+void
+AddCXXSynthetic  (TypeCategoryImpl::SharedPointer category_sp,
+  CXXSyntheticChildren::CreateFrontEndCallback 
generator,
+  const char* description,
+  ConstString type_name,
+  ScriptedSyntheticChildren::Flags flags,
+  bool regex = false);
+
+void
+AddFilter  (TypeCategoryImpl::SharedPointer category_sp,
+std::vector children,
+const char* description,
+ConstString type_name,
+ScriptedSyntheticChildren::Flags flags,
+bool regex = false);
+#endif
+
+} // namespace formatters
+} // namespace lldb_private
+
+#endif // lldb_FormattersHelpers_h_

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=246612&r1=246611&r2=246612&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep  1 20:21:31 2015
@@ -779,6 +779,7 @@
94CD705216F8F5BC00CF1E42 /* LibCxxMap.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 94CD705116F8F5BC00CF1E42 /* LibCxxMap.cpp */; };
94CD7D0919A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0819A3FBA300908B7C /* 
AppleObjCClassDescriptorV2.cpp */; };
94CD7D0C19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0B19A3FBCE00908B7C /* 
AppleObjCTypeEncodingParser.cpp */; };
+   94D0858C1B9675B8000D24BD /* FormattersHelpers.cpp in Sources */ 

[Lldb-commits] [lldb] r246613 - Use Language::LanguageIsCPlusPlus instead of doing the same switch over language

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 20:28:24 2015
New Revision: 246613

URL: http://llvm.org/viewvc/llvm-project?rev=246613&view=rev
Log:
Use Language::LanguageIsCPlusPlus instead of doing the same switch over language

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=246613&r1=246612&r2=246613&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Sep  
1 20:28:24 2015
@@ -58,14 +58,7 @@ CPlusPlusLanguage::GetPluginVersion()
 Language *
 CPlusPlusLanguage::CreateInstance (lldb::LanguageType language)
 {
-switch (language)
-{
-case lldb::eLanguageTypeC_plus_plus:
-case lldb::eLanguageTypeC_plus_plus_03:
-case lldb::eLanguageTypeC_plus_plus_11:
-case lldb::eLanguageTypeC_plus_plus_14:
-return new CPlusPlusLanguage();
-default:
-return nullptr;
-}
+if (Language::LanguageIsCPlusPlus(language))
+return new CPlusPlusLanguage();
+return nullptr;
 }


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


[Lldb-commits] [lldb] r246614 - Add a Language::ForAllLanguages helper function

2015-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  1 20:31:10 2015
New Revision: 246614

URL: http://llvm.org/viewvc/llvm-project?rev=246614&view=rev
Log:
Add a Language::ForAllLanguages helper function

Modified:
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=246614&r1=246613&r2=246614&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Tue Sep  1 20:31:10 2015
@@ -27,20 +27,20 @@ namespace lldb_private {
 {
 public:
 
-~Language() override;
-
-static Language*
-FindPlugin (lldb::LanguageType language);
-
-// return false from callback to stop iterating
-static void
-ForEach (std::function callback);
-
-virtual lldb::LanguageType
-GetLanguageType () const = 0;
-
-virtual lldb::TypeCategoryImplSP
-GetFormatters ();
+~Language() override;
+
+static Language*
+FindPlugin (lldb::LanguageType language);
+
+// return false from callback to stop iterating
+static void
+ForEach (std::function callback);
+
+virtual lldb::LanguageType
+GetLanguageType () const = 0;
+
+virtual lldb::TypeCategoryImplSP
+GetFormatters ();
 
 // These are accessors for general information about the Languages lldb 
knows about:
 
@@ -52,6 +52,10 @@ namespace lldb_private {
 
 static void
 PrintAllLanguages (Stream &s, const char *prefix, const char *suffix);
+
+// return false from callback to stop iterating
+static void
+ForAllLanguages (std::function callback);
 
 static bool
 LanguageIsCPlusPlus (lldb::LanguageType language);

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=246614&r1=246613&r2=246614&view=diff
==
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Tue Sep  1 20:31:10 2015
@@ -179,6 +179,16 @@ Language::PrintAllLanguages (Stream &s,
 }
 }
 
+void
+Language::ForAllLanguages (std::function callback)
+{
+for (uint32_t i = 1; i < num_languages; i++)
+{
+if (!callback(language_names[i].type))
+break;
+}
+}
+
 bool
 Language::LanguageIsCPlusPlus (LanguageType language)
 {


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


[Lldb-commits] [lldb] r246709 - We want Python int or long to both be usable as-a tid_t for API purposes. Introduce a typemap to this effect

2015-09-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep  2 15:53:43 2015
New Revision: 246709

URL: http://llvm.org/viewvc/llvm-project?rev=246709&view=rev
Log:
We want Python int or long to both be usable as-a tid_t for API purposes. 
Introduce a typemap to this effect

Modified:
lldb/trunk/scripts/Python/python-typemaps.swig

Modified: lldb/trunk/scripts/Python/python-typemaps.swig
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-typemaps.swig?rev=246709&r1=246708&r2=246709&view=diff
==
--- lldb/trunk/scripts/Python/python-typemaps.swig (original)
+++ lldb/trunk/scripts/Python/python-typemaps.swig Wed Sep  2 15:53:43 2015
@@ -25,6 +25,18 @@
   }
 }
 
+%typemap(in) lldb::tid_t {
+if (PyInt_Check($input))
+$1 = PyInt_AsLong($input);
+else if (PyLong_Check($input))
+$1 = PyLong_AsLong($input);
+else
+{
+PyErr_SetString(PyExc_ValueError, "Expecting an integer");
+return NULL;
+}
+}
+
 %typemap(typecheck) char ** {
   /* Check if is a list  */
   $1 = 1;


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


[Lldb-commits] [lldb] r246743 - CXXFormatterFunctions.{h|cpp} is not a good thing to have around, so start splitting stuff in different files in preparation for removing it and factoring formatters to

2015-09-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep  2 20:29:42 2015
New Revision: 246743

URL: http://llvm.org/viewvc/llvm-project?rev=246743&view=rev
Log:
CXXFormatterFunctions.{h|cpp} is not a good thing to have around, so start 
splitting stuff in different files in preparation for removing it and factoring 
formatters to the plugins where they belong


Added:
lldb/trunk/source/DataFormatters/CxxStringTypes.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
lldb/trunk/source/DataFormatters/Cocoa.cpp
lldb/trunk/source/DataFormatters/LibCxx.cpp
lldb/trunk/source/DataFormatters/LibStdcpp.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=246743&r1=246742&r2=246743&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Sep  2 20:29:42 2015
@@ -737,6 +737,7 @@
94380B8219940B0A00BFE4A8 /* StringLexer.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */; 
};
9439FB1A19EF140C006FD6A4 /* NSIndexPath.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9439FB1919EF140C006FD6A4 /* NSIndexPath.cpp */; 
};
943BDEFE1AA7B2F800789CE8 /* LLDBAssert.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */; };
+   943F31A61B97D9970047A590 /* CxxStringTypes.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 943F31A51B97D9970047A590 /* CxxStringTypes.cpp 
*/; settings = {ASSET_TAGS = (); }; };
944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* 
RegisterContextDummy.cpp */; };
9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
@@ -2426,6 +2427,7 @@
9439FB1919EF140C006FD6A4 /* NSIndexPath.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = NSIndexPath.cpp; path = source/DataFormatters/NSIndexPath.cpp; 
sourceTree = ""; };
943BDEFC1AA7B2DE00789CE8 /* LLDBAssert.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLDBAssert.h; path 
= include/lldb/Utility/LLDBAssert.h; sourceTree = ""; };
943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LLDBAssert.cpp; path = source/Utility/LLDBAssert.cpp; sourceTree = 
""; };
+   943F31A51B97D9970047A590 /* CxxStringTypes.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CxxStringTypes.cpp; path = source/DataFormatters/CxxStringTypes.cpp; 
sourceTree = ""; };
944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = RegisterContextDummy.cpp; path = Utility/RegisterContextDummy.cpp; 
sourceTree = ""; };
944372DB171F6B4300E57C32 /* RegisterContextDummy.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
RegisterContextDummy.h; path = Utility/RegisterContextDummy.h; sourceTree = 
""; };
9443B120140C18A90013457C /* SBData.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBData.h; path = 
include/lldb/API/SBData.h; sourceTree = ""; };
@@ -5316,6 +5318,7 @@
9492E2A41A8AC11000295BBD /* CoreMedia.cpp */,
94CB255F16B069800059775D /* 
CXXFormatterFunctions.h */,
94CB255716B069770059775D /* 
CXXFormatterFunctions.cpp */,
+   943F31A51B97D9970047A590 /* CxxStringTypes.cpp 
*/,
94CB256016B069800059775D /* DataVisualization.h 
*/,
94CB255816B069770059775D /* 
DataVisualization.cpp */,
94CB257516B1D3910059775D /* FormatCache.h */,
@@ -6466,6 +6469,7 @@
3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm 
in Sources */,
266603CA1345B5A8004DA8B6 /* 
ConnectionSharedMemory.cpp in Sources */,
2671A0D013482601003A87BB /* 
ConnectionMachPort.cpp in Sources */,
+   943F31A61B97D9970047A590 /* CxxStringTypes.cpp 
in Sources */,
4CABA9E0134A8BCD00539BDD /* 
ValueObje

Re: [Lldb-commits] [lldb] r246873 - Move the C++ data formatters to the C++ language plugin

2015-09-04 Thread Enrico Granata via lldb-commits

> On Sep 4, 2015, at 2:01 PM, Enrico Granata via lldb-commits 
>  wrote:
> 
> Added:
>lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h
>  - copied unchanged from r246859, 
> lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h

The Windows buildbot claims it can’t find this file, and hence fails to build
I see the file in the commit log, and it also claims to be tracked on my local 
system, so I am not sure what is amiss here

Can anyone with access to a Windows box please help look at it?

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r246876 - Never mind, I see what the problem is on the Windows build. Attempt a fix

2015-09-04 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Sep  4 16:22:54 2015
New Revision: 246876

URL: http://llvm.org/viewvc/llvm-project?rev=246876&view=rev
Log:
Never mind, I see what the problem is on the Windows build. Attempt a fix

Modified:
lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Modified: lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp?rev=246876&r1=246875&r2=246876&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp Fri Sep  4 16:22:54 
2015
@@ -7,7 +7,8 @@
 //
 
//===--===//
 
-#include "CXXFunctionPointer.h"
+#include "lldb/DataFormatters/CXXFunctionPointer.h"
+
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
 

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=246876&r1=246875&r2=246876&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Fri Sep  
4 16:22:54 2015
@@ -20,7 +20,6 @@
 #include "lldb/DataFormatters/DataVisualization.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 
-#include "CXXFunctionPointer.h"
 #include "CxxStringTypes.h"
 #include "LibCxx.h"
 #include "LibStdcpp.h"


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


[Lldb-commits] [lldb] r246884 - Add a --language (-l) option to type category {enable|disable} to allow people to turn on and off formatters for a given language

2015-09-04 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Sep  4 17:07:48 2015
New Revision: 246884

URL: http://llvm.org/viewvc/llvm-project?rev=246884&view=rev
Log:
Add a --language (-l) option to type category {enable|disable} to allow people 
to turn on and off formatters for a given language


Modified:
lldb/trunk/include/lldb/DataFormatters/DataVisualization.h
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/DataFormatters/DataVisualization.cpp
lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py

Modified: lldb/trunk/include/lldb/DataFormatters/DataVisualization.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DataVisualization.h?rev=246884&r1=246883&r2=246884&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/DataVisualization.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/DataVisualization.h Fri Sep  4 
17:07:48 2015
@@ -134,7 +134,13 @@ public:
 TypeCategoryMap::Position = TypeCategoryMap::Default);
 
 static void
+Enable (lldb::LanguageType lang_type);
+
+static void
 Disable (const ConstString& category);
+
+static void
+Disable (lldb::LanguageType lang_type);
 
 static void
 Enable (const lldb::TypeCategoryImplSP& category,

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=246884&r1=246883&r2=246884&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Fri Sep  4 17:07:48 
2015
@@ -258,6 +258,9 @@ public:
 
 static ConstString
 GetTypeForCache (ValueObject&, lldb::DynamicValueType);
+
+LanguageCategory*
+GetCategoryForLanguage (lldb::LanguageType lang_type);
 
 private:
 
@@ -272,9 +275,6 @@ private:
 bool did_strip_typedef,
 bool root_level = false);
 
-LanguageCategory*
-GetCategoryForLanguage (lldb::LanguageType lang_type);
-
 FormatCache m_format_cache;
 NamedSummariesMap m_named_summaries_map;
 std::atomic m_last_revision;

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=246884&r1=246883&r2=246884&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Fri Sep  4 17:07:48 2015
@@ -30,6 +30,7 @@
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Interpreter/Options.h"
 #include "lldb/Interpreter/OptionGroupFormat.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
@@ -2460,12 +2461,79 @@ CommandObjectTypeSummaryList::CommandOpt
 
 class CommandObjectTypeCategoryEnable : public CommandObjectParsed
 {
+class CommandOptions : public Options
+{
+public:
+
+CommandOptions (CommandInterpreter &interpreter) :
+Options (interpreter)
+{
+}
+
+virtual
+~CommandOptions (){}
+
+virtual Error
+SetOptionValue (uint32_t option_idx, const char *option_arg)
+{
+Error error;
+const int short_option = m_getopt_table[option_idx].val;
+
+switch (short_option)
+{
+case 'l':
+if (option_arg)
+{
+m_language = 
Language::GetLanguageTypeFromString(option_arg);
+if (m_language == lldb::eLanguageTypeUnknown)
+error.SetErrorStringWithFormat ("unrecognized 
language '%s'", option_arg);
+}
+break;
+default:
+error.SetErrorStringWithFormat ("unrecognized option 
'%c'", short_option);
+break;
+}
+
+return error;
+}
+
+void
+OptionParsingStarting ()
+{
+m_language = lldb::eLanguageTypeUnknown;
+}
+
+const OptionDefinition*
+GetDefinitions ()
+{
+return g_option_table;
+}
+
+// Options table: Required for subclasses of Options.
+
+static OptionDefinition g_option_table[];
+
+// Instance variables to hold the values for command options.
+
+lldb::LanguageType m_language;
+
+};
+
+  

[Lldb-commits] [lldb] r247082 - Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness

2015-09-08 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  8 17:09:19 2015
New Revision: 247082

URL: http://llvm.org/viewvc/llvm-project?rev=247082&view=rev
Log:
Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on 
the TypeSystem to get numeric types of specific sizes and signedness

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/DataFormatters/CoreMedia.cpp
lldb/trunk/source/DataFormatters/VectorType.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 17:09:19 2015
@@ -454,7 +454,7 @@ public:
 //--
 
 CompilerType
-GetIntTypeFromBitSize (size_t bit_size, bool is_signed)
+GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override
 {
 return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);
 }
@@ -477,7 +477,7 @@ public:
 //--
 
 CompilerType
-GetFloatTypeFromBitSize (size_t bit_size)
+GetFloatTypeFromBitSize (size_t bit_size) override
 {
 return GetFloatTypeFromBitSize (getASTContext(), bit_size);
 }

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 17:09:19 2015
@@ -400,6 +400,12 @@ public:
 virtual CompilerType
 GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;
 
+virtual CompilerType
+GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;
+
+virtual CompilerType
+GetFloatTypeFromBitSize (size_t bit_size) = 0;
+
 virtual bool
 IsBeingDefined (void *type) = 0;
 

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Sep  8 17:09:19 2015
@@ -1230,6 +1230,14 @@ public:
 ClangASTContext *
 GetScratchClangASTContext(bool create_on_demand=true);
 
+TypeSystem*
+GetTypeSystemForLanguage (lldb::LanguageType language);
+
+CompilerType
+GetBasicType (lldb::LanguageType language,
+  lldb::BasicType basic_type,
+  size_t size = 0);
+
 ClangASTImporter *
 GetClangASTImporter();
 

Modified: lldb/trunk/source/DataFormatters/CoreMedia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CoreMedia.cpp?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/source/DataFormatters/CoreMedia.cpp (original)
+++ lldb/trunk/source/DataFormatters/CoreMedia.cpp Tue Sep  8 17:09:19 2015
@@ -10,7 +10,7 @@
 #include "lldb/DataFormatters/CoreMedia.h"
 
 #include "lldb/Core/Flags.h"
-#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/TypeSystem.h"
 #include "lldb/Target/Target.h"
 #include 
 
@@ -25,13 +25,13 @@ lldb_private::formatters::CMTimeSummaryP
 if (!type.IsValid())
 return false;
 
-ClangASTContext *ast_ctx = 
valobj.GetExecutionContextRef().GetTargetSP()->GetScratchClangASTContext();
-if (!ast_ctx)
+TypeSystem *type_system = 
valobj.GetExecutionContextRef().GetTargetSP()->GetTypeSystemForLanguage(lldb::eLanguageTypeC);
+if (!type_system)
 return false;
 
 // fetch children by offset to compensate for potential lack of debug info
-auto int64_ty = ast_ctx->GetIntTypeFromBitSize(64, true);
-auto int32_ty = ast_ctx->GetIntTypeFromBitSize(32, true);
+auto int64_ty = type_system->GetIntTypeFromBitSize(64, true);
+auto int32_ty = type_system->GetIntTypeFromBitSize(32, true);
 
 auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true));
 auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true));

Modified: lldb/trunk/source/DataFormatters/VectorType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247082&r1=247081&r2=247082&view=diff
=

[Lldb-commits] [lldb] r247112 - Data formatter candidate matches can be generated in a number of ways; language-based dynamic type discovery being one of them (for instance, this is what takes an 'id'

2015-09-08 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  8 20:10:46 2015
New Revision: 247112

URL: http://llvm.org/viewvc/llvm-project?rev=247112&view=rev
Log:
Data formatter candidate matches can be generated in a number of ways; 
language-based dynamic type discovery being one of them (for instance, this is 
what takes an 'id' and discovers that it truly is an __NSArrayI, so it should 
probably use the NSArray formatter)

This used to be hardcoded in the FormatManager, but in a pluginized world that 
is not the right way to go

So, move this step to the Language plugin such that appropriate language 
plugins for a type get a say about adding candidates to the formatters lookup 
tables


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/lldb-private-enumerations.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Tue Sep  8 20:10:46 
2015
@@ -264,6 +264,9 @@ public:
 
 private:
 
+static std::vector
+GetCandidateLanguages (ValueObject& valobj);
+
 static void
 GetPossibleMatches (ValueObject& valobj,
 CompilerType clang_type,

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Tue Sep  8 20:10:46 2015
@@ -13,6 +13,7 @@
 // C Includes
 // C++ Includes
 #include 
+#include 
 
 // Other libraries and framework includes
 // Project includes
@@ -22,11 +23,10 @@
 
 namespace lldb_private {
 
-class Language :
-public PluginInterface
-{
-public:
-
+class Language :
+public PluginInterface
+{
+public:
 ~Language() override;
 
 static Language*
@@ -42,6 +42,9 @@ namespace lldb_private {
 virtual lldb::TypeCategoryImplSP
 GetFormatters ();
 
+virtual std::vector
+GetPossibleFormattersMatches (ValueObject& valobj, lldb::DynamicValueType 
use_dynamic);
+
 // These are accessors for general information about the Languages lldb 
knows about:
 
 static lldb::LanguageType
@@ -70,16 +73,16 @@ namespace lldb_private {
 LanguageIsPascal (lldb::LanguageType language);
 
 
-protected:
-//--
-// Classes that inherit from Language can see and modify these
-//--
-
-Language();
-private:
-
-DISALLOW_COPY_AND_ASSIGN (Language);
-};
+protected:
+//--
+// Classes that inherit from Language can see and modify these
+//--
+
+Language();
+private:
+
+DISALLOW_COPY_AND_ASSIGN (Language);
+};
 
 } // namespace lldb_private
 

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Tue Sep  8 20:10:46 2015
@@ -188,7 +188,7 @@ typedef enum FormatterChoiceCriterion
 eFormatterChoiceCriterionNavigatedTypedefs = 0x0002,
 eFormatterChoiceCriterionRegularExpressionSummary =  0x0004,
 eFormatterChoiceCriterionRegularExpressionFilter =   0x0004,
-eFormatterChoiceCriterionDynamicObjCDiscovery =  0x0008,
+eFormatterChoiceCriterionLanguagePlugin =0x0008,
 eFormatterChoiceCriterionStrippedBitField =  0x0010,
 eFormatterChoiceCriterionWentToStaticValue = 0x0020
 } FormatterChoiceCriterion;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/source/DataFo

Re: [Lldb-commits] TestFormattersBoolRefPtr.py on OSX

2015-09-09 Thread Enrico Granata via lldb-commits

> On Sep 9, 2015, at 5:10 AM, Tamas Berghammer  wrote:
> 
> Hi Enrico,
> 
> TestFormattersBoolRefPtr.py started to fail on the OSX buildbot. I think the 
> first build where it is failed is 
> http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/5522 
> , but 
> I am not sure as the bot is a bit unreliable. Can you take a look for it, or 
> if not, then are you fine with XFAIL-ing it until it get fixed?
> 
> Thanks,
> Tamas


This test seems to pass fine on a ToT checkout for me, and the bot seems to 
just say the test failed with no log of the issue. Do you mind providing a log 
if you have one available?

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


Re: [Lldb-commits] TestFormattersBoolRefPtr.py on OSX

2015-09-09 Thread Enrico Granata via lldb-commits

> On Sep 9, 2015, at 11:19 AM, Tamas Berghammer  wrote:
> 
> I attached the log for the failure (come from the build bot).
> 
> About the double reporting, I seen it on one of the build bot, but we have 
> some case when 2 different test have the same name what can explain the issue 
> (e.g. TestFormattersBoolRefPtr)
> 
> Tamas
> 
> On Wed, Sep 9, 2015 at 6:54 PM Zachary Turner  <mailto:ztur...@google.com>> wrote:
> +Todd just in case this is related to his changes.  We were seeing 1 or 2 
> test failures double reporting on Windows after the patch, so I'm not sure if 
> it could be related.
> 
> On Wed, Sep 9, 2015 at 10:37 AM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> 
>> On Sep 9, 2015, at 5:10 AM, Tamas Berghammer > <mailto:tbergham...@google.com>> wrote:
>> 
>> Hi Enrico,
>> 
>> TestFormattersBoolRefPtr.py started to fail on the OSX buildbot. I think the 
>> first build where it is failed is 
>> http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/5522 
>> <http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/5522>, but 
>> I am not sure as the bot is a bit unreliable. Can you take a look for it, or 
>> if not, then are you fine with XFAIL-ing it until it get fixed?
>> 
>> Thanks,
>> Tamas
> 
> 
> This test seems to pass fine on a ToT checkout for me, and the bot seems to 
> just say the test failed with no log of the issue. Do you mind providing a 
> log if you have one available?
> 
> Thanks,
> - Enrico
> 📩 egranata@.com ☎️ 27683
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org <mailto:lldb-commits@lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits>
> 


We failed to set the breakpoint:
Traceback (most recent call last):
  File "/Users/lldb_build/lldbSlave/buildDir/lldb/test/lldbtest.py", line 551, 
in wrapper
return func(self, *args, **kwargs)
  File 
"/Users/lldb_build/lldbSlave/buildDir/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py",
 line 28, in test_boolrefptr_with_dwarf_and_run_command
self.boolrefptr_data_formatter_commands()
  File 
"/Users/lldb_build/lldbSlave/buildDir/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py",
 line 40, in boolrefptr_data_formatter_commands
lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, 
num_expected_locations=1, loc_exact=True)
  File "/Users/lldb_build/lldbSlave/buildDir/lldb/test/lldbutil.py", line 326, 
in run_break_set_by_file_and_line
check_breakpoint_result (test, break_results, 
num_locations=num_expected_locations, file_name = file_name, line_number = 
line_number, module_name=module_name)
  File "/Users/lldb_build/lldbSlave/buildDir/lldb/test/lldbutil.py", line 460, 
in check_breakpoint_result
test.assertTrue (num_locations == out_num_locations, "Expecting %d 
locations, got %d."%(num_locations, out_num_locations))
AssertionError: False is not True : Expecting 1 locations, got 0.
Config=x86_64-clang
Session info generated @ Wed Sep  9 10:52:45 2015
To rerun this test, issue the following command from the 'test' directory:

Was the compiler on the buildbot updated around when this started happening?

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r247189 - Preparatory work for letting language plugins help the StringPrinter with formatting special characters

2015-09-09 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep  9 15:59:49 2015
New Revision: 247189

URL: http://llvm.org/viewvc/llvm-project?rev=247189&view=rev
Log:
Preparatory work for letting language plugins help the StringPrinter with 
formatting special characters


Modified:
lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/Cocoa.cpp
lldb/trunk/source/DataFormatters/StringPrinter.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=247189&r1=247188&r2=247189&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Wed Sep  9 15:59:49 
2015
@@ -14,6 +14,8 @@
 
 #include "lldb/Core/DataExtractor.h"
 
+#include 
+
 namespace lldb_private {
 namespace formatters
 {
@@ -308,13 +310,99 @@ namespace lldb_private {
 bool m_zero_is_terminator;
 };
 
-template 
-bool
-ReadStringAndDumpToStream (const ReadStringAndDumpToStreamOptions& 
options);
-
-template 
-bool
-ReadBufferAndDumpToStream (const ReadBufferAndDumpToStreamOptions& 
options);
+class StringPrinter
+{
+public:
+// I can't use a std::unique_ptr for this because the Deleter is a 
template argument there
+// and I want the same type to represent both pointers I want to 
free and pointers I don't need
+// to free - which is what this class essentially is
+// It's very specialized to the needs of this file, and not 
suggested for general use
+template 
+struct StringPrinterBufferPointer
+{
+public:
+
+typedef std::function Deleter;
+
+StringPrinterBufferPointer (std::nullptr_t ptr) :
+m_data(nullptr),
+m_size(0),
+m_deleter()
+{}
+
+StringPrinterBufferPointer(const T* bytes, S size, Deleter 
deleter = nullptr) :
+m_data(bytes),
+m_size(size),
+m_deleter(deleter)
+{}
+
+StringPrinterBufferPointer(const U* bytes, S size, Deleter 
deleter = nullptr) :
+m_data((T*)bytes),
+m_size(size),
+m_deleter(deleter)
+{}
+
+StringPrinterBufferPointer(StringPrinterBufferPointer&& rhs) :
+m_data(rhs.m_data),
+m_size(rhs.m_size),
+m_deleter(rhs.m_deleter)
+{
+rhs.m_data = nullptr;
+}
+
+StringPrinterBufferPointer(const StringPrinterBufferPointer& 
rhs) :
+m_data(rhs.m_data),
+m_size(rhs.m_size),
+m_deleter(rhs.m_deleter)
+{
+rhs.m_data = nullptr; // this is why m_data has to be 
mutable
+}
+
+const T*
+GetBytes () const
+{
+return m_data;
+}
+
+const S
+GetSize () const
+{
+return m_size;
+}
+
+~StringPrinterBufferPointer ()
+{
+if (m_data && m_deleter)
+m_deleter(m_data);
+m_data = nullptr;
+}
+
+StringPrinterBufferPointer&
+operator = (const StringPrinterBufferPointer& rhs)
+{
+if (m_data && m_deleter)
+m_deleter(m_data);
+m_data = rhs.m_data;
+m_size = rhs.m_size;
+m_deleter = rhs.m_deleter;
+rhs.m_data = nullptr;
+return *this;
+}
+
+private:
+mutable const T* m_data;
+size_t m_size;
+Deleter m_deleter;
+};
+
+template 
+static bool
+ReadStringAndDumpToStream (const ReadStringAndDumpToStreamOptions& 
options);
+
+template 
+static bool
+ReadBufferAndDumpToStream (const ReadBufferAndDumpToStreamOptions& 
options);
+};
 
 } // namespace formatters
 } // namespace lldb_private

Modified:

Re: [Lldb-commits] [lldb] r247082 - Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness

2015-09-09 Thread Enrico Granata via lldb-commits

> On Sep 9, 2015, at 2:47 PM, Ryan Brown  wrote:
> 
> 
> On Tue, Sep 8, 2015 at 3:10 PM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: enrico
> Date: Tue Sep  8 17:09:19 2015
> New Revision: 247082
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=247082&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=247082&view=rev>
> Log:
> Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers 
> on the TypeSystem to get numeric types of specific sizes and signedness
> 
> Modified:
> lldb/trunk/include/lldb/Symbol/ClangASTContext.h
> lldb/trunk/include/lldb/Symbol/TypeSystem.h
> lldb/trunk/include/lldb/Target/Target.h
> lldb/trunk/source/DataFormatters/CoreMedia.cpp
> lldb/trunk/source/DataFormatters/VectorType.cpp
> lldb/trunk/source/Target/Target.cpp
> 
> Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff>
> ==
> --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
> +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 17:09:19 2015
> @@ -454,7 +454,7 @@ public:
>  //--
> 
>  CompilerType
> -GetIntTypeFromBitSize (size_t bit_size, bool is_signed)
> +GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override
>  {
>  return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);
>  }
> @@ -477,7 +477,7 @@ public:
>  //--
> 
>  CompilerType
> -GetFloatTypeFromBitSize (size_t bit_size)
> +GetFloatTypeFromBitSize (size_t bit_size) override
>  {
>  return GetFloatTypeFromBitSize (getASTContext(), bit_size);
>  }
> 
> Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff>
> ==
> --- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
> +++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 17:09:19 2015
> @@ -400,6 +400,12 @@ public:
>  virtual CompilerType
>  GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;
> 
> +virtual CompilerType
> +GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;
> +
> +virtual CompilerType
> +GetFloatTypeFromBitSize (size_t bit_size) = 0;
> +
> 
> Why do these need to be here?

They are convenient to have when you are not transacting in terms of “int” or 
“float” but in terms of “I want a type that can represent a 32-bit unsigned 
integer value"

> It seems like everything using these is clang specific.

That might be because at the moment open-source LLDB does not have fully-baked 
type systems for non-clang languages
I suspect that most languages have a notion of numeric types of a certain 
bit-size and signedness, so the API itself is not clang-specific whatsoever

>  
>  virtual bool
>  IsBeingDefined (void *type) = 0;
> 
> 
> Modified: lldb/trunk/include/lldb/Target/Target.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff>
> ==
> --- lldb/trunk/include/lldb/Target/Target.h (original)
> +++ lldb/trunk/include/lldb/Target/Target.h Tue Sep  8 17:09:19 2015
> @@ -1230,6 +1230,14 @@ public:
>  ClangASTContext *
>  GetScratchClangASTContext(bool create_on_demand=true);
> 
> +TypeSystem*
> +GetTypeSystemForLanguage (lldb::LanguageType language);
> +
> +CompilerType
> +GetBasicType (lldb::LanguageType language,
> +  lldb::BasicType basic_type,
> +  size_t size = 0);
> +

I am not sure the latter API (Target::GetBasicType) even needs to be there - my 
bad for checking that in
The former one (Target::GetTypeSystemForLanguage) is what I 

[Lldb-commits] [lldb] r247195 - Remove Target::GetBasicType()

2015-09-09 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep  9 17:00:18 2015
New Revision: 247195

URL: http://llvm.org/viewvc/llvm-project?rev=247195&view=rev
Log:
Remove Target::GetBasicType()
I was experimenting with it briefly, and then settled on Target::GetTypeSystem 
+ TypeSystem::GetBasicType, so this API is not necessary to have

Thanks to Ryan Brown for bringing it to my attention


Modified:
lldb/trunk/include/lldb/Target/Target.h

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247195&r1=247194&r2=247195&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Wed Sep  9 17:00:18 2015
@@ -1233,11 +1233,6 @@ public:
 TypeSystem*
 GetTypeSystemForLanguage (lldb::LanguageType language);
 
-CompilerType
-GetBasicType (lldb::LanguageType language,
-  lldb::BasicType basic_type,
-  size_t size = 0);
-
 ClangASTImporter *
 GetClangASTImporter();
 


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


[Lldb-commits] [lldb] r247200 - Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape help

2015-09-09 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep  9 17:30:24 2015
New Revision: 247200

URL: http://llvm.org/viewvc/llvm-project?rev=247200&view=rev
Log:
Introduce the notion of an escape helper. Different languages have different 
notion of what to print in a string and how to escape non-printable things. The 
escape helper is where this notion is provided to LLDB

This is NFC, other than a code re-org


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/Cocoa.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/StringPrinter.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247200&r1=247199&r2=247200&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Wed Sep  9 17:30:24 
2015
@@ -262,6 +262,9 @@ public:
 LanguageCategory*
 GetCategoryForLanguage (lldb::LanguageType lang_type);
 
+static std::vector
+GetCandidateLanguages (lldb::LanguageType lang_type);
+
 private:
 
 static std::vector

Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=247200&r1=247199&r2=247200&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Wed Sep  9 17:30:24 
2015
@@ -19,300 +19,339 @@
 namespace lldb_private {
 namespace formatters
 {
-
-enum class StringElementType {
-ASCII,
-UTF8,
-UTF16,
-UTF32
-};
-
-class ReadStringAndDumpToStreamOptions
-{
-public:
-
-ReadStringAndDumpToStreamOptions () :
-m_location(0),
-m_process_sp(),
-m_stream(NULL),
-m_prefix_token(0),
-m_quote('"'),
-m_source_size(0),
-m_needs_zero_termination(true),
-m_escape_non_printables(true),
-m_ignore_max_length(false),
-m_zero_is_terminator(true)
-{
-}
-
-ReadStringAndDumpToStreamOptions (ValueObject& valobj);
-
-ReadStringAndDumpToStreamOptions&
-SetLocation (uint64_t l)
-{
-m_location = l;
-return *this;
-}
-
-uint64_t
-GetLocation () const
-{
-return m_location;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetProcessSP (lldb::ProcessSP p)
-{
-m_process_sp = p;
-return *this;
-}
-
-lldb::ProcessSP
-GetProcessSP () const
-{
-return m_process_sp;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetStream (Stream* s)
-{
-m_stream = s;
-return *this;
-}
-
-Stream*
-GetStream () const
-{
-return m_stream;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetPrefixToken (char p)
-{
-m_prefix_token = p;
-return *this;
-}
-
-char
-GetPrefixToken () const
-{
-return m_prefix_token;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetQuote (char q)
-{
-m_quote = q;
-return *this;
-}
-
-char
-GetQuote () const
-{
-return m_quote;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetSourceSize (uint32_t s)
-{
-m_source_size = s;
-return *this;
-}
-
-uint32_t
-GetSourceSize () const
-{
-return m_source_size;
-}
-
-ReadStringAndDumpToStreamOptions&
-SetNeedsZeroTermination (bool z)
-{
-m_

Re: [Lldb-commits] [lldb] r247082 - Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness

2015-09-10 Thread Enrico Granata via lldb-commits

> On Sep 9, 2015, at 3:58 PM, Ryan Brown  wrote:
> 
> 
> 
> On Wed, Sep 9, 2015 at 2:57 PM Enrico Granata  <mailto:egran...@apple.com>> wrote:
>> On Sep 9, 2015, at 2:47 PM, Ryan Brown > <mailto:rib...@google.com>> wrote:
>> 
>> 
>> On Tue, Sep 8, 2015 at 3:10 PM Enrico Granata via lldb-commits 
>> mailto:lldb-commits@lists.llvm.org>> wrote:
>> Author: enrico
>> Date: Tue Sep  8 17:09:19 2015
>> New Revision: 247082
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=247082&view=rev 
>> <http://llvm.org/viewvc/llvm-project?rev=247082&view=rev>
>> Log:
>> Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers 
>> on the TypeSystem to get numeric types of specific sizes and signedness
>> 
>> Modified:
>> lldb/trunk/include/lldb/Symbol/ClangASTContext.h
>> lldb/trunk/include/lldb/Symbol/TypeSystem.h
>> lldb/trunk/include/lldb/Target/Target.h
>> lldb/trunk/source/DataFormatters/CoreMedia.cpp
>> lldb/trunk/source/DataFormatters/VectorType.cpp
>> lldb/trunk/source/Target/Target.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff
>>  
>> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff>
>> ==
>> --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
>> +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 17:09:19 2015
>> @@ -454,7 +454,7 @@ public:
>>  //--
>> 
>>  CompilerType
>> -GetIntTypeFromBitSize (size_t bit_size, bool is_signed)
>> +GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override
>>  {
>>  return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);
>>  }
>> @@ -477,7 +477,7 @@ public:
>>  //--
>> 
>>  CompilerType
>> -GetFloatTypeFromBitSize (size_t bit_size)
>> +GetFloatTypeFromBitSize (size_t bit_size) override
>>  {
>>  return GetFloatTypeFromBitSize (getASTContext(), bit_size);
>>  }
>> 
>> Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff
>>  
>> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff>
>> ==
>> --- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
>> +++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 17:09:19 2015
>> @@ -400,6 +400,12 @@ public:
>>  virtual CompilerType
>>  GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;
>> 
>> +virtual CompilerType
>> +GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;
>> +
>> +virtual CompilerType
>> +GetFloatTypeFromBitSize (size_t bit_size) = 0;
>> +
>> 
>> Why do these need to be here?
> 
> They are convenient to have when you are not transacting in terms of “int” or 
> “float” but in terms of “I want a type that can represent a 32-bit unsigned 
> integer value"
> 
>> It seems like everything using these is clang specific.
> 
> That might be because at the moment open-source LLDB does not have 
> fully-baked type systems for non-clang languages
> I suspect that most languages have a notion of numeric types of a certain 
> bit-size and signedness, so the API itself is not clang-specific whatsoever
> 
> I ask because I'm trying to add another TypeSystem.
> I could implement these, but I don't really like adding functionality that  
> isn't used and that I don't really have any way to test.
>  

Returning a nullptr TypeSystem and hollow CompilerTypes is fine if you’re not 
going to make any use of these

>>  virtual bool
>>  IsBeingDefined (void *type) = 0;
>> 
>> 
>> Modified: lldb/trunk/include/lldb/Target/Target.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff
>> 

[Lldb-commits] [lldb] r247727 - Teach the ObjC data formatters to use the correct language when printing strings

2015-09-15 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 15 17:11:20 2015
New Revision: 247727

URL: http://llvm.org/viewvc/llvm-project?rev=247727&view=rev
Log:
Teach the ObjC data formatters to use the correct language when printing strings


Modified:
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp

Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=247727&r1=247726&r2=247727&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Tue Sep 15 17:11:20 2015
@@ -876,6 +876,7 @@ lldb_private::formatters::NSStringSummar
 options.SetNeedsZeroTermination(false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
 options.SetBinaryZeroIsTerminator(false);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream(options);
 }
 else
@@ -889,6 +890,7 @@ lldb_private::formatters::NSStringSummar
 options.SetNeedsZeroTermination(false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
 options.SetBinaryZeroIsTerminator(false);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream(options);
 }
 }
@@ -904,6 +906,7 @@ lldb_private::formatters::NSStringSummar
 options.SetQuote('"');
 options.SetSourceSize(explicit_length);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream
 (options);
 }
 else if (is_unicode)
@@ -935,6 +938,7 @@ lldb_private::formatters::NSStringSummar
 options.SetNeedsZeroTermination(has_explicit_length == false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
 options.SetBinaryZeroIsTerminator(has_explicit_length == false);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream
 (options);
 }
 else if (is_path_store)
@@ -953,6 +957,7 @@ lldb_private::formatters::NSStringSummar
 options.SetNeedsZeroTermination(has_explicit_length == false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
 options.SetBinaryZeroIsTerminator(has_explicit_length == false);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream
 (options);
 }
 else if (is_inline)
@@ -979,6 +984,7 @@ lldb_private::formatters::NSStringSummar
 options.SetNeedsZeroTermination(!has_explicit_length);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
 options.SetBinaryZeroIsTerminator(!has_explicit_length);
+options.SetLanguage(summary_options.GetLanguage());
 if (has_explicit_length)
 return 
StringPrinter::ReadStringAndDumpToStream(options);
 else
@@ -999,6 +1005,7 @@ lldb_private::formatters::NSStringSummar
 options.SetStream(&stream);
 options.SetSourceSize(explicit_length);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetLanguage(summary_options.GetLanguage());
 return 
StringPrinter::ReadStringAndDumpToStream(options);
 }
 }


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


[Lldb-commits] [lldb] r247831 - Move hardcoded formatters from the FormatManager to the Language plugins

2015-09-16 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 16 13:28:11 2015
New Revision: 247831

URL: http://llvm.org/viewvc/llvm-project?rev=247831&view=rev
Log:
Move hardcoded formatters from the FormatManager to the Language plugins


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatClasses.h
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/LanguageCategory.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatClasses.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatClasses.h?rev=247831&r1=247830&r2=247831&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatClasses.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatClasses.h Wed Sep 16 13:28:11 
2015
@@ -19,12 +19,31 @@
 // Project includes
 #include "lldb/lldb-public.h"
 #include "lldb/lldb-enumerations.h"
-
+#include "lldb/DataFormatters/TypeFormat.h"
+#include "lldb/DataFormatters/TypeSummary.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
+#include "lldb/DataFormatters/TypeValidator.h"
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Symbol/Type.h"
 
 namespace lldb_private {
 
+class HardcodedFormatters {
+public:
+template 
+using HardcodedFormatterFinder = std::function;
+
+template 
+using HardcodedFormatterFinders = 
std::vector>;
+
+typedef HardcodedFormatterFinders HardcodedFormatFinder;
+typedef HardcodedFormatterFinders HardcodedSummaryFinder;
+typedef HardcodedFormatterFinders 
HardcodedSyntheticFinder;
+typedef HardcodedFormatterFinders 
HardcodedValidatorFinder;
+};
+
 class FormattersMatchCandidate
 {
 public:

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247831&r1=247830&r2=247831&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Wed Sep 16 13:28:11 
2015
@@ -44,14 +44,6 @@ class FormatManager : public IFormatChan
 typedef TypeCategoryMap::MapType::iterator CategoryMapIterator;
 public:
 
-template 
-using HardcodedFormatterFinder = std::function;
-
-template 
-using HardcodedFormatterFinders = 
std::vector>;
-
 typedef std::map 
LanguageCategories;
 
 typedef TypeCategoryMap::CallbackType CategoryCallback;
@@ -292,11 +284,6 @@ private:
 ConstString m_system_category_name;
 ConstString m_vectortypes_category_name;
 
-HardcodedFormatterFinders m_hardcoded_formats;
-HardcodedFormatterFinders m_hardcoded_summaries;
-HardcodedFormatterFinders m_hardcoded_synthetics;
-HardcodedFormatterFinders m_hardcoded_validators;
-
 lldb::TypeFormatImplSP
 GetHardcodedFormat (ValueObject&,lldb::DynamicValueType);
 
@@ -325,9 +312,6 @@ private:
 
 void
 LoadVectorFormatters ();
-
-void
-LoadHardcodedFormatters ();
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=247831&r1=247830&r2=247831&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Wed Sep 16 
13:28:11 2015
@@ -53,6 +53,30 @@ public:
  lldb::DynamicValueType dynamic,
  FormattersMatchVector matches,
  lldb::TypeValidatorImplSP& format_sp);
+
+bool
+GetHardcoded (ValueObject& valobj,
+  lldb::DynamicValueType use_dynamic,
+  FormatManager& fmt_mgr,
+  lldb::TypeFormatImplSP& format_sp);
+
+bool
+GetHardcoded (ValueObject& valobj,
+  lldb::DynamicValueType use_dynamic,
+  FormatManager& fmt_mgr,
+  lldb::TypeSummaryImplSP& format_sp);
+
+bool
+GetHardcoded (ValueObject& valobj,
+  lldb::DynamicValueType use_dynamic,
+  FormatManager& fmt_mgr,
+  lldb::SyntheticChildrenSP& format_sp);
+
+bool
+GetHardcoded (ValueObject& valobj,
+  lldb::DynamicValueType use_dynamic,
+  FormatManager& fmt_mgr,
+  lldb::TypeValidatorImplSP& format_sp);
 
 lldb::TypeCategoryImplSP
 GetCategor

[Lldb-commits] [lldb] r247872 - Add the ability for formatter categories to be bound to one or more languages

2015-09-16 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 16 19:14:50 2015
New Revision: 247872

URL: http://llvm.org/viewvc/llvm-project?rev=247872&view=rev
Log:
Add the ability for formatter categories to be bound to one or more languages

What that does is it restricts formatters in those categories to only match to 
types coming from "compatible" source languages


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/DataFormatters/DataVisualization.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
lldb/trunk/source/DataFormatters/TypeCategory.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp

lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247872&r1=247871&r2=247872&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Wed Sep 16 19:14:50 
2015
@@ -60,8 +60,33 @@ public:
 EnableCategory (const ConstString& category_name,
 TypeCategoryMap::Position pos = TypeCategoryMap::Default)
 {
-m_categories_map.Enable(category_name,
-pos);
+EnableCategory(category_name,
+   pos,
+   std::initializer_list());
+}
+
+void
+EnableCategory (const ConstString& category_name,
+TypeCategoryMap::Position pos,
+lldb::LanguageType lang)
+{
+EnableCategory(category_name,
+   pos,
+   {lang});
+}
+
+void
+EnableCategory (const ConstString& category_name,
+TypeCategoryMap::Position pos = TypeCategoryMap::Default,
+std::initializer_list langs = {})
+{
+TypeCategoryMap::ValueSP category_sp;
+if (m_categories_map.Get(category_name, category_sp) && category_sp)
+{
+m_categories_map.Enable(category_sp, pos);
+for (const lldb::LanguageType lang : langs)
+category_sp->AddLanguage(lang);
+}
 }
 
 void

Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=247872&r1=247871&r2=247872&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Wed Sep 16 
19:14:50 2015
@@ -32,6 +32,12 @@ namespace lldb_private {
bool regex = false);
 
 void
+AddSummary(TypeCategoryImpl::SharedPointer category_sp,
+   lldb::TypeSummaryImplSP summary_sp,
+   ConstString type_name,
+   bool regex = false);
+
+void
 AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,
  const char* string,
  ConstString type_name,

Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=247872&r1=247871&r2=247872&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Wed Sep 16 19:14:50 
2015
@@ -99,7 +99,8 @@ namespace lldb_private {
 typedef ValidatorContainer::RegexMatchContainerSP 
RegexValidatorContainerSP;
 
 TypeCategoryImpl (IFormatChangeListener* clist,
-  ConstString name);
+  ConstString name,
+  std::initializer_list langs = 
{});
 
 FormatContainerSP
 GetTypeFormatsContainer ()
@@ -264,6 +265,21 @@ namespace lldb_private {
 {
 return m_name.GetCString();
 }
+
+size_t
+GetNumLanguages ();
+
+lldb::LanguageType
+GetLanguageAtIndex (size_t idx);
+
+void
+AddLanguage (lldb::LanguageType lang);
+
+bool
+HasLanguage (lldb::LanguageType lang);
+
+std::string
+GetDescription ();
 
 bool

[Lldb-commits] [lldb] r247875 - Visual Studio seems to consider this invocation ambiguous. Try to clarify what I mean

2015-09-16 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 16 20:13:12 2015
New Revision: 247875

URL: http://llvm.org/viewvc/llvm-project?rev=247875&view=rev
Log:
Visual Studio seems to consider this invocation ambiguous. Try to clarify what 
I mean

Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247875&r1=247874&r2=247875&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Wed Sep 16 20:13:12 
2015
@@ -70,9 +70,10 @@ public:
 TypeCategoryMap::Position pos,
 lldb::LanguageType lang)
 {
+std::initializer_list langs = {lang};
 EnableCategory(category_name,
pos,
-   {lang});
+   langs);
 }
 
 void


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


Re: [Lldb-commits] [PATCH] D12929: Remove unused includes from clang in DataFormatters.

2015-09-17 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

I am assuming you built this successfully.

If so, then yes please commit, it's a good change!


http://reviews.llvm.org/D12929



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


Re: [Lldb-commits] [PATCH] D12930: DataFormatters: Rename clang_type to compiler_type.

2015-09-17 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Fine by me


http://reviews.llvm.org/D12930



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


[Lldb-commits] [lldb] r247957 - Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType

2015-09-17 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep 17 17:56:38 2015
New Revision: 247957

URL: http://llvm.org/viewvc/llvm-project?rev=247957&view=rev
Log:
Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType

For C++ and ObjC, dynamic values are always (at least somewhat) pointer-like in 
nature, so a ValueType of scalar is actually good enough that it could 
originally be hardcoded as the right choice
Other languages, might have broader notions of things that are dynamic (e.g. a 
language where a value type can be dynamic). In those cases, it might actually 
be the case that a dynamic value is a pointer-to the data, or even a host 
address if dynamic expression results entirely in host space are being talked 
about

This patch enables the language runtime to make that decision, and makes 
ValueObjectDynamicValue comply with it


Modified:
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h

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

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

Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=247957&r1=247956&r2=247957&view=diff
==
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Thu Sep 17 17:56:38 2015
@@ -52,7 +52,8 @@ public:
 GetDynamicTypeAndAddress (ValueObject &in_value, 
   lldb::DynamicValueType use_dynamic, 
   TypeAndOrName &class_type_or_name, 
-  Address &address) = 0;
+  Address &address,
+  Value::ValueType &value_type) = 0;
 
 // This should be a fast test to determine whether it is likely that this 
value would
 // have a dynamic type.

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=247957&r1=247956&r2=247957&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Thu Sep 17 17:56:38 2015
@@ -210,25 +210,26 @@ ValueObjectDynamicValue::UpdateValue ()
 TypeAndOrName class_type_or_name;
 Address dynamic_address;
 bool found_dynamic_type = false;
+Value::ValueType value_type;
 
 lldb::LanguageType known_type = m_parent->GetObjectRuntimeLanguage();
 if (known_type != lldb::eLanguageTypeUnknown && known_type != 
lldb::eLanguageTypeC)
 {
 LanguageRuntime *runtime = process->GetLanguageRuntime (known_type);
 if (runtime)
-found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, 
m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, 
m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 }
 else
 {
 LanguageRuntime *cpp_runtime = process->GetLanguageRuntime 
(lldb::eLanguageTypeC_plus_plus);
 if (cpp_runtime)
-found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 
 if (!found_dynamic_type)
 {
 LanguageRuntime *objc_runtime = process->GetLanguageRuntime 
(lldb::eLanguageTypeObjC);
 if (objc_runtime)
-found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 }
 }
 
@@ -305,9 +306,7 @@ ValueObjectDynamicValue::UpdateValue ()

[Lldb-commits] [lldb] r248028 - Make libc++ tests skip themselves if libc++ is not actually loaded in the target

2015-09-18 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Sep 18 15:12:52 2015
New Revision: 248028

URL: http://llvm.org/viewvc/llvm-project?rev=248028&view=rev
Log:
Make libc++ tests skip themselves if libc++ is not actually loaded in the target


Modified:

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
lldb/trunk/test/lldbutil.py

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=248028&r1=248027&r2=248028&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
 Fri Sep 18 15:12:52 2015
@@ -36,6 +36,8 @@ class InitializerListTestCase(TestBase):
 """Test that that file and class static variables display correctly."""
 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
+lldbutil.skip_if_library_missing(self, self.target(), 
lldbutil.PrintableRegex("libc\+\+"))
+
 bkpt = 
self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, 
"Set break point at this line."))
 
 self.runCmd("run", RUN_SUCCEEDED)

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=248028&r1=248027&r2=248028&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
 Fri Sep 18 15:12:52 2015
@@ -37,6 +37,8 @@ class LibcxxIteratorDataFormatterTestCas
 """Test that libc++ iterators format properly."""
 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
+lldbutil.skip_if_library_missing(self, self.target(), 
lldbutil.PrintableRegex("libc\+\+"))
+
 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, 
num_expected_locations=-1)
 
 self.runCmd("run", RUN_SUCCEEDED)

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=248028&r1=248027&r2=248028&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
 Fri Sep 18 15:12:52 2015
@@ -2,7 +2,7 @@
 Test lldb data formatter subsystem.
 """
 
-import os, time
+import os, time, re
 import unittest2
 import lldb
 from lldbtest import *
@@ -39,6 +39,8 @@ class LibcxxListDataFormatterTestCase(Te
 def data_formatter_commands(self):
 """Test that that file and class static variables display correctly."""
 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+lldbutil.skip_if_library_missing(self, self.target(), 
lldbutil.PrintableRegex("libc\+\+"))
 
 lldbutil.

[Lldb-commits] [lldb] r248057 - On Linux, if you can't actually locate the libc++ install, do not attempt to use it

2015-09-18 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Sep 18 17:26:34 2015
New Revision: 248057

URL: http://llvm.org/viewvc/llvm-project?rev=248057&view=rev
Log:
On Linux, if you can't actually locate the libc++ install, do not attempt to 
use it

The failure mode when one gets this wrong is quite gnarly to then walk oneself 
out of, and if you can't actually find the library, trying to build against it 
is fairly pointless anyway
This + my previous skip_if_library_missing change should make running the 
libc++ tests on a Linux machine without it much more seamless


Modified:
lldb/trunk/test/make/Makefile.rules

Modified: lldb/trunk/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=248057&r1=248056&r2=248057&view=diff
==
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Fri Sep 18 17:26:34 2015
@@ -284,12 +284,17 @@ endif
 ifeq (1,$(USE_LIBCPP))
# Clang requires an extra flag: -stdlib=libstdc++
ifneq (,$(findstring clang,$(CC)))
-   CXXFLAGS += -stdlib=libc++
-   LDFLAGS += -stdlib=libc++
ifeq "$(OS)" "Linux"
# This is the default install location on Ubuntu 14.04
-   CXXFLAGS += -I/usr/include/c++/v1
-   endif
+   ifneq ($(wildcard /usr/include/c++/v1/.),)
+   CXXFLAGS += -stdlib=libc++
+   LDFLAGS += -stdlib=libc++
+   CXXFLAGS += -I/usr/include/c++/v1
+   endif
+   else
+   CXXFLAGS += -stdlib=libc++
+   LDFLAGS += -stdlib=libc++
+   endif
endif
 endif
 


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


Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-09-22 Thread Enrico Granata via lldb-commits
granata.enrico added a subscriber: granata.enrico.
granata.enrico requested changes to this revision.
granata.enrico added a reviewer: granata.enrico.
granata.enrico added a comment.

Is there a reason to explicitly add an API to get the concatenation of value 
and summary?

We already have APIs to retrieve the pieces:

  const char *
  GetValue ();
  
  const char *
  GetSummary ();

We even already have an API to retrieve the summary in an SBStream:

  const char *
  GetSummary (lldb::SBStream& stream,
  lldb::SBTypeSummaryOptions& options);

Is there a reason why the MI can't just call these APIs and then process the 
results as it sees fit?


http://reviews.llvm.org/D13058



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


Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-09-22 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Gotcha!

My suggestion would be to add the DoesPrintValue() logic to SBTypeSummary. I 
can't recall if it's there already - but if not, it would be a fine thing to 
add. Then the MI could use SBValue and SBTypeSummary to make that determination 
as it sees fit.


http://reviews.llvm.org/D13058



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


[Lldb-commits] [lldb] r248315 - Move the logic to post-process dynamic types for ValueObject purposes from the ValueObjects to the LanguageRuntime plugins

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 14:45:52 2015
New Revision: 248315

URL: http://llvm.org/viewvc/llvm-project?rev=248315&view=rev
Log:
Move the logic to post-process dynamic types for ValueObject purposes from the 
ValueObjects to the LanguageRuntime plugins

This is meant to cover cases such as the obvious

Base *base = new Derived();

where GetDynamicTypeAndAddress(base) would return the type "Derived", not 
"Derived *"


Modified:
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

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

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

Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=248315&r1=248314&r2=248315&view=diff
==
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Tue Sep 22 14:45:52 2015
@@ -59,6 +59,14 @@ public:
 // have a dynamic type.
 virtual bool
 CouldHaveDynamicValue (ValueObject &in_value) = 0;
+
+// The contract for GetDynamicTypeAndAddress() is to return a "bare-bones" 
dynamic type
+// For instance, given a Base* pointer, GetDynamicTypeAndAddress() will 
return the type of
+// Derived, not Derived*. The job of this API is to correct this 
misalignment between the
+// static type and the discovered dynamic type
+virtual TypeAndOrName
+FixUpDynamicType(const TypeAndOrName& type_and_or_name,
+ const CompilerType& static_type) = 0;
 
 virtual void
 SetExceptionBreakpoints ()

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=248315&r1=248314&r2=248315&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Tue Sep 22 14:45:52 2015
@@ -138,40 +138,6 @@ ValueObjectDynamicValue::GetValueType()
 return m_parent->GetValueType();
 }
 
-
-static TypeAndOrName
-FixupTypeAndOrName (const TypeAndOrName& type_andor_name,
-ValueObject& parent)
-{
-TypeAndOrName ret(type_andor_name);
-if (type_andor_name.HasType())
-{
-// The type will always be the type of the dynamic object.  If our 
parent's type was a pointer,
-// then our type should be a pointer to the type of the dynamic 
object.  If a reference, then the original type
-// should be okay...
-CompilerType orig_type = type_andor_name.GetCompilerType();
-CompilerType corrected_type = orig_type;
-if (parent.IsPointerType())
-corrected_type = orig_type.GetPointerType ();
-else if (parent.IsPointerOrReferenceType())
-corrected_type = orig_type.GetLValueReferenceType();
-ret.SetCompilerType(corrected_type);
-}
-else /*if (m_dynamic_type_info.HasName())*/
-{
-// If we are here we need to adjust our dynamic type name to include 
the correct & or * symbol
-std::string corrected_name (type_andor_name.GetName().GetCString());
-if (parent.IsPointerType())
-corrected_name.append(" *");
-else if (parent.IsPointerOrReferenceType())
-corrected_name.append(" &");
-// the parent type should be a correctly pointer'ed or referenc'ed type
-ret.SetCompilerType(parent.GetCompilerType());
-ret.SetName(corrected_name.c_str());
-}
-return ret;
-}
-
 bool
 ValueObjectDynamicValue::UpdateValue ()
 {
@@ -211,25 +177,27 @@ ValueObjectDynamicValue::UpdateValue ()
 Address dynamic_address;
 bool found_dynamic_type = false;
 Value::ValueType value_type;
+
+LanguageRuntime *runtime = nullptr;
 
 lldb::LanguageType known_type = m_parent->GetObjectRuntimeLanguage();
 if (known_type != lldb::eLanguageTypeUnknown && known_type != 
lldb::eLanguageTypeC)
 {
-LanguageRuntime *runtime = process->GetLanguageRuntime (known_type);
+runtime = process->GetLanguageRuntime (known_type);
 if (runtime)
 found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, 
m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 }
 else
 {
-Langua

[Lldb-commits] [lldb] r248316 - On second thought, amend the previous patch to pass itself the ValueObject& for the static value instead of just its type

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 14:58:02 2015
New Revision: 248316

URL: http://llvm.org/viewvc/llvm-project?rev=248316&view=rev
Log:
On second thought, amend the previous patch to pass itself the ValueObject& for 
the static value instead of just its type


Modified:
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

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

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

Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=248316&r1=248315&r2=248316&view=diff
==
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Tue Sep 22 14:58:02 2015
@@ -65,8 +65,8 @@ public:
 // Derived, not Derived*. The job of this API is to correct this 
misalignment between the
 // static type and the discovered dynamic type
 virtual TypeAndOrName
-FixUpDynamicType(const TypeAndOrName& type_and_or_name,
- const CompilerType& static_type) = 0;
+FixUpDynamicType (const TypeAndOrName& type_and_or_name,
+  ValueObject& static_value) = 0;
 
 virtual void
 SetExceptionBreakpoints ()

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=248316&r1=248315&r2=248316&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Tue Sep 22 14:58:02 2015
@@ -211,7 +211,7 @@ ValueObjectDynamicValue::UpdateValue ()
 if (class_type_or_name.HasType())
 {
 m_type_impl = TypeImpl(m_parent->GetCompilerType(),
-   
runtime->FixUpDynamicType(class_type_or_name, 
m_parent->GetCompilerType()).GetCompilerType());
+   
runtime->FixUpDynamicType(class_type_or_name, *m_parent).GetCompilerType());
 }
 else
 {
@@ -271,7 +271,7 @@ ValueObjectDynamicValue::UpdateValue ()
 }
 
 if (runtime)
-m_dynamic_type_info = runtime->FixUpDynamicType(m_dynamic_type_info, 
m_parent->GetCompilerType());
+m_dynamic_type_info = runtime->FixUpDynamicType(m_dynamic_type_info, 
*m_parent);
 
 //m_value.SetContext (Value::eContextTypeClangType, corrected_type);
 m_value.SetCompilerType (m_dynamic_type_info.GetCompilerType());

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=248316&r1=248315&r2=248316&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 Tue Sep 22 14:58:02 2015
@@ -271,8 +271,10 @@ ItaniumABILanguageRuntime::GetDynamicTyp
 }
 
 TypeAndOrName
-ItaniumABILanguageRuntime::FixUpDynamicType(const TypeAndOrName& 
type_and_or_name, const CompilerType& static_type)
+ItaniumABILanguageRuntime::FixUpDynamicType(const TypeAndOrName& 
type_and_or_name,
+ValueObject& static_value)
 {
+CompilerType static_type(static_value.GetCompilerType());
 Flags static_type_flags(static_type.GetTypeInfo());
 
 TypeAndOrName ret(type_and_or_name);

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h?rev=248316&r1=248315&r2=248316&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
 Tue Sep 22 14:58:02 2015
@@ -42,8 +42,8 @@ namespace lldb_private {
   Value::ValueType &value_type);
   

[Lldb-commits] [lldb] r248338 - Move the "run" alias from process launch --shell to process launch --shell-expand-args when building on OS X

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 17:57:12 2015
New Revision: 248338

URL: http://llvm.org/viewvc/llvm-project?rev=248338&view=rev
Log:
Move the "run" alias from process launch --shell to process launch 
--shell-expand-args when building on OS X
The argdumper-based launching is more friendly to System Integrity Protection, 
and will work on older releases of OS X as well

Leave non-Apple builds alone


Modified:
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=248338&r1=248337&r2=248338&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Sep 22 17:57:12 
2015
@@ -352,11 +352,19 @@ CommandInterpreter::Initialize ()
 #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
 ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
 #else
+#if defined(__APPLE__)
+std::string shell_option;
+shell_option.append("--shell-expand-args");
+shell_option.append(" true");
+shell_option.append(" --");
+ProcessAliasOptionsArgs (cmd_obj_sp, shell_option.c_str(), 
alias_arguments_vector_sp);
+#else
 std::string shell_option;
 shell_option.append("--shell=");
 shell_option.append(HostInfo::GetDefaultShell().GetPath());
 shell_option.append(" --");
 ProcessAliasOptionsArgs (cmd_obj_sp, shell_option.c_str(), 
alias_arguments_vector_sp);
+#endif
 #endif
 AddAlias ("r", cmd_obj_sp);
 AddAlias ("run", cmd_obj_sp);


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


[Lldb-commits] [lldb] r248339 - Fix a test case which was failing. There was no actual problem in the test logic, just a cosmetic issue with the presentation of the result by Foundation

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 18:08:13 2015
New Revision: 248339

URL: http://llvm.org/viewvc/llvm-project?rev=248339&view=rev
Log:
Fix a test case which was failing. There was no actual problem in the test 
logic, just a cosmetic issue with the presentation of the result by Foundation

Modified:
lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py

Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py?rev=248339&r1=248338&r2=248339&view=diff
==
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py Tue Sep 22 
18:08:13 2015
@@ -212,7 +212,7 @@ class FoundationTestCase2(TestBase):
 
 self.runCmd("run", RUN_SUCCEEDED)
 
-self.expect("po [NSError errorWithDomain:@\"Hello\" code:35 
userInfo:nil]",
+self.expect('po [NSError errorWithDomain:@"Hello" code:35 
userInfo:@{@"NSDescription" : @"be completed."}]',
 substrs = ["Error Domain=Hello", "Code=35", "be completed."])
 self.runCmd("process continue")
 


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


[Lldb-commits] [lldb] r248359 - Add {TypeSystem|CompilerType}::GetTypeForFormatters()

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 20:39:46 2015
New Revision: 248359

URL: http://llvm.org/viewvc/llvm-project?rev=248359&view=rev
Log:
Add {TypeSystem|CompilerType}::GetTypeForFormatters()

Different type system may have different notions of attributes of a type that 
do not matter for data formatters matching purposes
For instance, in the case of clang types, we remove some qualifiers (e.g. 
"volatile") as it doesn't make much sense to differentiate volatile T from T in 
the data formatters

This new API allows each type system to generate, if needed, a type that does 
not have those unwanted attributes that the data formatters can then consume to 
generate matches


Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=248359&r1=248358&r2=248359&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep 22 20:39:46 2015
@@ -904,6 +904,9 @@ public:
  size_t idx,
  lldb::TemplateArgumentKind &kind) override;
 
+CompilerType
+GetTypeForFormatters (void* type) override;
+
 //--
 // Modifying RecordType
 //--

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=248359&r1=248358&r2=248359&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Tue Sep 22 20:39:46 2015
@@ -456,6 +456,9 @@ public:
 GetTemplateArgument (size_t idx,
  lldb::TemplateArgumentKind &kind) const;
 
+CompilerType
+GetTypeForFormatters () const;
+
 //--
 // Pointers & References
 //--

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=248359&r1=248358&r2=248359&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep 22 20:39:46 2015
@@ -504,6 +504,9 @@ public:
 return nullptr;
 }
 
+virtual CompilerType
+GetTypeForFormatters (void* type);
+
 protected:
 const LLVMCastKind m_kind; // Support for llvm casting
 SymbolFile *m_sym_file;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=248359&r1=248358&r2=248359&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep 22 20:39:46 2015
@@ -199,7 +199,7 @@ FormatManager::GetPossibleMatches (Value
bool did_strip_typedef,
bool root_level)
 {
-compiler_type = ClangASTContext::RemoveFastQualifiers(compiler_type);
+compiler_type = compiler_type.GetTypeForFormatters();
 ConstString type_name(compiler_type.GetConstTypeName());
 if (valobj.GetBitfieldBitSize() > 0)
 {

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=248359&r1=248358&r2=248359&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Sep 22 20:39:46 2015
@@ -6801,6 +6801,14 @@ ClangASTContext::GetTemplateArgument (ll
 return CompilerType ();
 }
 
+CompilerType
+ClangASTContext::GetTypeForFormatters (void* type)
+{
+if (type)
+return RemoveFastQualifiers(CompilerType(this, type));
+return CompilerType();
+}
+
 static bool
 IsOperator (const char *name, clang::OverloadedOperatorKind &op_kind)
 {

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?re

[Lldb-commits] [lldb] r248363 - Allow CompilerType to express a vote on whether oneliner printing should happen

2015-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep 22 21:04:34 2015
New Revision: 248363

URL: http://llvm.org/viewvc/llvm-project?rev=248363&view=rev
Log:
Allow CompilerType to express a vote on whether oneliner printing should happen


Modified:
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=248363&r1=248362&r2=248363&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Tue Sep 22 21:04:34 2015
@@ -459,6 +459,9 @@ public:
 CompilerType
 GetTypeForFormatters () const;
 
+LazyBool
+ShouldPrintAsOneLiner () const;
+
 //--
 // Pointers & References
 //--

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=248363&r1=248362&r2=248363&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep 22 21:04:34 2015
@@ -507,6 +507,9 @@ public:
 virtual CompilerType
 GetTypeForFormatters (void* type);
 
+virtual LazyBool
+ShouldPrintAsOneLiner (void* type);
+
 protected:
 const LLVMCastKind m_kind; // Support for llvm casting
 SymbolFile *m_sym_file;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=248363&r1=248362&r2=248363&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep 22 21:04:34 2015
@@ -558,6 +558,23 @@ FormatManager::ShouldPrintAsOneLiner (Va
 if (valobj.GetNumChildren() == 0)
 return false;
 
+// ask the type if it has any opinion about this
+// eLazyBoolCalculate == no opinion; other values should be self 
explanatory
+CompilerType compiler_type(valobj.GetCompilerType());
+if (compiler_type.IsValid())
+{
+switch (compiler_type.ShouldPrintAsOneLiner())
+{
+case eLazyBoolNo:
+return false;
+case eLazyBoolYes:
+return true;
+case eLazyBoolCalculate:
+default:
+break;
+}
+}
+
 size_t total_children_name_len = 0;
 
 for (size_t idx = 0;

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=248363&r1=248362&r2=248363&view=diff
==
--- lldb/trunk/source/Symbol/CompilerType.cpp (original)
+++ lldb/trunk/source/Symbol/CompilerType.cpp Tue Sep 22 21:04:34 2015
@@ -859,6 +859,14 @@ CompilerType::GetTypeForFormatters () co
 return CompilerType();
 }
 
+LazyBool
+CompilerType::ShouldPrintAsOneLiner () const
+{
+if (IsValid())
+return m_type_system->ShouldPrintAsOneLiner(m_type);
+return eLazyBoolCalculate;
+}
+
 // Get the index of the child of "clang_type" whose name matches. This function
 // doesn't descend into the children, but only looks one level deep and name
 // matches can include base class names.

Modified: lldb/trunk/source/Symbol/TypeSystem.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/TypeSystem.cpp?rev=248363&r1=248362&r2=248363&view=diff
==
--- lldb/trunk/source/Symbol/TypeSystem.cpp (original)
+++ lldb/trunk/source/Symbol/TypeSystem.cpp Tue Sep 22 21:04:34 2015
@@ -85,3 +85,9 @@ TypeSystem::GetTypeForFormatters (void*
 {
 return CompilerType(this, type);
 }
+
+LazyBool
+TypeSystem::ShouldPrintAsOneLiner (void* type)
+{
+return eLazyBoolCalculate;
+}


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


Re: [Lldb-commits] [PATCH] D13084: Fix covered-switch-default warning in FormatManager.

2015-09-22 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D13084



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


Re: [Lldb-commits] [lldb] r248366 - Testcase and fix for bug 24074

2015-09-23 Thread Enrico Granata via lldb-commits
I am seeing the same issue on OS X

Ravitheja, can you investigate this?
Or should we just revert?

> On Sep 23, 2015, at 9:54 AM, Ed Maste via lldb-commits 
>  wrote:
> 
> On 23 September 2015 at 03:19, Ravitheja Addepally via lldb-commits
>  wrote:
>> Author: ravitheja
>> Date: Wed Sep 23 02:19:02 2015
>> New Revision: 248366
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=248366&view=rev
>> Log:
>> Testcase and fix for bug 24074
> 
> This change introduced a segfault in 10 or so test cases on FreeBSD:
> 
> FAIL: LLDB (suite) :: Test11588.py
> FAIL: LLDB (suite) :: TestAnonymous.py
> FAIL: LLDB (suite) :: TestCPPStaticMembers.py
> FAIL: LLDB (suite) :: TestCPPStaticMethods.py
> FAIL: LLDB (suite) :: TestCppScope.py
> FAIL: LLDB (suite) :: TestCppValueCast.py
> FAIL: LLDB (suite) :: TestDataFormatterCategories.py
> FAIL: LLDB (suite) :: TestDataFormatterEnumFormat.py
> FAIL: LLDB (suite) :: TestStructTypes.py
> FAIL: LLDB (suite) :: TestTypeList.py
> 
> The backtrace is available at https://bpaste.net/show/e6bb411e0a08
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r248421 - Revert 248366 "Testcase and fix for bug 24074"

2015-09-23 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 23 14:32:56 2015
New Revision: 248421

URL: http://llvm.org/viewvc/llvm-project?rev=248421&view=rev
Log:
Revert 248366 "Testcase and fix for bug 24074"

This commit introduced regressions in several test cases on FreeBSD and Mac OS X


Removed:
lldb/trunk/include/lldb/Symbol/TypeMap.h
lldb/trunk/source/Symbol/TypeMap.cpp
lldb/trunk/test/lang/c/typedef/
Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Symbol/SymbolContext.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/include/lldb/Symbol/TypeList.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Symbol/CMakeLists.txt
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp
lldb/trunk/source/Symbol/TypeList.cpp

Modified: lldb/trunk/include/lldb/Core/Module.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=248421&r1=248420&r2=248421&view=diff
==
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Wed Sep 23 14:32:56 2015
@@ -1193,7 +1193,7 @@ private:
 const CompilerDeclContext *parent_decl_ctx,
 bool append, 
 size_t max_matches,
-TypeMap& types);
+TypeList& types);
 
 
 DISALLOW_COPY_AND_ASSIGN (Module);

Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolContext.h?rev=248421&r1=248420&r2=248421&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolContext.h Wed Sep 23 14:32:56 2015
@@ -299,27 +299,6 @@ public:
ConstString &language_object_name);
 
 //--
-/// If this symbol context represents a function that is a method,
-/// return true and provide information about the method.
-///
-/// @param[out] language
-/// If \b true is returned, the language for the method.
-///
-/// @param[out] is_instance_method
-/// If \b true is returned, \b true if this is a instance method,
-/// \b false if this is a static/class function.
-///
-/// @param[out] language_object_name
-/// If \b true is returned, the name of the artificial variable
-/// for the language ("this" for C++, "self" for ObjC).
-///
-/// @return
-/// \b True if this symbol context represents a function that
-/// is a method of a class, \b false otherwise.
-//--
-void
-   SortTypeList(TypeMap &type_map, TypeList &type_list) const;
-//--
 /// Find a name of the innermost function for the symbol context.
 ///
 /// For instance, if the symbol context contains an inlined block,

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=248421&r1=248420&r2=248421&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Wed Sep 23 14:32:56 2015
@@ -141,7 +141,7 @@ public:
 virtual uint32_tFindGlobalVariables (const RegularExpression& 
regex, bool append, uint32_t max_matches, VariableList& variables);
 virtual uint32_tFindFunctions (const ConstString &name, const 
CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool 
include_inlines, bool append, SymbolContextList& sc_list);
 virtual uint32_tFindFunctions (const RegularExpression& regex, 
bool include_inlines, bool append, SymbolContextList& sc_list);
-virtual uint32_tFindTypes (const SymbolContext& sc, const 
ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, 
uint32_t max_matches, TypeMap& types);
+virtual uint32_tFindTypes (const SymbolContext& sc, const 
ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, 
uint32_t max_matches, TypeList& types);
 

Re: [Lldb-commits] [lldb] r248366 - Testcase and fix for bug 24074

2015-09-23 Thread Enrico Granata via lldb-commits

> On Sep 23, 2015, at 12:09 PM, Ed Maste  wrote:
> 
> I'd suggest we revert for now and bring it back after testing on all
> platforms. There were a couple of nits and changes in the committed
> version relative to the version in the review as well so I think it's
> better to bring it back with those fixed up.
> 
> On 23 September 2015 at 14:52, Enrico Granata  wrote:
>> 
>> I am seeing the same issue on OS X
>> 
>> Ravitheja, can you investigate this?
>> Or should we just revert?
>> 


Reverted in r248421

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


Re: [Lldb-commits] [Diffusion] rL248338: Move the "run" alias from process launch --shell to process launch --shell…

2015-09-23 Thread Enrico Granata via lldb-commits

> On Sep 23, 2015, at 12:42 PM, Dawn Perchik via lldb-commits 
>  wrote:
> 
> dawn added a subscriber: dawn.
> dawn raised a concern with this commit.
> dawn added a comment.
> 
> Hi Enrico,
> 
> This commit has caused catasrophic test failures on OSX.  The failure count 
> went
> up by 512.
> 
> lldb is built with cmake/ninja, and tests are run in the test dir as follows:
> 
>  cd ~/llvm
>  mkdir -p build_ninja && cd build_ninja
>  cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" 
> -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release
>  security unlock-keychain -p   
> /Users/testuser/Library/Keychains/login.keychain
>  ninja
>  cd ../tools/lldb/test
>  ./dotest.py --output-on-success -v
> 
> Can you have a look please?
> 
> Thanks in advance,
> -Dawn
> 
> 
> Users:
>  dawn (Auditor)
> 
> http://reviews.llvm.org/rL248338
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Dawn,
I can certainly take a look at this, but I don’t anticipate finding much

We have been running in this mode (with run meaning —shell-expand-args) for 
months now internally, with no catastrophic test failures
Also, there is a test case that specifically validates launching via argdumper

Are you able to manually launch *any* inferior with an lldb built this way? Is 
argdumper being built as part of your builds?

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r248427 - Make the ObjCLanguageRuntimes comply with llvm-style RTTI

2015-09-23 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 23 15:12:19 2015
New Revision: 248427

URL: http://llvm.org/viewvc/llvm-project?rev=248427&view=rev
Log:
Make the ObjCLanguageRuntimes comply with llvm-style RTTI


Modified:
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
lldb/trunk/include/lldb/lldb-private-enumerations.h
lldb/trunk/source/Expression/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=248427&r1=248426&r2=248427&view=diff
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Wed Sep 23 15:12:19 
2015
@@ -26,6 +26,8 @@
 #include "lldb/Symbol/Type.h"
 #include "lldb/Target/LanguageRuntime.h"
 
+#include "llvm/Support/Casting.h"
+
 class CommandObjectObjC_ClassTable_Dump;
 
 namespace lldb_private {
@@ -36,6 +38,13 @@ class ObjCLanguageRuntime :
 public LanguageRuntime
 {
 public:
+enum class ObjCRuntimeVersions
+{
+eObjC_VersionUnknown = 0,
+eAppleObjC_V1 = 1,
+eAppleObjC_V2 = 2
+};
+
 typedef lldb::addr_t ObjCISA;
 
 class ClassDescriptor;
@@ -293,9 +302,9 @@ public:
 CreateObjectChecker (const char *) = 0;
 
 virtual ObjCRuntimeVersions
-GetRuntimeVersion ()
+GetRuntimeVersion () const
 {
-return eObjC_VersionUnknown;
+return ObjCRuntimeVersions::eObjC_VersionUnknown;
 }
 
 bool

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=248427&r1=248426&r2=248427&view=diff
==
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Wed Sep 23 15:12:19 2015
@@ -106,13 +106,6 @@ typedef enum SortOrder
 eSortOrderByName
 } SortOrder;
 
-typedef enum ObjCRuntimeVersions {
-eObjC_VersionUnknown = 0,
-eAppleObjC_V1 = 1,
-eAppleObjC_V2 = 2
-} ObjCRuntimeVersions;
-
-
 //--
 // LazyBool is for boolean values that need to be calculated lazily.
 // Values start off set to eLazyBoolCalculate, and then they can be

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=248427&r1=248426&r2=248427&view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Wed Sep 23 15:12:19 
2015
@@ -277,7 +277,7 @@ ClangExpressionParser::ClangExpressionPa
 {
 if (process_sp->GetObjCLanguageRuntime())
 {
-if (process_sp->GetObjCLanguageRuntime()->GetRuntimeVersion() == 
eAppleObjC_V2)
+if (process_sp->GetObjCLanguageRuntime()->GetRuntimeVersion() == 
ObjCLanguageRuntime::ObjCRuntimeVersions::eAppleObjC_V2)
 m_compiler->getLangOpts().ObjCRuntime.set(ObjCRuntime::MacOSX, 
VersionTuple(10, 7));
 else
 
m_compiler->getLangOpts().ObjCRuntime.set(ObjCRuntime::FragileMacOSX, 
VersionTuple(10, 7));

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp?rev=248427&r1=248426&r2=248427&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp Wed Sep 23 15:12:19 2015
@@ -624,7 +624,7 @@ SyntheticChildrenFrontEnd* lldb_private:
 lldb::ProcessSP process_sp (valobj_sp->GetProcessSP());
 if (!process_sp)
 return NULL;
-AppleObjCRuntime *runtime = 
(AppleObjCRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);
+AppleObjCRuntime *runtime = 
llvm::dyn_cast_or_null(process_sp->GetObjCLanguageRuntime());
 if (!runtime)
 return NULL;
 

Modified: 
lldb/trunk/source/Plugins/LanguageRunti

[Lldb-commits] [lldb] r248429 - The Visual Studio compiler does not like this C-ism when 'enum class'es are involved

2015-09-23 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 23 15:49:15 2015
New Revision: 248429

URL: http://llvm.org/viewvc/llvm-project?rev=248429&view=rev
Log:
The Visual Studio compiler does not like this C-ism when 'enum class'es are 
involved


Modified:

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h?rev=248429&r1=248428&r2=248429&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
 Wed Sep 23 15:49:15 2015
@@ -105,7 +105,7 @@ protected:
 static bool
 AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
 
-static enum ObjCRuntimeVersions
+static ObjCRuntimeVersions
 GetObjCVersion (Process *process, lldb::ModuleSP &objc_module_sp);
 
 void


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


Re: [Lldb-commits] [lldb] r248429 - The Visual Studio compiler does not like this C-ism when 'enum class'es are involved

2015-09-23 Thread Enrico Granata via lldb-commits

> On Sep 23, 2015, at 2:31 PM, Zachary Turner  wrote:
> 
> If you change "enum" to "enum class" I think it will work

Yes that would also work

> (IANALL but I think it's even more correct). 

IANALL either, but I beg to differ on that
The way I usually heard it explained is that C has different “namespaces” (*) 
where it puts structs, vs. enums, vs. typedefs, and that is why you need to 
classify names with the kind of type they are - or make typedefs for them
(*) not in the C++ sense of the term, in the sense of bucket where the compiler 
would go look for a type given a typename
In C++ all kinds of types all live in common buckets, so the classification is 
redundant, but allowed, because C

> But if what you've done works, then that should be fine.

I haven’t heard any more rumbling from the bot. I’ll take that as approval of 
my patch :-)

> 
> On Wed, Sep 23, 2015 at 1:50 PM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: enrico
> Date: Wed Sep 23 15:49:15 2015
> New Revision: 248429
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=248429&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=248429&view=rev>
> Log:
> The Visual Studio compiler does not like this C-ism when 'enum class'es are 
> involved
> 
> 
> Modified:
> 
> lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
> 
> Modified: 
> lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h?rev=248429&r1=248428&r2=248429&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h?rev=248429&r1=248428&r2=248429&view=diff>
> ==
> --- 
> lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
>  (original)
> +++ 
> lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
>  Wed Sep 23 15:49:15 2015
> @@ -105,7 +105,7 @@ protected:
>  static bool
>  AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
> 
> -static enum ObjCRuntimeVersions
> +static ObjCRuntimeVersions
>  GetObjCVersion (Process *process, lldb::ModuleSP &objc_module_sp);
> 
>  void
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org <mailto:lldb-commits@lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits>


Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r248960 - Introudce a IsTopLevelFunction() API on Language and Function

2015-09-30 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Sep 30 18:12:22 2015
New Revision: 248960

URL: http://llvm.org/viewvc/llvm-project?rev=248960&view=rev
Log:
Introudce a IsTopLevelFunction() API on Language and Function

This is meant to support languages that have a scripting mode with top-level 
code that acts as global

For now, this flag only controls whether 'frame variable' will attempt to treat 
globals as locals when within such a function


Modified:
lldb/trunk/include/lldb/Symbol/Function.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Symbol/Function.cpp
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=248960&r1=248959&r2=248960&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Wed Sep 30 18:12:22 2015
@@ -631,6 +631,24 @@ public:
 //--
 bool
 GetIsOptimized ();
+
+//--
+/// Get whether this function represents a 'top-level' function
+///
+/// The concept of a top-level function is language-specific, mostly
+/// meant to represent the notion of scripting-style code that has
+/// global visibility of the variables/symbols/functions/...
+/// defined within the containing file/module
+///
+/// If stopped in a top-level function, LLDB will expose global variables
+/// as-if locals in the 'frame variable' command
+///
+/// @return
+/// Returns 'true' if this function is a top-level function,
+/// 'false' otherwise.
+//--
+bool
+IsTopLevelFunction ();
 
 lldb::DisassemblerSP
 GetInstructions (const ExecutionContext &exe_ctx,

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=248960&r1=248959&r2=248960&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Wed Sep 30 18:12:22 2015
@@ -41,6 +41,9 @@ public:
 virtual lldb::LanguageType
 GetLanguageType () const = 0;
 
+bool
+IsTopLevelFunction (Function& function);
+
 virtual lldb::TypeCategoryImplSP
 GetFormatters ();
 

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=248960&r1=248959&r2=248960&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Wed Sep 30 18:12:22 2015
@@ -35,6 +35,7 @@
 #include "lldb/Interpreter/OptionGroupVariable.h"
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/Function.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/Type.h"
@@ -409,6 +410,10 @@ protected:
 
 DumpValueObjectOptions 
options(m_varobj_options.GetAsDumpOptions(eLanguageRuntimeDescriptionDisplayVerbosityFull,eFormatDefault,summary_format_sp));
 
+const SymbolContext& sym_ctx = 
frame->GetSymbolContext(eSymbolContextFunction);
+if (sym_ctx.function && sym_ctx.function->IsTopLevelFunction())
+m_option_variable.show_globals = true;
+
 if (variable_list)
 {
 const Format format = m_option_format.GetFormat();

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=248960&r1=248959&r2=248960&view=diff
==
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Wed Sep 30 18:12:22 2015
@@ -17,6 +17,7 @@
 #include "lldb/Symbol/LineTable.h"
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Target/Language.h"
 #include "llvm/Support/Casting.h"
 
 using namespace lldb;
@@ -481,6 +482,17 @@ Function::GetIsOptimized ()
 return result;
 }
 
+bool
+Function::IsTopLevelFunction ()
+{
+bool result = false;
+
+if (Language* language = Language::FindPlugin(GetLanguage()))
+result = language->IsTopLevelFunction(*this);
+
+return result;
+}
+
 ConstString
 Function::GetDisplayName () const
 {

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Targ

[Lldb-commits] [lldb] r249047 - Add a 'type lookup' command. This command is meant to look up type information by name in a language-specific way.

2015-10-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Oct  1 13:16:18 2015
New Revision: 249047

URL: http://llvm.org/viewvc/llvm-project?rev=249047&view=rev
Log:
Add a 'type lookup' command. This command is meant to look up type information 
by name in a language-specific way.

Currently, it only supports Objective-C - C++ types can be looked up through 
debug info via 'image lookup -t', whereas ObjC types via this command are 
looked up by runtime introspection

This behavior is in line with type lookup's behavior in Xcode 7, but I am 
definitely open to feedback as to what makes the most sense here


Modified:
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=249047&r1=249046&r2=249047&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Thu Oct  1 13:16:18 2015
@@ -13,6 +13,8 @@
 // C Includes
 // C++ Includes
 #include 
+#include 
+#include 
 #include 
 
 // Other libraries and framework includes
@@ -29,6 +31,42 @@ class Language :
 public PluginInterface
 {
 public:
+
+class TypeScavenger
+{
+public:
+class Result
+{
+public:
+virtual bool
+IsValid () = 0;
+
+virtual bool
+DumpToStream (Stream& stream,
+  bool print_help_if_available) = 0;
+
+virtual ~Result() = default;
+};
+
+typedef std::set> ResultSet;
+
+virtual ~TypeScavenger () = default;
+
+size_t
+Find (ExecutionContextScope *exe_scope,
+  const char *key,
+  ResultSet &results,
+  bool append = true);
+
+protected:
+TypeScavenger () = default;
+
+virtual bool
+Find_Impl (ExecutionContextScope *exe_scope,
+   const char *key,
+   ResultSet &results) = 0;
+};
+
 ~Language() override;
 
 static Language*
@@ -65,6 +103,9 @@ public:
 virtual lldb_private::formatters::StringPrinter::EscapingHelper
 GetStringPrinterEscapingHelper 
(lldb_private::formatters::StringPrinter::GetPrintableElementType);
 
+virtual std::unique_ptr
+GetTypeScavenger ();
+
 // These are accessors for general information about the Languages lldb 
knows about:
 
 static lldb::LanguageType
@@ -91,7 +132,6 @@ public:
 
 static bool
 LanguageIsPascal (lldb::LanguageType language);
-
 
 protected:
 //--

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=249047&r1=249046&r2=249047&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Oct  1 13:16:18 2015
@@ -4558,6 +4558,218 @@ CommandObjectTypeFilterAdd::CommandOptio
 { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
 };
 
+//--
+// "type lookup"
+//--
+class CommandObjectTypeLookup : public CommandObjectRaw
+{
+protected:
+
+class CommandOptions : public OptionGroup
+{
+public:
+
+CommandOptions () :
+OptionGroup(),
+m_show_help(false),
+m_language(eLanguageTypeUnknown)
+{}
+
+virtual
+~CommandOptions () {}
+
+virtual uint32_t
+GetNumDefinitions ()
+{
+return 3;
+}
+
+virtual const OptionDefinition*
+GetDefinitions ()
+{
+return g_option_table;
+}
+
+virtual Error
+SetOptionValue (CommandInterpreter &interpreter,
+uint32_t option_idx,
+const char *option_value)
+{
+Error error;
+
+const int short_option = g_option_table[option_idx].short_option;
+
+switch (short_option)
+{
+case 'h':
+m_show_help = true;
+break;
+
+case 'l':
+m_language = 
Language::GetLanguageTypeFromString(option_value);
+break;
+
+default:
+ 

Re: [Lldb-commits] [lldb] r248934 - Now persistent expression data no longer lives with the Target, but rather with

2015-10-01 Thread Enrico Granata via lldb-commits
The way I understand this from talking with Sean about it is that the 
persistent variables for each type system will need to generate non-conflicting 
names

In your example,

(lldb) expr -l c — 1
$1 = 1
(lldb) expr -l go — 2
$G1 = 2
(lldb) expr -l go — $1
Identifier ‘$1’ not recognized (or whatever equivalent error Go would produce, 
unless you had somehow gotten Go and Clang to interop with each other in a 
smart way)

But that is simply my understanding

> On Oct 1, 2015, at 11:15 AM, Ryan Brown via lldb-commits 
>  wrote:
> 
> Oh, now I see the search in 249027.
> But how does this work with multiple type systems?
> Target no longer manages persistent variable names so won't each type system 
> generate conflicting names? 
> e.g.
> (lldb) expr -l c -- 1
> $1 = 1
> (lldb) expr -l go -- 2
> $1 = 2
> (lldb) expr -l go -- $1
> 
> Which $1 do you get?
> 
> 
> On Thu, Oct 1, 2015 at 10:59 AM Ryan Brown  > wrote:
> Shouldn't Target::GetPersistentVariable take a language parameter instead of 
> assuming clang?
> 
> On Wed, Sep 30, 2015 at 12:59 PM Sean Callanan via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: spyffe
> Date: Wed Sep 30 14:57:57 2015
> New Revision: 248934
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=248934&view=rev 
> 
> Log:
> Now persistent expression data no longer lives with the Target, but rather 
> with
> the corresponding TypeSystem.  This makes sense because what kind of data 
> there
> is -- and how it can be looked up -- depends on the language.
> 
> Functionality that is common to all type systems is factored out into
> PersistentExpressionState.
> 
> Modified:
> lldb/trunk/include/lldb/Expression/ExpressionVariable.h
> lldb/trunk/include/lldb/Symbol/ClangASTContext.h
> lldb/trunk/include/lldb/Symbol/TypeSystem.h
> lldb/trunk/include/lldb/Target/Target.h
> lldb/trunk/include/lldb/lldb-forward.h
> lldb/trunk/source/API/SBFrame.cpp
> lldb/trunk/source/Commands/CommandObjectMemory.cpp
> lldb/trunk/source/Core/ValueObject.cpp
> lldb/trunk/source/Expression/ExpressionSourceCode.cpp
> lldb/trunk/source/Expression/ExpressionVariable.cpp
> lldb/trunk/source/Expression/Materializer.cpp
> lldb/trunk/source/Expression/UserExpression.cpp
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
> 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
> 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
> 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
> lldb/trunk/source/Symbol/ClangASTContext.cpp
> lldb/trunk/source/Target/ABI.cpp
> lldb/trunk/source/Target/Target.cpp
> 
> Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=248934&r1=248933&r2=248934&view=diff
>  
> 
> ==
> --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original)
> +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Wed Sep 30 
> 14:57:57 2015
> @@ -265,6 +265,36 @@ private:
>  std::vector  m_variables;
>  };
> 
> +class PersistentExpressionState : public ExpressionVariableList {
> +public:
> +//--
> +// See TypeSystem.h for how to add subclasses to this.
> +//--
> +enum LLVMCastKind {
> +eKindClang,
> +eKindSwift,
> +eKindGo,
> +kNumKinds
> +};
> +
> +LLVMCastKind getKind() const { return m_kind; }
> +
> +PersistentExpressionState(LLVMCastKind kind) :
> +m_kind(kind)
> +{
> +}
> +
> +virtual ~PersistentExpressionState ();
> +
> +virtual ConstString
> +GetNextPersistentVariableName () = 0;
> +
> +virtual void
> +RemovePersistentVariable (lldb::ExpressionVariableSP variable) = 0;
> +private:
> +LLVMCastKind m_kind;
> +};
> +
>  }
> 
>  #endif /* liblldb_ExpressionVariable_h_ */
> 
> Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=248934&r1=248933&r2=248934&view=diff
>  
> 
> ==
> --- lldb/trunk/in

Re: [Lldb-commits] [lldb] r249047 - Add a 'type lookup' command. This command is meant to look up type information by name in a language-specific way.

2015-10-01 Thread Enrico Granata via lldb-commits

> On Oct 1, 2015, at 12:49 PM, Zachary Turner  wrote:
> 
> Hi Enrico,
> 
> Could you add some tests for this?

Sure. I am still churning through a thing or two before declaring victory, but 
I can add tests as I make progress

>  python API tests and appropriate methods added to SBTarget

There currently is no SB API component to this. It is a purely command-line 
facility.
If you feel it would be useful to have SB API for this, it will need to be 
designed (e.g. “type lookup” is allowed to transact in things that are not 
strictly speaking compiler types - we have no API way to represent this kind of 
concept)

> would be ideal.
> 
> On Thu, Oct 1, 2015 at 11:17 AM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: enrico
> Date: Thu Oct  1 13:16:18 2015
> New Revision: 249047
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=249047&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=249047&view=rev>
> Log:
> Add a 'type lookup' command. This command is meant to look up type 
> information by name in a language-specific way.
> 
> Currently, it only supports Objective-C - C++ types can be looked up through 
> debug info via 'image lookup -t', whereas ObjC types via this command are 
> looked up by runtime introspection
> 
> This behavior is in line with type lookup's behavior in Xcode 7, but I am 
> definitely open to feedback as to what makes the most sense here
> 
> 
> Modified:
> lldb/trunk/include/lldb/Target/Language.h
> lldb/trunk/source/Commands/CommandObjectType.cpp
> lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
> lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
> lldb/trunk/source/Target/Language.cpp
> 
> Modified: lldb/trunk/include/lldb/Target/Language.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=249047&r1=249046&r2=249047&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=249047&r1=249046&r2=249047&view=diff>
> ==
> --- lldb/trunk/include/lldb/Target/Language.h (original)
> +++ lldb/trunk/include/lldb/Target/Language.h Thu Oct  1 13:16:18 2015
> @@ -13,6 +13,8 @@
>  // C Includes
>  // C++ Includes
>  #include 
> +#include 
> +#include 
>  #include 
> 
>  // Other libraries and framework includes
> @@ -29,6 +31,42 @@ class Language :
>  public PluginInterface
>  {
>  public:
> +
> +class TypeScavenger
> +{
> +public:
> +class Result
> +{
> +public:
> +virtual bool
> +IsValid () = 0;
> +
> +virtual bool
> +DumpToStream (Stream& stream,
> +  bool print_help_if_available) = 0;
> +
> +virtual ~Result() = default;
> +};
> +
> +typedef std::set> ResultSet;
> +
> +virtual ~TypeScavenger () = default;
> +
> +size_t
> +Find (ExecutionContextScope *exe_scope,
> +  const char *key,
> +  ResultSet &results,
> +  bool append = true);
> +
> +protected:
> +TypeScavenger () = default;
> +
> +virtual bool
> +Find_Impl (ExecutionContextScope *exe_scope,
> +   const char *key,
> +   ResultSet &results) = 0;
> +};
> +
>  ~Language() override;
> 
>  static Language*
> @@ -65,6 +103,9 @@ public:
>  virtual lldb_private::formatters::StringPrinter::EscapingHelper
>  GetStringPrinterEscapingHelper 
> (lldb_private::formatters::StringPrinter::GetPrintableElementType);
> 
> +virtual std::unique_ptr
> +GetTypeScavenger ();
> +
>  // These are accessors for general information about the Languages lldb 
> knows about:
> 
>  static lldb::LanguageType
> @@ -91,7 +132,6 @@ public:
> 
>  static bool
>  LanguageIsPascal (lldb::LanguageType language);
> -
> 
>  protected:
>  //--
> 
> Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=249047&r1=249046&r2=249047&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=249047&r1=249046&r2=249047&view=diff>
> ==
> --- lldb/trunk/source/Commands/CommandObjectTy

Re: [Lldb-commits] [lldb] r249047 - Add a 'type lookup' command. This command is meant to look up type information by name in a language-specific way.

2015-10-01 Thread Enrico Granata via lldb-commits

> On Oct 1, 2015, at 1:15 PM, Zachary Turner  wrote:
> 
> I see there's SBType, does this represent something different?

Yes, it represents types.
Type lookup does not necessarily always deal with types.
For instance, imagine a language that has function declarations such that

function foo(int x, int y) returns int

and

function bar(int x, int y) returns int

represents two different declarations - but they have the same type

function (int, int) returns int

We want type lookup to be able to maintain that distinction, such that one 
could say

(lldb) type lookup -l newlanguage — foo
function foo(int x, int y) returns int

vs.

(lldb) type lookup -l newlanguage — bar
function bar(int x, int y) returns int

Other similar cases are languages where a runtime introspection mechanism does 
not expose fully-baked types, but still provides useful introspection 
information that one could show the user. Those are useful things for type 
lookup to do, and forcing the results to be CompilerTypes would lose us that 
ability. We would need something like SBTypeOrDecl, or an opaque 
SBTypeLookupResult.

>   I was thinking you could make a method like 
> 
> SBType *
> SBTarget::LookupType(const char* type_name, eLanguage lang);
> 
> Even if it didn't support every possible usage of the "type lookup" command, 
> it would be a start.

I would like to avoid having a command that does the right thing always, and an 
API that does somewhat a good thing sometimes. Note that I don’t say this to 
oppose the notion of an API for “type lookup”, but only to oppose the notion of 
an API that returns a list of types, when the output of “type lookup” is not 
necessarily always just types.

An API is a reasonable thing to ask for - I can’t promise I’ll have one done 
today or tomorrow, especially because I have given no thought to how to design 
one, but now that you mention it, it is in my queue of improvements for this 
functionality.

> 
> At one point on the list it was discussed whether tests which use runCmd and 
> then matching the output should be separated from the rest of the test suite, 
> so there's a more clearly enforced distinction about which tests use the 
> command API and which tests use the python API.  At least Jim thought that 
> was a good idea and supported the move, but nobody else really chimed in.  If 
> you agree, maybe you could be the first?  :)  Something like 
> lldb/test/commands/type-lookup.  Eventually the goal would just be to have 3 
> top level directories, 
> 
> lldb
> |__test
> |__commands
> |__python-api
> |__unit-tests

I have historically been putting this kind of things in “test/functionalities”. 
I am not sure that - as a matter of convention - we have command-line only 
tests in “functionalities” though.
Is there any objection to a refactor as-you-touch-things approach here? i.e. if 
I add a test for the command-line side, it goes in test/functionalities/* - but 
if at a later time I add SB API for type lookup, then the test for that goes in 
test/python-api/*
It seems a reasonable way forward to me - unless I am missing something

> 
> With the existing sub-trees divided up accordingly between the 3.   (This is 
> all assuming of course that making the SBTarget::LookupType method I 
> suggested earlier doesn't work for some reason)
> 
> On Thu, Oct 1, 2015 at 1:01 PM Enrico Granata  <mailto:egran...@apple.com>> wrote:
>> On Oct 1, 2015, at 12:49 PM, Zachary Turner > <mailto:ztur...@google.com>> wrote:
>> 
>> Hi Enrico,
>> 
>> Could you add some tests for this?
> 
> Sure. I am still churning through a thing or two before declaring victory, 
> but I can add tests as I make progress
> 
>>  python API tests and appropriate methods added to SBTarget
> 
> There currently is no SB API component to this. It is a purely command-line 
> facility.
> If you feel it would be useful to have SB API for this, it will need to be 
> designed (e.g. “type lookup” is allowed to transact in things that are not 
> strictly speaking compiler types - we have no API way to represent this kind 
> of concept)
> 
>> would be ideal.
>> 
>> On Thu, Oct 1, 2015 at 11:17 AM Enrico Granata via lldb-commits 
>> mailto:lldb-commits@lists.llvm.org>> wrote:
>> Author: enrico
>> Date: Thu Oct  1 13:16:18 2015
>> New Revision: 249047
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=249047&view=rev 
>> <http://llvm.org/viewvc/llvm-project?rev=249047&view=rev>
>> Log:
>> Add a 'type lookup' command. This command is meant to look up type 
>> information by name in a language-specific way.
>> 
>> Currently, it only supports Objective-C - C++ types can be looked up through 

Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-10-01 Thread Enrico Granata via lldb-commits
granata.enrico requested changes to this revision.
granata.enrico added a comment.
This revision now requires changes to proceed.

Sorry, I didn't realize you were still waiting on me to land this patch.

I have a few extra comments before this is ready to land.



Comment at: include/lldb/API/SBTypeSummary.h:125
@@ +124,3 @@
+
+bool DoesPrintValue(const lldb::SBValue &value) const;
+

Can you please change this to

bool
DoesPrintValue (lldb::SBValue value);

There is no need to pass the SBValue by reference since you're not actually 
altering it - and since SBValue wraps a (glorified) pointer to a ValueObject 
you're not really copying much data over. I don't see the need to classify the 
function as const (only IsValid() seems to be marked thusly in that file), and 
definitely no need for the SBValue to be a const


Comment at: source/API/SBTypeSummary.cpp:289
@@ -286,1 +288,3 @@
 
+bool
+SBTypeSummary::DoesPrintValue(const lldb::SBValue &value) const

Of course change this in the C++ file as well


Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp:372
@@ +371,3 @@
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetValueSummary() const
+{

I might be missing something, but how is this going to work when an SBValue has 
a value but no summary (something as simple as int x = 1;)?

GetSummary() is free to return NULL, and I only see you fetching the value here 
when there is a summary. Your logic should be more like

GetSummary()
if (!summary || summary && DoesPrintValue())
 append value

A very long-term goal of mine is for all of this logic to exist in the 
ValueObjectPrinter and clients to simply be able to ask it to print a 
ValueObject according to some specification of theirs, in the middle of an 
existing stream. But that is way beyond the scope of your patch, so if you just 
clean up the logic here to do the right thing for values without summaries, I 
am happy.


http://reviews.llvm.org/D13058



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


[Lldb-commits] [lldb] r249117 - Teach 'type lookup' to pull types from clang modules; also add a test case

2015-10-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Oct  1 20:23:11 2015
New Revision: 249117

URL: http://llvm.org/viewvc/llvm-project?rev=249117&view=rev
Log:
Teach 'type lookup' to pull types from clang modules; also add a test case


Added:
lldb/trunk/test/functionalities/type_lookup/
lldb/trunk/test/functionalities/type_lookup/Makefile
lldb/trunk/test/functionalities/type_lookup/TestTypeLookup.py
lldb/trunk/test/functionalities/type_lookup/main.m
Modified:
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

Modified: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp?rev=249117&r1=249116&r2=249117&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp Thu Oct  1 
20:23:11 2015
@@ -708,34 +708,57 @@ ObjCLanguage::GetTypeScavenger ()
 {
 bool result = false;
 
-Process* process = exe_scope->CalculateProcess().get();
-if (process)
+Target* target = exe_scope->CalculateTarget().get();
+if (target)
 {
-const bool create_on_demand = false;
-auto objc_runtime = 
process->GetObjCLanguageRuntime(create_on_demand);
-if (objc_runtime)
+if (auto clang_modules_decl_vendor = 
target->GetClangModulesDeclVendor())
 {
-auto decl_vendor = objc_runtime->GetDeclVendor();
-if (decl_vendor)
+std::vector  decls;
+ConstString key_cs(key);
+
+if (clang_modules_decl_vendor->FindDecls(key_cs, false, 
UINT32_MAX, decls) > 0 &&
+decls.size() > 0)
 {
-std::vector decls;
-ConstString name(key);
-decl_vendor->FindDecls(name, true, UINT32_MAX, decls);
-for (auto decl : decls)
+CompilerType module_type = 
ClangASTContext::GetTypeForDecl(decls.front());
+result = true;
+std::unique_ptr 
result(new ObjCScavengerResult(module_type));
+results.insert(std::move(result));
+}
+}
+}
+
+if (!result)
+{
+Process* process = exe_scope->CalculateProcess().get();
+if (process)
+{
+const bool create_on_demand = false;
+auto objc_runtime = 
process->GetObjCLanguageRuntime(create_on_demand);
+if (objc_runtime)
+{
+auto decl_vendor = objc_runtime->GetDeclVendor();
+if (decl_vendor)
 {
-if (decl)
+std::vector decls;
+ConstString name(key);
+decl_vendor->FindDecls(name, true, UINT32_MAX, 
decls);
+for (auto decl : decls)
 {
-if (CompilerType candidate = 
ClangASTContext::GetTypeForDecl(decl))
+if (decl)
 {
-result = true;
-
std::unique_ptr result(new 
ObjCScavengerResult(candidate));
-results.insert(std::move(result));
+if (CompilerType candidate = 
ClangASTContext::GetTypeForDecl(decl))
+{
+result = true;
+
std::unique_ptr result(new 
ObjCScavengerResult(candidate));
+results.insert(std::move(result));
+}
 }
 }
 }
 }
 }
 }
+
 return result;
 }
 

Added: lldb/trunk/test/functionalities/type_lookup/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/type_lookup/Makefile?rev=249117&view=auto
==
--- lldb/trunk/test/functionalities/type_lookup/Makefile (added)
+++ lldb/trunk/test/functionalities/type_lookup/Makefile Thu Oct  1 20:23:11 
2015
@@ -0,0 +1,9 @@
+LEVEL = ../../make
+
+OBJC_SOURCES := main.m
+
+CFLAGS_EXTRAS += -w
+
+include $(LEVEL)/Makefile.rules
+
+LDFLAGS += -framework Foundation

Added: lldb/trunk/test/functionalities/type_lookup/TestType

Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-10-02 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.

I am not deeply involved in MI internals, so I am going to assume you ran the 
test suite, and that you actually verified that types without summaries still 
work

In general, once you opt into data formatters, you get a lot more than simply 
UTF handling. I understand that this is your rationale for the change, but you 
may want to make sure that MI still does the right thing if users define 
formatters for types that have nothing to do with strings (e.g. what if 
somebody does define a summary for int or float?)

With that said, this looks reasonable, and an MI refactoring would be outside 
of my realm anyway.


http://reviews.llvm.org/D13058



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


Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-10-02 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

I Thought I had marked it as good to go.
My bad if I have not.

- Enrico


http://reviews.llvm.org/D13058



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


Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

2015-10-02 Thread Enrico Granata via lldb-commits
I Thought I had marked it as good to go.
My bad if I have not. 

- Enrico
Sent from my iPhone

> On Oct 2, 2015, at 1:12 PM, Dawn Perchik  wrote:
> 
> dawn added a comment.
> 
> This patch is good to commit now right?  It's not marked "accepted" for some 
> reason.
> 
> 
> http://reviews.llvm.org/D13058
> 
> 
> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r249185 - Add hooks that enable NSSet, NSDictionary and NSString formatting to apply to other types beyond the well-known ones

2015-10-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Oct  2 15:59:58 2015
New Revision: 249185

URL: http://llvm.org/viewvc/llvm-project?rev=249185&view=rev
Log:
Add hooks that enable NSSet, NSDictionary and NSString formatting to apply to 
other types beyond the well-known ones

This is meant to support languages that can do some sort of bridging from<-->to 
these ObjC types via types that statically vend themselves as Cocoa types, but 
dynamically have an implementation that does not match any of our well-known 
types, but where an introspecting formatter can be vended by the bridged 
language


Added:
lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h
lldb/trunk/source/Plugins/Language/ObjC/NSSet.h
lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSString.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h
lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=249185&r1=249184&r2=249185&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Oct  2 15:59:58 2015
@@ -780,6 +780,7 @@
94B6385D1B8FB178004FE1E4 /* CPlusPlusLanguage.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 94B6385B1B8FB174004FE1E4 /* 
CPlusPlusLanguage.cpp */; };
94B638631B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 94B638621B8FB7F1004FE1E4 /* 
ObjCPlusPlusLanguage.cpp */; };
94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* 
ValueObjectSyntheticFilter.cpp */; };
+   94B9E5121BBF20F4000A48DC /* NSString.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 94B9E5111BBF20F4000A48DC /* NSString.cpp */; };
94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 94BA8B6C176F8C9B005A91B5 /* Range.cpp */; };
94BA8B70176F97CE005A91B5 /* CommandHistory.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp 
*/; };
94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* 
DataVisualization.cpp */; };
@@ -2523,6 +2524,10 @@
94B638621B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ObjCPlusPlusLanguage.cpp; path = 
Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp; sourceTree = ""; };
94B6E76013D8833C005F417F /* ValueObjectSyntheticFilter.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ValueObjectSyntheticFilter.h; path = 
include/lldb/Core/ValueObjectSyntheticFilter.h; sourceTree = ""; };
94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = ValueObjectSyntheticFilter.cpp; path = 
source/Core/ValueObjectSyntheticFilter.cpp; sourceTree = ""; };
+   94B9E50E1BBEFDFE000A48DC /* NSDictionary.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSDictionary.h; 
path = Language/ObjC/NSDictionary.h; sourceTree = ""; };
+   94B9E50F1BBF0069000A48DC /* NSSet.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSSet.h; path = 
Language/ObjC/NSSet.h; sourceTree = ""; };
+   94B9E5101BBF20B7000A48DC /* NSString.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSString.h; path = 
Language/ObjC/NSString.h; sourceTree = ""; };
+   94B9E5111BBF20F4000A48DC /* NSString.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = NSString.cpp; path = Language/ObjC/NSString.cpp; sourceTree = ""; 
};
94BA8B6C176F8C9B005A91B5 /* Range.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = Range.cpp; path = source/Utility/Range.cpp; sourceTree = ""; };
94BA8B6E176F8CA0005A91B5 /* Range.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Range.h; path = 
include/lldb/Utility/Range.h; sourceTree = ""; };
94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CommandHistory.cpp; path = source/Interpreter/CommandHistory.cpp; 
sou

[Lldb-commits] [lldb] r249189 - Fix the CMake build

2015-10-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Oct  2 16:14:38 2015
New Revision: 249189

URL: http://llvm.org/viewvc/llvm-project?rev=249189&view=rev
Log:
Fix the CMake build

Modified:
lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt?rev=249189&r1=249188&r2=249189&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt Fri Oct  2 16:14:38 
2015
@@ -7,4 +7,5 @@ add_lldb_library(lldbPluginObjCLanguage
   NSDictionary.cpp
   NSIndexPath.cpp
   NSSet.cpp
+  NSString.cpp
 )


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


[Lldb-commits] [lldb] r249210 - Do not attempt to join the remote paths if none exist

2015-10-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Oct  2 17:53:32 2015
New Revision: 249210

URL: http://llvm.org/viewvc/llvm-project?rev=249210&view=rev
Log:
Do not attempt to join the remote paths if none exist

Modified:
lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249210&r1=249209&r2=249210&view=diff
==
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri Oct  2 17:53:32 2015
@@ -2407,7 +2407,7 @@ class TestBase(Base):
 if lldb.pre_flight:
 lldb.pre_flight(self)
 
-if lldb.remote_platform:
+if lldb.remote_platform and lldb.remote_platform_working_dir:
 remote_test_dir = lldbutil.join_remote_paths(
 lldb.remote_platform_working_dir,
 self.getArchitecture(),


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


[Lldb-commits] [lldb] r249366 - Introduce a FormattersMatchData class which contains all the information that data formatters need in one place, and also allows for lazy computation of expensive chunk

2015-10-05 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Oct  5 20:02:47 2015
New Revision: 249366

URL: http://llvm.org/viewvc/llvm-project?rev=249366&view=rev
Log:
Introduce a FormattersMatchData class which contains all the information that 
data formatters need in one place, and also allows for lazy computation of 
expensive chunks of information if need be

This is a NFC commit that is essentially plumbing the new currency through the 
system


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatClasses.h
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
lldb/trunk/source/DataFormatters/FormatClasses.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/LanguageCategory.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatClasses.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatClasses.h?rev=249366&r1=249365&r2=249366&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatClasses.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatClasses.h Mon Oct  5 20:02:47 
2015
@@ -118,6 +118,36 @@ private:
 };
 
 typedef std::vector FormattersMatchVector;
+typedef std::vector CandidateLanguagesVector;
+
+class FormattersMatchData
+{
+public:
+FormattersMatchData (ValueObject&,
+ lldb::DynamicValueType);
+
+FormattersMatchVector
+GetMatchesVector ();
+
+ConstString
+GetTypeForCache ();
+
+CandidateLanguagesVector
+GetCandidateLanguages ();
+
+ValueObject&
+GetValueObject ();
+
+lldb::DynamicValueType
+GetDynamicValueType ();
+
+private:
+ValueObject& m_valobj;
+lldb::DynamicValueType m_dynamic_value_type;
+std::pair m_formatters_match_vector;
+ConstString m_type_for_cache;
+CandidateLanguagesVector m_candidate_languages;
+};
 
 class TypeNameSpecifierImpl
 {

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=249366&r1=249365&r2=249366&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Oct  5 20:02:47 
2015
@@ -311,16 +311,16 @@ private:
 ConstString m_vectortypes_category_name;
 
 lldb::TypeFormatImplSP
-GetHardcodedFormat (ValueObject&,lldb::DynamicValueType);
+GetHardcodedFormat (FormattersMatchData&);
 
 lldb::TypeSummaryImplSP
-GetHardcodedSummaryFormat (ValueObject&,lldb::DynamicValueType);
+GetHardcodedSummaryFormat (FormattersMatchData&);
 
 lldb::SyntheticChildrenSP
-GetHardcodedSyntheticChildren (ValueObject&,lldb::DynamicValueType);
+GetHardcodedSyntheticChildren (FormattersMatchData&);
 
 lldb::TypeValidatorImplSP
-GetHardcodedValidator (ValueObject&,lldb::DynamicValueType);
+GetHardcodedValidator (FormattersMatchData&);
 
 TypeCategoryMap&
 GetCategories ()
@@ -338,6 +338,8 @@ private:
 
 void
 LoadVectorFormatters ();
+
+friend class FormattersMatchData;
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=249366&r1=249365&r2=249366&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Oct  5 
20:02:47 2015
@@ -31,51 +31,39 @@ public:
 LanguageCategory (lldb::LanguageType lang_type);
 
 bool
-Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
+Get (FormattersMatchData& match_data,
  lldb::TypeFormatImplSP& format_sp);
 
 bool
-Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
+Get (FormattersMatchData& match_data,
  lldb::TypeSummaryImplSP& format_sp);
 
 bool
-Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
+Get (FormattersMatchData& match_data,
  lldb::SyntheticChildrenSP& format_sp);
 
 bool
-Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
+Get (FormattersMatchData& match_data,
  lldb::TypeValidatorImplSP& format_sp);
 
 bool
-GetHardcoded

[Lldb-commits] [lldb] r249433 - Create a logging category that is specific to data formatters activity

2015-10-06 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Oct  6 12:55:14 2015
New Revision: 249433

URL: http://llvm.org/viewvc/llvm-project?rev=249433&view=rev
Log:
Create a logging category that is specific to data formatters activity


Modified:
lldb/trunk/include/lldb/Core/Logging.h
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Core/Logging.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp

Modified: lldb/trunk/include/lldb/Core/Logging.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Logging.h?rev=249433&r1=249432&r2=249433&view=diff
==
--- lldb/trunk/include/lldb/Core/Logging.h (original)
+++ lldb/trunk/include/lldb/Core/Logging.h Tue Oct  6 12:55:14 2015
@@ -48,6 +48,7 @@
 #define LIBLLDB_LOG_SYSTEM_RUNTIME  (1u << 26)
 #define LIBLLDB_LOG_JIT_LOADER  (1u << 27)
 #define LIBLLDB_LOG_LANGUAGE(1u << 28)
+#define LIBLLDB_LOG_DATAFORMATTERS  (1u << 29)
 #define LIBLLDB_LOG_ALL (UINT32_MAX)
 #define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS  |\
  LIBLLDB_LOG_THREAD   |\

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=249433&r1=249432&r2=249433&view=diff
==
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Tue Oct  6 12:55:14 2015
@@ -533,7 +533,7 @@ ScanBracketedRange (llvm::StringRef subp
 int64_t& index_lower,
 int64_t& index_higher)
 {
-Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+Log *log(lldb_private::GetLogIfAllCategoriesSet 
(LIBLLDB_LOG_DATAFORMATTERS));
 close_bracket_index = llvm::StringRef::npos;
 const size_t open_bracket_index = subpath.find('[');
 if (open_bracket_index == llvm::StringRef::npos)
@@ -670,7 +670,7 @@ ExpandIndexedExpression (ValueObject* va
  StackFrame* frame,
  bool deref_pointer)
 {
-Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+Log *log(lldb_private::GetLogIfAllCategoriesSet 
(LIBLLDB_LOG_DATAFORMATTERS));
 const char* ptr_deref_format = "[%d]";
 std::string ptr_deref_buffer(10,0);
 ::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index);
@@ -731,7 +731,7 @@ DumpValue (Stream &s,
 if (valobj == NULL)
 return false;
 
-Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+Log *log(lldb_private::GetLogIfAllCategoriesSet 
(LIBLLDB_LOG_DATAFORMATTERS));
 Format custom_format = eFormatInvalid;
 ValueObject::ValueObjectRepresentationStyle val_obj_display = 
entry.string.empty() ? ValueObject::eValueObjectRepresentationStyleValue : 
ValueObject::eValueObjectRepresentationStyleSummary;
 

Modified: lldb/trunk/source/Core/Logging.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Logging.cpp?rev=249433&r1=249432&r2=249433&view=diff
==
--- lldb/trunk/source/Core/Logging.cpp (original)
+++ lldb/trunk/source/Core/Logging.cpp Tue Oct  6 12:55:14 2015
@@ -148,6 +148,7 @@ lldb_private::DisableLog (const char **c
 else if (0 == ::strcasecmp(arg, "os"))  flag_bits &= 
~LIBLLDB_LOG_OS;
 else if (0 == ::strcasecmp(arg, "jit")) flag_bits &= 
~LIBLLDB_LOG_JIT_LOADER;
 else if (0 == ::strcasecmp(arg, "language"))flag_bits &= 
~LIBLLDB_LOG_LANGUAGE;
+else if (0 == ::strncasecmp(arg, "formatters", 10))   
flag_bits &= ~LIBLLDB_LOG_DATAFORMATTERS;
 else
 {
 feedback_strm->Printf ("error:  unrecognized log category 
'%s'\n", arg);
@@ -224,6 +225,7 @@ lldb_private::EnableLog (StreamSP &log_s
 else if (0 == ::strncasecmp(arg, "watch", 5))   flag_bits |= 
LIBLLDB_LOG_WATCHPOINTS;
 else if (0 == ::strcasecmp(arg, "jit")) flag_bits |= 
LIBLLDB_LOG_JIT_LOADER;
 else if (0 == ::strcasecmp(arg, "language"))flag_bits |= 
LIBLLDB_LOG_LANGUAGE;
+else if (0 == ::strncasecmp(arg, "formatters", 10))   flag_bits |= 
LIBLLDB_LOG_DATAFORMATTERS;
 else
 {
 feedback_strm->Printf("error: unrecognized log category 
'%s'\n", arg);
@@ -254,6 +256,7 @@ lldb_private::ListLogCategories (Stream
  "  dyld - log shared library related activities\n"
  "  events - log broadcaster, listener and event queue 
activities\n"
  "  expr - log expressions\n"
+ "  formatters - log data formatters related a

[Lldb-commits] [lldb] r249503 - Introduce a variant of GetSummaryAsCString() that takes a LanguageType argument, and use it when crafting summaries by running selectors

2015-10-06 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Oct  6 20:41:23 2015
New Revision: 249503

URL: http://llvm.org/viewvc/llvm-project?rev=249503&view=rev
Log:
Introduce a variant of GetSummaryAsCString() that takes a LanguageType 
argument, and use it when crafting summaries by running selectors

This is the first in a series of commits that are meant to teach LLDB how to 
properly handle multi-language formatting of values


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249503&r1=249502&r2=249503&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct  6 20:41:23 2015
@@ -610,11 +610,12 @@ public:
 GetLocationAsCString ();
 
 const char *
-GetSummaryAsCString ();
+GetSummaryAsCString (lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
 
 bool
 GetSummaryAsCString (TypeSummaryImpl* summary_ptr,
- std::string& destination);
+ std::string& destination,
+ lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
 
 bool
 GetSummaryAsCString (std::string& destination,

Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=249503&r1=249502&r2=249503&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Tue Oct  6 
20:41:23 2015
@@ -89,7 +89,8 @@ namespace lldb_private {
 ExtractSummaryFromObjCExpression (ValueObject &valobj,
   const char* target_type,
   const char* selector,
-  Stream &stream);
+  Stream &stream,
+  lldb::LanguageType lang_type);
 
 lldb::ValueObjectSP
 CallSelectorOnObject (ValueObject &valobj,

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=249503&r1=249502&r2=249503&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Oct  6 20:41:23 2015
@@ -874,9 +874,10 @@ ValueObject::CreateChildAtIndex (size_t
 
 bool
 ValueObject::GetSummaryAsCString (TypeSummaryImpl* summary_ptr,
-  std::string& destination)
+  std::string& destination,
+  lldb::LanguageType lang)
 {
-return GetSummaryAsCString(summary_ptr, destination, TypeSummaryOptions());
+return GetSummaryAsCString(summary_ptr, destination, 
TypeSummaryOptions().SetLanguage(lang));
 }
 
 bool
@@ -885,7 +886,7 @@ ValueObject::GetSummaryAsCString (TypeSu
   const TypeSummaryOptions& options)
 {
 destination.clear();
-
+
 // ideally we would like to bail out if passing NULL, but if we do so
 // we end up not providing the summary for function pointers anymore
 if (/*summary_ptr == NULL ||*/ m_is_getting_summary)
@@ -893,31 +894,38 @@ ValueObject::GetSummaryAsCString (TypeSu
 
 m_is_getting_summary = true;
 
+TypeSummaryOptions actual_options(options);
+
+if (actual_options.GetLanguage() == lldb::eLanguageTypeUnknown)
+actual_options.SetLanguage(GetPreferredDisplayLanguage());
+
 // this is a hot path in code and we prefer to avoid setting this string 
all too often also clearing out other
 // information that we might care to see in a crash log. might be useful 
in very specific situations though.
 /*Host::SetCrashDescriptionWithFormat("Trying to fetch a summary for %s 
%s. Summary provider's description is %s",
-GetTypeName().GetCString(),
-GetName().GetCString(),
-
summary_ptr->GetDescription().c_str());*/
+ GetTypeName().GetCString(),
+ GetName().GetCString(),
+ summary_ptr->GetDescription().c_str());*/
 
 if (UpdateValueIfNeeded (false) && summary_ptr)
 {
 if (HasSyntheticValue())
 m_synthetic_value->UpdateValueIfNeeded(); // the summary might 
depend on

[Lldb-commits] [lldb] r249506 - Enable the StringPrinter to have prefixes that are strings instead of just a single character; and also introduce a comparable suffix mechanism

2015-10-06 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Oct  6 21:06:48 2015
New Revision: 249506

URL: http://llvm.org/viewvc/llvm-project?rev=249506&view=rev
Log:
Enable the StringPrinter to have prefixes that are strings instead of just a 
single character; and also introduce a comparable suffix mechanism


Modified:
lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
lldb/trunk/source/DataFormatters/StringPrinter.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=249506&r1=249505&r2=249506&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Tue Oct  6 21:06:48 
2015
@@ -15,6 +15,7 @@
 #include "lldb/Core/DataExtractor.h"
 
 #include 
+#include 
 
 namespace lldb_private {
 namespace formatters
@@ -45,7 +46,8 @@ namespace lldb_private {
 m_location(0),
 m_process_sp(),
 m_stream(NULL),
-m_prefix_token(0),
+m_prefix_token(),
+m_suffix_token(),
 m_quote('"'),
 m_source_size(0),
 m_needs_zero_termination(true),
@@ -98,16 +100,43 @@ namespace lldb_private {
 }
 
 ReadStringAndDumpToStreamOptions&
-SetPrefixToken (char p)
+SetPrefixToken (const std::string& p)
 {
 m_prefix_token = p;
 return *this;
 }
 
-char
+ReadStringAndDumpToStreamOptions&
+SetPrefixToken (std::nullptr_t)
+{
+m_prefix_token.clear();
+return *this;
+}
+
+const char*
 GetPrefixToken () const
 {
-return m_prefix_token;
+return m_prefix_token.c_str();
+}
+
+ReadStringAndDumpToStreamOptions&
+SetSuffixToken (const std::string& p)
+{
+m_suffix_token = p;
+return *this;
+}
+
+ReadStringAndDumpToStreamOptions&
+SetSuffixToken (std::nullptr_t)
+{
+m_suffix_token.clear();
+return *this;
+}
+
+const char*
+GetSuffixToken () const
+{
+return m_suffix_token.c_str();
 }
 
 ReadStringAndDumpToStreamOptions&
@@ -206,7 +235,8 @@ namespace lldb_private {
 uint64_t m_location;
 lldb::ProcessSP m_process_sp;
 Stream* m_stream;
-char m_prefix_token;
+std::string m_prefix_token;
+std::string m_suffix_token;
 char m_quote;
 uint32_t m_source_size;
 bool m_needs_zero_termination;
@@ -223,7 +253,8 @@ namespace lldb_private {
 ReadBufferAndDumpToStreamOptions () :
 m_data(),
 m_stream(NULL),
-m_prefix_token(0),
+m_prefix_token(),
+m_suffix_token(),
 m_quote('"'),
 m_source_size(0),
 m_escape_non_printables(true),
@@ -263,16 +294,43 @@ namespace lldb_private {
 }
 
 ReadBufferAndDumpToStreamOptions&
-SetPrefixToken (char p)
+SetPrefixToken (const std::string& p)
 {
 m_prefix_token = p;
 return *this;
 }
 
-char
+ReadBufferAndDumpToStreamOptions&
+SetPrefixToken (std::nullptr_t)
+{
+m_prefix_token.clear();
+return *this;
+}
+
+const char*
 GetPrefixToken () const
 {
-return m_prefix_token;
+return m_prefix_token.c_str();
+}
+
+ReadBufferAndDumpToStreamOptions&
+SetSuffixToken (const std::string& p)
+{
+m_suffix_token = p;
+return *this;
+}
+
+ReadBufferAndDumpToStreamOptions&
+SetS

[Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this in us

2015-10-06 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Oct  6 21:36:35 2015
New Revision: 249507

URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev
Log:
Route the preferred-display-language mechanism to the ValueObjectPrinter and 
actually fill in a few gaps for dynamic and synthetic values to be able to 
adopt this in useful ways


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Core/ValueObjectConstResult.cpp
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct  6 21:36:35 2015
@@ -1242,6 +1242,9 @@ protected:
 bool
 IsChecksumEmpty ();
 
+void
+SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType);
+
 private:
 //--
 // For ValueObject only

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct  6 21:36:35 
2015
@@ -105,6 +105,12 @@ public:
 virtual TypeImpl
 GetTypeImpl ();
 
+virtual lldb::LanguageType
+GetPreferredDisplayLanguage ();
+
+void
+SetPreferredDisplayLanguage (lldb::LanguageType);
+
 virtual bool
 GetDeclaration (Declaration &decl);
 

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct  6 
21:36:35 2015
@@ -152,6 +152,12 @@ public:
 virtual void
 SetFormat (lldb::Format format);
 
+virtual lldb::LanguageType
+GetPreferredDisplayLanguage ();
+
+void
+SetPreferredDisplayLanguage (lldb::LanguageType);
+
 virtual bool
 GetDeclaration (Declaration &decl);
 

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=249507&r1=249506&r2=249507&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Oct  6 
21:36:35 2015
@@ -61,6 +61,7 @@ struct DumpValueObjectOptions
 lldb::Format m_format = lldb::eFormatDefault;
 lldb::TypeSummaryImplSP m_summary_sp;
 std::string m_root_valobj_name;
+lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown;
 PointerDepth m_max_ptr_depth;
 bool m_use_synthetic : 1;
 bool m_scope_already_checked : 1;
@@ -252,6 +253,13 @@ struct DumpValueObjectOptions
 return *this;
 }
 
+DumpValueObjectOptions&
+SetVariableFormatDisplayLanguage (lldb::LanguageType lang = 
lldb::eLanguageTypeUnknown)
+{
+m_varformat_language = lang;
+return *this;
+}
+
 DumpValueObjectOptions&
 SetRunValidator (bool run = true)
 {

Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=249507&r1=249506&r2=249507&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Tue Oct  6 21:36:35 
2015
@@ -335,6 +335,7 @@ CommandObjectExpression::EvaluateExpress
 result_valobj_sp->SetFormat (format);
 
 DumpValueObjectOptions 
options(m_varobj_options.GetAsDumpOptions(m

Re: [Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this i

2015-10-06 Thread Enrico Granata via lldb-commits
I am not done here.
Also, even once I am done, all that you will be able to see here is no 
regressions in existing functionality.

I am plumbing through a set of facilities that I need in order to make certain 
parts of data formatting logic Language-plugin based.

That is required to make it easier to support new source languages in a clean 
fashion.

Since the C++ and ObjC support is already there, there will be no (unintended) 
change in functionality. What you want to see here testing-wise is the lack of 
any regression for existing languages.

The benefits are to be reaped if you were to add support for a new source 
language, which then would require its own testing, ..., but I plan to do no 
such thing at the moment.

tl;dr existing tests cover this already; this is refactoring work

Sent from my iPhone

> On Oct 6, 2015, at 9:20 PM, Zachary Turner  wrote:
> 
> Actually upon further inspection it looks like the test that was updated was 
> not really anything new, but an update of an existing test to pass a new 
> argument through.
> 
> Can you add some tests that test this specific functionality?
> 
>> On Tue, Oct 6, 2015 at 9:09 PM Zachary Turner  wrote:
>> It looks like there's only 1 test added for all of this functionality from 
>> this and the last few commits, and that the test is specific to Objective C. 
>>  The functionality itself seems language agnostic though.  Is there any way 
>> to write a test that does not rely on a particular language?  That would 
>> improve the test coverage of this functionality.
>> 
>>> On Tue, Oct 6, 2015 at 7:38 PM Enrico Granata via lldb-commits 
>>>  wrote:
>>> Author: enrico
>>> Date: Tue Oct  6 21:36:35 2015
>>> New Revision: 249507
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev
>>> Log:
>>> Route the preferred-display-language mechanism to the ValueObjectPrinter 
>>> and actually fill in a few gaps for dynamic and synthetic values to be able 
>>> to adopt this in useful ways
>>> 
>>> 
>>> Modified:
>>> lldb/trunk/include/lldb/Core/ValueObject.h
>>> lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
>>> lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
>>> lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
>>> lldb/trunk/source/Commands/CommandObjectExpression.cpp
>>> lldb/trunk/source/Commands/CommandObjectFrame.cpp
>>> lldb/trunk/source/Core/ValueObject.cpp
>>> lldb/trunk/source/Core/ValueObjectConstResult.cpp
>>> lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
>>> lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
>>> lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
>>> 
>>> lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
>>> 
>>> Modified: lldb/trunk/include/lldb/Core/ValueObject.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Core/ValueObject.h (original)
>>> +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct  6 21:36:35 2015
>>> @@ -1242,6 +1242,9 @@ protected:
>>>  bool
>>>  IsChecksumEmpty ();
>>> 
>>> +void
>>> +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType);
>>> +
>>>  private:
>>>  //--
>>>  // For ValueObject only
>>> 
>>> Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
>>> +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct  6 
>>> 21:36:35 2015
>>> @@ -105,6 +105,12 @@ public:
>>>  virtual TypeImpl
>>>  GetTypeImpl ();
>>> 
>>> +virtual lldb::LanguageType
>>> +GetPreferredDisplayLanguage ();
>>> +
>>> +void
>>> +SetPreferredDisplayLanguage (lldb::LanguageType);
>>> +
>>>  virtual bool
>>>  GetDeclaration (Declaration &decl);
>>> 
>>> 
>>> Mo

[Lldb-commits] [lldb] r249587 - This is the work I was building up to with my patches yesterday

2015-10-07 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Oct  7 13:36:53 2015
New Revision: 249587

URL: http://llvm.org/viewvc/llvm-project?rev=249587&view=rev
Log:
This is the work I was building up to with my patches yesterday

Introduce the notion of Language-based formatter prefix/suffix
This is meant for languages that share certain data types but present them in 
syntatically different ways, such that LLDB can now have language-based 
awareness of which of the syntax variations it has to present to the user when 
formatting those values

This is goodness for new languages and interoperability, but is NFC for 
existing languages. As such, existing tests cover this


Modified:
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSString.h
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Target/Language.cpp

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py

lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py

lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/main.m

lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py

lldb/trunk/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=249587&r1=249586&r2=249587&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Wed Oct  7 13:36:53 2015
@@ -79,7 +79,7 @@ public:
 virtual lldb::LanguageType
 GetLanguageType () const = 0;
 
-bool
+virtual bool
 IsTopLevelFunction (Function& function);
 
 virtual lldb::TypeCategoryImplSP
@@ -106,6 +106,13 @@ public:
 virtual std::unique_ptr
 GetTypeScavenger ();
 
+// if an individual data formatter can apply to several types and cross a 
language boundary
+// it makes sense for individual languages to want to customize the 
printing of values of that
+// type by appending proper prefix/suffix information in language-specific 
ways
+virtual bool
+GetFormatterPrefixSuffix (ValueObject& valobj, ConstString type_hint,
+  std::string& prefix, std::string& suffix);
+
 // These are accessors for general information about the Languages lldb 
knows about:
 
 static lldb::LanguageType

Modified: lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CF.cpp?rev=249587&r1=249586&r2=249587&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/CF.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CF.cpp Wed Oct  7 13:36:53 2015
@@ -17,6 +17,7 @@
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/Host/Endian.h"
 #include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
 
@@ -42,6 +43,8 @@ lldb_private::formatters::CFAbsoluteTime
 bool
 lldb_private::formatters::CFBagSummaryProvider (ValueObject& valobj, Stream& 
stream, const TypeSummaryOptions& options)
 {
+static ConstString g_TypeHint("CFBag");
+
 ProcessSP process_sp = valobj.GetProcessSP();
 if (!process_sp)
 return false;
@@ -84,7 +87,9 @@ lldb_private::formatters::CFBagSummaryPr
 ValueObjectSP count_sp;
 StreamString expr;
 expr.Printf("(int)CFBagGetCount((void*)0x%" PRIx64 
")",valobj.GetPointerValue());
-if (process_sp->GetTarget().EvaluateExpression(expr.GetData(), 
frame_sp.get(), count_sp) != eExpressionCompleted)
+EvaluateExpressionOptions options;
+options.SetResultIsInternal(true);
+if (process_sp->GetTarget().EvaluateExpression(expr.GetData(), 
frame_sp.get(), count_sp, options) != eExpressionCompleted)
 return false;
 if (!count_sp)
 return false;
@@ -98,8 +103,21 @@ lldb_private::formatters::CFBagSummaryPr
 if (error.Fail())
 return false;
 }
-stream.Printf("@\"%u value%s\"",
-  

Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-12 Thread Enrico Granata via lldb-commits
granata.enrico requested changes to this revision.
granata.enrico added a comment.
This revision now requires changes to proceed.

Truth be told, I find this notation (numeric value + printable character) to be 
heavy and somewhat redundant

I would be happier with a model where printable characters print as the 
character, and non-printable ones print as the numeric value

With that said, if the MI really needs to do this for whatever reason, a 
solution would be for the MI to create its own formatters category and insert 
this formatter there. Since the char formatter is in the 'system' category, any 
other category you create should have higher priority and thus win the match 
and get to be the formatter of choice.
I am not sure whether the SB API allows CXXFormatterFunctions to be created, 
but this would be easy to add, so please feel free to do so and submit that 
change for review. I will gladly look at it!


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-12 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

The consistency argument is not entirely unfair.

I would claim that Unicode is a more complex beast than plain ASCII, so it 
makes sense to go the extra mile in giving you details in that case, compared 
to the simpler char case.

If the only reason you're pursuing the patch is to appease the test case, I say 
"no" to the change.
If you think this is actually worthwhile on its own merits, I would rather much 
have either a separate "MI" formatters category.


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [lldb] r250081 - Fix test for change in a summary string (objects -> elements).

2015-10-12 Thread Enrico Granata via lldb-commits

> On Oct 12, 2015, at 12:00 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> Author: jingham
> Date: Mon Oct 12 14:00:28 2015
> New Revision: 250081
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=250081&view=rev
> Log:
> Fix test for change in a summary string (objects -> elements).
> 
> Modified:
>lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
> 
> Modified: lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py?rev=250081&r1=250080&r2=250081&view=diff
> ==
> --- lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py (original)
> +++ lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py Mon Oct 12 
> 14:00:28 2015
> @@ -129,14 +129,14 @@ class HiddenIvarsTestCase(TestBase):
> substrs = ["= 3"])
> 
> self.expect("expression k.filteredDataSource", 
> VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = [' = 0x', '"2 objects"'])
> +substrs = [' = 0x', '"2 elements"'])
> 
> if strip:
> self.expect("expression *(k)", VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = ["foo = 2", ' = 0x', '"2 objects"'])
> +substrs = ["foo = 2", ' = 0x', '"2 elements"'])
> else:
> self.expect("expression *(k)", VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = ["foo = 2", "bar = 3", '_filteredDataSource = 0x', 
> '"2 objects"'])
> +substrs = ["foo = 2", "bar = 3", '_filteredDataSource = 0x', 
> '"2 elements"'])
> 
> def frame_var(self, strip):
> self.common_setup(strip)
> @@ -160,14 +160,14 @@ class HiddenIvarsTestCase(TestBase):
> substrs = ["= 2"])
> 
> self.expect("frame variable k->_filteredDataSource", 
> VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = [' = 0x', '"2 objects"'])
> +substrs = [' = 0x', '"2 elements"'])
> 
> if strip:
> self.expect("frame variable *k", VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = ["foo = 2", '_filteredDataSource = 0x', '"2 
> objects"'])
> +substrs = ["foo = 2", '_filteredDataSource = 0x', '"2 
> elements"'])
> else:
> self.expect("frame variable *k", VARIABLES_DISPLAYED_CORRECTLY,
> -substrs = ["foo = 2", "bar = 3", '_filteredDataSource = 0x', 
> '"2 objects"'])
> +substrs = ["foo = 2", "bar = 3", '_filteredDataSource = 0x', 
> '"2 elements"'])
> 
> 
> if __name__ == '__main__':
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Ops… Thanks for fixing this!

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


Re: [Lldb-commits] [PATCH] D13678: [libstdc++ data-formatters] Remove size limits and loop detector.

2015-10-12 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Why are you removing the loop detection?

As for the size capping, yes, if you remove the loop detection it will be less 
of a problem because downstream commands (e.g. frame variable) will actually 
cap how many elements get fetched unless the user overrides that determination 
(or the API is used directly to retrieve values)


http://reviews.llvm.org/D13678



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


Re: [Lldb-commits] [PATCH] D13678: [libstdc++ data-formatters] Remove size limits and loop detector.

2015-10-12 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Possibility number 3 (and the true reason why the check is there): if you stop 
at a place where the variable is not fully initialized/being torn down, and as 
a result, something is pointing back inside the list. For a list traversal, 
that is a deadly outcome.

This is (partially) the same reason why there's a cap on string summaries. It's 
fairly unlikely that a user will truly have a 3GB string (if they did, we might 
still want to cap it, but it's unlikely to begin with): an uninitialized string 
that claims to have a 3GB buffer.

I think there are ways to make this code smarter. For instance, if you have to 
get node #10, you could only check for a loop up until node #10, and so on..
If you store the state of the loop-checker as you get out, you might get away 
without having to check the same nodes multiple times as you progress deeper 
into the list

Drawback is that you would have already handed out at least some data by the 
time you find out the list is flawed. You can decide for yourself if that is a 
problem or not (the list might be partially valid, and returning some of the 
data is actually a good thing, maybe?)


http://reviews.llvm.org/D13678



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


Re: [Lldb-commits] [PATCH] D13678: [libstdc++ data-formatters] Remove size limits and loop detector.

2015-10-12 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Removing the size limit would be acceptable, yes

It is a remnant of a time when LLDB lacked ways to actually cap data at the 
command-line level and the Xcode UI did not do lazy fetching of values

Given that these things now work properly, the ability to generate *all* 
children for large lists should be safe


http://reviews.llvm.org/D13678



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Currently I don't think SBTypeSummary allows for defining formatters backed by 
a CXXFunctionSummaryFormat
It would, however, be a great addition to our API. Is it a change you're 
interested in working on?

If so, the easy part is going to be introducing LLVM-style RTTI for 
TypeSummaryImpl such that one can replace the ->IsScripted() calls with a 
proper switch over all kinds of summaries (there's three, you're gonna want to 
introduce a fourth - read below).
The slightly more interesting part is that currently CXXFunctionSummaryFormat 
expects to transact in ValueObjects and std::strings. These are things we 
cannot expose at the SB layer. So we might need to add yet another kind of 
summary that instead takes an SBValue, an SBSummaryOptions and fills in an 
SBStream. Once we have that, the MI could actually use the functionality to 
register its own summaries (and if we find SBValue to be lackluster in any way 
as a result, we should fill in those gaps).


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

We are not supposed to be inheriting from SB classes, much less introduce 
virtual-ness to them (Greg can go in detail about the reasons, the tl;dr is 
that it has the potential to be ABI-breaking)

The way one would do that is to have a typedef akin to (and after fixing up any 
syntax errors and choosing a nice name)

typedef bool (*SBSummaryFormatterCallback)(SBValue, SBTypeSummaryOptions, 
SBStream&)

Unfortunately it has to be a C-style function pointer, and not an 
std::function, again because the SB API can't use the STL

Then you would have a creating function of the sort of:

SBTypeSummary::CreateCxxFunctionSummary(const char* name, const char* 
description, SBSummaryFormatterCallback callback)
(CxxFunctionSummary is definitely not great as a name, but I have no better 
suggestion right now - let's worry about that once we have some code up and 
running)

You might need to make yourself a subclass of TypeSummaryImpl in the .cpp file 
to store these formatters. It will essentially be very similar to 
CXXFunctionSummaryFormat except it would end up using the 
SBSummaryFormatterCallback typedef - and also it has to live in the 
SBTypeSummary.cpp because we can't put things that reference the SB API in 
lldb_private. Notice that, if you're so inclined, your helper class *can* 
actually use an std::function, and have virtual functions, and all such 
niceties, because it is an implementation-only detail not exposed to API clients


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-14 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Admittedly way simpler than my original idea. +1

Having the RTTI support so that these SBTypeSummary objects can actually be 
used for anything other than mere creation would be nice.
However, I can fill that gap myself later.



Comment at: source/API/SBTypeSummary.cpp:157
@@ +156,3 @@
+SBStream stream;
+if (!cb(valobj.GetSP(), &opt, stream))
+return false;

I assume you are essentially relying on the SBValue constructor that takes a 
ValueObjectSP here, right?
And similarly for the SummaryOptions?


Comment at: source/API/SBTypeSummary.cpp:162
@@ +161,3 @@
+   },
+   "SBTypeSummary formatter callbacxk"
+   )

Any reason not to let people submit their own name/description for the summary 
formatter here?


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-14 Thread Enrico Granata via lldb-commits
granata.enrico added inline comments.


Comment at: source/API/SBTypeSummary.cpp:155
@@ +154,3 @@
+   new CXXFunctionSummaryFormat(options, 
+   [cb] (ValueObject& valobj, Stream& stm, const 
TypeSummaryOptions& opt) -> bool {
+SBStream stream;

Should we check for cb != null here?


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13699: RenderScript command for printing allocation contents.

2015-10-14 Thread Enrico Granata via lldb-commits
granata.enrico added a subscriber: granata.enrico.
granata.enrico added a comment.

Is there any reason why we need a special command here?

Are these allocations not bound to any user-visible variable, such that one 
could get the same result by using our existing data inspection commands 
(expression, frame variable, ...) with some data formatter support?


Repository:
  rL LLVM

http://reviews.llvm.org/D13699



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-14 Thread Enrico Granata via lldb-commits
granata.enrico added inline comments.


Comment at: source/API/SBTypeSummary.cpp:155
@@ +154,3 @@
+   new CXXFunctionSummaryFormat(options, 
+   [cb] (ValueObject& valobj, Stream& stm, const 
TypeSummaryOptions& opt) -> bool {
+SBStream stream;

evgeny777 wrote:
> granata.enrico wrote:
> > Should we check for cb != null here?
> May be assert(cb) ?
No, I would rather much us create an hollow SBTypeSummary (with a 
TypeSummaryImplSP that points to nullptr). Then you would get an invalid one 
(IsValid() == false) but not cause a crash


Comment at: source/API/SBTypeSummary.cpp:157
@@ +156,3 @@
+SBStream stream;
+if (!cb(valobj.GetSP(), &opt, stream))
+return false;

evgeny777 wrote:
> granata.enrico wrote:
> > I assume you are essentially relying on the SBValue constructor that takes 
> > a ValueObjectSP here, right?
> > And similarly for the SummaryOptions?
> You're right - implicit construction here
Sorry to nitpick, but is there any advantage to not using explicit construction 
here?


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-14 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

So, if you do the explicit constructor change and handle the case of a nullptr 
Callback I think it should be good to go. Looking forward to it!



Comment at: source/API/SBTypeSummary.cpp:157
@@ +156,3 @@
+SBStream stream;
+if (!cb(valobj.GetSP(), &opt, stream))
+return false;

evgeny777 wrote:
> granata.enrico wrote:
> > evgeny777 wrote:
> > > granata.enrico wrote:
> > > > I assume you are essentially relying on the SBValue constructor that 
> > > > takes a ValueObjectSP here, right?
> > > > And similarly for the SummaryOptions?
> > > You're right - implicit construction here
> > Sorry to nitpick, but is there any advantage to not using explicit 
> > construction here?
> None, except more compact code. Would like to use explicit construction here?
Yes, I would prefer that

It saves us a few lines of code, but it is confusing to read, and I want to 
make sure we don't break sometime in the future due to changes in the 
constructor (the ones taking SPs are technically private to us)


http://reviews.llvm.org/D13657



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


[Lldb-commits] [lldb] r250339 - Fix a problem where LLDB could sometimes try to get the size of an Objective-C type without passing an appropriate ExecutionContext

2015-10-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Oct 14 17:44:30 2015
New Revision: 250339

URL: http://llvm.org/viewvc/llvm-project?rev=250339&view=rev
Log:
Fix a problem where LLDB could sometimes try to get the size of an Objective-C 
type without passing an appropriate ExecutionContext


Modified:
lldb/trunk/include/lldb/Core/Value.h
lldb/trunk/source/Core/Value.cpp
lldb/trunk/source/Core/ValueObjectCast.cpp
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

Modified: lldb/trunk/include/lldb/Core/Value.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=250339&r1=250338&r2=250339&view=diff
==
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Wed Oct 14 17:44:30 2015
@@ -265,7 +265,7 @@ public:
 GetValueDefaultFormat ();
 
 uint64_t
-GetValueByteSize (Error *error_ptr);
+GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx);
 
 Error
 GetValueAsData (ExecutionContext *exe_ctx, 

Modified: lldb/trunk/source/Core/Value.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=250339&r1=250338&r2=250339&view=diff
==
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Wed Oct 14 17:44:30 2015
@@ -260,7 +260,7 @@ Value::ValueOf(ExecutionContext *exe_ctx
 }
 
 uint64_t
-Value::GetValueByteSize (Error *error_ptr)
+Value::GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx)
 {
 uint64_t byte_size = 0;
 
@@ -277,7 +277,7 @@ Value::GetValueByteSize (Error *error_pt
 {
 const CompilerType &ast_type = GetCompilerType();
 if (ast_type.IsValid())
-byte_size = ast_type.GetByteSize(nullptr);
+byte_size = ast_type.GetByteSize(exe_ctx ? 
exe_ctx->GetBestExecutionContextScope() : nullptr);
 }
 break;
 }
@@ -434,7 +434,7 @@ Value::GetValueAsData (ExecutionContext
 lldb::Encoding type_encoding = 
ast_type.GetEncoding(type_encoding_count);
 
 if (type_encoding == eEncodingUint || type_encoding == 
eEncodingSint)
-limit_byte_size = ast_type.GetByteSize(nullptr);
+limit_byte_size = ast_type.GetByteSize(exe_ctx ? 
exe_ctx->GetBestExecutionContextScope() : nullptr);
 }
 
 if (m_value.GetData (data, limit_byte_size))
@@ -639,7 +639,7 @@ Value::GetValueAsData (ExecutionContext
 }
 
 // If we got here, we need to read the value from memory
-size_t byte_size = GetValueByteSize (&error);
+size_t byte_size = GetValueByteSize (&error, exe_ctx);
 
 // Bail if we encountered any errors getting the byte size
 if (error.Fail())

Modified: lldb/trunk/source/Core/ValueObjectCast.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectCast.cpp?rev=250339&r1=250338&r2=250339&view=diff
==
--- lldb/trunk/source/Core/ValueObjectCast.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectCast.cpp Wed Oct 14 17:44:30 2015
@@ -76,7 +76,8 @@ ValueObjectCast::CalculateNumChildren()
 uint64_t
 ValueObjectCast::GetByteSize()
 {
-return m_value.GetValueByteSize(NULL);
+ExecutionContext exe_ctx (GetExecutionContextRef());
+return m_value.GetValueByteSize(nullptr, &exe_ctx);
 }
 
 lldb::ValueType

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=250339&r1=250338&r2=250339&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Wed Oct 14 17:44:30 2015
@@ -127,7 +127,10 @@ ValueObjectDynamicValue::GetByteSize()
 {
 const bool success = UpdateValueIfNeeded(false);
 if (success && m_dynamic_type_info.HasType())
-return m_value.GetValueByteSize(nullptr);
+{
+ExecutionContext exe_ctx (GetExecutionContextRef());
+return m_value.GetValueByteSize(nullptr, &exe_ctx);
+}
 else
 return m_parent->GetByteSize();
 }


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


[Lldb-commits] [lldb] r250340 - Fix a couple issues where trying to print a type would cause LLDB to crash

2015-10-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Oct 14 17:44:50 2015
New Revision: 250340

URL: http://llvm.org/viewvc/llvm-project?rev=250340&view=rev
Log:
Fix a couple issues where trying to print a type would cause LLDB to crash


Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=250340&r1=250339&r2=250340&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Oct 14 17:44:50 2015
@@ -4431,7 +4431,7 @@ ClangASTContext::GetBitSize (lldb::opaqu
 if (!g_printed)
 {
 StreamString s;
-DumpTypeDescription(&s);
+DumpTypeDescription(type, &s);
 
 llvm::outs() << "warning: trying to determine the size 
of type ";
 llvm::outs() << s.GetString() << "\n";
@@ -8822,7 +8822,7 @@ void
 ClangASTContext::DumpTypeDescription (lldb::opaque_compiler_type_t type)
 {
 StreamFile s (stdout, false);
-DumpTypeDescription (&s);
+DumpTypeDescription (type, &s);
 ClangASTMetadata *metadata = ClangASTContext::GetMetadata 
(getASTContext(), type);
 if (metadata)
 {


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


[Lldb-commits] [lldb] r250341 - Add a data formatter for __NSArray0, the type of empty arrays

2015-10-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Wed Oct 14 17:45:04 2015
New Revision: 250341

URL: http://llvm.org/viewvc/llvm-project?rev=250341&view=rev
Log:
Add a data formatter for __NSArray0, the type of empty arrays

Modified:
lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp?rev=250341&r1=250340&r2=250341&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp Wed Oct 14 17:45:04 2015
@@ -202,6 +202,31 @@ namespace  lldb_private {
 std::vector m_children;
 };
 
+class NSArray0SyntheticFrontEnd : public SyntheticChildrenFrontEnd
+{
+public:
+NSArray0SyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+virtual size_t
+CalculateNumChildren ();
+
+virtual lldb::ValueObjectSP
+GetChildAtIndex (size_t idx);
+
+virtual bool
+Update();
+
+virtual bool
+MightHaveChildren ();
+
+virtual size_t
+GetIndexOfChildWithName (const ConstString &name);
+
+virtual
+~NSArray0SyntheticFrontEnd ();
+private:
+};
+
 class NSArrayCodeRunningSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd
 {
 public:
@@ -275,6 +300,10 @@ lldb_private::formatters::NSArraySummary
 if (error.Fail())
 return false;
 }
+else if (!strcmp(class_name,"__NSArray0"))
+{
+value = 0;
+}
 else if (!strcmp(class_name,"__NSCFArray"))
 {
 Error error;
@@ -632,6 +661,45 @@ lldb_private::formatters::NSArrayISynthe
 return retval_sp;
 }
 
+lldb_private::formatters::NSArray0SyntheticFrontEnd::NSArray0SyntheticFrontEnd 
(lldb::ValueObjectSP valobj_sp) :
+SyntheticChildrenFrontEnd (*valobj_sp.get())
+{
+}
+
+lldb_private::formatters::NSArray0SyntheticFrontEnd::~NSArray0SyntheticFrontEnd
 ()
+{
+}
+
+size_t
+lldb_private::formatters::NSArray0SyntheticFrontEnd::GetIndexOfChildWithName 
(const ConstString &name)
+{
+return UINT32_MAX;
+}
+
+size_t
+lldb_private::formatters::NSArray0SyntheticFrontEnd::CalculateNumChildren ()
+{
+return 0;
+}
+
+bool
+lldb_private::formatters::NSArray0SyntheticFrontEnd::Update()
+{
+return false;
+}
+
+bool
+lldb_private::formatters::NSArray0SyntheticFrontEnd::MightHaveChildren ()
+{
+return false;
+}
+
+lldb::ValueObjectSP
+lldb_private::formatters::NSArray0SyntheticFrontEnd::GetChildAtIndex (size_t 
idx)
+{
+return lldb::ValueObjectSP();
+}
+
 SyntheticChildrenFrontEnd* 
lldb_private::formatters::NSArraySyntheticFrontEndCreator 
(CXXSyntheticChildren*, lldb::ValueObjectSP valobj_sp)
 {
 if (!valobj_sp)
@@ -669,6 +737,10 @@ SyntheticChildrenFrontEnd* lldb_private:
 {
 return (new NSArrayISyntheticFrontEnd(valobj_sp));
 }
+else if (!strcmp(class_name,"__NSArray0"))
+{
+return (new NSArray0SyntheticFrontEnd(valobj_sp));
+}
 else if (!strcmp(class_name,"__NSArrayM"))
 {
 if (runtime->GetFoundationVersion() >= 1100)

Modified: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp?rev=250341&r1=250340&r2=250341&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp Wed Oct 14 
17:45:04 2015
@@ -446,6 +446,7 @@ LoadObjCFormatters(TypeCategoryImplSP ob
 AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("NSArray"), appkit_flags);
 AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("NSMutableArray"), appkit_flags);
 AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("__NSArrayI"), appkit_flags);
+AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("__NSArray0"), appkit_flags);
 AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("__NSArrayM"), appkit_flags);
 AddCXXSummary(objc_category_sp, 
lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", 
ConstString("__NSCFA

Re: [Lldb-commits] [PATCH] D13577: Fix build with python disabled after r249597

2015-10-15 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.

Looks fine to me


Repository:
  rL LLVM

http://reviews.llvm.org/D13577



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-15 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Fine to get it in


http://reviews.llvm.org/D13657



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


  1   2   3   4   5   >