[Lldb-commits] [lldb] r243902 - Jim suggested to use eArgTypeAddressOrExpression for the addresses that 'memory find' takes

2015-08-03 Thread Enrico Granata
Author: enrico
Date: Mon Aug  3 15:47:19 2015
New Revision: 243902

URL: http://llvm.org/viewvc/llvm-project?rev=243902&view=rev
Log:
Jim suggested to use eArgTypeAddressOrExpression for the addresses that 'memory 
find' takes

Modified:
lldb/trunk/source/Commands/CommandObjectMemory.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=243902&r1=243901&r2=243902&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Mon Aug  3 15:47:19 2015
@@ -1042,15 +1042,15 @@ public:
 CommandArgumentData value_arg;
 
 // Define the first (and only) variant of this arg.
-addr_arg.arg_type = eArgTypeAddress;
+addr_arg.arg_type = eArgTypeAddressOrExpression;
 addr_arg.arg_repetition = eArgRepeatPlain;
 
 // There is only one variant this argument could be; put it into the 
argument entry.
 arg1.push_back (addr_arg);
 
 // Define the first (and only) variant of this arg.
-value_arg.arg_type = eArgTypeValue;
-value_arg.arg_repetition = eArgRepeatPlus;
+value_arg.arg_type = eArgTypeAddressOrExpression;
+value_arg.arg_repetition = eArgRepeatPlain;
 
 // There is only one variant this argument could be; put it into the 
argument entry.
 arg2.push_back (value_arg);


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243893 - Fix the memory find command such that it can actually take an expression

2015-08-03 Thread Enrico Granata
Author: enrico
Date: Mon Aug  3 13:51:39 2015
New Revision: 243893

URL: http://llvm.org/viewvc/llvm-project?rev=243893&view=rev
Log:
Fix the memory find command such that it can actually take an expression

Modified:
lldb/trunk/source/Commands/CommandObjectMemory.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=243893&r1=243892&r2=243893&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Mon Aug  3 13:51:39 2015
@@ -1119,7 +1119,8 @@ protected:
   {
   StackFrame* frame = m_exe_ctx.GetFramePtr();
   ValueObjectSP result_sp;
-  if 
(process->GetTarget().EvaluateExpression(m_memory_options.m_expr.GetStringValue(),
 frame, result_sp) && result_sp.get())
+  if ((eExpressionCompleted == 
process->GetTarget().EvaluateExpression(m_memory_options.m_expr.GetStringValue(),
 frame, result_sp)) &&
+  result_sp.get())
   {
   uint64_t value = result_sp->GetValueAsUnsigned(0);
   switch (result_sp->GetClangType().GetByteSize(nullptr))
@@ -1150,13 +1151,13 @@ protected:
   result.AppendError("unknown type. pass a string 
instead");
   return false;
   default:
-  result.AppendError("do not know how to deal with larger 
than 8 byte result types. pass a string instead");
+  result.AppendError("result size larger than 8 bytes. 
pass a string instead");
   return false;
   }
   }
   else
   {
-  result.AppendError("expression evaluation failed. pass a string 
instead?");
+  result.AppendError("expression evaluation failed. pass a string 
instead");
   return false;
   }
   }
@@ -1176,14 +1177,14 @@ protected:
   {
   if (!ever_found)
   {
-  result.AppendMessage("Your data was not found within the 
range.\n");
+  result.AppendMessage("data not found within the range.\n");
   result.SetStatus(lldb::eReturnStatusSuccessFinishNoResult);
   }
   else
-  result.AppendMessage("No more matches found within the 
range.\n");
+  result.AppendMessage("no more matches within the range.\n");
   break;
   }
-  result.AppendMessageWithFormat("Your data was found at location: 
0x%" PRIx64 "\n", found_location);
+  result.AppendMessageWithFormat("data found at location: 0x%" PRIx64 
"\n", found_location);
 
   DataBufferHeap dumpbuffer(32,0);
   
process->ReadMemory(found_location+m_memory_options.m_offset.GetCurrentValue(), 
dumpbuffer.GetBytes(), dumpbuffer.GetByteSize(), error);
@@ -1211,27 +1212,16 @@ protected:
 {
 Process *process = m_exe_ctx.GetProcessPtr();
 DataBufferHeap heap(buffer_size, 0);
-lldb::addr_t fictional_ptr = low;
 for (auto ptr = low;
- low < high;
- fictional_ptr++)
+ ptr < high;
+ ptr++)
 {
 Error error;
-if (ptr == low || buffer_size == 1)
-process->ReadMemory(ptr, heap.GetBytes(), buffer_size, error);
-else
-{
-memmove(heap.GetBytes(), heap.GetBytes()+1, buffer_size-1);
-process->ReadMemory(ptr, heap.GetBytes()+buffer_size-1, 1, 
error);
-}
+process->ReadMemory(ptr, heap.GetBytes(), buffer_size, error);
 if (error.Fail())
 return LLDB_INVALID_ADDRESS;
 if (memcmp(heap.GetBytes(), buffer, buffer_size) == 0)
-return fictional_ptr;
-if (ptr == low)
-ptr += buffer_size;
-else
-ptr += 1;
+return ptr;
 }
 return LLDB_INVALID_ADDRESS;
 }


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243483 - Cleanup a few stale comments in FormattersContainer.h

2015-07-28 Thread Enrico Granata
Author: enrico
Date: Tue Jul 28 16:28:33 2015
New Revision: 243483

URL: http://llvm.org/viewvc/llvm-project?rev=243483&view=rev
Log:
Cleanup a few stale comments in FormattersContainer.h

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

Modified: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=243483&r1=243482&r2=243483&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Tue Jul 28 
16:28:33 2015
@@ -43,10 +43,6 @@
 
 namespace lldb_private {
 
-// this file (and its. cpp) contain the low-level implementation of LLDB Data 
Visualization
-// class DataVisualization is the high-level front-end of this feature
-// clients should refer to that class as the entry-point into the data 
formatters
-// unless they have a good reason to bypass it and prefer to use this file's 
objects directly
 class IFormatChangeListener
 {
 public:
@@ -447,7 +443,6 @@ protected:
 {
 for (const FormattersMatchCandidate& candidate : candidates)
 {
-// FIXME: could we do the IsMatch() check first?
 if (Get(candidate.GetTypeName(),entry))
 {
 if (candidate.IsMatch(entry) == false)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243482 - Make ClangASTType::RemoveFastQualifiers() actually do something useful

2015-07-28 Thread Enrico Granata
Author: enrico
Date: Tue Jul 28 16:24:39 2015
New Revision: 243482

URL: http://llvm.org/viewvc/llvm-project?rev=243482&view=rev
Log:
Make ClangASTType::RemoveFastQualifiers() actually do something useful

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

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=243482&r1=243481&r2=243482&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Jul 28 16:24:39 2015
@@ -2084,7 +2084,7 @@ ClangASTType::RemoveFastQualifiers () co
 if (m_type)
 {
 clang::QualType qual_type(GetQualType());
-qual_type.getQualifiers().removeFastQualifiers();
+qual_type.removeLocalFastQualifiers();
 return ClangASTType (m_ast, qual_type);
 }
 return ClangASTType();


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243472 - Fix a bug where the std::list synthetic child provider would not clean its cache correctly on update, causing stale children to be returned in some circumstances

2015-07-28 Thread Enrico Granata
Author: enrico
Date: Tue Jul 28 15:19:45 2015
New Revision: 243472

URL: http://llvm.org/viewvc/llvm-project?rev=243472&view=rev
Log:
Fix a bug where the std::list synthetic child provider would not clean its 
cache correctly on update, causing stale children to be returned in some 
circumstances

Fixes rdar://20560680


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

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

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp

Modified: lldb/trunk/source/DataFormatters/LibCxxList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxList.cpp?rev=243472&r1=243471&r2=243472&view=diff
==
--- lldb/trunk/source/DataFormatters/LibCxxList.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxList.cpp Tue Jul 28 15:19:45 2015
@@ -312,6 +312,7 @@ lldb_private::formatters::LibcxxStdListS
 bool
 lldb_private::formatters::LibcxxStdListSyntheticFrontEnd::Update()
 {
+m_children.clear();
 m_head = m_tail = NULL;
 m_node_address = 0;
 m_count = UINT32_MAX;

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=243472&r1=243471&r2=243472&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
 Tue Jul 28 15:19:45 2015
@@ -33,6 +33,8 @@ class LibcxxListDataFormatterTestCase(Te
 # Find the line number to break at.
 self.line = line_number('main.cpp', '// Set break point at this line.')
 self.line2 = line_number('main.cpp', '// Set second break point at 
this line.')
+self.line3 = line_number('main.cpp', '// Set third break point at this 
line.')
+self.line4 = line_number('main.cpp', '// Set fourth break point at 
this line.')
 
 def data_formatter_commands(self):
 """Test that that file and class static variables display correctly."""
@@ -40,6 +42,8 @@ class LibcxxListDataFormatterTestCase(Te
 
 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, 
num_expected_locations=-1)
 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, 
num_expected_locations=-1)
+lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line3, 
num_expected_locations=-1)
+lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line4, 
num_expected_locations=-1)
 
 self.runCmd("run", RUN_SUCCEEDED)
 
@@ -172,6 +176,21 @@ class LibcxxListDataFormatterTestCase(Te
 substrs = ['goofy']);
 self.expect("frame variable text_list[3]",
 substrs = ['!!!']);
+
+self.runCmd("continue")
+
+# check that the list provider correctly updates if elements move
+countingList = self.frame().FindVariable("countingList")
+countingList.SetPreferDynamicValue(True)
+countingList.SetPreferSyntheticValue(True)
+
+self.assertTrue(countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) 
== 3141, "list[0] == 3141")
+self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) 
== 3141, "list[1] == 3141")
+
+self.runCmd("continue")
+
+self.assertTrue(countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) 
== 3141, "uniqued list[0] == 3141")
+self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) 
== 3142, "uniqued list[1] == 3142")
 
 if __name__ == '__main__':
 import atexit

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp?rev=243472&r1=243471&r2=243472&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
 Tue Jul 28 15:19:45 2015
@@ -33,6 +33,11 @@ int main()
 (text_list.push_back(std::string("smart")));
 
 (text_list.push_back(std::string("!!!"))); // Set second break point at 
this line.
-
+
+std::list countingList = {3141, 3142, 3142,3142,3142, 3142, 3142, 
3141};
+countingList.sort();
+countingList.unique(); // Set third break point at t

[Lldb-commits] [lldb] r243369 - There is no reason why this formatter should not cascade. Make it cascade

2015-07-27 Thread Enrico Granata
Author: enrico
Date: Mon Jul 27 21:13:03 2015
New Revision: 243369

URL: http://llvm.org/viewvc/llvm-project?rev=243369&view=rev
Log:
There is no reason why this formatter should not cascade. Make it cascade

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=243369&r1=243368&r2=243369&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Jul 27 21:13:03 2015
@@ -1157,7 +1157,7 @@ FormatManager::LoadSystemFormatters()
 .SetHideItemNames(false);
 
 TypeSummaryImpl::Flags string_array_flags;
-string_array_flags.SetCascades(false)
+string_array_flags.SetCascades(true)
 .SetSkipPointers(true)
 .SetSkipReferences(false)
 .SetDontShowChildren(true)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243367 - Second attempt at the fix for the recursion in ValueObjectChild::CanUpdateWithInvalidExecutionContext()

2015-07-27 Thread Enrico Granata
Author: enrico
Date: Mon Jul 27 20:45:23 2015
New Revision: 243367

URL: http://llvm.org/viewvc/llvm-project?rev=243367&view=rev
Log:
Second attempt at the fix for the recursion in 
ValueObjectChild::CanUpdateWithInvalidExecutionContext()

This one should prevent the previous issues, and be the one true fix for 
rdar://21949558


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectChild.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObjectChild.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=243367&r1=243366&r2=243367&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Mon Jul 27 20:45:23 2015
@@ -861,7 +861,7 @@ public:
 bool
 NeedsUpdating ()
 {
-const bool accept_invalid_exe_ctx = 
CanUpdateWithInvalidExecutionContext();
+const bool accept_invalid_exe_ctx = 
(CanUpdateWithInvalidExecutionContext() == eLazyBoolYes);
 return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
 }
 
@@ -1172,10 +1172,10 @@ protected:
 virtual bool
 UpdateValue () = 0;
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return false;
+return eLazyBoolCalculate;
 }
 
 virtual void

Modified: lldb/trunk/include/lldb/Core/ValueObjectChild.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectChild.h?rev=243367&r1=243366&r2=243367&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h Mon Jul 27 20:45:23 2015
@@ -16,6 +16,8 @@
 // Project includes
 #include "lldb/Core/ValueObject.h"
 
+#include "llvm/ADT/Optional.h"
+
 namespace lldb_private {
 
 //--
@@ -84,7 +86,7 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ();
 
 virtual ClangASTType
@@ -101,6 +103,7 @@ protected:
 uint8_t m_bitfield_bit_offset;
 bool m_is_base_class;
 bool m_is_deref_of_parent;
+llvm::Optional m_can_update_with_invalid_exe_ctx;
 
 //
 //  void

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=243367&r1=243366&r2=243367&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Mon Jul 27 20:45:23 
2015
@@ -109,10 +109,10 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return true;
+return eLazyBoolYes;
 }
 
 virtual lldb::DynamicValueType

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=243367&r1=243366&r2=243367&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Mon Jul 27 
20:45:23 2015
@@ -156,10 +156,10 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return true;
+return eLazyBoolYes;
 }
 
 virtual ClangASTType

Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=243367&r1=243366&r2=243367&view=diff
==
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Mon Jul 27 20:45:23 2015
@@ -44,7 +44,8 @@ ValueObjectChild::ValueObjectChild
 m_bitfield_bit_size (bitfield_bit_size),
 m_bitfield_bit_offset (bitfield_bit_offset),
 m_is_base_class (is_base_class),
-m_is_deref_of_parent (is_deref_of_parent)
+m_is_deref_of_parent (is_deref_of_parent),
+m_can_update_with_invalid_exe_ctx()
 {
 m_name = name;
 SetAddressTypeOfChildren(child_ptr_or_ref_addr_type);
@@ -109,12 +110,20 @@ ValueObjectChild::GetDisplayTypeName()
 return display_name;
 }
 
-bool
+LazyBool
 ValueObjectChild::CanUpdateWithInvalidExecutionContext ()
 {
+  

[Lldb-commits] [lldb] r243330 - If a path contains a '/' before a ':', then the ':' is not a hostname separator, but just a part of the path (e.g. /tmp/fi:lename vs. pro:/tmp/fi:lename)

2015-07-27 Thread Enrico Granata
Author: enrico
Date: Mon Jul 27 16:27:02 2015
New Revision: 243330

URL: http://llvm.org/viewvc/llvm-project?rev=243330&view=rev
Log:
If a path contains a '/' before a ':', then the ':' is not a hostname 
separator, but just a part of the path (e.g. /tmp/fi:lename vs. 
pro:/tmp/fi:lename)


Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=243330&r1=243329&r2=243330&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jul 27 
16:27:02 2015
@@ -126,9 +126,15 @@ removeHostnameFromPathname(const char* p
 {
 return path_from_dwarf;
 }
-
+
 const char *colon_pos = strchr(path_from_dwarf, ':');
-if (!colon_pos)
+if (nullptr == colon_pos)
+{
+return path_from_dwarf;
+}
+
+const char *slash_pos = strchr(path_from_dwarf, '/');
+if (slash_pos && (slash_pos < colon_pos))
 {
 return path_from_dwarf;
 }
@@ -143,7 +149,7 @@ removeHostnameFromPathname(const char* p
 {
 return path_from_dwarf;
 }
-
+
 return colon_pos + 1;
 }
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11498: Print reference values on one line.

2015-07-27 Thread Enrico Granata
granata.enrico added a comment.

Can you please try using revision 243301 or later?

In my testing, this change makes references work the way you expect
If you're still not getting the behavior you expect, can you please include a 
test case that fails before your change but succeeds after? That should help 
ensure we don't regress, and might also help us pinpoint the correct change to 
make


http://reviews.llvm.org/D11498




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243301 - Add a more tweakable way for ValueObjectPrinter to control pointer expansion. NFC.

2015-07-27 Thread Enrico Granata
Author: enrico
Date: Mon Jul 27 13:34:14 2015
New Revision: 243301

URL: http://llvm.org/viewvc/llvm-project?rev=243301&view=rev
Log:
Add a more tweakable way for ValueObjectPrinter to control pointer expansion. 
NFC.


Modified:
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=243301&r1=243300&r2=243301&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Mon Jul 27 
13:34:14 2015
@@ -26,13 +26,42 @@ namespace lldb_private {
 
 struct DumpValueObjectOptions
 {
-uint32_t m_max_ptr_depth = 0;
+struct PointerDepth
+{
+enum class Mode
+{
+Always,
+Formatters,
+Default,
+Never
+} m_mode;
+uint32_t m_count;
+
+PointerDepth
+operator --() const
+{
+if (m_count > 0)
+return PointerDepth {m_mode,m_count-1};
+return PointerDepth {m_mode,m_count};
+}
+
+bool
+CanAllowExpansion () const;
+
+bool
+CanAllowExpansion (bool is_root,
+   TypeSummaryImpl* entry,
+   ValueObject *valobj,
+   const std::string& summary);
+};
+
 uint32_t m_max_depth = UINT32_MAX;
 lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
 uint32_t m_omit_summary_depth = 0;
 lldb::Format m_format = lldb::eFormatDefault;
 lldb::TypeSummaryImplSP m_summary_sp;
 std::string m_root_valobj_name;
+PointerDepth m_max_ptr_depth;
 bool m_use_synthetic : 1;
 bool m_scope_already_checked : 1;
 bool m_flat_output : 1;
@@ -50,6 +79,7 @@ struct DumpValueObjectOptions
 DumpValueObjectOptions() :
 m_summary_sp(),
 m_root_valobj_name(),
+m_max_ptr_depth{PointerDepth::Mode::Default,0},
 m_use_synthetic(true),
 m_scope_already_checked(false),
 m_flat_output(false),
@@ -78,7 +108,7 @@ struct DumpValueObjectOptions
 DumpValueObjectOptions (ValueObject& valobj);
 
 DumpValueObjectOptions&
-SetMaximumPointerDepth(uint32_t depth = 0)
+SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never,0})
 {
 m_max_ptr_depth = depth;
 return *this;
@@ -268,7 +298,7 @@ protected:
 ValueObjectPrinter (ValueObject* valobj,
 Stream* s,
 const DumpValueObjectOptions& options,
-uint32_t ptr_depth,
+const DumpValueObjectOptions::PointerDepth& ptr_depth,
 uint32_t curr_depth);
 
 // we should actually be using delegating constructors here
@@ -277,7 +307,7 @@ protected:
 Init (ValueObject* valobj,
   Stream* s,
   const DumpValueObjectOptions& options,
-  uint32_t ptr_depth,
+  const DumpValueObjectOptions::PointerDepth& ptr_depth,
   uint32_t curr_depth);
 
 bool
@@ -343,7 +373,7 @@ protected:
 
 bool
 ShouldPrintChildren (bool is_failed_description,
- uint32_t& curr_ptr_depth);
+ DumpValueObjectOptions::PointerDepth& curr_ptr_depth);
 
 bool
 ShouldExpandEmptyAggregates ();
@@ -359,13 +389,15 @@ protected:
 
 void
 PrintChild (lldb::ValueObjectSP child_sp,
-uint32_t curr_ptr_depth);
+const DumpValueObjectOptions::PointerDepth& curr_ptr_depth);
 
 uint32_t
 GetMaxNumChildrenToPrint (bool& print_dotdotdot);
 
 void
-PrintChildren (uint32_t curr_ptr_depth);
+PrintChildren (bool value_printed,
+   bool summary_printed,
+   const DumpValueObjectOptions::PointerDepth& curr_ptr_depth);
 
 void
 PrintChildrenIfNeeded (bool value_printed,
@@ -382,7 +414,7 @@ private:
 DumpValueObjectOptions options;
 Flags m_type_flags;
 ClangASTType m_clang_type;
-uint32_t m_ptr_depth;
+DumpValueObjectOptions::PointerDepth m_ptr_depth;
 uint32_t m_curr_depth;
 LazyBool m_should_print;
 LazyBool m_is_nil;

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=243301&r1=243300&r2=243301&view=diff
==
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Mon 

Re: [Lldb-commits] [PATCH] D11498: Print reference values on one line.

2015-07-24 Thread Enrico Granata
granata.enrico added a subscriber: granata.enrico.
granata.enrico added a comment.

I am assuming that your intent is:

int x = 1;
int& y = 1;

(lldb) frame variable y
(int&) y = 0x123456 (y = 1)

If so, two things:
a) a much better way would be to make FormatManager::ShouldPrintAsOneLiner() 
decide that a T& can be printed on one-line iff the referenced thing can
b) test cases would be great

If I am reading your intent wrong, can you please elaborate on what you're 
trying to achieve?

I would really appreciate if you didn't commit this.


http://reviews.llvm.org/D11498




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11473: Add option eTypeOptionHideEmptyAggregates.

2015-07-24 Thread Enrico Granata
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

If the test suite passes, go ahead and commit


http://reviews.llvm.org/D11473




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243077 - Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context

2015-07-23 Thread Enrico Granata
Author: enrico
Date: Thu Jul 23 19:57:19 2015
New Revision: 243077

URL: http://llvm.org/viewvc/llvm-project?rev=243077&view=rev
Log:
Fix an issue where LLDB would run out of stack space trying to decide if a 
deeply nested child can be updated in the face of an invalid execution context

The issue is that a child can't really ask the root object, since this decision 
could actually hinge on whether a dynamic and/or synthetic value is present
To do this, make values vote lazily for whether they are willing to allow this, 
so that we can navigate up the chain without recursively invoking ourselves

Tentative fix for rdar://21949558


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectChild.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObjectChild.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=243077&r1=243076&r2=243077&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Jul 23 19:57:19 2015
@@ -861,7 +861,7 @@ public:
 bool
 NeedsUpdating ()
 {
-const bool accept_invalid_exe_ctx = 
CanUpdateWithInvalidExecutionContext();
+const bool accept_invalid_exe_ctx = 
(CanUpdateWithInvalidExecutionContext() == eLazyBoolYes);
 return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
 }
 
@@ -1172,10 +1172,10 @@ protected:
 virtual bool
 UpdateValue () = 0;
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return false;
+return eLazyBoolCalculate;
 }
 
 virtual void

Modified: lldb/trunk/include/lldb/Core/ValueObjectChild.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectChild.h?rev=243077&r1=243076&r2=243077&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h Thu Jul 23 19:57:19 2015
@@ -84,7 +84,7 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ();
 
 virtual ClangASTType

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=243077&r1=243076&r2=243077&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Thu Jul 23 19:57:19 
2015
@@ -109,10 +109,10 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return true;
+return eLazyBoolYes;
 }
 
 virtual lldb::DynamicValueType

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=243077&r1=243076&r2=243077&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Thu Jul 23 
19:57:19 2015
@@ -156,10 +156,10 @@ protected:
 virtual bool
 UpdateValue ();
 
-virtual bool
+virtual LazyBool
 CanUpdateWithInvalidExecutionContext ()
 {
-return true;
+return eLazyBoolYes;
 }
 
 virtual ClangASTType

Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=243077&r1=243076&r2=243077&view=diff
==
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Thu Jul 23 19:57:19 2015
@@ -109,12 +109,14 @@ ValueObjectChild::GetDisplayTypeName()
 return display_name;
 }
 
-bool
+LazyBool
 ValueObjectChild::CanUpdateWithInvalidExecutionContext ()
 {
-if (m_parent)
-return m_parent->CanUpdateWithInvalidExecutionContext();
-return this->ValueObject::CanUpdateWithInvalidExecutionContext();
+ValueObject* opinionated_ancestor = FollowParentChain([] (ValueObject* vo) 
-> bool {
+return (vo->CanUpdateWithInvalidExecutionContext() == 
eLazyBoolCalculate);
+});
+
+return opinionated_ancestor ? 
opinionated_ancestor->CanUpdateWithInvalidExecutionContext() : 
this->ValueObject::CanUpdateWithInvalidExecutionContext();
 }

[Lldb-commits] [lldb] r243053 - Several improvements to the Either type

2015-07-23 Thread Enrico Granata
Author: enrico
Date: Thu Jul 23 17:17:39 2015
New Revision: 243053

URL: http://llvm.org/viewvc/llvm-project?rev=243053&view=rev
Log:
Several improvements to the Either type


Modified:
lldb/trunk/include/lldb/Utility/Either.h

Modified: lldb/trunk/include/lldb/Utility/Either.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Either.h?rev=243053&r1=243052&r2=243053&view=diff
==
--- lldb/trunk/include/lldb/Utility/Either.h (original)
+++ lldb/trunk/include/lldb/Utility/Either.h Thu Jul 23 17:17:39 2015
@@ -12,36 +12,56 @@
 
 #include "llvm/ADT/Optional.h"
 
+#include 
+
 namespace lldb_utility {
 template 
-class Either {
+class Either
+{
 private:
-enum class Selected {
+enum class Selected
+{
 One, Two
 };
 
 Selected m_selected;
-union {
+union
+{
 T1 m_t1;
 T2 m_t2;
 };
 
 public:
-Either(const T1& t1)
+Either (const T1& t1)
 {
 m_t1 = t1;
 m_selected = Selected::One;
 }
 
-Either(const T2& t2)
+Either (const T2& t2)
 {
 m_t2 = t2;
 m_selected = Selected::Two;
 }
 
-template ::value>::type * = nullptr >
+Either (const Either& rhs)
+{
+switch (rhs.m_selected)
+{
+case Selected::One:
+m_t1 = rhs.GetAs().getValue();
+m_selected = Selected::One;
+break;
+case Selected::Two:
+m_t2 = rhs.GetAs().getValue();
+m_selected = Selected::Two;
+break;
+}
+}
+
+template ::value>::type * = nullptr>
 llvm::Optional
-GetAs()
+GetAs() const
 {
 switch (m_selected)
 {
@@ -52,9 +72,9 @@ namespace lldb_utility {
 }
 }
 
-template ::value>::type * = nullptr >
+template ::value>::type * = nullptr>
 llvm::Optional
-GetAs()
+GetAs() const
 {
 switch (m_selected)
 {
@@ -64,6 +84,68 @@ namespace lldb_utility {
 return llvm::Optional();
 }
 }
+
+template 
+ResultType
+Apply (std::function if_T1,
+   std::function if_T2) const
+{
+switch (m_selected)
+{
+case Selected::One:
+return if_T1(m_t1);
+case Selected::Two:
+return if_T2(m_t2);
+}
+}
+
+bool
+operator == (const Either& rhs)
+{
+return (GetAs() == rhs.GetAs()) && (GetAs() == 
rhs.GetAs());
+}
+
+explicit
+operator bool ()
+{
+switch (m_selected)
+{
+case Selected::One:
+return (bool)m_t1;
+case Selected::Two:
+return (bool)m_t2;
+}
+}
+
+Either&
+operator = (const Either& rhs)
+{
+switch (rhs.m_selected)
+{
+case Selected::One:
+m_t1 = rhs.GetAs().getValue();
+m_selected = Selected::One;
+break;
+case Selected::Two:
+m_t2 = rhs.GetAs().getValue();
+m_selected = Selected::Two;
+break;
+}
+return *this;
+}
+
+~Either ()
+{
+switch (m_selected)
+{
+case Selected::One:
+m_t1.T1::~T1();
+break;
+case Selected::Two:
+m_t2.T2::~T2();
+break;
+}
+}
 };
 
 } // namespace lldb_utility


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11473: Add option eTypeOptionHideEmptyAggregates.

2015-07-23 Thread Enrico Granata
granata.enrico added a comment.

In http://reviews.llvm.org/D11473#211047, @sivachandra wrote:

> On Thu, Jul 23, 2015 at 2:17 PM, Enrico Granata  
> wrote:
>
> > - Is there going to be a flag to "type summary add" for setting your new 
> > flag, or is this only meant for internal formatters?
>
>
> I have only envisioned using such an option in scripts. If you feel it would 
> be relevant/complete to expose it in the "type summary flags", I will do it 
> as a follow up unless you want me to do it with this change itself.


It seems like a generally useful option to have, since we're adding this 
ability to the summary, to set it at the command line for a formatter you are 
creating yourself

> > - How do you plan to test it?

> 

> 

> I am testing my change locally by having a type summary script along with a 
> synthetic children provider script which returns 0 children. I will add the 
> same as a test for this patch.


Of course this mode would work just as well for a type which just happens to 
have zero children "organically", as in:

struct S {};
S myS;

I don't think there should be anything specific to synthetic children here, 
even though I see why that's mostly useful there
My general theory would be for synthetic children to be able to fail-safe 
themselves, as in, recognize that some of their preconditions are not met 
(imagine an std::list with a NULL base pointer), and then fall back to 
displaying the actual child values. The issue you run into is that the summary 
is independent of the synthetic children, so you risk getting a mismatch 
between what the summary says and the content you see.
For instance, a list might store its count inline, but then have a bogus 
first-node pointer, so you would get, say, "size =5" and then incorrect 
children.
I have yet to figure out a sustainable strategy for that, but that's way beyond 
the scope of this change.

> > - If anything, maybe replace Print with Expand, to get 
> > ShouldExpandEmptyAggregates(). We are indeed printing the aggregate, just 
> > not "expanding" it

> 

> 

> Will do it.



http://reviews.llvm.org/D11473




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11473: Add option eTypeOptionHideEmptyAggregates.

2015-07-23 Thread Enrico Granata
granata.enrico added a comment.

The change itself seems fine, just a couple minor things:

- I have some ideas on what should happen if synthetic children fail to produce 
values for whatever reason. This change itself does not conflict with any of 
that, though, so it's good to go
- Is there going to be a flag to "type summary add" for setting your new flag, 
or is this only meant for internal formatters?
- How do you plan to test it?
- If anything, maybe replace Print with Expand, to get 
ShouldExpandEmptyAggregates(). We are indeed printing the aggregate, just not 
"expanding" it


http://reviews.llvm.org/D11473




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242944 - Set the live address on child const results in a way that is more maintainable for sustained merges with our internal branches

2015-07-22 Thread Enrico Granata
Author: enrico
Date: Wed Jul 22 16:39:15 2015
New Revision: 242944

URL: http://llvm.org/viewvc/llvm-project?rev=242944&view=rev
Log:
Set the live address on child const results in a way that is more maintainable 
for sustained merges with our internal branches


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

Modified: lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp?rev=242944&r1=242943&r2=242944&view=diff
==
--- lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp Wed Jul 22 16:39:15 
2015
@@ -106,9 +106,8 @@ ValueObjectConstResultImpl::CreateChildA
   child_bitfield_bit_size,
   child_bitfield_bit_offset,
   child_is_base_class,
-  child_is_deref_of_parent);
-if (m_live_address != LLDB_INVALID_ADDRESS)
-valobj->m_impl.SetLiveAddress(m_live_address+child_byte_offset);
+  child_is_deref_of_parent,
+  m_live_address == 
LLDB_INVALID_ADDRESS ? m_live_address : m_live_address+child_byte_offset);
 }
 
 return valobj;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11295: [asan] Display ASan history threads in reverse chronological order

2015-07-21 Thread Enrico Granata
granata.enrico added a comment.

I am ok with this is Jason is


http://reviews.llvm.org/D11295




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242745 - The session dictionary attached to a Python interpeter holds variables the user creates in the script interpreter

2015-07-20 Thread Enrico Granata
Author: enrico
Date: Mon Jul 20 19:38:25 2015
New Revision: 242745

URL: http://llvm.org/viewvc/llvm-project?rev=242745&view=rev
Log:
The session dictionary attached to a Python interpeter holds variables the user 
creates in the script interpreter
This can include objects that have complex state and need to be torn down 
intelligently (e.g. our SB* objects)

This will fail if the Python interpreter does not hold a valid thread state. 
So, acquire one, delete the session dictionary, and then let go of it on 
destruction

This fixes rdar://20960843


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

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=242745&r1=242744&r2=242745&view=diff
==
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Mon Jul 20 
19:38:25 2015
@@ -212,6 +212,14 @@ ScriptInterpreterPython::ScriptInterpret
 
 ScriptInterpreterPython::~ScriptInterpreterPython ()
 {
+// the session dictionary may hold objects with complex state
+// which means that they may need to be torn down with some level of smarts
+// and that, in turn, requires a valid thread state
+// force Python to procure itself such a thread state, nuke the session 
dictionary
+// and then release it for others to use and proceed with the rest of the 
shutdown
+auto gil_state = PyGILState_Ensure();
+m_session_dict.Reset();
+PyGILState_Release(gil_state);
 }
 
 void


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242583 - Remove a static helper function and use the StringPrinter API exclusively to format NSStrings

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 17:39:35 2015
New Revision: 242583

URL: http://llvm.org/viewvc/llvm-project?rev=242583&view=rev
Log:
Remove a static helper function and use the StringPrinter API exclusively to 
format NSStrings


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

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242583&r1=242582&r2=242583&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Fri Jul 17 
17:39:35 2015
@@ -716,48 +716,6 @@ lldb_private::formatters::NSDataSummaryP
 return true;
 }
 
-static bool
-ReadAsciiBufferAndDumpToStream (lldb::addr_t location,
-lldb::ProcessSP& process_sp,
-Stream& dest,
-uint32_t size = 0,
-Error* error = NULL,
-size_t *data_read = NULL,
-char prefix_token = '@',
-char quote = '"')
-{
-Error my_error;
-size_t my_data_read;
-if (!process_sp || location == 0)
-return false;
-
-if (!size)
-size = process_sp->GetTarget().GetMaximumSizeOfStringSummary();
-else
-size = 
std::min(size,process_sp->GetTarget().GetMaximumSizeOfStringSummary());
-
-lldb::DataBufferSP buffer_sp(new DataBufferHeap(size,0));
-
-my_data_read = process_sp->ReadCStringFromMemory(location, 
(char*)buffer_sp->GetBytes(), size, my_error);
-
-if (error)
-*error = my_error;
-if (data_read)
-*data_read = my_data_read;
-
-if (my_error.Fail())
-return false;
-
-dest.Printf("%c%c",prefix_token,quote);
-
-if (my_data_read)
-dest.Printf("%s",(char*)buffer_sp->GetBytes());
-
-dest.Printf("%c",quote);
-
-return true;
-}
-
 bool
 lldb_private::formatters::NSTaggedString_SummaryProvider 
(ObjCLanguageRuntime::ClassDescriptorSP descriptor, Stream& stream)
 {
@@ -956,7 +914,16 @@ lldb_private::formatters::NSStringSummar
 else if (is_inline && has_explicit_length && !is_unicode && !is_path_store 
&& !is_mutable)
 {
 uint64_t location = 3 * ptr_size + valobj_addr;
-return 
ReadAsciiBufferAndDumpToStream(location,process_sp,stream,explicit_length);
+
+ReadStringAndDumpToStreamOptions options(valobj);
+options.SetLocation(location);
+options.SetProcessSP(process_sp);
+options.SetStream(&stream);
+options.SetPrefixToken('@');
+options.SetQuote('"');
+options.SetSourceSize(explicit_length);
+options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+return ReadStringAndDumpToStream (options);
 }
 else if (is_unicode)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242573 - Make this test case be somewhat less verbose when not asked to

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 16:11:46 2015
New Revision: 242573

URL: http://llvm.org/viewvc/llvm-project?rev=242573&view=rev
Log:
Make this test case be somewhat less verbose when not asked to


Modified:
lldb/trunk/test/expression_command/formatters/TestFormatters.py

Modified: lldb/trunk/test/expression_command/formatters/TestFormatters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/formatters/TestFormatters.py?rev=242573&r1=242572&r2=242573&view=diff
==
--- lldb/trunk/test/expression_command/formatters/TestFormatters.py (original)
+++ lldb/trunk/test/expression_command/formatters/TestFormatters.py Fri Jul 17 
16:11:46 2015
@@ -50,12 +50,13 @@ class ExprFormattersTestCase(TestBase):
 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, 
loc_exact=True)
 
 self.runCmd("run", RUN_SUCCEEDED)
-self.runCmd("script import formatters")
-self.runCmd("script import foosynth")
+self.runCmd("command script import formatters.py")
+self.runCmd("command script import foosynth.py")
 
-self.runCmd("frame variable foo1 --show-types")
-self.runCmd("frame variable foo1.b --show-types")
-self.runCmd("frame variable foo1.b.b_ref --show-types")
+if self.TraceOn():
+self.runCmd("frame variable foo1 --show-types")
+self.runCmd("frame variable foo1.b --show-types")
+self.runCmd("frame variable foo1.b.b_ref --show-types")
 
 self.expect("expression --show-types -- *(new foo(47))",
 substrs = ['(int) a = 47', '(bar) b = {', '(int) i = 94', '(baz) b 
= {', '(int) k = 99'])


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242572 - Teach the "extend char types" (char16_t, char32_t and wchar_t) formatters that a *single character* whose value is 0 is actually a valid thing to print out

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 15:54:52 2015
New Revision: 242572

URL: http://llvm.org/viewvc/llvm-project?rev=242572&view=rev
Log:
Teach the "extend char types" (char16_t, char32_t and wchar_t) formatters that 
a *single character* whose value is 0 is actually a valid thing to print out


Modified:
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py
lldb/trunk/test/lang/cpp/char1632_t/main.cpp
lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py
lldb/trunk/test/lang/cpp/wchar_t/main.cpp

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242572&r1=242571&r2=242572&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Fri Jul 17 
15:54:52 2015
@@ -362,6 +362,7 @@ lldb_private::formatters::Char16SummaryP
 options.SetPrefixToken('u');
 options.SetQuote('\'');
 options.SetSourceSize(1);
+options.SetBinaryZeroIsTerminator(false);
 
 return ReadBufferAndDumpToStream(options);
 }
@@ -387,6 +388,7 @@ lldb_private::formatters::Char32SummaryP
 options.SetPrefixToken('U');
 options.SetQuote('\'');
 options.SetSourceSize(1);
+options.SetBinaryZeroIsTerminator(false);
 
 return ReadBufferAndDumpToStream(options);
 }
@@ -407,6 +409,7 @@ lldb_private::formatters::WCharSummaryPr
 options.SetPrefixToken('L');
 options.SetQuote('\'');
 options.SetSourceSize(1);
+options.SetBinaryZeroIsTerminator(false);
 
 return ReadBufferAndDumpToStream(options);
 }

Modified: lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py?rev=242572&r1=242571&r2=242572&view=diff
==
--- lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py (original)
+++ lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py Fri Jul 17 15:54:52 
2015
@@ -76,6 +76,12 @@ class Char1632TestCase(TestBase):
 self.expect("frame variable s16 s32",
 substrs = ['(char16_t *) s16 = 0x','(char32_t *) s32 = 
','"色ハ匂ヘト散リヌルヲ"','"෴"'])
 
+# check that zero values are properly handles
+self.expect('frame variable cs16_zero', substrs=["U+ u'\\0'"])
+self.expect('frame variable cs32_zero', substrs=["U+0x 
U'\\0'"])
+self.expect('expression cs16_zero', substrs=["U+ u'\\0'"])
+self.expect('expression cs32_zero', substrs=["U+0x U'\\0'"])
+
 # Check that we can run expressions that return charN_t
 self.expect("expression u'a'",substrs = ['(char16_t) $',"61 u'a'"])
 self.expect("expression U'a'",substrs = ['(char32_t) $',"61 U'a'"])

Modified: lldb/trunk/test/lang/cpp/char1632_t/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/char1632_t/main.cpp?rev=242572&r1=242571&r2=242572&view=diff
==
--- lldb/trunk/test/lang/cpp/char1632_t/main.cpp (original)
+++ lldb/trunk/test/lang/cpp/char1632_t/main.cpp Fri Jul 17 15:54:52 2015
@@ -10,6 +10,8 @@
 
 int main (int argc, char const *argv[])
 {
+  auto cs16_zero = (char16_t)0;
+  auto cs32_zero = (char32_t)0;
 auto cs16 = u"hello world ྒྙྐ";
auto cs32 = U"hello world ྒྙྐ";
 char16_t *s16 = (char16_t *)u"ﺸﺵۻ";

Modified: lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py?rev=242572&r1=242571&r2=242572&view=diff
==
--- lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py (original)
+++ lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py Fri Jul 17 15:54:52 2015
@@ -78,6 +78,9 @@ class CxxWCharTTestCase(TestBase):
 
 self.expect("frame variable array",substrs = ['L"Hey, I\'m a super 
wchar_t string'])
 self.expect("frame variable array",substrs = ['[0]'], matching=False)
+
+self.expect('frame variable wchar_zero', substrs=["L'\\0'"])
+self.expect('expression wchar_zero', substrs=["L'\\0'"])
 
 if __name__ == '__main__':
 import atexit

Modified: lldb/trunk/test/lang/cpp/wchar_t/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/wchar_t/main.cpp?rev=242572&r1=242571&r2=242572&view=diff
==
--- lldb/trunk/test/lang/cpp/wchar_t/main.cpp (original)
+++ lldb/trunk/test/lang/cpp/wchar_t/main.cpp Fri Jul 17 15:54:52 2015
@@ -29,6 +29,7 @@ int main (int argc, char const *argv[])
 wchar_t *ws_

[Lldb-commits] [lldb] r242559 - Teach the NSString data formatter to handle embedded NULs in short ASCII strings

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 14:06:39 2015
New Revision: 242559

URL: http://llvm.org/viewvc/llvm-project?rev=242559&view=rev
Log:
Teach the NSString data formatter to handle embedded NULs in short ASCII strings


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

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/main.m

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242559&r1=242558&r2=242559&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Fri Jul 17 
14:06:39 2015
@@ -1008,15 +1008,30 @@ lldb_private::formatters::NSStringSummar
 {
 uint64_t location = valobj_addr + 2*ptr_size;
 if (!has_explicit_length)
+{
+// in this kind of string, the byte before the string content is a 
length byte
+// so let's try and use it to handle the embedded NUL case
+Error error;
+explicit_length = 
process_sp->ReadUnsignedIntegerFromMemory(location, 1, 0, error);
+if (error.Fail() || explicit_length == 0)
+has_explicit_length = false;
+else
+has_explicit_length = true;
 location++;
+}
 ReadStringAndDumpToStreamOptions options(valobj);
 options.SetLocation(location);
 options.SetProcessSP(process_sp);
 options.SetStream(&stream);
 options.SetPrefixToken('@');
 options.SetSourceSize(explicit_length);
+options.SetNeedsZeroTermination(!has_explicit_length);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
-return ReadStringAndDumpToStream(options);
+options.SetBinaryZeroIsTerminator(!has_explicit_length);
+if (has_explicit_length)
+return ReadStringAndDumpToStream(options);
+else
+return 
ReadStringAndDumpToStream(options);
 }
 else
 {

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py?rev=242559&r1=242558&r2=242559&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
 Fri Jul 17 14:06:39 2015
@@ -63,6 +63,19 @@ class NSStringDataFormatterTestCase(Test
 """Check that Unicode characters come out of CFString summary 
correctly."""
 self.appkit_tester_impl(self.buildDwarf,self.rdar11106605_commands)
 
+@skipUnlessDarwin
+@dsym_test
+def test_nsstring_withNULs_with_dsym_and_run_command(self):
+"""Test formatters for NSString."""
+self.appkit_tester_impl(self.buildDsym,self.nsstring_withNULs_commands)
+
+@skipUnlessDarwin
+@dwarf_test
+def test_nsstring_withNULS_with_dwarf_and_run_command(self):
+"""Test formatters for NSString."""
+
self.appkit_tester_impl(self.buildDwarf,self.nsstring_withNULs_commands)
+
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -102,9 +115,15 @@ class NSStringDataFormatterTestCase(Test
 self.expect('expr -d run-target -- path',substrs = ['usr/blah/stuff'])
 self.expect('frame variable path',substrs = ['usr/blah/stuff'])
 
+def nsstring_withNULs_commands(self):
+"""Check that the NSString formatter supports embedded NULs in the 
text"""
 self.expect('po strwithNULs', substrs=['a very much boring task to 
write'])
 self.expect('expr [strwithNULs length]', substrs=['54'])
 self.expect('frame variable strwithNULs', substrs=['@"a very much 
boring task to write\\0a string this way!!'])
+self.expect('po strwithNULs2', substrs=['a very much boring task to 
write'])
+self.expect('expr [strwithNULs2 length]', substrs=['52'])
+self.expect('frame variable strwithNULs2', substrs=['@"a very much 
boring task to write\\0a string this way!!'])
+
 
 if __name__ == '__main__':
 import atexit

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/main.m
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/main.m?rev=242559&r1=242558&r2=242559&view=diff

[Lldb-commits] [lldb] r242555 - Improve the NSString data formatter so that explicitly-lengthed Unicode strings print embedded NULs correctly

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 13:22:51 2015
New Revision: 242555

URL: http://llvm.org/viewvc/llvm-project?rev=242555&view=rev
Log:
Improve the NSString data formatter so that explicitly-lengthed Unicode strings 
print embedded NULs correctly


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

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/main.m

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242555&r1=242554&r2=242555&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Fri Jul 17 
13:22:51 2015
@@ -879,11 +879,11 @@ lldb_private::formatters::NSStringSummar
 bool is_inline = (info_bits & 0x60) == 0;
 bool has_explicit_length = (info_bits & (1 | 4)) != 4;
 bool is_unicode = (info_bits & 0x10) == 0x10;
-bool is_special = strcmp(class_name,"NSPathStore2") == 0;
+bool is_path_store = strcmp(class_name,"NSPathStore2") == 0;
 bool has_null = (info_bits & 8) == 8;
 
 size_t explicit_length = 0;
-if (!has_null && has_explicit_length && !is_special)
+if (!has_null && has_explicit_length && !is_path_store)
 {
 lldb::addr_t explicit_length_offset = 2*ptr_size;
 if (is_mutable && !is_inline)
@@ -933,6 +933,7 @@ lldb_private::formatters::NSStringSummar
 options.SetSourceSize(explicit_length);
 options.SetNeedsZeroTermination(false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetBinaryZeroIsTerminator(false);
 return 
ReadStringAndDumpToStream(options);
 }
 else
@@ -945,10 +946,11 @@ lldb_private::formatters::NSStringSummar
 options.SetSourceSize(explicit_length);
 options.SetNeedsZeroTermination(false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetBinaryZeroIsTerminator(false);
 return 
ReadStringAndDumpToStream(options);
 }
 }
-else if (is_inline && has_explicit_length && !is_unicode && !is_special && 
!is_mutable)
+else if (is_inline && has_explicit_length && !is_unicode && !is_path_store 
&& !is_mutable)
 {
 uint64_t location = 3 * ptr_size + valobj_addr;
 return 
ReadAsciiBufferAndDumpToStream(location,process_sp,stream,explicit_length);
@@ -981,9 +983,10 @@ lldb_private::formatters::NSStringSummar
 options.SetSourceSize(explicit_length);
 options.SetNeedsZeroTermination(has_explicit_length == false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetBinaryZeroIsTerminator(has_explicit_length == false);
 return ReadStringAndDumpToStream (options);
 }
-else if (is_special)
+else if (is_path_store)
 {
 ProcessStructReader reader(valobj.GetProcessSP().get(), 
valobj.GetValueAsUnsigned(0), GetNSPathStore2Type(*valobj.GetTargetSP()));
 explicit_length = 
reader.GetField(ConstString("lengthAndRef")) >> 20;
@@ -998,6 +1001,7 @@ lldb_private::formatters::NSStringSummar
 options.SetSourceSize(explicit_length);
 options.SetNeedsZeroTermination(has_explicit_length == false);
 options.SetIgnoreMaxLength(summary_options.GetCapping() == 
TypeSummaryCapping::eTypeSummaryUncapped);
+options.SetBinaryZeroIsTerminator(has_explicit_length == false);
 return ReadStringAndDumpToStream (options);
 }
 else if (is_inline)

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py?rev=242555&r1=242554&r2=242555&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
 Fri Jul 17 13:22:51 2015
@@ -102,6 +102,10 @@ class NSStringDataFormatterTestCase(Test
 self.expect('expr -d run-target -- path',substrs = ['usr/blah/stuff'])
 self.expect('frame variable path',substrs = ['usr/blah/stuff'])
 
+self.expect('po strwithNULs', substrs=['a very much boring task to 
write'])
+self.expect('expr [strwithNULs length]', substrs=['54'])
+se

[Lldb-commits] [lldb] r242552 - Split the portion of the data-formatter-objc test case that deals with NSString into its own separate test case

2015-07-17 Thread Enrico Granata
Author: enrico
Date: Fri Jul 17 12:54:39 2015
New Revision: 242552

URL: http://llvm.org/viewvc/llvm-project?rev=242552&view=rev
Log:
Split the portion of the data-formatter-objc test case that deals with NSString 
into its own separate test case


Added:
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/Makefile

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/nsstring/main.m
Modified:

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

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=242552&r1=242551&r2=242552&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
 Fri Jul 17 12:54:39 2015
@@ -45,20 +45,6 @@ class ObjCDataFormatterTestCase(TestBase
 """Test formatters for NSNumber."""
 
self.appkit_tester_impl(self.buildDwarf,self.nsnumber_data_formatter_commands)
 
-
-@skipUnlessDarwin
-@dsym_test
-def test_nsstring_with_dsym_and_run_command(self):
-"""Test formatters for NSString."""
-
self.appkit_tester_impl(self.buildDsym,self.nsstring_data_formatter_commands)
-
-@skipUnlessDarwin
-@dwarf_test
-def test_nsstring_with_dwarf_and_run_command(self):
-"""Test formatters for NSString."""
-
self.appkit_tester_impl(self.buildDwarf,self.nsstring_data_formatter_commands)
-
-
 @skipUnlessDarwin
 @dsym_test
 def test_nscontainers_with_dsym_and_run_command(self):
@@ -193,20 +179,6 @@ class ObjCDataFormatterTestCase(TestBase
 
 @skipUnlessDarwin
 @dsym_test
-def test_rdar11106605_with_dsym_and_run_command(self):
-"""Check that Unicode characters come out of CFString summary 
correctly."""
-self.buildDsym()
-self.rdar11106605_commands()
-
-@skipUnlessDarwin
-@dwarf_test
-def test_rdar11106605_with_dwarf_and_run_command(self):
-"""Check that Unicode characters come out of CFString summary 
correctly."""
-self.buildDwarf()
-self.rdar11106605_commands()
-
-@skipUnlessDarwin
-@dsym_test
 def test_expr_with_dsym_and_run_command(self):
 """Test common cases of expression parser <--> formatters 
interaction."""
 self.buildDsym()
@@ -225,37 +197,6 @@ class ObjCDataFormatterTestCase(TestBase
 # Find the line number to break at.
 self.line = line_number('main.m', '// Set break point at this line.')
 
-def rdar11106605_commands(self):
-"""Check that Unicode characters come out of CFString summary 
correctly."""
-self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
-lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, 
num_expected_locations=1, loc_exact=True)
-
-self.runCmd("run", RUN_SUCCEEDED)
-
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs = ['stopped',
-   'stop reason = breakpoint'])
-
-# This is the function to remove the custom formats in order to have a
-# clean slate for the next test case.
-def cleanup():
-self.runCmd('type format clear', check=False)
-self.runCmd('type summary clear', check=False)
-self.runCmd('type synth clear', check=False)
-
-
-# Execute the cleanup function during test case tear down.
-self.addTearDownHook(cleanup)
-
-self.expect('frame variable italian', substrs = ['L\'Italia è una 
Repubblica democratica, fondata sul lavoro. La sovranità appartiene al popolo, 
che la esercita nelle forme e nei limiti della Costituzione.'])
-self.expect('frame variable french', substrs = ['Que veut cette horde 
d\'esclaves, De traîtres, de rois conjurés?'])
-self.expect('frame variable german', substrs = ['Über-Ich und aus den 
Ansprüchen der sozialen Umwelt'])
-self.expect('frame variable japanese', substrs = 
['色は匂へど散りぬるを'])
-self.expect('frame variable hebrew', substrs = ['לילה טוב'])
-
-
 def plain_data_formatter_commands(self):
 """Test basic ObjC formatting behavior."""
 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
@@ -367,32 +308,6 @@ class ObjCDataFormatterTestCase(TestBase
 '(NSNumber *) num_at3 = ',' (double)12.5',
 '

[Lldb-commits] [lldb] r242501 - Teach the std::wstring data formatter how to properly display strings with embedded NUL bytes

2015-07-16 Thread Enrico Granata
Author: enrico
Date: Thu Jul 16 20:56:25 2015
New Revision: 242501

URL: http://llvm.org/viewvc/llvm-project?rev=242501&view=rev
Log:
Teach the std::wstring data formatter how to properly display strings with 
embedded NUL bytes


Modified:
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
lldb/trunk/source/DataFormatters/StringPrinter.cpp

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

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242501&r1=242500&r2=242501&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Thu Jul 16 
20:56:25 2015
@@ -494,7 +494,7 @@ ExtractLibcxxStringInfo (ValueObject& va
 }
 
 bool
-lldb_private::formatters::LibcxxWStringSummaryProvider (ValueObject& valobj, 
Stream& stream, const TypeSummaryOptions& options)
+lldb_private::formatters::LibcxxWStringSummaryProvider (ValueObject& valobj, 
Stream& stream, const TypeSummaryOptions& summary_options)
 {
 uint64_t size = 0;
 ValueObjectSP location_sp((ValueObject*)nullptr);
@@ -507,7 +507,43 @@ lldb_private::formatters::LibcxxWStringS
 }   
 if (!location_sp)
 return false;
-return WCharStringSummaryProvider(*location_sp.get(), stream, options);
+
+DataExtractor extractor;
+if (summary_options.GetCapping() == TypeSummaryCapping::eTypeSummaryCapped)
+size = std::min(size, 
valobj.GetTargetSP()->GetMaximumSizeOfStringSummary());
+location_sp->GetPointeeData(extractor, 0, size);
+
+// std::wstring::size() is measured in 'characters', not bytes
+auto wchar_t_size = 
valobj.GetTargetSP()->GetScratchClangASTContext()->GetBasicType(lldb::eBasicTypeWChar).GetByteSize(nullptr);
+
+ReadBufferAndDumpToStreamOptions options(valobj);
+options.SetData(extractor);
+options.SetStream(&stream);
+options.SetPrefixToken('L');
+options.SetQuote('"');
+options.SetSourceSize(size);
+options.SetBinaryZeroIsTerminator(false);
+
+switch (wchar_t_size)
+{
+case 1:
+
lldb_private::formatters::ReadBufferAndDumpToStream(options);
+break;
+
+case 2:
+
lldb_private::formatters::ReadBufferAndDumpToStream(options);
+break;
+
+case 4:
+
lldb_private::formatters::ReadBufferAndDumpToStream(options);
+break;
+
+default:
+stream.Printf("size for wchar_t is not valid");
+return true;
+}
+
+return true;
 }
 
 bool
@@ -534,7 +570,7 @@ lldb_private::formatters::LibcxxStringSu
 location_sp->GetPointeeData(extractor, 0, size);
 
 ReadBufferAndDumpToStreamOptions options(valobj);
-options.SetData(extractor); // none of this matters for a string - pass 
some defaults
+options.SetData(extractor);
 options.SetStream(&stream);
 options.SetPrefixToken(0);
 options.SetQuote('"');

Modified: lldb/trunk/source/DataFormatters/StringPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/StringPrinter.cpp?rev=242501&r1=242500&r2=242501&view=diff
==
--- lldb/trunk/source/DataFormatters/StringPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/StringPrinter.cpp Thu Jul 16 20:56:25 2015
@@ -382,6 +382,8 @@ DumpUTFBufferToStream (ConversionResult
 utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes();
 utf8_data_end_ptr = utf8_data_ptr + 
utf8_data_buffer_sp->GetByteSize();
 ConvertFunction ( &data_ptr, data_end_ptr, &utf8_data_ptr, 
utf8_data_end_ptr, lenientConversion );
+if (false == zero_is_terminator)
+utf8_data_end_ptr = utf8_data_ptr;
 utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes(); // needed 
because the ConvertFunction will change the value of the data_ptr
 }
 else

Modified: 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py?rev=242501&r1=242500&r2=242501&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxS

[Lldb-commits] [lldb] r242496 - Add StringPrinter support for printing a std::string with embedded NUL bytes

2015-07-16 Thread Enrico Granata
Author: enrico
Date: Thu Jul 16 20:03:59 2015
New Revision: 242496

URL: http://llvm.org/viewvc/llvm-project?rev=242496&view=rev
Log:
Add StringPrinter support for printing a std::string with embedded NUL bytes


Modified:
lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
lldb/trunk/source/DataFormatters/StringPrinter.cpp

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

lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=242496&r1=242495&r2=242496&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Thu Jul 16 20:03:59 
2015
@@ -38,7 +38,8 @@ namespace lldb_private {
 m_source_size(0),
 m_needs_zero_termination(true),
 m_escape_non_printables(true),
-m_ignore_max_length(false)
+m_ignore_max_length(false),
+m_zero_is_terminator(true)
 {
 }
 
@@ -136,6 +137,19 @@ namespace lldb_private {
 }
 
 ReadStringAndDumpToStreamOptions&
+SetBinaryZeroIsTerminator (bool e)
+{
+m_zero_is_terminator = e;
+return *this;
+}
+
+bool
+GetBinaryZeroIsTerminator () const
+{
+return m_zero_is_terminator;
+}
+
+ReadStringAndDumpToStreamOptions&
 SetEscapeNonPrintables (bool e)
 {
 m_escape_non_printables = e;
@@ -171,6 +185,7 @@ namespace lldb_private {
 bool m_needs_zero_termination;
 bool m_escape_non_printables;
 bool m_ignore_max_length;
+bool m_zero_is_terminator;
 };
 
 class ReadBufferAndDumpToStreamOptions
@@ -183,12 +198,15 @@ namespace lldb_private {
 m_prefix_token(0),
 m_quote('"'),
 m_source_size(0),
-m_escape_non_printables(true)
+m_escape_non_printables(true),
+m_zero_is_terminator(true)
 {
 }
 
 ReadBufferAndDumpToStreamOptions (ValueObject& valobj);
 
+ReadBufferAndDumpToStreamOptions (const 
ReadStringAndDumpToStreamOptions& options);
+
 ReadBufferAndDumpToStreamOptions&
 SetData (DataExtractor d)
 {
@@ -267,6 +285,19 @@ namespace lldb_private {
 return m_escape_non_printables;
 }
 
+ReadBufferAndDumpToStreamOptions&
+SetBinaryZeroIsTerminator (bool e)
+{
+m_zero_is_terminator = e;
+return *this;
+}
+
+bool
+GetBinaryZeroIsTerminator () const
+{
+return m_zero_is_terminator;
+}
+
 private:
 DataExtractor m_data;
 Stream* m_stream;
@@ -274,15 +305,16 @@ namespace lldb_private {
 char m_quote;
 uint32_t m_source_size;
 bool m_escape_non_printables;
+bool m_zero_is_terminator;
 };
 
 template 
 bool
-ReadStringAndDumpToStream (ReadStringAndDumpToStreamOptions options);
+ReadStringAndDumpToStream (const ReadStringAndDumpToStreamOptions& 
options);
 
 template 
 bool
-ReadBufferAndDumpToStream (ReadBufferAndDumpToStreamOptions options);
+ReadBufferAndDumpToStream (const ReadBufferAndDumpToStreamOptions& 
options);
 
 } // namespace formatters
 } // namespace lldb_private

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=242496&r1=242495&r2=242496&view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Thu Jul 16 
20:03:59 2015
@@ -539,6 +539,7 @@ lldb_private::formatters::LibcxxStringSu
 options.SetPrefixToken(0);
 options.SetQuote('"');
 options.SetSourceSize(size);
+options.SetBinaryZeroIsTerminator(false);
 
lldb_private::formatters::ReadBufferAndDumpToStream(options);
 
 return true;

Modified: lldb/trunk/source/DataFormatters/StringPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/sourc

Re: [Lldb-commits] [PATCH] D11203: Add a class ValueObjectConstResultCast.

2015-07-15 Thread Enrico Granata
granata.enrico accepted this revision.
granata.enrico added a comment.

This patch is fine for now if that is what is required in the current model

In general, a redesign of how Cast works (and even - on a broader level - what 
operations might fall under the "casting" label in a debugger) would be great, 
but that is definitely beyond the scope of your change


http://reviews.llvm.org/D11203




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r241531 - Add a summary for vector types

2015-07-06 Thread Enrico Granata
Author: enrico
Date: Mon Jul  6 19:20:57 2015
New Revision: 241531

URL: http://llvm.org/viewvc/llvm-project?rev=241531&view=rev
Log:
Add a summary for vector types

The summary is - quite simply - a one-line printout of the vector elements

We still need synthetic children:
a) as a source of the elements to print in the summary
b) for graphical IDEs that display structure regardless of the summary settings

rdar://5429347


Modified:
lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
lldb/trunk/include/lldb/DataFormatters/VectorType.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/VectorType.cpp

lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py

Modified: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?rev=241531&r1=241530&r2=241531&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Mon Jul  6 
19:20:57 2015
@@ -18,6 +18,7 @@
 #include "lldb/Core/ConstString.h"
 #include "lldb/DataFormatters/FormatClasses.h"
 #include "lldb/DataFormatters/TypeSynthetic.h"
+#include "lldb/DataFormatters/VectorType.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"

Modified: lldb/trunk/include/lldb/DataFormatters/VectorType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/VectorType.h?rev=241531&r1=241530&r2=241531&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/VectorType.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/VectorType.h Mon Jul  6 19:20:57 2015
@@ -0,0 +1,28 @@
+//===-- VectorType.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_VectorType_h_
+#define liblldb_VectorType_h_
+
+#include "lldb/lldb-forward.h"
+
+namespace lldb_private {
+namespace formatters
+{
+bool
+VectorTypeSummaryProvider (ValueObject&,
+   Stream&,
+   const TypeSummaryOptions&);
+
+SyntheticChildrenFrontEnd*
+VectorTypeSyntheticFrontEndCreator (CXXSyntheticChildren*, 
lldb::ValueObjectSP);
+} // namespace formatters
+} // namespace lldb_private
+
+#endif // liblldb_VectorType_h_

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=241531&r1=241530&r2=241531&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Jul  6 19:20:57 2015
@@ -1608,6 +1608,26 @@ FormatManager::LoadHardcodedFormatters()
 }
 return nullptr;
 });
+m_hardcoded_summaries.push_back(
+ [](lldb_private::ValueObject& valobj,
+lldb::DynamicValueType,
+FormatManager& fmt_mgr) -> 
TypeSummaryImpl::SharedPointer {
+ static 
CXXFunctionSummaryFormat::SharedPointer formatter_sp(new 
CXXFunctionSummaryFormat(TypeSummaryImpl::Flags()
+   
   .SetCascades(true)
+   
   
.SetDontShowChildren(true)
+   
   .SetHideItemNames(true)
+   
   
.SetShowMembersOneLiner(true)
+   
   .SetSkipPointers(true)
+   
   
.SetSkipReferences(false),
+   

[Lldb-commits] [lldb] r241184 - When I introduced hard-coded formatters, I made them non-cacheable

2015-07-01 Thread Enrico Granata
Author: enrico
Date: Wed Jul  1 15:06:40 2015
New Revision: 241184

URL: http://llvm.org/viewvc/llvm-project?rev=241184&view=rev
Log:
When I introduced hard-coded formatters, I made them non-cacheable

This is because - in theory - the formatter could match on not just the type, 
but also other properties of a ValueObject, so a per-type caching would not be 
a good thing
On the other hand, that is not always true - sometimes the matching truly is 
per-type

So, introduce a non-cacheable attribute on formatters that decides whether a 
formatter should or should not be cached. That way, the few formatters that 
don't want themselves cached can do so, but most formatters (including most 
hard-coded ones) can cache themselves just fine


Modified:
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/include/lldb/lldb-enumerations.h
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/TypeFormat.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeFormat.h?rev=241184&r1=241183&r2=241184&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeFormat.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeFormat.h Wed Jul  1 15:06:40 2015
@@ -115,6 +115,22 @@ namespace lldb_private {
 return *this;
 }
 
+bool
+GetNonCacheable () const
+{
+return (m_flags & lldb::eTypeOptionNonCacheable) == 
lldb::eTypeOptionNonCacheable;
+}
+
+Flags&
+SetNonCacheable (bool value = true)
+{
+if (value)
+m_flags |= lldb::eTypeOptionNonCacheable;
+else
+m_flags &= ~lldb::eTypeOptionNonCacheable;
+return *this;
+}
+
 uint32_t
 GetValue ()
 {
@@ -153,6 +169,11 @@ namespace lldb_private {
 {
 return m_flags.GetSkipReferences();
 }
+bool
+NonCacheable () const
+{
+return m_flags.GetNonCacheable();
+}
 
 void
 SetCascades (bool value)
@@ -171,6 +192,12 @@ namespace lldb_private {
 {
 m_flags.SetSkipReferences(value);
 }
+
+void
+SetNonCacheable (bool value)
+{
+m_flags.SetNonCacheable(value);
+}
 
 uint32_t
 GetOptions ()

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=241184&r1=241183&r2=241184&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h Wed Jul  1 15:06:40 
2015
@@ -211,6 +211,22 @@ namespace lldb_private {
 return *this;
 }
 
+bool
+GetNonCacheable () const
+{
+return (m_flags & lldb::eTypeOptionNonCacheable) == 
lldb::eTypeOptionNonCacheable;
+}
+
+Flags&
+SetNonCacheable (bool value = true)
+{
+if (value)
+m_flags |= lldb::eTypeOptionNonCacheable;
+else
+m_flags &= ~lldb::eTypeOptionNonCacheable;
+return *this;
+}
+
 uint32_t
 GetValue ()
 {
@@ -252,6 +268,11 @@ namespace lldb_private {
 {
 return m_flags.GetSkipReferences();
 }
+bool
+NonCacheable () const
+{
+return m_flags.GetNonCacheable();
+}
 
 virtual bool
 DoesPrintChildren (ValueObject* valobj) const
@@ -319,6 +340,12 @@ namespace lldb_private {
 m_flags.SetHideItemNames(value);
 }
 
+virtual void
+SetNonCacheable (bool value)
+{
+m_flags.SetNonCacheable(value);
+}
+
 uint32_t
 GetOptions ()
 {

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=241184&r1=241183&r2=241184&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Wed Jul  1 15:06:40 
2015
@@ -236,6 +236,22 @@ namespace lldb_privat

Re: [Lldb-commits] [PATCH] [Python] Allow PyLong & PyBool values in integer list typemaps.

2015-06-30 Thread Enrico Granata
At a glance, it looks like you might be able to use PyLong_AsUnsignedLongLong() 
also for bool values.
If so, that might be a nicer code flow instead of the exact pointer equality 
check

if (PyLong || PyBool) { PyLong_AsUnsigned }

But if that actually doesn't work, looks good to me


http://reviews.llvm.org/D10821

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r240606 - Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

2015-06-30 Thread Enrico Granata

> On Jun 30, 2015, at 2:58 AM, Pavel Labath  wrote:
> 
> I would prefer if we were going in the direction of decreasing the number of 
> warnings rather than increasing it

Hard to disagree with that one.

> (right now, this is the only warning that I get for my build config). Having 
> the default clause in there also sounds reasonable to me, so how about we 
> find a way to suppress this warning without changing semantics?
> option a: cast the switched value to int: this should get rid of the warning 
> in this case..

If anything, this feels like a hack-around the warning. Given that there is at 
least a better option, I’d say “nay” personally

> option b: compile with -Wno-covered-switch-default: I personally think I 
> could live just fine without this warning

This would be a good one, IMHO

> option c: ???
> 

None from me. But if anyone has other ideas, now is a good time to share them

> pl
> 
> 
> On 29 June 2015 at 23:47, Enrico Granata  <mailto:egran...@apple.com>> wrote:
> 
>> On Jun 29, 2015, at 11:58 AM, Ed Maste > <mailto:ema...@freebsd.org>> wrote:
>> 
>> On 29 June 2015 at 14:47, Enrico Granata > <mailto:egran...@apple.com>> wrote:
>>> 
>>>> I can see arguments for and against removing the default, but I think
>>>> removing it will cause a new warning to appear if Clang adds other new
>>>> kinds in the future.
>>> 
>>> Yes. And I am slightly more worried about the silent failure when that 
>>> happens rather than the warning per se - which is why I am hesitant to just 
>>> say “yes please remove"
>> 
>> I mean the warning will prompt us to go and add any new missing enum
>> values
> 
> Until we’re busy and forget to do it and some builds end up with bugs because 
> of silent fall-through at runtime :-)
> 
>> if this happens -- especially if we enable -Werror :)
> 
> Which I suspect we’re not doing anytime soon
> 
>> 
>> I don't feel too strongly one way or the other,
> 
> Likewise. I have a slight preference for keeping the default in there, but 
> only so slight
> 
>> but it seems we have
>> removed the defaults in all of these cases in the past.
> 
> 
> Thanks,
> - Enrico
> 📩 egranata@.com ☎️ 27683
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu <mailto:lldb-commits@cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits 
> <http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits>
> 
> 


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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r240606 - Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

2015-06-29 Thread Enrico Granata

> On Jun 29, 2015, at 11:58 AM, Ed Maste  wrote:
> 
> On 29 June 2015 at 14:47, Enrico Granata  wrote:
>> 
>>> I can see arguments for and against removing the default, but I think
>>> removing it will cause a new warning to appear if Clang adds other new
>>> kinds in the future.
>> 
>> Yes. And I am slightly more worried about the silent failure when that 
>> happens rather than the warning per se - which is why I am hesitant to just 
>> say “yes please remove"
> 
> I mean the warning will prompt us to go and add any new missing enum
> values

Until we’re busy and forget to do it and some builds end up with bugs because 
of silent fall-through at runtime :-)

> if this happens -- especially if we enable -Werror :)

Which I suspect we’re not doing anytime soon

> 
> I don't feel too strongly one way or the other,

Likewise. I have a slight preference for keeping the default in there, but only 
so slight

> but it seems we have
> removed the defaults in all of these cases in the past.


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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r240606 - Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

2015-06-29 Thread Enrico Granata

> On Jun 29, 2015, at 11:32 AM, Ed Maste  wrote:
> 
> On 29 June 2015 at 14:21, Enrico Granata  wrote:
>> 
>> Are you trying to build with -Werror?
>> We are not here, so warnings don’t cause our builds to fail - and in this 
>> case, I slightly prefer the default to stay
> 
> I'm not building with -Werror, just looking at the warnings that come
> out. I would like a warning-free build and the ability to enable
> -Werror though. On FreeBSD we now have only this one and one warning
> from a system header (that will be fixed in FreeBSD 11).
> 
> I can see arguments for and against removing the default, but I think
> removing it will cause a new warning to appear if Clang adds other new
> kinds in the future.

Yes. And I am slightly more worried about the silent failure when that happens 
rather than the warning per se - which is why I am hesitant to just say “yes 
please remove"

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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r240606 - Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

2015-06-29 Thread Enrico Granata

> On Jun 29, 2015, at 8:17 AM, Ed Maste  wrote:
> 
> On 24 June 2015 at 19:13, Enrico Granata  wrote:
>> Author: enrico
>> Date: Wed Jun 24 18:13:23 2015
>> New Revision: 240606
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=240606&view=rev
>> Log:
>> Handle (or at least don't crash) trying to get the encoding for a bunch of 
>> new builtin types in clang trunk
> 
> This introduces a warning now that all enum values are covered in the switch.
> 
> ../tools/lldb/source/Symbol/ClangASTType.cpp:2215:13: warning: default
> label in switch which covers all enumeration values
> [-Wcovered-switch-default]
>default: assert(0 && "Unknown builtin type!");
> 
> Shall I just remove the default?


Are you trying to build with -Werror?
We are not here, so warnings don’t cause our builds to fail - and in this case, 
I slightly prefer the default to stay

With that said, if you’re going for warning-free builds, then yes, let’s think 
of a way forward - the fact that we were not handling all cases was not 
intentional, just a by-product of clang adding new kinds that we didn’t run 
into/need to handle

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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add test for SBValue.GetNonSyntheticValue in presence of synth provider.

2015-06-26 Thread Enrico Granata
Looks good. Thanks.


http://reviews.llvm.org/D10783

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240677 - Fix a bug where we were trying to reconstruct ivars of ObjC types from the runtime in "expression parser mode"

2015-06-25 Thread Enrico Granata
Author: enrico
Date: Thu Jun 25 14:17:04 2015
New Revision: 240677

URL: http://llvm.org/viewvc/llvm-project?rev=240677&view=rev
Log:
Fix a bug where we were trying to reconstruct ivars of ObjC types from the 
runtime in "expression parser mode"

The expression parser mode allows UnknownAnyTy to make it all the way through, 
but that is bad for ivars because it means type layout fails horribly (as in, 
clang crashes)

This patch fixes the issue by using the "variables view mode", which masks 
UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void*

This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC 
type - as per accompanying test case

Fixes rdar://21471326


Added:
lldb/trunk/test/lang/objc/ivar-IMP/
lldb/trunk/test/lang/objc/ivar-IMP/Makefile
lldb/trunk/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
lldb/trunk/test/lang/objc/ivar-IMP/myclass.h
lldb/trunk/test/lang/objc/ivar-IMP/myclass.m
lldb/trunk/test/lang/objc/ivar-IMP/repro.m
Modified:

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

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp?rev=240677&r1=240676&r2=240677&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
 Thu Jun 25 14:17:04 2015
@@ -496,7 +496,7 @@ AppleObjCDeclVendor::FinishDecl(clang::O
 if (!name || !type)
 return false;
 
-const bool for_expression = true;
+const bool for_expression = false;
 
 if (log)
 log->Printf("[  AOTV::FD] Instance variable [%s] [%s], offset at 
%" PRIx64, name, type, offset_ptr);

Added: lldb/trunk/test/lang/objc/ivar-IMP/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/ivar-IMP/Makefile?rev=240677&view=auto
==
--- lldb/trunk/test/lang/objc/ivar-IMP/Makefile (added)
+++ lldb/trunk/test/lang/objc/ivar-IMP/Makefile Thu Jun 25 14:17:04 2015
@@ -0,0 +1,12 @@
+LEVEL = ../../../make
+
+myclass.o: myclass.h myclass.m
+   $(CC) myclass.m -c -o myclass.o
+
+repro: myclass.o repro.m
+   $(CC) -g -O0 myclass.o repro.m -framework Foundation
+
+cleanup:
+   rm -r myclass.o
+
+include $(LEVEL)/Makefile.rules

Added: lldb/trunk/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py?rev=240677&view=auto
==
--- lldb/trunk/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py (added)
+++ lldb/trunk/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py Thu Jun 25 14:17:04 
2015
@@ -0,0 +1,75 @@
+"""
+Test that dynamically discovered ivars of type IMP do not crash LLDB
+"""
+
+import os, time
+import re
+import unittest2
+import lldb, lldbutil
+from lldbtest import *
+import commands
+
+def execute_command (command):
+# print '%% %s' % (command)
+(exit_status, output) = commands.getstatusoutput (command)
+# if output:
+# print output
+# print 'status = %u' % (exit_status)
+return exit_status
+
+class ObjCiVarIMPTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+def test_imp_ivar_type(self):
+"""Test that dynamically discovered ivars of type IMP do not crash 
LLDB"""
+if self.getArchitecture() == 'i386':
+# rdar://problem/9946499
+self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
+self.buildReproCase()
+self.runTheTest()
+
+def setUp(self):
+# Call super's setUp().
   
+TestBase.setUp(self)
+
+def buildReproCase (self):
+execute_command("make repro")
+
+def runTheTest(self):
+"""MakeTest that dynamically discovered ivars of type IMP do not crash 
LLDB"""
+def cleanup():
+execute_command("make cleanup")
+self.addTearDownHook(cleanup)
+
+exe = os.path.join(os.getcwd(), "a.out")
+
+# Create a target from the debugger.
+
+target = self.dbg.CreateTarget (exe)
+self.assertTrue(target, VALID_TARGET)
+
+# Set up our breakpoint
+
+bkpt = lldbutil.run_break_set_by_source_regexp (self, "break here")
+
+# Now launch the process, and do not stop at the entry point.
+process = target.LaunchSimple (None, None, 
self.get_process_working_directory())
+
+self.assertTrue(process.GetState

Re: [Lldb-commits] [PATCH] [LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.

2015-06-25 Thread Enrico Granata
Just discovered the checkmark. As I said, that's a good change, so yes 
definitely good to go. I assume you ran the test suite and there were no 
regressions.


http://reviews.llvm.org/D10625

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Make SBValue::GetNonSyntheticValue return really that.

2015-06-24 Thread Enrico Granata

> On Jun 24, 2015, at 6:08 PM, Siva Chandra  wrote:
> 
> On Wed, Jun 24, 2015 at 12:58 PM, Enrico Granata  wrote:
>> 
>> Try this:
>> Sendingsource/API/SBValue.cpp
>> Transmitting file data .
>> Committed revision 240578.
>> 
>> It seems to fix your issue for me
> 
> Yes, it works. Thanks for looking into it promptly.

Awesome!
I would like for your repro case to be added as a test case, so that we can 
catch any future regressions in this area
If you have a few spare minutes and want to handle that, great; if not I’ll 
gladly do it tomorrow morning.

> 
> The change makes me think that we always want non-dynamic,
> non-synthetic ValueObject to back a SBValue object while the "flavor"
> of the SBValue is per the user settings.

Yes, exactly.
The invariant is that ValueImpl stores a root ValueObjectSP that is neither 
dynamic nor synthetic
This is why I am hesitant to take your other patch - because, yes, it will fix 
the specific case, but I’d rather much ensure that ValueImpl does the right 
thing internally.
Now, it should Just Work in all cases - as the invariant is enforced at 
construction time.

> This seems meaningful now; if
> we are holding on to a SBValue object and change settings, we want the
> behavior of that SBValue object to change according to the settings.


Exactly. That’s the whole reason to have ValueImpl in the first place.

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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240606 - Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

2015-06-24 Thread Enrico Granata
Author: enrico
Date: Wed Jun 24 18:13:23 2015
New Revision: 240606

URL: http://llvm.org/viewvc/llvm-project?rev=240606&view=rev
Log:
Handle (or at least don't crash) trying to get the encoding for a bunch of new 
builtin types in clang trunk


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

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=240606&r1=240605&r2=240606&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Jun 24 18:13:23 2015
@@ -2246,6 +2246,24 @@ ClangASTType::GetEncoding (uint64_t &cou
 case clang::BuiltinType::ObjCSel:   return lldb::eEncodingUint;
 
 case clang::BuiltinType::NullPtr:   return lldb::eEncodingUint;
+
+case clang::BuiltinType::Kind::ARCUnbridgedCast:
+case clang::BuiltinType::Kind::BoundMember:
+case clang::BuiltinType::Kind::BuiltinFn:
+case clang::BuiltinType::Kind::Dependent:
+case clang::BuiltinType::Kind::Half:
+case clang::BuiltinType::Kind::OCLEvent:
+case clang::BuiltinType::Kind::OCLImage1d:
+case clang::BuiltinType::Kind::OCLImage1dArray:
+case clang::BuiltinType::Kind::OCLImage1dBuffer:
+case clang::BuiltinType::Kind::OCLImage2d:
+case clang::BuiltinType::Kind::OCLImage2dArray:
+case clang::BuiltinType::Kind::OCLImage3d:
+case clang::BuiltinType::Kind::OCLSampler:
+case clang::BuiltinType::Kind::Overload:
+case clang::BuiltinType::Kind::PseudoObject:
+case clang::BuiltinType::Kind::UnknownAny:
+break;
 }
 break;
 // All pointer types are represented as unsigned integer encodings.


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] [LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.

2015-06-24 Thread Enrico Granata

> On Jun 24, 2015, at 11:35 AM, Siva Chandra  wrote:
> 
> ping.
> This was probably missed due to the discussion on the other two patches.
> 
> 
> http://reviews.llvm.org/D10625
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


That’s a good catch! Looks good.
Did you run the test suite to make sure that the change causes no regressions?

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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Make SBValue::GetNonSyntheticValue return really that.

2015-06-24 Thread Enrico Granata
Try this:
Sendingsource/API/SBValue.cpp
Transmitting file data .
Committed revision 240578.

It seems to fix your issue for me

> On Jun 22, 2015, at 12:50 PM, Siva Chandra  wrote:
> 
> The following is a small repro case I am using.
> 
> C++ source (class.cc):
> 
>   1 class CCC
>   2 {
>   3 public:
>   4   int a, b, c;
>   5 };
>   6 
>   7 int
>   8 main ()
>   9 {
>  10   CCC obj = { 111, 222, 333 };
>  11   return 0;
>  12 }
> 
> Python (ccc.py):
> 
>   1 import lldb
>   2 
>   3 def ccc_summary(sbvalue, internal_dict):
>   4 sbvalue = sbvalue.GetNonSyntheticValue()
>   5 return ("%s, %s, %s" %
>   6 (str(sbvalue.GetChildMemberWithName("a")),
>   7  str(sbvalue.GetChildMemberWithName("b")),
>   8  str(sbvalue.GetChildMemberWithName("c"
>   9 
>  10 
>  11 class CCCSynthProvider(object):
>  12 def __init__(self, sbvalue, internal_dict):
>  13 self._sbvalue = sbvalue
>  14 
>  15 def num_children(self):
>  16 return 3
>  17 
>  18 def get_child_index(self, name):
>  19 raise RuntimeError("I don't want to be called!")
>  20 
>  21 def get_child_at_index(self, index):
>  22 if index == 0:
>  23 return self._sbvalue.GetChildMemberWithName("a")
>  24 if index == 1:
>  25 return self._sbvalue.GetChildMemberWithName("b")
>  26 if index == 2:
>  27 return self._sbvalue.GetChildMemberWithName("c")
>  28 
>  29 
>  30 cat = lldb.debugger.CreateCategory("my_cat")
>  31 cat.AddTypeSynthetic(
>  32 lldb.SBTypeNameSpecifier("CCC"),
>  33 lldb.SBTypeSynthetic.CreateWithClassName("ccc.CCCSynthProvider",
>  34  lldb.eTypeOptionCascade))
>  35 cat.AddTypeSummary(
>  36 lldb.SBTypeNameSpecifier("CCC"),
>  37 lldb.SBTypeSummary.CreateWithFunctionName("ccc.ccc_summary",
>  38   lldb.eTypeOptionCascade))
>  39 cat.SetEnabled(True)
> 
> Without the proposed change, this is what happens:
> 
>  (lldb) script import ccc
>  (lldb) b class.cc :11
>  Breakpoint 1: where = a.out`main + 25 at class.cc:11, address = 
> 0x00400506
>  (lldb) r
>  Process 31046 launched: 
> '/usr/local/google/home/sivachandra/LAB/lldb_scripting/a.out' (x86_64)
>  Process 31046 stopped
>  * thread #1: tid = 31046, 0x00400506 a.out`main + 25 at class.cc:11, 
> name = 'a.out', stop reason = breakpoint 1.1
>  frame #0: 0x00400506 a.out`main + 25 at class.cc:11
> 8 main ()
> 9 {
> 10  CCC obj = { 111, 222, 333 };
>  -> 11  return 0;
> 12}
>  (lldb) p obj
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  Traceback (most recent call last):
>File "./ccc.py", line 19, in get_child_index
>  raise RuntimeError("I don't want to be called!")
>  RuntimeError: I don't want to be called!
>  (CCC) $0 = No value, No value, No value {
>a = 111
>b = 222
>c = 333
>  }
> 
> After the proposed change:
> 
>  (lldb) script import ccc
>  (lldb) b class.cc :11
>  Breakpoint 1: where = a.out`main + 25 at class.cc:11, address = 
> 0x00400506
>  (lldb) r
>  Process 31412 launched: 
> '/usr/local/google/home/sivachandra/LAB/lldb_scripting/a.out' (x86_64)
>  Process 31412 stopped
>  * thread #1: tid = 31412, 0x00400506 a.out`main + 25 at class.cc:11, 
> name = 'a.out', stop reason = breakpoint 1.1
>  frame #0: 0x00400506 a.out`main + 25 at class.cc:11
> 8 main ()
> 9 {
> 10  CCC obj = { 111, 222, 333 };
>  -> 11  return 0;
> 12}
>  (lldb) p obj
>  (CCC) $0 = (int) a = 111, (int) b = 222, (int) c = 333 {
>a = 111
>b = 222
>c = 333
>  }
> 
> 
> http://reviews.llvm.org/D10581
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Thanks,
- Enrico
📩 egranata@.com

[Lldb-commits] [lldb] r240578 - Fix an issue where an SBValue could end up capturing a synthetic value and would then be unable to return the non-synthetic version thereof

2015-06-24 Thread Enrico Granata
Author: enrico
Date: Wed Jun 24 14:53:22 2015
New Revision: 240578

URL: http://llvm.org/viewvc/llvm-project?rev=240578&view=rev
Log:
Fix an issue where an SBValue could end up capturing a synthetic value and 
would then be unable to return the non-synthetic version thereof

This patch makes the backing ValueImpl always store the root-most value no 
matter the "flavor" that is initially passed into it


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

Modified: lldb/trunk/source/API/SBValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=240578&r1=240577&r2=240578&view=diff
==
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Wed Jun 24 14:53:22 2015
@@ -61,13 +61,19 @@ public:
lldb::DynamicValueType use_dynamic,
bool use_synthetic,
const char *name = NULL) :
-m_valobj_sp(in_valobj_sp),
+m_valobj_sp(),
 m_use_dynamic(use_dynamic),
 m_use_synthetic(use_synthetic),
 m_name (name)
 {
-if (!m_name.IsEmpty() && m_valobj_sp)
-m_valobj_sp->SetName(m_name);
+if (in_valobj_sp)
+{
+if ( (m_valobj_sp = 
in_valobj_sp->GetQualifiedRepresentationIfAvailable(lldb::eNoDynamicValues, 
false)) )
+{
+if (!m_name.IsEmpty())
+m_valobj_sp->SetName(m_name);
+}
+}
 }
 
 ValueImpl (const ValueImpl& rhs) :


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] [ValueObjectPrinter::GetValueSummaryError] Get summary of non-synthetic values.

2015-06-24 Thread Enrico Granata
Still not the right change.

This will only "fix" the case of summaries - but other instances where people 
get their hands on an SBValue will still behave incorrectly. The underlying bug 
is the one in GetNonSyntheticValue(), and I'd prefer to fix that one instead of 
going around putting band-aids on the rest of the code


http://reviews.llvm.org/D10624

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] [ValueObjectPrinter::GetValueSummaryError] Get summary of non-synthetic values.

2015-06-24 Thread Enrico Granata
I don't think this is the right change. A summary should be getting the most 
qualified possible value - compatible with user settings - because it makes 
sense to use that extra information in presenting information. Imagine a 
summary that wants to say "I have %d elements". If we gave to it the 
non-synthetic value, it would compute the number of elements in the underlying 
storage, not the count of user-visible values. That is the wrong way to go at 
it.

Of course, if a summary truly needs a specific flavor of value, it's fine to 
ask for that via the SBValue API.

I understand there is an underlying issue with SBValue::GetNonSyntheticValue() 
- and that is the one we should pursue. I am going to try and look at it today 
or tomorrow, but please do not commit this patch in the meanwhile.


http://reviews.llvm.org/D10624

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r239874 - Revert r239873 - I actually want to think some more about this

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 21:11:48 2015
New Revision: 239874

URL: http://llvm.org/viewvc/llvm-project?rev=239874&view=rev
Log:
Revert r239873 - I actually want to think some more about this


Modified:
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py

lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=239874&r1=239873&r2=239874&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Jun 16 
21:11:48 2015
@@ -22,8 +22,6 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/DataFormatters/TypeSummary.h"
 
-#include "llvm/ADT/Optional.h"
-
 namespace lldb_private {
 
 struct DumpValueObjectOptions
@@ -373,9 +371,6 @@ protected:
 bool
 PrintChildrenOneLiner (bool hide_names);
 
-lldb::Format
-GetFormatForChildElements ();
-
 private:
 
 ValueObject *m_orig_valobj;
@@ -396,7 +391,6 @@ private:
 std::string m_summary;
 std::string m_error;
 std::pair m_validation;
-llvm::Optional m_children_format;
 
 friend struct StringSummaryFormat;
 

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=239874&r1=239873&r2=239874&view=diff
==
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Tue Jun 16 21:11:48 
2015
@@ -83,7 +83,6 @@ ValueObjectPrinter::Init (ValueObject* v
 m_value.assign("");
 m_summary.assign("");
 m_error.assign("");
-m_children_format.reset();
 }
 
 bool
@@ -503,25 +502,12 @@ ValueObjectPrinter::PrintChildrenPreambl
 }
 }
 
-lldb::Format
-ValueObjectPrinter::GetFormatForChildElements ()
-{
-// we special case vector types here because for a vector type the format 
is not trivially passed down but is one of the things
-// the synthetic child provider uses to decide how to produce children in 
the first place - in general this might be something
-// we'd want to expose in some cleaner way, but until there is more than 
one instance of this, it's hard to design this capability
-// in a sensible way, so for now, leave this alone as a special case
-if (m_children_format.hasValue())
-return m_children_format.getValue();
-
-return (m_children_format = m_clang_type.IsVectorType(nullptr, nullptr) ? 
lldb::eFormatInvalid : options.m_format).getValue();
-}
-
 void
 ValueObjectPrinter::PrintChild (ValueObjectSP child_sp,
 uint32_t curr_ptr_depth)
 {
 DumpValueObjectOptions child_options(options);
-
child_options.SetFormat(GetFormatForChildElements()).SetSummary().SetRootValueObjectName();
+
child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
 
child_options.SetScopeChecked(true).SetHideName(options.m_hide_name).SetHideValue(options.m_hide_value)
 .SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? 
child_options.m_omit_summary_depth - 1 : 0);
 if (child_sp.get())
@@ -644,7 +630,7 @@ ValueObjectPrinter::PrintChildrenOneLine
 }
 child_sp->DumpPrintableRepresentation(*m_stream,
   
ValueObject::eValueObjectRepresentationStyleSummary,
-  
GetFormatForChildElements(),
+  lldb::eFormatInvalid,
   
ValueObject::ePrintableRepresentationSpecialCasesDisable);
 }
 }

Modified: 
lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py?rev=239874&r1=239873&r2=239874&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
 Tue Jun 16 21:11:48 2015
@@ -83,9 +83,6 @@ class FormatPropagationTestCase(TestBase
 Y.SetFormat(lldb.eFormatDefault)
 self.assertTrue(X.GetValue() == "0x0004", "X is not hex as it 
asked")
 se

[Lldb-commits] [lldb] r239873 - Fix an issue where the oneliner printing of variables would ignore custom formatting

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 21:06:24 2015
New Revision: 239873

URL: http://llvm.org/viewvc/llvm-project?rev=239873&view=rev
Log:
Fix an issue where the oneliner printing of variables would ignore custom 
formatting

Because vector types use their formats in special ways (i.e. children get 
generated based on them), this change by itself would cause a regression in 
printing vector types with some custom formats
Work around that issue by special casing vector types out of this 
format-passdown mode. I believe there is a more general feature to be designed 
in this space, but until I see more cases of interest, I am going to leave this 
as a special case

Fixes rdar://20810062


Modified:
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py

lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=239873&r1=239872&r2=239873&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Jun 16 
21:06:24 2015
@@ -22,6 +22,8 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/DataFormatters/TypeSummary.h"
 
+#include "llvm/ADT/Optional.h"
+
 namespace lldb_private {
 
 struct DumpValueObjectOptions
@@ -371,6 +373,9 @@ protected:
 bool
 PrintChildrenOneLiner (bool hide_names);
 
+lldb::Format
+GetFormatForChildElements ();
+
 private:
 
 ValueObject *m_orig_valobj;
@@ -391,6 +396,7 @@ private:
 std::string m_summary;
 std::string m_error;
 std::pair m_validation;
+llvm::Optional m_children_format;
 
 friend struct StringSummaryFormat;
 

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=239873&r1=239872&r2=239873&view=diff
==
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Tue Jun 16 21:06:24 
2015
@@ -83,6 +83,7 @@ ValueObjectPrinter::Init (ValueObject* v
 m_value.assign("");
 m_summary.assign("");
 m_error.assign("");
+m_children_format.reset();
 }
 
 bool
@@ -502,12 +503,25 @@ ValueObjectPrinter::PrintChildrenPreambl
 }
 }
 
+lldb::Format
+ValueObjectPrinter::GetFormatForChildElements ()
+{
+// we special case vector types here because for a vector type the format 
is not trivially passed down but is one of the things
+// the synthetic child provider uses to decide how to produce children in 
the first place - in general this might be something
+// we'd want to expose in some cleaner way, but until there is more than 
one instance of this, it's hard to design this capability
+// in a sensible way, so for now, leave this alone as a special case
+if (m_children_format.hasValue())
+return m_children_format.getValue();
+
+return (m_children_format = m_clang_type.IsVectorType(nullptr, nullptr) ? 
lldb::eFormatInvalid : options.m_format).getValue();
+}
+
 void
 ValueObjectPrinter::PrintChild (ValueObjectSP child_sp,
 uint32_t curr_ptr_depth)
 {
 DumpValueObjectOptions child_options(options);
-
child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
+
child_options.SetFormat(GetFormatForChildElements()).SetSummary().SetRootValueObjectName();
 
child_options.SetScopeChecked(true).SetHideName(options.m_hide_name).SetHideValue(options.m_hide_value)
 .SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? 
child_options.m_omit_summary_depth - 1 : 0);
 if (child_sp.get())
@@ -630,7 +644,7 @@ ValueObjectPrinter::PrintChildrenOneLine
 }
 child_sp->DumpPrintableRepresentation(*m_stream,
   
ValueObject::eValueObjectRepresentationStyleSummary,
-  lldb::eFormatInvalid,
+  
GetFormatForChildElements(),
   
ValueObject::ePrintableRepresentationSpecialCasesDisable);
 }
 }

Modified: 
lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py?rev=239873&r1=239872&r2=239873&view=diff
=

[Lldb-commits] [lldb] r239865 - Add a ThreadSafe adapter over llvm::DenseSet

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 18:20:12 2015
New Revision: 239865

URL: http://llvm.org/viewvc/llvm-project?rev=239865&view=rev
Log:
Add a ThreadSafe adapter over llvm::DenseSet


Added:
lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Added: lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h?rev=239865&view=auto
==
--- lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h (added)
+++ lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Tue Jun 16 18:20:12 2015
@@ -0,0 +1,65 @@
+//===-- ThreadSafeDenseSet.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_ThreadSafeDenseSet_h_
+#define liblldb_ThreadSafeDenseSet_h_
+
+// C Includes
+// C++ Includes
+
+// Other libraries and framework includes
+#include "llvm/ADT/DenseSet.h"
+
+// Project includes
+#include "lldb/Host/Mutex.h"
+
+namespace lldb_private {
+
+template 
+class ThreadSafeDenseSet
+{
+public:
+typedef llvm::DenseSet<_ElementType> LLVMSetType;
+
+ThreadSafeDenseSet(unsigned set_initial_capacity = 0,
+   Mutex::Type mutex_type = Mutex::eMutexTypeNormal) :
+m_set(set_initial_capacity),
+m_mutex(mutex_type)
+{
+}
+
+void
+Insert (_ElementType e)
+{
+Mutex::Locker locker(m_mutex);
+m_set.insert(e);
+}
+
+void
+Erase (_ElementType e)
+{
+Mutex::Locker locker(m_mutex);
+m_set.erase(e);
+}
+
+bool
+Lookup (_ElementType e)
+{
+Mutex::Locker locker(m_mutex);
+return (m_set.count(e) > 0);
+}
+
+protected:
+LLVMSetType m_set;
+Mutex m_mutex;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_ThreadSafeDenseSet_h_

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=239865&r1=239864&r2=239865&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jun 16 18:20:12 2015
@@ -2498,6 +2498,7 @@
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 = ""; };
9443B121140C18C10013457C /* SBData.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = ""; };
+   9449B8031B30E0690019342B /* ThreadSafeDenseSet.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ThreadSafeDenseSet.h; path = include/lldb/Core/ThreadSafeDenseSet.h; sourceTree 
= ""; };
944DC3481774C99000D7D884 /* python-swigsafecast.swig */ = {isa 
= PBXFileReference; lastKnownFileType = text; path = 
"python-swigsafecast.swig"; sourceTree = ""; };
945215DD17F639E600521C0B /* ValueObjectPrinter.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ValueObjectPrinter.h; path = include/lldb/DataFormatters/ValueObjectPrinter.h; 
sourceTree = ""; };
945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ValueObjectPrinter.cpp; path = 
source/DataFormatters/ValueObjectPrinter.cpp; sourceTree = ""; };
@@ -4140,6 +4141,7 @@
26BC7D7E10F1B77400F91463 /* Timer.h */,
26BC7E9610F1B85900F91463 /* Timer.cpp */,
94ED54A119C8A822007BE2EA /* 
ThreadSafeDenseMap.h */,
+   9449B8031B30E0690019342B /* 
ThreadSafeDenseSet.h */,
268A813F115B19D000F645B0 /* UniqueCStringMap.h 
*/,
26BC7D8010F1B77400F91463 /* UserID.h */,
26BC7E9810F1B85900F91463 /* UserID.cpp */,


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs

[Lldb-commits] [lldb] r239853 - Add a .parent property to SBFrame's Python interface which allows easy access to the caller frame of the current frame

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 16:07:52 2015
New Revision: 239853

URL: http://llvm.org/viewvc/llvm-project?rev=239853&view=rev
Log:
Add a .parent property to SBFrame's Python interface which allows easy access 
to the caller frame of the current frame


Modified:
lldb/trunk/scripts/interface/SBFrame.i

Modified: lldb/trunk/scripts/interface/SBFrame.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBFrame.i?rev=239853&r1=239852&r2=239853&view=diff
==
--- lldb/trunk/scripts/interface/SBFrame.i (original)
+++ lldb/trunk/scripts/interface/SBFrame.i Tue Jun 16 16:07:52 2015
@@ -273,6 +273,13 @@ public:
 %pythoncode %{
 def get_all_variables(self):
 return self.GetVariables(True,True,True,True)
+
+def get_parent_frame(self):
+parent_idx = self.idx + 1
+if parent_idx >= 0 and parent_idx < len(self.thread.frame):
+return self.thread.frame[parent_idx]
+else:
+return SBFrame()
 
 def get_arguments(self):
 return self.GetVariables(True,False,False,False)
@@ -382,6 +389,9 @@ public:
 __swig_getmethods__["reg"] = get_registers_access
 if _newclass: reg = property(get_registers_access, None, doc='''A read 
only property that returns an helper object providing a flattened indexable 
view of the CPU registers for this stack frame''')
 
+__swig_getmethods__["parent"] = get_parent_frame
+if _newclass: parent = property(get_parent_frame, None, doc='''A read 
only property that returns the parent (caller) frame of the current frame.''')
+
 %}
 };
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r239851 - Fixing a potential issue where the NSIndexPath formatter could try to access stale data

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 15:48:49 2015
New Revision: 239851

URL: http://llvm.org/viewvc/llvm-project?rev=239851&view=rev
Log:
Fixing a potential issue where the NSIndexPath formatter could try to access 
stale data

No test because I did not see this happen - it has been found by code 
inspection as a response to seeing crash logs about this


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

Modified: lldb/trunk/source/DataFormatters/NSIndexPath.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSIndexPath.cpp?rev=239851&r1=239850&r2=239851&view=diff
==
--- lldb/trunk/source/DataFormatters/NSIndexPath.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSIndexPath.cpp Tue Jun 16 15:48:49 2015
@@ -47,7 +47,7 @@ public:
 virtual bool
 Update()
 {
-m_impl.m_mode = Mode::Invalid;
+m_impl.Clear();
 
 m_ast_ctx = 
ClangASTContext::GetASTContext(m_backend.GetClangType().GetASTContext());
 if (!m_ast_ctx)
@@ -76,8 +76,8 @@ public:
 
 if (descriptor->GetTaggedPointerInfo(&info_bits, &value_bits, 
&payload))
 {
-m_impl.m_mode = Mode::Inlined;
 m_impl.m_inlined.SetIndexes(payload, *process_sp);
+m_impl.m_mode = Mode::Inlined;
 }
 else
 {
@@ -191,104 +191,133 @@ protected:
 }
 
 struct InlinedIndexes {
-   public:
- void SetIndexes(uint64_t value, Process& p)
- {
- m_indexes = value;
- _lengthForInlinePayload(p.GetAddressByteSize());
- m_process = &p;
- }
-  
- size_t
- GetNumIndexes ()
- {
- return m_count;
- }
-  
- lldb::ValueObjectSP
- GetIndexAtIndex (size_t idx, const ClangASTType& desired_type)
- {
- std::pair 
value(_indexAtPositionForInlinePayload(idx));
- if (!value.second)
- return nullptr;
- Value v;
- if (m_ptr_size == 8)
- {
- Scalar scalar( (unsigned long long)value.first );
- v = Value(scalar);
- }
- else
- {
- Scalar scalar( (unsigned int)value.first );
- v = Value(scalar);
- }
- v.SetClangType(desired_type);
- StreamString idx_name;
- idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
- return ValueObjectConstResult::Create(m_process, v, 
ConstString(idx_name.GetData()));
- }
-
- private:
- uint64_t m_indexes;
- size_t m_count;
- uint32_t m_ptr_size;
- Process *m_process;
-
- // cfr. Foundation for the details of this code
- size_t _lengthForInlinePayload(uint32_t ptr_size) {
- m_ptr_size = ptr_size;
- if (m_ptr_size == 8)
- m_count = ((m_indexes >> 3) & 0x7);
- else
- m_count = ((m_indexes >> 3) & 0x3);
- return m_count;
- }
-
- std::pair
- _indexAtPositionForInlinePayload(size_t pos) {
- if (m_ptr_size == 8)
- {
-   switch (pos) {
-   case 5: return {((m_indexes >> 51) & 0x1ff),true};
-   case 4: return {((m_indexes >> 42) & 0x1ff),true};
-   case 3: return {((m_indexes >> 33) & 0x1ff),true};
-   case 2: return {((m_indexes >> 24) & 0x1ff),true};
-   case 1: return {((m_indexes >> 15) & 0x1ff),true};
-   case 0: return {((m_indexes >>  6) & 0x1ff),true};
-   }
- }
- else
- {
- switch (pos) {
- case 2: return {((m_indexes >> 23) & 0x1ff),true};
- case 1: return {((m_indexes >> 14) & 0x1ff),true};
- case 0: return {((m_indexes >>  5) & 0x1ff),true};
- }
- }
- return {0,false};
- }
+public:
+  void SetIndexes(uint64_t value, Process& p)
+  {
+  m_indexes = value;
+  _lengthForInlinePayload(p.GetAddressByteSize());
+  m_process = &p;
+  }
+  
+  size_t
+  GetNumIndexes ()
+  {
+  return m_count;
+  }
+
+  lldb::ValueObjectSP
+  GetIndexAtIndex (size_t idx, const ClangASTType& desired_type)
+  {
+  std::pair 
value(_indexAtPositionForInlinePayload(idx));
+  if (!value.second)
+  return nullptr;
+  
+  Value v;
+  if (m_ptr_size == 8)
+  {
+  Scalar scalar( (unsigned long long)value.first );
+  v = Value(scalar);
+   

[Lldb-commits] [lldb] r239839 - Enable 'command script import' to accept multiple modules to import in one invocation

2015-06-16 Thread Enrico Granata
Author: enrico
Date: Tue Jun 16 13:31:04 2015
New Revision: 239839

URL: http://llvm.org/viewvc/llvm-project?rev=239839&view=rev
Log:
Enable 'command script import' to accept multiple modules to import in one 
invocation

Fixes rdar://21388472


Modified:
lldb/trunk/source/Commands/CommandObjectCommands.cpp

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=239839&r1=239838&r2=239839&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Tue Jun 16 13:31:04 
2015
@@ -1570,7 +1570,7 @@ public:
 
 // Define the first (and only) variant of this arg.
 cmd_arg.arg_type = eArgTypeFilename;
-cmd_arg.arg_repetition = eArgRepeatPlain;
+cmd_arg.arg_repetition = eArgRepeatPlus;
 
 // There is only one variant this argument could be; put it into the 
argument entry.
 arg1.push_back (cmd_arg);
@@ -1670,7 +1670,6 @@ protected:
 bool
 DoExecute (Args& command, CommandReturnObject &result)
 {
-
 if (m_interpreter.GetDebugger().GetScriptLanguage() != 
lldb::eScriptLanguagePython)
 {
 result.AppendError ("only scripting language supported for module 
importing is currently Python");
@@ -1679,36 +1678,40 @@ protected:
 }
 
 size_t argc = command.GetArgumentCount();
-
-if (argc != 1)
+if (0 == argc)
 {
-result.AppendError ("'command script import' requires one 
argument");
+result.AppendError("command script import needs one or more 
arguments");
 result.SetStatus (eReturnStatusFailed);
 return false;
 }
 
-std::string path = command.GetArgumentAtIndex(0);
-Error error;
-
-const bool init_session = true;
-// FIXME: this is necessary because CommandObject::CheckRequirements() 
assumes that
-// commands won't ever be recursively invoked, but it's actually 
possible to craft
-// a Python script that does other "command script imports" in 
__lldb_init_module
-// the real fix is to have recursive commands possible with a 
CommandInvocation object
-// separate from the CommandObject itself, so that recursive command 
invocations
-// won't stomp on each other (wrt to execution contents, options, and 
more)
-m_exe_ctx.Clear();
-if 
(m_interpreter.GetScriptInterpreter()->LoadScriptingModule(path.c_str(),
-  
m_options.m_allow_reload,
-  
init_session,
-  error))
+for (int i = 0;
+ i < argc;
+ i++)
 {
-result.SetStatus (eReturnStatusSuccessFinishNoResult);
-}
-else
-{
-result.AppendErrorWithFormat("module importing failed: %s", 
error.AsCString());
-result.SetStatus (eReturnStatusFailed);
+std::string path = command.GetArgumentAtIndex(i);
+Error error;
+
+const bool init_session = true;
+// FIXME: this is necessary because 
CommandObject::CheckRequirements() assumes that
+// commands won't ever be recursively invoked, but it's actually 
possible to craft
+// a Python script that does other "command script imports" in 
__lldb_init_module
+// the real fix is to have recursive commands possible with a 
CommandInvocation object
+// separate from the CommandObject itself, so that recursive 
command invocations
+// won't stomp on each other (wrt to execution contents, options, 
and more)
+m_exe_ctx.Clear();
+if 
(m_interpreter.GetScriptInterpreter()->LoadScriptingModule(path.c_str(),
+  
m_options.m_allow_reload,
+  
init_session,
+  
error))
+{
+result.SetStatus (eReturnStatusSuccessFinishNoResult);
+}
+else
+{
+result.AppendErrorWithFormat("module importing failed: %s", 
error.AsCString());
+result.SetStatus (eReturnStatusFailed);
+}
 }
 
 return result.Succeeded();


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r239779 - If a candidate keyword contains quotes, it's clearly not a keyword, so bail out early

2015-06-15 Thread Enrico Granata
Author: enrico
Date: Mon Jun 15 18:12:29 2015
New Revision: 239779

URL: http://llvm.org/viewvc/llvm-project?rev=239779&view=rev
Log:
If a candidate keyword contains quotes, it's clearly not a keyword, so bail out 
early

There are other characters we could optimize for (any non-letter pretty much), 
but keyword.iskeyword() will handle them, whereas quotes do have the potential 
to confuse us, so they actually need custom handling

Fixes rdar://problem/21022787


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

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=239779&r1=239778&r2=239779&view=diff
==
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Mon Jun 15 
18:12:29 2015
@@ -45,6 +45,8 @@
 #include "lldb/Host/windows/ConnectionGenericFileWindows.h"
 #endif
 
+#include "llvm/ADT/StringRef.h"
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -2615,6 +2617,16 @@ ScriptInterpreterPython::LoadScriptingMo
 bool
 ScriptInterpreterPython::IsReservedWord (const char* word)
 {
+if (!word || !word[0])
+return false;
+
+llvm::StringRef word_sr(word);
+
+// filter out a few characters that would just confuse us
+// and that are clearly not keyword material anyway
+if (word_sr.find_first_of("'\"") != llvm::StringRef::npos)
+return false;
+
 StreamString command_stream;
 command_stream.Printf("keyword.iskeyword('%s')", word);
 bool result;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r239777 - Add a formatter for wchar_t[N] arrays

2015-06-15 Thread Enrico Granata
Author: enrico
Date: Mon Jun 15 18:01:47 2015
New Revision: 239777

URL: http://llvm.org/viewvc/llvm-project?rev=239777&view=rev
Log:
Add a formatter for wchar_t[N] arrays

rdar://21299888


Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py
lldb/trunk/test/lang/cpp/wchar_t/main.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=239777&r1=239776&r2=239777&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Jun 15 18:01:47 2015
@@ -1152,19 +1152,23 @@ FormatManager::LoadSystemFormatters()
 .SetShowMembersOneLiner(false)
 .SetHideItemNames(false);
 
+TypeSummaryImpl::Flags string_array_flags;
+string_array_flags.SetCascades(false)
+.SetSkipPointers(true)
+.SetSkipReferences(false)
+.SetDontShowChildren(true)
+.SetDontShowValue(true)
+.SetShowMembersOneLiner(false)
+.SetHideItemNames(false);
+
 lldb::TypeSummaryImplSP string_format(new 
StringSummaryFormat(string_flags, "${var%s}"));
 
 
-lldb::TypeSummaryImplSP string_array_format(new 
StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
-
.SetSkipPointers(true)
-
.SetSkipReferences(false)
-
.SetDontShowChildren(true)
-
.SetDontShowValue(true)
-
.SetShowMembersOneLiner(false)
-
.SetHideItemNames(false),
+lldb::TypeSummaryImplSP string_array_format(new 
StringSummaryFormat(string_array_flags,
 
"${var%s}"));
 
 lldb::RegularExpressionSP any_size_char_arr(new RegularExpression("char 
\\[[0-9]+\\]"));
+lldb::RegularExpressionSP any_size_wchar_arr(new 
RegularExpression("wchar_t \\[[0-9]+\\]"));
 
 TypeCategoryImpl::SharedPointer sys_category_sp = 
GetCategory(m_system_category_name);
 
@@ -1190,6 +1194,7 @@ FormatManager::LoadSystemFormatters()
 AddCXXSummary(sys_category_sp, 
lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary 
provider", ConstString("char32_t *"), string_flags);
 
 AddCXXSummary(sys_category_sp, 
lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary 
provider", ConstString("wchar_t *"), string_flags);
+AddCXXSummary(sys_category_sp, 
lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary 
provider", ConstString("wchar_t \\[[0-9]+\\]"), string_array_flags, true);
 
 AddCXXSummary(sys_category_sp, 
lldb_private::formatters::Char16StringSummaryProvider, "unichar * summary 
provider", ConstString("unichar *"), string_flags);
 

Modified: lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py?rev=239777&r1=239776&r2=239777&view=diff
==
--- lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py (original)
+++ lldb/trunk/test/lang/cpp/wchar_t/TestCxxWCharT.py Mon Jun 15 18:01:47 2015
@@ -76,6 +76,9 @@ class CxxWCharTTestCase(TestBase):
 self.expect("frame variable ws_NULL",substrs = ['(wchar_t *) ws_NULL = 
0x0'])
 self.expect("frame variable ws_empty",substrs = [' L""'])
 
+self.expect("frame variable array",substrs = ['L"Hey, I\'m a super 
wchar_t string'])
+self.expect("frame variable array",substrs = ['[0]'], matching=False)
+
 if __name__ == '__main__':
 import atexit
 lldb.SBDebugger.Initialize()

Modified: lldb/trunk/test/lang/cpp/wchar_t/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/wchar_t/main.cpp?rev=239777&r1=239776&r2=239777&view=diff
==
--- lldb/trunk/test/lang/cpp/wchar_t/main.cpp (original)
+++ lldb/trunk/test/lang/cpp/wchar_t/main.cpp Mon Jun 15 18:01:47 2015
@@ -26,5 +26,7 @@ int main (int argc, char const *argv[])
 const wchar_t *mazeltov = L"מזל טוב";
 wchar_t *ws_NULL = nullptr;
 wchar_t *ws_empty = L"";
+   wchar_t array[200], * array_source = L"Hey, I'm a super wchar_t string, 
éõñž";
+   memcpy(array, array_source, 39 * sizeof(wchar_t));
 return 0; // Set break point at this line.
 }



___
lldb-commits mailing list
lldb-commit

[Lldb-commits] [lldb] r239766 - Fix a bug where passing a value of the type "A B" to settings set target.env-vars would cause LLDB to crash

2015-06-15 Thread Enrico Granata
Author: enrico
Date: Mon Jun 15 16:37:05 2015
New Revision: 239766

URL: http://llvm.org/viewvc/llvm-project?rev=239766&view=rev
Log:
Fix a bug where passing a value of the type "A B" to settings set 
target.env-vars would cause LLDB to crash

Fixes rdar://problem/21241817


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

Modified: lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=239766&r1=239765&r2=239766&view=diff
==
--- lldb/trunk/source/Interpreter/OptionValueDictionary.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueDictionary.cpp Mon Jun 15 16:37:05 
2015
@@ -117,6 +117,12 @@ OptionValueDictionary::SetArgs (const Ar
 llvm::StringRef key_and_value(args.GetArgumentAtIndex(i));
 if (!key_and_value.empty())
 {
+if (key_and_value.find('=') == llvm::StringRef::npos)
+{
+error.SetErrorString("assign operation takes one or 
more key=value arguments");
+return error;
+}
+
 std::pair 
kvp(key_and_value.split('='));
 llvm::StringRef key = kvp.first;
 bool key_valid = false;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r238984 - I make no claims that Mach ports work, but at least we should check the right thing

2015-06-03 Thread Enrico Granata
Author: enrico
Date: Wed Jun  3 17:35:55 2015
New Revision: 238984

URL: http://llvm.org/viewvc/llvm-project?rev=238984&view=rev
Log:
I make no claims that Mach ports work, but at least we should check the right 
thing


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

Modified: lldb/trunk/source/Core/ConnectionMachPort.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionMachPort.cpp?rev=238984&r1=238983&r2=238984&view=diff
==
--- lldb/trunk/source/Core/ConnectionMachPort.cpp (original)
+++ lldb/trunk/source/Core/ConnectionMachPort.cpp Wed Jun  3 17:35:55 2015
@@ -68,7 +68,7 @@ ConnectionMachPort::Connect (const char
 
 ConnectionStatus status = eConnectionStatusError;
 
-if (strncmp (s, "bootstrap-checkin://", strlen("bootstrap-checkin://")))
+if (0 == strncmp (s, "bootstrap-checkin://", 
strlen("bootstrap-checkin://")))
 {
 s += strlen("bootstrap-checkin://");
 
@@ -82,7 +82,7 @@ ConnectionMachPort::Connect (const char
 error_ptr->SetErrorString ("bootstrap port name is empty");
 }
 }
-else if (strncmp (s, "bootstrap-lookup://", strlen("bootstrap-lookup://")))
+else if (0 == strncmp (s, "bootstrap-lookup://", 
strlen("bootstrap-lookup://")))
 {
 s += strlen("bootstrap-lookup://");
 if (*s)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r238961 - Fix a bug where trying to Dump() a ValueObject would use the static/non-synthetic version of the value even if the ValueObject one actually called Dump() on turned out

2015-06-03 Thread Enrico Granata
Author: enrico
Date: Wed Jun  3 15:43:54 2015
New Revision: 238961

URL: http://llvm.org/viewvc/llvm-project?rev=238961&view=rev
Log:
Fix a bug where trying to Dump() a ValueObject would use the 
static/non-synthetic version of the value even if the ValueObject one actually 
called Dump() on turned out to be dynamic and/or synthetic
This was of course overridable by using DumpValueObjectOptions, but the default 
should be saner and the previous behavior made for a few fun investigations

rdar://problem/21065149


Added:
lldb/trunk/test/functionalities/data-formatter/dump_dynamic/
lldb/trunk/test/functionalities/data-formatter/dump_dynamic/Makefile

lldb/trunk/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
lldb/trunk/test/functionalities/data-formatter/dump_dynamic/main.cpp
Modified:
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=238961&r1=238960&r2=238961&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Wed Jun  3 
15:43:54 2015
@@ -75,6 +75,8 @@ struct DumpValueObjectOptions
 
 DumpValueObjectOptions (const DumpValueObjectOptions& rhs) = default;
 
+DumpValueObjectOptions (ValueObject& valobj);
+
 DumpValueObjectOptions&
 SetMaximumPointerDepth(uint32_t depth = 0)
 {
@@ -246,6 +248,9 @@ struct DumpValueObjectOptions
 class ValueObjectPrinter
 {
 public:
+
+ValueObjectPrinter (ValueObject* valobj,
+Stream* s);
 
 ValueObjectPrinter (ValueObject* valobj,
 Stream* s,

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=238961&r1=238960&r2=238961&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Wed Jun  3 15:43:54 2015
@@ -3560,7 +3560,7 @@ void
 ValueObject::LogValueObject (Log *log)
 {
 if (log)
-return LogValueObject (log, DumpValueObjectOptions::DefaultOptions());
+return LogValueObject (log, DumpValueObjectOptions(*this));
 }
 
 void
@@ -3578,7 +3578,7 @@ ValueObject::LogValueObject (Log *log, c
 void
 ValueObject::Dump (Stream &s)
 {
-Dump (s, DumpValueObjectOptions::DefaultOptions());
+Dump (s, DumpValueObjectOptions(*this));
 }
 
 void

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=238961&r1=238960&r2=238961&view=diff
==
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Wed Jun  3 15:43:54 
2015
@@ -21,6 +21,28 @@
 using namespace lldb;
 using namespace lldb_private;
 
+DumpValueObjectOptions::DumpValueObjectOptions (ValueObject& valobj) :
+DumpValueObjectOptions()
+{
+m_use_dynamic = valobj.GetDynamicValueType();
+m_use_synthetic = valobj.IsSynthetic();
+}
+
+ValueObjectPrinter::ValueObjectPrinter (ValueObject* valobj,
+Stream* s)
+{
+if (valobj)
+{
+DumpValueObjectOptions options(*valobj);
+Init (valobj,s,options,options.m_max_ptr_depth,0);
+}
+else
+{
+DumpValueObjectOptions options;
+Init (valobj,s,options,options.m_max_ptr_depth,0);
+}
+}
+
 ValueObjectPrinter::ValueObjectPrinter (ValueObject* valobj,
 Stream* s,
 const DumpValueObjectOptions& options)

Added: lldb/trunk/test/functionalities/data-formatter/dump_dynamic/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/dump_dynamic/Makefile?rev=238961&view=auto
==
--- lldb/trunk/test/functionalities/data-formatter/dump_dynamic/Makefile (added)
+++ lldb/trunk/test/functionalities/data-formatter/dump_dynamic/Makefile Wed 
Jun  3 15:43:54 2015
@@ -0,0 +1,12 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+CXXFLAGS += -std=c++11
+
+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD 
+# targets.  Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+  CFLAGS_EXTRAS += -fno-limit-debug-info
+endif
+
+include $(LEVEL)/Makefile.rules

A

Re: [Lldb-commits] [lldb] r238425 - Fix TestCommandScript: return an error if target executable is not set

2015-05-28 Thread Enrico Granata
Please do not do this.

This is meant to test that LLDB automatically does the check for you via 
setting the eCommandRequiresTarget flag.

If that flag is not working on FreeBSD, that is what you want to look into, not 
just undo the entire point of that test.

My first guess is that something is going on with your build process (not 
recreating the SWIG layer maybe?) so I would first try a clean build.

Feel free to ask additional questions as needed, I will gladly help.

But as I said, please revert this change and let's get the right thing tested 
and working.

Sent from my iPhone

> On May 28, 2015, at 7:22 AM, Ed Maste  wrote:
> 
> Author: emaste
> Date: Thu May 28 09:22:57 2015
> New Revision: 238425
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=238425&view=rev
> Log:
> Fix TestCommandScript: return an error if target executable is not set
> 
> The test invokes the 'targetname' test command before setting a
> target executable, which caused Python to raise TypeError: cannot
> concatenate 'str' and 'NoneType' objects.
> 
> llvm.org/pr23686
> 
> Modified:
>lldb/trunk/test/functionalities/command_script/welcome.py
> 
> Modified: lldb/trunk/test/functionalities/command_script/welcome.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_script/welcome.py?rev=238425&r1=238424&r2=238425&view=diff
> ==
> --- lldb/trunk/test/functionalities/command_script/welcome.py (original)
> +++ lldb/trunk/test/functionalities/command_script/welcome.py Thu May 28 
> 09:22:57 2015
> @@ -16,11 +16,15 @@ class TargetnameCommand(object):
> pass
> 
> def __call__(self, debugger, args, exe_ctx, result):
> -target = debugger.GetSelectedTarget()
> -file = target.GetExecutable()
> -print >>result,  ('Current target ' + file.GetFilename())
> if args == 'fail':
> result.SetError('a test for error in command')
> +return
> +target = debugger.GetSelectedTarget()
> +file = target.GetExecutable()
> +if file:
> +print >>result,  ('Current target ' + file.GetFilename())
> +else:
> +result.SetError('target.GetExecutable() failed')
> 
> def get_flags(self):
> return lldb.eCommandRequiresTarget
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r238286 - Add support for custom commands to set flags on themselves

2015-05-26 Thread Enrico Granata
Author: enrico
Date: Wed May 27 00:04:35 2015
New Revision: 238286

URL: http://llvm.org/viewvc/llvm-project?rev=238286&view=rev
Log:
Add support for custom commands to set flags on themselves
This works for Python commands defined via a class (implement get_flags on your 
class) and C++ plugin commands (which can call SBCommand::GetFlags()/SetFlags())

Flags allow features such as not letting the command run if there's no target, 
or if the process is not stopped, ...
Commands could always check for these things themselves, but having these 
accessible via flags makes custom commands more consistent with built-in ones


Modified:
lldb/trunk/include/lldb/API/SBCommandInterpreter.h
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
lldb/trunk/source/API/SBCommandInterpreter.cpp
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Commands/CommandObjectRegister.cpp
lldb/trunk/source/Commands/CommandObjectSource.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Commands/CommandObjectThread.cpp
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp

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

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/trunk/test/functionalities/command_script/TestCommandScript.py
lldb/trunk/test/functionalities/command_script/py_import
lldb/trunk/test/functionalities/command_script/welcome.py

Modified: lldb/trunk/include/lldb/API/SBCommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommandInterpreter.h?rev=238286&r1=238285&r2=238286&view=diff
==
--- lldb/trunk/include/lldb/API/SBCommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/API/SBCommandInterpreter.h Wed May 27 00:04:35 2015
@@ -291,6 +291,12 @@ public:
 void
 SetHelpLong (const char*);
 
+uint32_t
+GetFlags ();
+
+void
+SetFlags (uint32_t flags);
+
 lldb::SBCommand
 AddMultiwordCommand (const char* name, const char* help = NULL);
 

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=238286&r1=238285&r2=238286&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Wed May 27 00:04:35 2015
@@ -220,89 +220,6 @@ public:
 
 bool
 IsPairType (ArgumentRepetitionType arg_repeat_type);
-
-enum
-{
-
//--
-// eFlagRequiresTarget
-//
-// Ensures a valid target is contained in m_exe_ctx prior to executing
-// the command. If a target doesn't exist or is invalid, the command
-// will fail and CommandObject::GetInvalidTargetDescription() will be
-// returned as the error. CommandObject subclasses can override the
-// virtual function for GetInvalidTargetDescription() to provide custom
-// strings when needed.
-
//--
-eFlagRequiresTarget = (1u << 0),
-
//--
-// eFlagRequiresProcess
-//
-// Ensures a valid process is contained in m_exe_ctx prior to executing
-// the command. If a process doesn't exist or is invalid, the command
-// will fail and CommandObject::GetInvalidProcessDescription() will be
-// returned as the error. CommandObject subclasses can override the
-// virtual function for GetInvalidProcessDescription() to provide 
custom
-// strings when needed.
-
//--
-eFlagRequiresProcess= (1u << 1),
-
//--
-// eFlagRequiresThread
-//
-// Ensures a valid thread

[Lldb-commits] [lldb] r237714 - A previous patch made it so that ValueObjects could update themselves even in the face of an invalid execution context (which was required for the dynamic and synthetic

2015-05-19 Thread Enrico Granata
Author: enrico
Date: Tue May 19 13:53:13 2015
New Revision: 237714

URL: http://llvm.org/viewvc/llvm-project?rev=237714&view=rev
Log:
A previous patch made it so that ValueObjects could update themselves even in 
the face of an invalid execution context (which was required for the dynamic 
and synthetic values of const objects)

It turns out, child values also need similar provisions

This patch simplifies things a bit allowing ValueObject subclasses to just 
declare whether they can accept an invalid context at update time, and letting 
the update machinery in the EvaluationPoint to the rest
Also, this lets ValueObjectChild proclaim that its parent chooses whether such 
blank-slate updates are possible


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectChild.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObjectChild.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=237714&r1=237713&r2=237714&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue May 19 13:53:13 2015
@@ -858,10 +858,10 @@ public:
 return m_update_point.IsConstant();
 }
 
-virtual bool
+bool
 NeedsUpdating ()
 {
-const bool accept_invalid_exe_ctx = false;
+const bool accept_invalid_exe_ctx = 
CanUpdateWithInvalidExecutionContext();
 return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
 }
 
@@ -1137,6 +1137,7 @@ protected:
 m_did_calculate_complete_objc_class_type:1,
 m_is_synthetic_children_generated:1;
 
+friend class ValueObjectChild;
 friend class ClangExpressionDeclMap;  // For GetValue
 friend class ClangExpressionVariable; // For SetName
 friend class Target;  // For SetName
@@ -1171,6 +1172,12 @@ protected:
 virtual bool
 UpdateValue () = 0;
 
+virtual bool
+CanUpdateWithInvalidExecutionContext ()
+{
+return false;
+}
+
 virtual void
 CalculateDynamicValue (lldb::DynamicValueType use_dynamic);
 

Modified: lldb/trunk/include/lldb/Core/ValueObjectChild.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectChild.h?rev=237714&r1=237713&r2=237714&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h Tue May 19 13:53:13 2015
@@ -83,6 +83,9 @@ public:
 protected:
 virtual bool
 UpdateValue ();
+
+virtual bool
+CanUpdateWithInvalidExecutionContext ();
 
 virtual ClangASTType
 GetClangTypeImpl ()

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=237714&r1=237713&r2=237714&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue May 19 13:53:13 
2015
@@ -62,13 +62,6 @@ public:
 return false;
 }
 
-virtual bool
-NeedsUpdating ()
-{
-const bool accept_invalid_exe_ctx = true;
-return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
-}
-
 virtual ValueObject *
 GetParent()
 {
@@ -116,6 +109,12 @@ protected:
 virtual bool
 UpdateValue ();
 
+virtual bool
+CanUpdateWithInvalidExecutionContext ()
+{
+return true;
+}
+
 virtual lldb::DynamicValueType
 GetDynamicValueTypeImpl ()
 {

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=237714&r1=237713&r2=237714&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue May 19 
13:53:13 2015
@@ -145,14 +145,7 @@ public:
 {
 return false;
 }
-
-virtual bool
-NeedsUpdating ()
-{
-const bool accept_invalid_exe_ctx = true;
-return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
-}
-
+
 virtual bool
 SetValueFromCString (const char *value_str, Error& error);
 
@@ -163,6 +156,12 @@ protected:
 virtual bool
 UpdateValue ();
 
+virtual bool
+CanUpdateWithInvalidExecutionContext ()
+{
+return true;
+}
+
 virtual ClangASTT

[Lldb-commits] [lldb] r237504 - Constant result ValueObjects are - well - constant

2015-05-15 Thread Enrico Granata
Author: enrico
Date: Fri May 15 20:27:00 2015
New Revision: 237504

URL: http://llvm.org/viewvc/llvm-project?rev=237504&view=rev
Log:
Constant result ValueObjects are - well  - constant
And they also do not have a thread/frame attached to them

That makes dynamic and synthetic values attached to them impossible to update - 
which, among other things, makes it impossible to properly display persistent 
variables of types that could have such dynamic/persistent values

Fix this by making it so that a ValueObject can control its constantness (hint: 
dynamic and synthetic values cannot be constant) and whether it wants to let 
itself be updated when an invalid thread is around


Added:
lldb/trunk/test/expression_command/persistent_ptr_update/
lldb/trunk/test/expression_command/persistent_ptr_update/Makefile

lldb/trunk/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
lldb/trunk/test/expression_command/persistent_ptr_update/main.c
Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=237504&r1=237503&r2=237504&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Fri May 15 20:27:00 2015
@@ -285,18 +285,19 @@ public:
 SetUpdated ();
 
 bool
-NeedsUpdating()
+NeedsUpdating(bool accept_invalid_exe_ctx)
 {
-SyncWithProcessState();
+SyncWithProcessState(accept_invalid_exe_ctx);
 return m_needs_update;
 }
 
 bool
 IsValid ()
 {
+const bool accept_invalid_exe_ctx = false;
 if (!m_mod_id.IsValid())
 return false;
-else if (SyncWithProcessState ())
+else if (SyncWithProcessState (accept_invalid_exe_ctx))
 {
 if (!m_mod_id.IsValid())
 return false;
@@ -318,7 +319,7 @@ public:
 
 private:
 bool
-SyncWithProcessState ();
+SyncWithProcessState (bool accept_invalid_exe_ctx);
 
 ProcessModID m_mod_id; // This is the stop id when this ValueObject 
was last evaluated.
 ExecutionContextRef m_exe_ctx_ref;
@@ -851,12 +852,19 @@ public:
 virtual bool
 SetData (DataExtractor &data, Error &error);
 
-bool
+virtual bool
 GetIsConstant () const
 {
 return m_update_point.IsConstant();
 }
 
+virtual bool
+NeedsUpdating ()
+{
+const bool accept_invalid_exe_ctx = false;
+return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
+}
+
 void
 SetIsConstant ()
 {

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=237504&r1=237503&r2=237504&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Fri May 15 20:27:00 
2015
@@ -56,6 +56,19 @@ public:
 return true;
 }
 
+virtual bool
+GetIsConstant () const
+{
+return false;
+}
+
+virtual bool
+NeedsUpdating ()
+{
+const bool accept_invalid_exe_ctx = true;
+return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
+}
+
 virtual ValueObject *
 GetParent()
 {

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=237504&r1=237503&r2=237504&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Fri May 15 
20:27:00 2015
@@ -141,6 +141,19 @@ public:
 }
 
 virtual bool
+GetIsConstant () const
+{
+return false;
+}
+
+virtual bool
+NeedsUpdating ()
+{
+const bool accept_invalid_exe_ctx = true;
+return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
+}
+
+virtual bool
 SetValueFromCString (const char *value_str, Error& error);
 
 virtual void

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=237504&r1=237503&r2=237504&view=diff
==
--- lldb/

[Lldb-commits] [lldb] r237322 - Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents

2015-05-13 Thread Enrico Granata
Author: enrico
Date: Wed May 13 19:46:47 2015
New Revision: 237322

URL: http://llvm.org/viewvc/llvm-project?rev=237322&view=rev
Log:
Implement an objc tagged-pointer info command that will provide information 
about what LLDB thinks an ObjC tagged pointer represents


Modified:
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.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=237322&r1=237321&r2=237322&view=diff
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Wed May 13 19:46:47 
2015
@@ -310,6 +310,30 @@ public:
 std::unordered_set m_class_names;
 };
 
+class TaggedPointerVendor
+{
+public:
+virtual bool
+IsPossibleTaggedPointer (lldb::addr_t ptr) = 0;
+
+virtual ObjCLanguageRuntime::ClassDescriptorSP
+GetClassDescriptor (lldb::addr_t ptr) = 0;
+
+virtual
+~TaggedPointerVendor () { }
+protected:
+TaggedPointerVendor () = default;
+
+private:
+DISALLOW_COPY_AND_ASSIGN(TaggedPointerVendor);
+};
+
+virtual TaggedPointerVendor*
+GetTaggedPointerVendor ()
+{
+return nullptr;
+}
+
 typedef std::shared_ptr EncodingToTypeSP;
 
 virtual EncodingToTypeSP

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=237322&r1=237321&r2=237322&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 Wed May 13 19:46:47 2015
@@ -32,6 +32,7 @@
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Expression/ClangFunction.h"
 #include "lldb/Expression/ClangUtilityFunction.h"
+#include "lldb/Host/StringConvert.h"
 #include "lldb/Interpreter/CommandObject.h"
 #include "lldb/Interpreter/CommandObjectMultiword.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
@@ -363,7 +364,7 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2 (
 m_has_object_getClass (false),
 m_loaded_objc_opt (false),
 
m_non_pointer_isa_cache_ap(NonPointerISACache::CreateInstance(*this,objc_module_sp)),
-
m_tagged_pointer_vendor_ap(TaggedPointerVendor::CreateInstance(*this,objc_module_sp)),
+
m_tagged_pointer_vendor_ap(TaggedPointerVendorV2::CreateInstance(*this,objc_module_sp)),
 m_encoding_to_type_sp(),
 m_noclasses_warning_emitted(false)
 {
@@ -508,6 +509,106 @@ protected:
 }
 };
 
+class CommandObjectMultiwordObjC_TaggedPointer_Info : public 
CommandObjectParsed
+{
+public:
+
+CommandObjectMultiwordObjC_TaggedPointer_Info (CommandInterpreter 
&interpreter) :
+CommandObjectParsed (interpreter,
+ "info",
+ "Dump information on a tagged pointer.",
+ "language objc tagged-pointer info",
+ eFlagRequiresProcess   |
+ eFlagProcessMustBeLaunched |
+ eFlagProcessMustBePaused   )
+{
+CommandArgumentEntry arg;
+CommandArgumentData index_arg;
+
+// Define the first (and only) variant of this arg.
+index_arg.arg_type = eArgTypeAddress;
+index_arg.arg_repetition = eArgRepeatPlus;
+
+// There is only one variant this argument could be; put it into the 
argument entry.
+arg.push_back (index_arg);
+
+// Push the data for the first argument into the m_arguments vector.
+m_arguments.push_back (arg);
+}
+
+~CommandObjectMultiwordObjC_TaggedPointer_Info ()
+{
+}
+
+protected:
+bool
+DoExecute (Args& command, CommandReturnObject &result)
+{
+if (command.GetArgumentCount() == 0)
+{
+result.AppendError("this command requires arguments");
+result.SetStatus(lldb::eReturnStatusFailed);
+return false;
+}
+
+Process *process = m_exe_ctx.GetProcessPtr();
+ExecutionContext exe_ctx(process);
+ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();
+if (objc_runtime)
+{
+ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor = 
objc_runtime->GetTaggedPointerVendor();
+if (tagged_ptr_vendor)
+{
+  

[Lldb-commits] [lldb] r236769 - Make it so that changing formats on a synthetic value object causes children to be invalidated and refetched when needed

2015-05-07 Thread Enrico Granata
Author: enrico
Date: Thu May  7 15:33:31 2015
New Revision: 236769

URL: http://llvm.org/viewvc/llvm-project?rev=236769&view=rev
Log:
Make it so that changing formats on a synthetic value object causes children to 
be invalidated and refetched when needed

This is required for supporting vector types formatting


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp

lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=236769&r1=236768&r2=236769&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu May  7 15:33:31 2015
@@ -1133,6 +1133,7 @@ protected:
 friend class ClangExpressionVariable; // For SetName
 friend class Target;  // For SetName
 friend class ValueObjectConstResultImpl;
+friend class ValueObjectSynthetic;// For ClearUserVisibleData
 
 //--
 // Constructors and Destructors

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=236769&r1=236768&r2=236769&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Thu May  7 
15:33:31 2015
@@ -144,12 +144,7 @@ public:
 SetValueFromCString (const char *value_str, Error& error);
 
 virtual void
-SetFormat (lldb::Format format)
-{
-if (m_parent)
-m_parent->SetFormat(format);
-this->ValueObject::SetFormat(format);
-}
+SetFormat (lldb::Format format);
 
 protected:
 virtual bool

Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=236769&r1=236768&r2=236769&view=diff
==
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Thu May  7 15:33:31 
2015
@@ -304,3 +304,15 @@ ValueObjectSynthetic::SetValueFromCStrin
 {
 return m_parent->SetValueFromCString(value_str, error);
 }
+
+void
+ValueObjectSynthetic::SetFormat (lldb::Format format)
+{
+if (m_parent)
+{
+m_parent->ClearUserVisibleData(eClearUserVisibleDataItemsAll);
+m_parent->SetFormat(format);
+}
+this->ValueObject::SetFormat(format);
+this->ClearUserVisibleData(eClearUserVisibleDataItemsAll);
+}

Modified: 
lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py?rev=236769&r1=236768&r2=236769&view=diff
==
--- 
lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
 (original)
+++ 
lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
 Thu May  7 15:33:31 2015
@@ -71,6 +71,15 @@ class VectorTypesFormattingTestCase(Test
 
 self.expect("expr -f int16_t[] -- v", substrs=['[0] = 0', '[1] = 
16288', '[2] = 0', '[3] = 16288', '[4] = 0', '[5] = 16416', '[6] = 0', '[7] = 
16416'])
 self.expect("expr -f uint128_t[] -- v", substrs=['[0] = 
85236745249553456609335044694184296448'])
+
+oldValue = v.GetChildAtIndex(0).GetValue()
+v.SetFormat(lldb.eFormatHex)
+newValue = v.GetChildAtIndex(0).GetValue()
+self.assertFalse(oldValue == newValue, "values did not change along 
with format")
+
+v.SetFormat(lldb.eFormatVectorOfFloat32)
+oldValueAgain = v.GetChildAtIndex(0).GetValue()
+self.assertTrue(oldValue == oldValueAgain, "same format but different 
values")
 
 if __name__ == '__main__':
 import atexit


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Have lldb_assert accept bool expressions

2015-05-07 Thread Enrico Granata
LGTM

- Enrico
Sent from my iPhone

> On May 7, 2015, at 8:15 AM, Pavel Labath  wrote:
> 
> Hi granata.enrico, zturner,
> 
> This changes lldb_assert to accept bool expressions as the parameter, this is 
> because some
> objects (such as std::shared_ptr) are convertible to bool, but are not 
> convertible to int, which
> leads to surprising errors.
> 
> http://reviews.llvm.org/D9565
> 
> Files:
>  include/lldb/Utility/LLDBAssert.h
>  source/Utility/LLDBAssert.cpp
> 
> Index: include/lldb/Utility/LLDBAssert.h
> ===
> --- include/lldb/Utility/LLDBAssert.h
> +++ include/lldb/Utility/LLDBAssert.h
> @@ -20,7 +20,7 @@
> 
> namespace lldb_private {
> void
> -lldb_assert (int expression,
> +lldb_assert (bool expression,
>  const char* expr_text,
>  const char* func,
>  const char* file,
> Index: source/Utility/LLDBAssert.cpp
> ===
> --- source/Utility/LLDBAssert.cpp
> +++ source/Utility/LLDBAssert.cpp
> @@ -17,7 +17,7 @@
> using namespace lldb_private;
> 
> void
> -lldb_private::lldb_assert (int expression,
> +lldb_private::lldb_assert (bool expression,
>const char* expr_text,
>const char* func,
>const char* file,
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236646 - I forgot to return here, so do it, and appease the compiler

2015-05-06 Thread Enrico Granata
Author: enrico
Date: Wed May  6 16:54:18 2015
New Revision: 236646

URL: http://llvm.org/viewvc/llvm-project?rev=236646&view=rev
Log:
I forgot to return here, so do it, and appease the compiler

Modified:

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

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=236646&r1=236645&r2=236646&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 Wed May  6 16:54:18 2015
@@ -497,6 +497,7 @@ protected:
 }
 }
 result.SetStatus(lldb::eReturnStatusSuccessFinishResult);
+return true;
 }
 else
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236640 - Add a language objc class-table dump command

2015-05-06 Thread Enrico Granata
Author: enrico
Date: Wed May  6 16:01:07 2015
New Revision: 236640

URL: http://llvm.org/viewvc/llvm-project?rev=236640&view=rev
Log:
Add a language objc class-table dump command

This command dumps a bunch of interesting facts about all Objective-C classes 
known to LLDB in the inferior process


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

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

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=236640&r1=236639&r2=236640&view=diff
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Wed May  6 16:01:07 
2015
@@ -26,6 +26,8 @@
 #include "lldb/Symbol/Type.h"
 #include "lldb/Target/LanguageRuntime.h"
 
+class CommandObjectObjC_ClassTable_Dump;
+
 namespace lldb_private {
 
 class ClangUtilityFunction;
@@ -663,6 +665,11 @@ protected:
 ISAToDescriptorIterator
 GetDescriptorIterator (const ConstString &name);
 
+friend class ::CommandObjectObjC_ClassTable_Dump;
+
+std::pair
+GetDescriptorIteratorPair (bool update_if_needed = true);
+
 void
 ReadObjCLibraryIfNeeded (const ModuleList &module_list);
 

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=236640&r1=236639&r2=236640&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 Wed May  6 16:01:07 2015
@@ -32,6 +32,9 @@
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Expression/ClangFunction.h"
 #include "lldb/Expression/ClangUtilityFunction.h"
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Interpreter/CommandObjectMultiword.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/Symbol.h"
@@ -445,12 +448,112 @@ AppleObjCRuntimeV2::CreateInstance (Proc
 return NULL;
 }
 
+class CommandObjectObjC_ClassTable_Dump : public CommandObjectParsed
+{
+public:
+
+CommandObjectObjC_ClassTable_Dump (CommandInterpreter &interpreter) :
+CommandObjectParsed (interpreter,
+ "dump",
+ "Dump information on Objective-C classes known to the 
current process.",
+ "language objc class-table dump",
+ eFlagRequiresProcess   |
+ eFlagProcessMustBeLaunched |
+ eFlagProcessMustBePaused   )
+{
+}
+
+~CommandObjectObjC_ClassTable_Dump ()
+{
+}
+
+protected:
+bool
+DoExecute (Args& command, CommandReturnObject &result)
+{
+Process *process = m_exe_ctx.GetProcessPtr();
+ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();
+if (objc_runtime)
+{
+auto iterators_pair = objc_runtime->GetDescriptorIteratorPair();
+auto iterator = iterators_pair.first;
+for(; iterator != iterators_pair.second; iterator++)
+{
+result.GetOutputStream().Printf("isa = 0x%" PRIx64, 
iterator->first);
+if (iterator->second)
+{
+result.GetOutputStream().Printf(" name = %s", 
iterator->second->GetClassName().AsCString(""));
+result.GetOutputStream().Printf(" instance size = %" 
PRIu64, iterator->second->GetInstanceSize());
+result.GetOutputStream().Printf(" num ivars = %" PRIuPTR, 
(uintptr_t)iterator->second->GetNumIVars());
+if (auto superclass = iterator->second->GetSuperclass())
+{
+result.GetOutputStream().Printf(" superclass = %s", 
superclass->GetClassName().AsCString(""));
+}
+result.GetOutputStream().Printf("\n");
+}
+else
+{
+result.GetOutputStream().Printf(" has no associated 
class.\n");
+}
+}
+result.SetStatus(lldb::eReturnStatusSuccessFinishResult);
+}
+else
+{
+result.AppendError("current process has no Objective-C runtime 
loaded");
+result.SetStatus(lldb::eReturnStatusFailed);
+return false;
+}
+}
+};
+
+class CommandObjectMultiwordObjC_C

[Lldb-commits] [lldb] r236362 - Fix an issue where the UTF dumper was ignoring the direction to generate uncapped dumps

2015-05-01 Thread Enrico Granata
Author: enrico
Date: Fri May  1 17:57:38 2015
New Revision: 236362

URL: http://llvm.org/viewvc/llvm-project?rev=236362&view=rev
Log:
Fix an issue where the UTF dumper was ignoring the direction to generate 
uncapped dumps

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

Modified: lldb/trunk/source/DataFormatters/StringPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/StringPrinter.cpp?rev=236362&r1=236361&r2=236362&view=diff
==
--- lldb/trunk/source/DataFormatters/StringPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/StringPrinter.cpp Fri May  1 17:57:38 2015
@@ -555,7 +555,7 @@ ReadUTFBufferAndDumpToStream (const Read
 sourceSize = process_sp->GetTarget().GetMaximumSizeOfStringSummary();
 needs_zero_terminator = true;
 }
-else
+else if (!options.GetIgnoreMaxLength())
 sourceSize = 
std::min(sourceSize,process_sp->GetTarget().GetMaximumSizeOfStringSummary());
 
 const int bufferSPSize = sourceSize * type_width;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r236174 - Introduce a NullLog class, which ignores all messages.

2015-04-29 Thread Enrico Granata
One possible avenue to fix the performance issue would be to have your log 
calls take a lambda expression that returns the string to be printed, e.g.

#include 
#include 
#include 
#include 

typedef std::function LogFunction;

void log(bool dolog, LogFunction f) {
if (dolog)
std::cout << f() << std::endl;
}

int main() {
log(true, [] () -> std::string { return "hello world"; } );
log(false, [] {sleep(10); return "hi"; });
return 0;
}

I don’t think the code gets much better doing this compared to the previous if 
(log) model we were using - but that’s at least arguable


> More importantly, I don't think this is a good change.  I want to be able to 
> freely put complex log statements where ever I need without having to worry 
> about the performance implications.  That was always possible, because the 
> cost of not logging was checking if log was NULL.
> 
> With this change I'm always going to get back a log, so I'm always going to 
> marshall the arguments, and do whatever work was going to go into printing, 
> etc and then call a virtual function that does nothing with the results.
> 
> That seems undesirable to me.  You could work around this by having any code 
> that does logging in a loop or that has complex arguments check if the log is 
> a null log and not do the work if it is, but then we're right back where we 
> started except now we only do the check sometimes, making things even more 
> confusing.
> 
> Jim
> 
> On Apr 29, 2015, at 4:30 PM, Sean Callanan  wrote:
> 
> Zachary,
> 
> Log.cpp doesn’t build anymore with this change.  In particular, you have
> –
> +virtual void
> +VAPrintf(const char *format, va_list args);
> –
> but at several places VAPrintf is called with no va_list, e.g.,
> –
> void
> -Log::Error (const char *format, ...)
> +Log::Error(const char *format, ...)
> {
> -char *arg_msg = NULL;
> +char *arg_msg = nullptr;
>   va_list args;
> -va_start (args, format);
> -::vasprintf (&arg_msg, format, args);
> -va_end (args);
> +va_start(args, format);
> +::vasprintf(&arg_msg, format, args);
> +va_end(args);
> 
> -if (arg_msg != NULL)
> -{
> -PrintfWithFlags (LLDB_LOG_FLAG_ERROR, "error: %s", arg_msg);
> -free (arg_msg);
> -}
> +if (arg_msg == nullptr)
> +return;
> +
> +VAPrintf("error: %s", arg_msg);
> +free(arg_msg);
> }
> –
> Do you have more commits coming that are going to resolve this problem?
> 
> Sean
> 
> 
>> On Apr 29, 2015, at 3:55 PM, Zachary Turner  wrote:
>> 
>> Author: zturner
>> Date: Wed Apr 29 17:55:28 2015
>> New Revision: 236174
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=236174&view=rev
>> Log:
>> Introduce a NullLog class, which ignores all messages.
>> 
>> The purpose of this class is so that GetLogIfAllCategoriesSet
>> can always return an instance of some class, whether it be a real
>> logging class or a "null" class, which ignores messages.  Code
>> that is littered with if statements that only log if the pointer
>> is non-null can get very unwieldy very quickly, so this should
>> help code readability in such circumstances.
>> 
>> Since I'm in this code anyway, I'm also deleting the
>> PrintfWithFlags methods, as well as all the flags, since they
>> appear to be dead code that have been superceded by newer
>> mechanisms and all the flags are simply ignored.
>> 
>> Added:
>>  lldb/trunk/include/lldb/Core/NullLog.h
>>  lldb/trunk/source/Core/NullLog.cpp
>> Modified:
>>  lldb/trunk/include/lldb/Core/Log.h
>>  lldb/trunk/source/Core/CMakeLists.txt
>>  lldb/trunk/source/Core/Log.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Core/Log.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Log.h?rev=236174&r1=236173&r2=236174&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Core/Log.h (original)
>> +++ lldb/trunk/include/lldb/Core/Log.h Wed Apr 29 17:55:28 2015
>> @@ -26,17 +26,6 @@
>> #include "lldb/Core/PluginInterface.h"
>> 
>> //--
>> -// Logging types
>> -//--
>> -#define LLDB_LOG_FLAG_STDOUT(1u << 0)
>> -#define LLDB_LOG_FLAG_STDERR(1u << 1)
>> -#define LLDB_LOG_FLAG_FATAL (1u << 2)
>> -#define LLDB_LOG_FLAG_ERROR (1u << 3)
>> -#define LLDB_LOG_FLAG_WARNING   (1u << 4)
>> -#define LLDB_LOG_FLAG_DEBUG (1u << 5)
>> -#define LLDB_LOG_FLAG_VERBOSE   (1u << 6)
>> -
>> -//--
>> // Logging Options
>> //--
>> #define LLDB_LOG_OPTION_THREADSAFE  (1u << 0)
>> @@ -61,12 +50,10 @@ public:
>>   //--
>>   // Callback definitions for abstracted plug-in log access.
>>   //---

[Lldb-commits] [lldb] r235447 - Add properties to SBExecutionContext to access the several entities it stores in a more Pythonic fashion

2015-04-21 Thread Enrico Granata
Author: enrico
Date: Tue Apr 21 17:09:12 2015
New Revision: 235447

URL: http://llvm.org/viewvc/llvm-project?rev=235447&view=rev
Log:
Add properties to SBExecutionContext to access the several entities it stores 
in a more Pythonic fashion


Modified:
lldb/trunk/scripts/Python/interface/SBExecutionContext.i

Modified: lldb/trunk/scripts/Python/interface/SBExecutionContext.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBExecutionContext.i?rev=235447&r1=235446&r2=235447&view=diff
==
--- lldb/trunk/scripts/Python/interface/SBExecutionContext.i (original)
+++ lldb/trunk/scripts/Python/interface/SBExecutionContext.i Tue Apr 21 
17:09:12 2015
@@ -37,6 +37,21 @@ public:
 
 SBFrame
 GetFrame () const;
+
+%pythoncode %{
+__swig_getmethods__["target"] = GetTarget
+if _newclass: target = property(GetTarget, None, doc='''A read only 
property that returns the same result as GetTarget().''')
+
+__swig_getmethods__["process"] = GetProcess
+if _newclass: process = property(GetProcess, None, doc='''A read only 
property that returns the same result as GetProcess().''')
+
+__swig_getmethods__["thread"] = GetThread
+if _newclass: thread = property(GetThread, None, doc='''A read only 
property that returns the same result as GetThread().''')
+
+__swig_getmethods__["frame"] = GetFrame
+if _newclass: frame = property(GetFrame, None, doc='''A read only 
property that returns the same result as GetFrame().''')
+%}
+
 };
 
 } // namespace lldb


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r235157 - Fix a bug where argdumper would not launch inferiors correctly in the presence of arguments of the form word1\ word2 (vs. the quoted form "word1 word2")

2015-04-16 Thread Enrico Granata
Author: enrico
Date: Thu Apr 16 20:50:11 2015
New Revision: 235157

URL: http://llvm.org/viewvc/llvm-project?rev=235157&view=rev
Log:
Fix a bug where argdumper would not launch inferiors correctly in the presence 
of arguments of the form word1\ word2 (vs. the quoted form "word1 word2")

Fixes rdar://20493444


Modified:
lldb/trunk/include/lldb/Host/Host.h
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/macosx/Host.mm

lldb/trunk/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=235157&r1=235156&r2=235157&view=diff
==
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Thu Apr 16 20:50:11 2015
@@ -268,6 +268,15 @@ public:
  std::string *command_output,   // Pass NULL if you don't 
want the command output
  uint32_t timeout_sec,
  bool run_in_default_shell = true);
+
+static Error
+RunShellCommand (const Args& args,
+ const char *working_dir,   // Pass NULL to use the 
current working directory
+ int *status_ptr,   // Pass NULL if you don't 
want the process exit status
+ int *signo_ptr,// Pass NULL if you don't 
want the signal that caused the process to exit
+ std::string *command_output,   // Pass NULL if you don't 
want the command output
+ uint32_t timeout_sec,
+ bool run_in_default_shell = true);
 
 static lldb::DataBufferSP
 GetAuxvData (lldb_private::Process *process);

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=235157&r1=235156&r2=235157&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Thu Apr 16 20:50:11 2015
@@ -552,6 +552,18 @@ Host::RunShellCommand (const char *comma
uint32_t timeout_sec,
bool run_in_default_shell)
 {
+return RunShellCommand(Args(command), working_dir, status_ptr, signo_ptr, 
command_output_ptr, timeout_sec, run_in_default_shell);
+}
+
+Error
+Host::RunShellCommand (const Args &args,
+   const char *working_dir,
+   int *status_ptr,
+   int *signo_ptr,
+   std::string *command_output_ptr,
+   uint32_t timeout_sec,
+   bool run_in_default_shell)
+{
 Error error;
 ProcessLaunchInfo launch_info;
 launch_info.SetArchitecture(HostInfo::GetArchitecture());
@@ -559,10 +571,10 @@ Host::RunShellCommand (const char *comma
 {
 // Run the command in a shell
 launch_info.SetShell(HostInfo::GetDefaultShell());
-launch_info.GetArguments().AppendArgument(command);
+launch_info.GetArguments().AppendArguments(args);
 const bool localhost = true;
 const bool will_debug = false;
-const bool first_arg_is_full_shell_command = true;
+const bool first_arg_is_full_shell_command = false;
 launch_info.ConvertArgumentsForLaunchingInShell (error,
  localhost,
  will_debug,
@@ -572,7 +584,6 @@ Host::RunShellCommand (const char *comma
 else
 {
 // No shell, just run it
-Args args (command);
 const bool first_arg_is_executable = true;
 launch_info.SetArguments(args, first_arg_is_executable);
 }
@@ -580,7 +591,7 @@ Host::RunShellCommand (const char *comma
 if (working_dir)
 launch_info.SetWorkingDirectory(working_dir);
 llvm::SmallString output_file_path;
-
+
 if (command_output_ptr)
 {
 // Create a temporary file to get the stdout/stderr and redirect the
@@ -618,10 +629,10 @@ Host::RunShellCommand (const char *comma
 
 error = LaunchProcess (launch_info);
 const lldb::pid_t pid = launch_info.GetProcessID();
-
+
 if (error.Success() && pid == LLDB_INVALID_PROCESS_ID)
 error.SetErrorString("failed to get process ID");
-
+
 if (error.Success())
 {
 // The process successfully launched, so we can defer ownership of
@@ -640,7 +651,7 @@ Host::RunShellCommand (const char *comma
 if (timed_out)
 {
 error.SetErrorString("timed out waiting for shell command to 
complete");
-
+
 // Kill the process since it didn't complete within the timeout 
specified
 Kill (pid, SIGKILL);
 // Wait for the monitor callback to g

Re: [Lldb-commits] [PATCH] [IRForTarget] Strenghten handling of alternate mangling.

2015-04-06 Thread Enrico Granata

> On Apr 6, 2015, at 3:32 PM, Sean Callanan  wrote:
> 
> I like this; we could have the CXXLanguageRuntime return a list of 
> “candidate” remangled names if you can’t find a given one, and then try those.
> The function would have the signature
> 
> size_t
> CXXLanguageRuntime::GetAlternateManglings(ConstString mangled_name, 
> std::vector &alternate_names);
> 
> What do you folks think?
> 
> Sean
> 
> Siva, please move your logic (and the existing logic) into that function, 
> which should ideally just take a str
> 
>> On Apr 6, 2015, at 3:15 PM, Zachary Turner > > wrote:
>> 
>> Is it possible to do away with the hardcoded mangled name?  I really dislike 
>> seeing this kind of thing.  Not only because it doesn't work with all ABIs, 
>> but just in general it's very gross for the debugger to have exceptions for 
>> specific mangled names.  Why is this necessary, and is there any way to get 
>> rid of it?
>> 
>> If it is necessary, can we at least move it to somewhere more appropriate 
>> like the Mangled class and provide some kind of generic method like 
>> Mangled::GetAlternateMangling()?  
>> 
>> On Mon, Apr 6, 2015 at 3:10 PM Greg Clayton > > wrote:
>> I'll OK this on the condition that Sean Callanan OKs this. Sean?
>> 
>> 
>> http://reviews.llvm.org/D8846 
>> 
>> EMAIL PREFERENCES
>>   http://reviews.llvm.org/settings/panel/emailpreferences/ 
>> 
>> 
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@cs.uiuc.edu 
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits 
>> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


FWIW, we already have some similar provisions for detangled name in 
CPPLanguageRuntime

It’s called CPPRuntimeEquivalents, and according to SVN, I introduced it in 
2012:

Author: enrico
Date: Thu Feb  2 19:41:25 2012
New Revision: 149661

URL: http://llvm.org/viewvc/llvm-project?rev=149661&view=rev 

Log:
Adding support for an "equivalents map". This can be useful when compilers emit 
multiple, different names for the same actual type. In such scenarios, one of 
the type names can actually be found during a type lookup, while the others are 
just aliases. This can cause issues when trying to work with these aliased 
names and being unable to resolve them to an actual type (e.g. getting an 
SBType for the aliased name).
Currently, no code is using this feature, since we can hopefully rely on the 
new template support in SBType to get the same stuff done, but the support is 
there just in case it turns out to be useful for some future need.

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


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

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r234239 - Fix an issue where LLDB could crash when trying to figure out the return value layout for an invalid type

2015-04-06 Thread Enrico Granata
Author: enrico
Date: Mon Apr  6 16:39:56 2015
New Revision: 234239

URL: http://llvm.org/viewvc/llvm-project?rev=234239&view=rev
Log:
Fix an issue where LLDB could crash when trying to figure out the return value 
layout for an invalid type


Modified:
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=234239&r1=234238&r2=234239&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Apr  6 
16:39:56 2015
@@ -871,6 +871,10 @@ ABISysV_x86_64::GetReturnValueObjectImpl
 ClangASTType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
 const size_t field_bit_width = 
field_clang_type.GetBitSize(&thread);
 
+// if we don't know the size of the field (e.g. invalid type), 
just bail out
+if (field_bit_width == 0)
+break;
+
 // If there are any unaligned fields, this is stored in memory.
 if (field_bit_offset % field_bit_width != 0)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r234194 - If memory read does not find a NULL terminator, still print whatever it gathered instead of just NOP'ing out

2015-04-06 Thread Enrico Granata
Author: enrico
Date: Mon Apr  6 13:41:17 2015
New Revision: 234194

URL: http://llvm.org/viewvc/llvm-project?rev=234194&view=rev
Log:
If memory read does not find a NULL terminator, still print whatever it 
gathered instead of just NOP'ing out

However, remark that this is an incomplete chunk of data by still emitting the 
"no NULL found" warning

rdar://20330073


Modified:
lldb/trunk/source/Commands/CommandObjectMemory.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=234194&r1=234193&r2=234194&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Mon Apr  6 13:41:17 2015
@@ -744,6 +744,7 @@ protected:
 auto data_addr = addr;
 auto count = item_count;
 item_count = 0;
+bool break_on_no_NULL = false;
 while (item_count < count)
 {
 std::string buffer;
@@ -756,17 +757,24 @@ protected:
 result.SetStatus(eReturnStatusFailed);
 return false;
 }
+
 if (item_byte_size == read)
 {
 result.AppendWarningWithFormat("unable to find a NULL 
terminated string at 0x%" PRIx64 ".Consider increasing the maximum read 
length.\n", data_addr);
-break;
+--read;
+break_on_no_NULL = true;
 }
-read+=1; // account for final NULL byte
+else
+++read; // account for final NULL byte
+
 memcpy(data_ptr, &buffer[0], read);
 data_ptr += read;
 data_addr += read;
 bytes_read += read;
 item_count++; // if we break early we know we only read 
item_count strings
+
+if (break_on_no_NULL)
+break;
 }
 data_sp.reset(new 
DataBufferHeap(data_sp->GetBytes(),bytes_read+1));
 }


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Cleanup to simplify the formatter for std::map of libstdc++.

2015-03-18 Thread Enrico Granata
Looks good to me, assuming you're not going to need any of those lines you 
removed. The comment seems to imply they're clang-specific so you might be fine.


http://reviews.llvm.org/D8424

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Fix xcodeproj build after http://reviews.llvm.org/rL232619

2015-03-18 Thread Enrico Granata
This should be already fixed - see:
Author: enrico
Date: Wed Mar 18 13:42:41 2015
New Revision: 232655

URL: http://llvm.org/viewvc/llvm-project?rev=232655&view=rev 

Log:
Fix the Xcode build after the MIPS64 changes

> On Mar 18, 2015, at 10:42 AM, Robert Flack  wrote:
> 
> Hi clayborg,
> 
> Adds EmulateInstructionMIPS64 to the xcodeproj build so that it's found when 
> linking.
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D8420
> 
> Files:
>  lldb.xcodeproj/project.pbxproj
> 
> Index: lldb.xcodeproj/project.pbxproj
> ===
> --- lldb.xcodeproj/project.pbxproj
> +++ lldb.xcodeproj/project.pbxproj
> @@ -920,6 +920,7 @@
>B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources 
> */ = {isa = PBXBuildFile; fileRef = B2B7CCEF15D1C20F00EEFB57 
>E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 26D6F3F4183E7F9300194858 /* 
>E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = E769331D1A94D18100C73337 /* lld
> +   E7FA0A8D1AB9EF1000626A5B /* EmulateInstructionMIPS64.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = E7FA0A8A1AB9EF1000
>ED88244E15114A9200BC98B9 /* Security.framework in Frameworks 
> */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B 
>ED88245015114CA200BC98B9 /* main.mm in Sources */ = {isa = 
> PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */;
>ED88245115114CA200BC98B9 /* main.mm in Sources */ = {isa = 
> PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */;
> @@ -2663,6 +2664,8 @@
>B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sour
>B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcec
>E769331D1A94D18100C73337 /* lldb-server.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode
> +   E7FA0A8A1AB9EF1000626A5B /* EmulateInstructionMIPS64.cpp */ = 
> {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType
> +   E7FA0A8B1AB9EF1000626A5B /* EmulateInstructionMIPS64.h */ = 
> {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
>ED88244F15114CA200BC98B9 /* main.mm */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.obj
>ED88245215114CFC00BC98B9 /* LauncherRootXPCService.mm */ = 
> {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
>EDB919B214F6EC85008FF64B /* LauncherXPCService.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourc
> @@ -4608,6 +4611,7 @@
>26D9FDCA12F785120003F2EE /* Instruction */ = {
>isa = PBXGroup;
>children = (
> +   E7FA0A881AB9EF1000626A5B /* MIPS64 */,
>26D9FDCB12F785270003F2EE /* ARM */,
>264A12F91372522000875C42 /* ARM64 */,
>);
> @@ -5122,6 +5126,15 @@
>name = "lldb-server";
>sourceTree = "";
>};
> +   E7FA0A881AB9EF1000626A5B /* MIPS64 */ = {
> +   isa = PBXGroup;
> +   children = (
> +   E7FA0A8A1AB9EF1000626A5B /* 
> EmulateInstructionMIPS64.cpp */,
> +   E7FA0A8B1AB9EF1000626A5B /* 
> EmulateInstructionMIPS64.h */,
> +   );
> +   path = MIPS64;
> +   sourceTree = "";
> +   };
>EDC6D49114E5C15C001B75F8 /* launcherXPCService */ = {
>isa = PBXGroup;
>children = (
> @@ -6143,6 +6156,7 @@
>2689010A13353E6F00698AC0 /* 
> ThreadPlanTracer.cpp in Sources */,
>AF37E10A17C861F20061E18E /* ProcessRunLock.cpp 
> in Sources */,
>26474CAA18D0CB070073DEBA /* 
> RegisterContextFreeBSD_mips64.cpp in Sources */,
> +   E7FA0A8D1AB9EF1000626A5B /* 
> EmulateInstructionMIPS64.cpp in Sources */,
>26CA97A1172B1FD5005DC71B /* 
> RegisterContextThreadMemory.cpp in Sources */,
>2689010B13353E6F00698AC0 /* ThreadSpec.cpp in 
> Sources */,
>2689010C13353E6F00698AC0 /* UnixSignals.cpp in 
> Sources */,
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> ___
> lldb-commits mailing list
> ll

[Lldb-commits] [lldb] r232655 - Fix the Xcode build after the MIPS64 changes

2015-03-18 Thread Enrico Granata
Author: enrico
Date: Wed Mar 18 13:42:41 2015
New Revision: 232655

URL: http://llvm.org/viewvc/llvm-project?rev=232655&view=rev
Log:
Fix the Xcode build after the MIPS64 changes

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=232655&r1=232654&r2=232655&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Mar 18 13:42:41 2015
@@ -797,6 +797,7 @@
947A1D651616476B0017C8D1 /* CommandObjectPlugin.h in Headers */ 
= {isa = PBXBuildFile; fileRef = 947A1D631616476A0017C8D1 /* 
CommandObjectPlugin.h */; };
9492E2A51A8AC11000295BBD /* CoreMedia.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 9492E2A41A8AC11000295BBD /* CoreMedia.cpp */; };
949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* 
ValueObjectConstResultImpl.cpp */; };
+   94A5B3971AB9FE8D00A5EE7F /* EmulateInstructionMIPS64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 94A5B3951AB9FE8300A5EE7F /* 
EmulateInstructionMIPS64.cpp */; };
94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* 
ValueObjectSyntheticFilter.cpp */; };
94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 94BA8B6C176F8C9B005A91B5 /* Range.cpp */; };
94BA8B70176F97CE005A91B5 /* CommandHistory.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp 
*/; };
@@ -2448,6 +2449,8 @@
9492E2A41A8AC11000295BBD /* CoreMedia.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CoreMedia.cpp; path = source/DataFormatters/CoreMedia.cpp; sourceTree = 
""; };
949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ValueObjectConstResultImpl.h; path = 
include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = ""; };
949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = 
source/Core/ValueObjectConstResultImpl.cpp; sourceTree = ""; };
+   94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
EmulateInstructionMIPS64.cpp; path = MIPS64/EmulateInstructionMIPS64.cpp; 
sourceTree = ""; };
+   94A5B3961AB9FE8300A5EE7F /* EmulateInstructionMIPS64.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
EmulateInstructionMIPS64.h; path = MIPS64/EmulateInstructionMIPS64.h; 
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 = ""; };
94BA8B6C176F8C9B005A91B5 /* Range.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = Range.cpp; path = source/Utility/Range.cpp; sourceTree = ""; };
@@ -3347,8 +3350,9 @@
264A12FA1372522000875C42 /* 
EmulateInstructionARM64.cpp */,
264A12FB1372522000875C42 /* 
EmulateInstructionARM64.h */,
);
-   path = ARM64;
-   sourceTree = "";
+   name = ARM64;
+   path = source/Plugins/Instruction/ARM64;
+   sourceTree = SOURCE_ROOT;
};
264A97BC133918A30017F0BE /* GDB Server */ = {
isa = PBXGroup;
@@ -4610,6 +4614,7 @@
children = (
26D9FDCB12F785270003F2EE /* ARM */,
264A12F91372522000875C42 /* ARM64 */,
+   94A5B3941AB9FE5F00A5EE7F /* MIPS64 */,
);
path = Instruction;
sourceTree = "";
@@ -5002,6 +5007,15 @@
name = POSIX;
sourceTree = "";
};
+   94A5B3941AB9FE5F00A5EE7F /* MIPS6

[Lldb-commits] [lldb] r232226 - Add accessors on SBCommand to get and set the help texts for a command

2015-03-13 Thread Enrico Granata
Author: enrico
Date: Fri Mar 13 17:32:11 2015
New Revision: 232226

URL: http://llvm.org/viewvc/llvm-project?rev=232226&view=rev
Log:
Add accessors on SBCommand to get and set the help texts for a command

Modified:
lldb/trunk/include/lldb/API/SBCommandInterpreter.h
lldb/trunk/source/API/SBCommandInterpreter.cpp

Modified: lldb/trunk/include/lldb/API/SBCommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommandInterpreter.h?rev=232226&r1=232225&r2=232226&view=diff
==
--- lldb/trunk/include/lldb/API/SBCommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/API/SBCommandInterpreter.h Fri Mar 13 17:32:11 2015
@@ -266,6 +266,15 @@ public:
 const char*
 GetHelp ();
 
+const char*
+GetHelpLong ();
+
+void
+SetHelp (const char*);
+
+void
+SetHelpLong (const char*);
+
 lldb::SBCommand
 AddMultiwordCommand (const char* name, const char* help = NULL);
 

Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=232226&r1=232225&r2=232226&view=diff
==
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Fri Mar 13 17:32:11 2015
@@ -794,6 +794,28 @@ SBCommand::GetHelp ()
 return NULL;
 }
 
+const char*
+SBCommand::GetHelpLong ()
+{
+if (IsValid ())
+return m_opaque_sp->GetHelpLong ();
+return NULL;
+}
+
+void
+SBCommand::SetHelp (const char* help)
+{
+if (IsValid())
+m_opaque_sp->SetHelp(help);
+}
+
+void
+SBCommand::SetHelpLong (const char* help)
+{
+if (IsValid())
+m_opaque_sp->SetHelpLong(help);
+}
+
 lldb::SBCommand
 SBCommand::AddMultiwordCommand (const char* name, const char* help)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r232224 - Add support for Python object commands to return custom short and long help by implementing

2015-03-13 Thread Enrico Granata
Author: enrico
Date: Fri Mar 13 17:22:28 2015
New Revision: 232224

URL: http://llvm.org/viewvc/llvm-project?rev=232224&view=rev
Log:
Add support for Python object commands to return custom short and long help by 
implementing

def get_short_help(self)
def get_long_help(self)

methods on the command object

Also, add a test case for this feature


Modified:
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
lldb/trunk/test/functionalities/command_script/TestCommandScript.py
lldb/trunk/test/functionalities/command_script/py_import
lldb/trunk/test/functionalities/command_script/welcome.py

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=232224&r1=232223&r2=232224&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Fri Mar 13 17:22:28 2015
@@ -98,7 +98,7 @@ public:
 return m_interpreter;
 }
 
-const char *
+virtual const char *
 GetHelp ();
 
 virtual const char *
@@ -114,6 +114,9 @@ public:
 SetHelp (const char * str);
 
 void
+SetHelp (std::string str);
+
+void
 SetHelpLong (const char * str);
 
 void

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h?rev=232224&r1=232223&r2=232224&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Fri Mar 13 17:22:28 
2015
@@ -614,6 +614,22 @@ public:
 }
 
 virtual bool
+GetShortHelpForCommandObject (lldb::ScriptInterpreterObjectSP cmd_obj_sp,
+  std::string& dest)
+{
+dest.clear();
+return false;
+}
+
+virtual bool
+GetLongHelpForCommandObject (lldb::ScriptInterpreterObjectSP cmd_obj_sp,
+ std::string& dest)
+{
+dest.clear();
+return false;
+}
+
+virtual bool
 CheckObjectExists (const char* name)
 {
 return false;

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=232224&r1=232223&r2=232224&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h Fri Mar 13 
17:22:28 2015
@@ -214,6 +214,14 @@ public:
 GetDocumentationForItem (const char* item, std::string& dest) override;
 
 bool
+GetShortHelpForCommandObject (lldb::ScriptInterpreterObjectSP cmd_obj_sp,
+  std::string& dest) override;
+
+bool
+GetLongHelpForCommandObject (lldb::ScriptInterpreterObjectSP cmd_obj_sp,
+ std::string& dest) override ;
+
+bool
 CheckObjectExists (const char* name) override
 {
 if (!name || !name[0])

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=232224&r1=232223&r2=232224&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Fri Mar 13 17:22:28 
2015
@@ -1435,6 +1435,8 @@ class CommandObjectScriptingObject : pub
 private:
 lldb::ScriptInterpreterObjectSP m_cmd_obj_sp;
 ScriptedCommandSynchronicity m_synchro;
+bool m_fetched_help_short:1;
+bool m_fetched_help_long:1;
 
 public:
 
@@ -1447,7 +1449,9 @@ public:
   NULL,
   NULL),
 m_cmd_obj_sp(cmd_obj_sp),
-m_synchro(synch)
+m_synchro(synch),
+m_fetched_help_short(false),
+m_fetched_help_long(false)
 {
 StreamString stream;
 stream.Printf("For more information run 'help %s'",name.c_str());
@@ -1476,10 +1480,38 @@ public:
 {
 return m_synchro;
 }
+
+virtual const char *
+GetHelp ()
+{
+if (!m_fetched_help_short)
+{
+ScriptInterpreter* scripter = m_interpreter.GetScriptInterpreter();
+if (scripter)
+{
+std

[Lldb-commits] [lldb] r232126 - Silence warnings here by explicit cast.

2015-03-12 Thread Enrico Granata
Author: enrico
Date: Thu Mar 12 19:31:45 2015
New Revision: 232126

URL: http://llvm.org/viewvc/llvm-project?rev=232126&view=rev
Log:
Silence warnings here by explicit cast.

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

Modified: lldb/trunk/source/Utility/StringExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=232126&r1=232125&r2=232126&view=diff
==
--- lldb/trunk/source/Utility/StringExtractor.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractor.cpp Thu Mar 12 19:31:45 2015
@@ -143,7 +143,7 @@ StringExtractor::GetU32 (uint32_t fail_v
 char *end = nullptr;
 const char *start = m_packet.c_str();
 const char *cstr = start + m_index;
-uint32_t result = ::strtoul (cstr, &end, base);
+uint32_t result = static_cast(::strtoul (cstr, &end, base));
 
 if (end && end != cstr)
 {
@@ -162,7 +162,7 @@ StringExtractor::GetS32 (int32_t fail_va
 char *end = nullptr;
 const char *start = m_packet.c_str();
 const char *cstr = start + m_index;
-int32_t result = ::strtol (cstr, &end, base);
+int32_t result = static_cast(::strtol (cstr, &end, base));
 
 if (end && end != cstr)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r232115 - This fixes the build I previously broke - and actually makes the test case work just like I promised

2015-03-12 Thread Enrico Granata
Author: enrico
Date: Thu Mar 12 17:30:58 2015
New Revision: 232115

URL: http://llvm.org/viewvc/llvm-project?rev=232115&view=rev
Log:
This fixes the build I previously broke - and actually makes the test case work 
just like I promised


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

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=232115&r1=232114&r2=232115&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Mar 12 17:30:58 2015
@@ -2289,7 +2289,7 @@ ValueObject::GetSyntheticExpressionPathC
 // lets make one and cache it for any future reference.
 synthetic_child_sp = GetValueForExpressionPath(expression,
NULL, NULL, NULL,
-   
GetValueForExpressionPathOptions().DontAllowSyntheticChildren());
+   
GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal(GetValueForExpressionPathOptions::SyntheticChildrenTraversal::None));
 
 // Cache the value if we got one back...
 if (synthetic_child_sp.get())
@@ -2820,19 +2820,43 @@ ValueObject::GetValueForExpressionPath_I
 *final_result = 
ValueObject::eExpressionPathEndResultTypePlain;
 return child_valobj_sp;
 }
-else if (options.m_no_synthetic_children == false) // 
let's try with synthetic children
+else
 {
-if (root->IsSynthetic())
+switch (options.m_synthetic_children_traversal)
 {
-*first_unparsed = expression_cstr;
-*reason_to_stop = 
ValueObject::eExpressionPathScanEndReasonNoSuchSyntheticChild;
-*final_result = 
ValueObject::eExpressionPathEndResultTypeInvalid;
-return ValueObjectSP();
+case 
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::None:
+break;
+case 
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::FromSynthetic:
+if (root->IsSynthetic())
+{
+child_valobj_sp = 
root->GetNonSyntheticValue();
+if (child_valobj_sp.get())
+child_valobj_sp = 
child_valobj_sp->GetChildMemberWithName(child_name, true);
+}
+break;
+case 
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::ToSynthetic:
+if (!root->IsSynthetic())
+{
+child_valobj_sp = 
root->GetSyntheticValue();
+if (child_valobj_sp.get())
+child_valobj_sp = 
child_valobj_sp->GetChildMemberWithName(child_name, true);
+}
+break;
+case 
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::Both:
+if (root->IsSynthetic())
+{
+child_valobj_sp = 
root->GetNonSyntheticValue();
+if (child_valobj_sp.get())
+child_valobj_sp = 
child_valobj_sp->GetChildMemberWithName(child_name, true);
+}
+else
+{
+child_valobj_sp = 
root->GetSyntheticValue();
+if (child_valobj_sp.get())
+child_valobj_sp = 
child_valobj_sp->GetChildMemberWithName(child_name, true);
+}
+break;
 }
-
-child_valobj_sp = root->GetSyntheticValue();
-if (child_valobj_sp.get())
-child_valobj_sp = 
child_valobj_sp->GetChildMemberWithName(child_name, true);
 }
 
 // if we are here and options.m_no_synthetic_children is 
true, child_valobj_sp is going to be a NULL SP,
@@ -2863,19 +2887,43 @@ ValueObject::GetValueForExpressionPath_I
 *final_result = 
ValueObject::eExpressionPathEndResultTypePlain;
 continue;

Re: [Lldb-commits] [lldb] r232114 - Fix a bug in the data formatters where summary strings would not look into the non-synthetic value for child members if the ValueObject being formatted happened to

2015-03-12 Thread Enrico Granata
I just realized I failed to commit the bulk of this patch (and of course, 
accidentally did a revert…)
Your build will be broken for the next 5 minutes until I actually rewrite the 
changes and commit them

> On Mar 12, 2015, at 3:17 PM, Enrico Granata  wrote:
> 
> Author: enrico
> Date: Thu Mar 12 17:17:07 2015
> New Revision: 232114
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=232114&view=rev
> Log:
> Fix a bug in the data formatters where summary strings would not look into 
> the non-synthetic value for child members if the ValueObject being formatted 
> happened to have a synthetic value
> 
> rdar://15630776
> 
> 
> Modified:
>lldb/trunk/include/lldb/Core/ValueObject.h
>lldb/trunk/source/Core/FormatEntity.cpp
>lldb/trunk/source/DataFormatters/LibCxx.cpp
>
> lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
> 
> Modified: lldb/trunk/include/lldb/Core/ValueObject.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=232114&r1=232113&r2=232114&view=diff
> ==
> --- lldb/trunk/include/lldb/Core/ValueObject.h (original)
> +++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar 12 17:17:07 2015
> @@ -141,19 +141,27 @@ public:
> 
> struct GetValueForExpressionPathOptions
> {
> +enum class SyntheticChildrenTraversal
> +{
> +None,
> +ToSynthetic,
> +FromSynthetic,
> +Both
> +};
> +
> bool m_check_dot_vs_arrow_syntax;
> bool m_no_fragile_ivar;
> bool m_allow_bitfields_syntax;
> -bool m_no_synthetic_children;
> +SyntheticChildrenTraversal m_synthetic_children_traversal;
> 
> GetValueForExpressionPathOptions(bool dot = false,
>  bool no_ivar = false,
>  bool bitfield = true,
> - bool no_synth = false) :
> + SyntheticChildrenTraversal 
> synth_traverse = SyntheticChildrenTraversal::ToSynthetic) :
> m_check_dot_vs_arrow_syntax(dot),
> m_no_fragile_ivar(no_ivar),
> m_allow_bitfields_syntax(bitfield),
> -m_no_synthetic_children(no_synth)
> +m_synthetic_children_traversal(synth_traverse)
> {
> }
> 
> @@ -200,16 +208,9 @@ public:
> }
> 
> GetValueForExpressionPathOptions&
> -DoAllowSyntheticChildren()
> -{
> -m_no_synthetic_children = false;
> -return *this;
> -}
> -
> -GetValueForExpressionPathOptions&
> -DontAllowSyntheticChildren()
> +SetSyntheticChildrenTraversal(SyntheticChildrenTraversal traverse)
> {
> -m_no_synthetic_children = true;
> +m_synthetic_children_traversal = traverse;
> return *this;
> }
> 
> 
> Modified: lldb/trunk/source/Core/FormatEntity.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=232114&r1=232113&r2=232114&view=diff
> ==
> --- lldb/trunk/source/Core/FormatEntity.cpp (original)
> +++ lldb/trunk/source/Core/FormatEntity.cpp Thu Mar 12 17:17:07 2015
> @@ -766,7 +766,7 @@ DumpValue (Stream &s,
> ValueObject::ExpressionPathAftermath what_next = (do_deref_pointer ?
>   
> ValueObject::eExpressionPathAftermathDereference : 
> ValueObject::eExpressionPathAftermathNothing);
> ValueObject::GetValueForExpressionPathOptions options;
> -
> options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().DoAllowSyntheticChildren();
> +
> options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().SetSyntheticChildrenTraversal(ValueObject::GetValueForExpressionPathOptions::SyntheticChildrenTraversal::Both);
> ValueObject* target = NULL;
> const char* var_name_final_if_array_range = NULL;
> size_t close_bracket_index = llvm::StringRef::npos;
> 
> Modified: lldb/trunk/source/DataFormatters/LibCxx.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxx.cpp?rev=232114&r1=232113&r2=232114&view=diff
> ==
> --- lldb/trunk/source/DataFormatters/LibCxx.cpp (original)
> +++ lldb/trunk/source/DataFormatters/LibCxx.cpp Thu M

[Lldb-commits] [lldb] r232113 - Fix an issue where values would be printed in one-line mode even if you asked to see locations and/or asked for flat output mode

2015-03-12 Thread Enrico Granata
Author: enrico
Date: Thu Mar 12 17:16:20 2015
New Revision: 232113

URL: http://llvm.org/viewvc/llvm-project?rev=232113&view=rev
Log:
Fix an issue where values would be printed in one-line mode even if you asked 
to see locations and/or asked for flat output mode


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

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=232113&r1=232112&r2=232113&view=diff
==
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Thu Mar 12 17:16:20 
2015
@@ -631,7 +631,11 @@ ValueObjectPrinter::PrintChildrenIfNeede
 
 uint32_t curr_ptr_depth = m_ptr_depth;
 bool print_children = ShouldPrintChildren 
(is_failed_description,curr_ptr_depth);
-bool print_oneline = (curr_ptr_depth > 0 || options.m_show_types || 
!options.m_allow_oneliner_mode) ? false : 
DataVisualization::ShouldPrintAsOneLiner(*m_valobj);
+bool print_oneline = (curr_ptr_depth > 0 ||
+  options.m_show_types ||
+  !options.m_allow_oneliner_mode ||
+  options.m_flat_output ||
+  options.m_show_location) ? false : 
DataVisualization::ShouldPrintAsOneLiner(*m_valobj);
 
 if (print_children)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r232114 - Fix a bug in the data formatters where summary strings would not look into the non-synthetic value for child members if the ValueObject being formatted happened to have

2015-03-12 Thread Enrico Granata
Author: enrico
Date: Thu Mar 12 17:17:07 2015
New Revision: 232114

URL: http://llvm.org/viewvc/llvm-project?rev=232114&view=rev
Log:
Fix a bug in the data formatters where summary strings would not look into the 
non-synthetic value for child members if the ValueObject being formatted 
happened to have a synthetic value

rdar://15630776


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/DataFormatters/LibCxx.cpp

lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=232114&r1=232113&r2=232114&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar 12 17:17:07 2015
@@ -141,19 +141,27 @@ public:
 
 struct GetValueForExpressionPathOptions
 {
+enum class SyntheticChildrenTraversal
+{
+None,
+ToSynthetic,
+FromSynthetic,
+Both
+};
+
 bool m_check_dot_vs_arrow_syntax;
 bool m_no_fragile_ivar;
 bool m_allow_bitfields_syntax;
-bool m_no_synthetic_children;
+SyntheticChildrenTraversal m_synthetic_children_traversal;
 
 GetValueForExpressionPathOptions(bool dot = false,
  bool no_ivar = false,
  bool bitfield = true,
- bool no_synth = false) :
+ SyntheticChildrenTraversal 
synth_traverse = SyntheticChildrenTraversal::ToSynthetic) :
 m_check_dot_vs_arrow_syntax(dot),
 m_no_fragile_ivar(no_ivar),
 m_allow_bitfields_syntax(bitfield),
-m_no_synthetic_children(no_synth)
+m_synthetic_children_traversal(synth_traverse)
 {
 }
 
@@ -200,16 +208,9 @@ public:
 }
 
 GetValueForExpressionPathOptions&
-DoAllowSyntheticChildren()
-{
-m_no_synthetic_children = false;
-return *this;
-}
-
-GetValueForExpressionPathOptions&
-DontAllowSyntheticChildren()
+SetSyntheticChildrenTraversal(SyntheticChildrenTraversal traverse)
 {
-m_no_synthetic_children = true;
+m_synthetic_children_traversal = traverse;
 return *this;
 }
 

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=232114&r1=232113&r2=232114&view=diff
==
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Thu Mar 12 17:17:07 2015
@@ -766,7 +766,7 @@ DumpValue (Stream &s,
 ValueObject::ExpressionPathAftermath what_next = (do_deref_pointer ?
   
ValueObject::eExpressionPathAftermathDereference : 
ValueObject::eExpressionPathAftermathNothing);
 ValueObject::GetValueForExpressionPathOptions options;
-
options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().DoAllowSyntheticChildren();
+
options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().SetSyntheticChildrenTraversal(ValueObject::GetValueForExpressionPathOptions::SyntheticChildrenTraversal::Both);
 ValueObject* target = NULL;
 const char* var_name_final_if_array_range = NULL;
 size_t close_bracket_index = llvm::StringRef::npos;

Modified: lldb/trunk/source/DataFormatters/LibCxx.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxx.cpp?rev=232114&r1=232113&r2=232114&view=diff
==
--- lldb/trunk/source/DataFormatters/LibCxx.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxx.cpp Thu Mar 12 17:17:07 2015
@@ -266,7 +266,7 @@ lldb_private::formatters::LibCxxMapItera
  NULL,
  NULL,
  NULL,
- 
ValueObject::GetValueForExpressionPathOptions().DontCheckDotVsArrowSyntax().DontAllowSyntheticChildren(),
+ 
ValueObject::GetValueForExpressionPathOptions().DontCheckDotVsArrowSyntax().SetSyntheticChildrenTraversal(ValueObject::GetValueForExpressionPathOptions::SyntheticChildrenTraversal::None),
  NULL).get();
 
 return false;

Modified: 
lldb/tr

Re: [Lldb-commits] [PATCH] Add SBArgs to the public interface

2015-03-11 Thread Enrico Granata
I see

Looking at your patch, I see that it uses std::string in the SB layer
That’s a big no-no, so please rework your code to use SBStream or const char* + 
a size_t (and SWIG should do the right thing for Python)

> On Mar 11, 2015, at 2:43 PM, Zachary Turner  wrote:
> 
> Mostly added you for the SWIG stuff, because I'm doing something kind of 
> "new" here and I had to figure it out with some hacking.
> 
> +Greg for the overall idea.
> 
> 
> http://reviews.llvm.org/D8265
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL231449: Provide synthetic children for some vector types

2015-03-06 Thread Enrico Granata
This revision should fix it:

Sendingsource/DataFormatters/FormatManager.cpp
Sendingsource/DataFormatters/VectorType.cpp
Sendingsource/Symbol/ClangASTType.cpp
Sending
test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
Sendingtest/functionalities/data-formatter/rdar-10642615/main.cpp
Transmitting file data .
Committed revision 231504.

Thanks for keeping an eye on tests!

> On Mar 6, 2015, at 3:13 AM, Ilia K  wrote:
> 
> It broke the following tests:
> 
>  ==
>  FAIL: test_with_dsym_and_run_command 
> (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
> Test data formatter commands.
>  --
>  Traceback (most recent call last):
>File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 456, in 
> wrapper
>  return func(self, *args, **kwargs)
>File 
> "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py",
>  line 21, in test_with_dsym_and_run_command
>  self.data_formatter_commands()
>File 
> "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py",
>  line 68, in data_formatter_commands
>  '(vBool32) valueBool32 = (0, 1, 0, 1)'])
>File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in 
> expect
>  msg if msg else EXP_MSG(str, exe))
>  AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', 
> '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', 
> '\0', '\0')' returns expected result
>  Config=x86_64-clang
>  ==
>  FAIL: test_with_dwarf_and_run_command 
> (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
> Test data formatter commands.
>  --
>  Traceback (most recent call last):
>File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 473, in 
> wrapper
>  return func(self, *args, **kwargs)
>File 
> "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py",
>  line 28, in test_with_dwarf_and_run_command
>  self.data_formatter_commands()
>File 
> "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py",
>  line 68, in data_formatter_commands
>  '(vBool32) valueBool32 = (0, 1, 0, 1)'])
>File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in 
> expect
>  msg if msg else EXP_MSG(str, exe))
>  AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', 
> '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', 
> '\0', '\0')' returns expected result
>  Config=x86_64-clang
>  --
> 
> Here is the patch that fixes it: http://reviews.llvm.org/D8102
> 
> 
> http://reviews.llvm.org/rL231449
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

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




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Fix Radar10642615DataFormatterTestCase after r231449

2015-03-06 Thread Enrico Granata
No I don't.

I have a plan on how to improve this scenario after my latest patch, so this 
should all eventually settle.

A stopgap to keep tests happy is nothing to be worried about.

Sent from my iPhone

> On Mar 6, 2015, at 8:55 AM, Ilia K  wrote:
> 
> I gonna commit it. Hope you don't mind.
> 
> 
> http://reviews.llvm.org/D8102
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r231450 - Windows bot

2015-03-05 Thread Enrico Granata
Author: enrico
Date: Thu Mar  5 21:37:33 2015
New Revision: 231450

URL: http://llvm.org/viewvc/llvm-project?rev=231450&view=rev
Log:
Windows bot

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

Modified: lldb/trunk/source/DataFormatters/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CMakeLists.txt?rev=231450&r1=231449&r2=231450&view=diff
==
--- lldb/trunk/source/DataFormatters/CMakeLists.txt (original)
+++ lldb/trunk/source/DataFormatters/CMakeLists.txt Thu Mar  5 21:37:33 2015
@@ -28,4 +28,5 @@ add_lldb_library(lldbDataFormatters
   TypeSynthetic.cpp
   TypeValidator.cpp
   ValueObjectPrinter.cpp
+  VectorType.cpp
   )


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r231449 - Provide synthetic children for some vector types

2015-03-05 Thread Enrico Granata
Author: enrico
Date: Thu Mar  5 21:32:20 2015
New Revision: 231449

URL: http://llvm.org/viewvc/llvm-project?rev=231449&view=rev
Log:
Provide synthetic children for some vector types

Unlike GDB, we tackle the problem of representing vector types in different 
styles by having a synthetic child provider that recognizes the format you're 
trying to apply to the variable, and coming up with the right type and number 
of child values to match that format

This makes for a more compact representation and less visual noise

Fixes rdar://5429347


Added:
lldb/trunk/include/lldb/DataFormatters/VectorType.h
lldb/trunk/source/DataFormatters/VectorType.cpp
lldb/trunk/test/functionalities/data-formatter/vector-types/
lldb/trunk/test/functionalities/data-formatter/vector-types/Makefile

lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
lldb/trunk/test/functionalities/data-formatter/vector-types/main.cpp
Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=231449&r1=231448&r2=231449&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar  5 21:32:20 2015
@@ -864,7 +864,7 @@ public:
 lldb::Format
 GetFormat () const;
 
-void
+virtual void
 SetFormat (lldb::Format format)
 {
 if (format != m_format)

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=231449&r1=231448&r2=231449&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Thu Mar  5 
21:32:20 2015
@@ -143,6 +143,14 @@ public:
 virtual bool
 SetValueFromCString (const char *value_str, Error& error);
 
+virtual void
+SetFormat (lldb::Format format)
+{
+if (m_parent)
+m_parent->SetFormat(format);
+this->ValueObject::SetFormat(format);
+}
+
 protected:
 virtual bool
 UpdateValue ();

Modified: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?rev=231449&r1=231448&r2=231449&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Thu Mar  5 
21:32:20 2015
@@ -398,6 +398,7 @@ namespace lldb_private {
 
 SyntheticChildrenFrontEnd* 
LibcxxInitializerListSyntheticFrontEndCreator (CXXSyntheticChildren*, 
lldb::ValueObjectSP);
 
+SyntheticChildrenFrontEnd* VectorTypeSyntheticFrontEndCreator 
(CXXSyntheticChildren*, lldb::ValueObjectSP);
 } // namespace formatters
 } // namespace lldb_private
 

Added: lldb/trunk/include/lldb/DataFormatters/VectorType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/VectorType.h?rev=231449&view=auto
==
(empty)

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=231449&r1=231448&r2=231449&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Mar  5 21:32:20 2015
@@ -758,6 +758,7 @@
940B04E11A89860E0045D5F7 /* libedit.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 940B04E01A89860E0045D5F7 /* libedit.dylib */; };
940B04E41A8987680045D5F7 /* argdumper in CopyFiles */ = {isa = 
PBXBuildFile; fileRef = 942829C01A89835300521B30 /* argdumper */; settings = 
{ATTRIBUTES = (CodeSignOnCopy, ); }; };
94145431175E63B500284436 /* lldb-versioning.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 94145430175D7FDE00284436 /* lldb-versioning.h 
*/; settings = {ATTRIBUTES = (Public, ); }; };
+   9418EBCD1AA910910058B02E /* VectorType.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 9418EBCC1AA910910058B02E /* VectorType.cpp */; };
941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa 
= PBXBuildFile; fileRef = 9461568614E355F2003A195C /* 

Re: [Lldb-commits] [PATCH] Change lldb_assert() to use llvm::sys::PrintBacktrace

2015-03-04 Thread Enrico Granata
Then I think your proposal should change from adjusting this one spot in the 
code on an ad-hoc basis to actually removing Host::Backtrace() in favor of the 
LLVM facility.

I will let others weigh in on that change.

Sent from my iPhone

> On Mar 4, 2015, at 6:01 PM, Zachary Turner  wrote:
> 
> 
> 
> On Wed, Mar 4, 2015 at 5:48 PM Enrico Granata  wrote:
>>> On Mar 4, 2015, at 5:36 PM, Zachary Turner  wrote:
>>> 
>>> We don't have the wheel though.  For example, it's not implemented on 
>>> Android and it's not implemented on Windows.  I could duplicate a bunch of 
>>> code from LLVM, but why?  The code is already there in LLVM.  And what 
>>> about the Android people?  There's currently about 3 completely different 
>>> implementations of backtracing (MacOSX, FreeBSD, Linux).  All of them print 
>>> backtraces in a different format.  We can call 1 function and have 
>>> backtraces in the same format for everyone, including Windows and Android, 
>>> right now.  This seems like kind of a straightforward case of code reuse to 
>>> me, and a clear win, so I'm not sure why it's that contentious.
>> 
>> Two things worry me about this:
>> 
>> 1) we have a sanctioned LLDB facility that retrieves a host backtrace, but 
>> we’re saying that it does not work on all platforms, and instead of making 
>> it work on all platforms, we’re going to use another API, but have no plan 
>> to either improve or remove the existing LLDB API for this
>> 
>> Given that we have an LLDB API to do this task, we should use it. If it is 
>> not an API that we can reasonably support on all platforms we care about, 
>> then we should remove it in favor of one that we can support on all 
>> platforms we care about. But we should not be ad-hoc choosing to use one or 
>> another way to do this task
> I'm more than happy to remove Host::Backtrace in favor of 
> llvm::sys::PrintBacktrace().  It is called from 3 locations in the codebase, 
> and I believe I can replace all 3 of them by adding a simple overload to llvm 
> that takes an std::string by reference.
> 
> Having a sanctioned API doesn't mean we can't improve on things, or move to a 
> different sanctioned API.  This API is not exposed through the public 
> interface, so we have no guarantee or requirement to maintain compatibility.  
> And there is a better one in LLVM.
> 
> "Sanctioned" shouldn't mean "now and forever no matter what new developments 
> arise".  It should mean "this is what we use because it happens to be the 
> best thing, but if something better comes along, then by all means, go for it"
>  
>> 
>> 2) the LLDB API interoperates nicely with our Streams, whereas the LLVM one 
>> only supports FILE*. In general, Streams are a much nicer interface to work 
>> with than FILE* are.
> LLVM is open source too, why can't we modify it?  I modify it all the time, 
> I'm quite confident I could push a change to LLVM that adds 
> PrintStackTrace(std::string &output).  I believe that should address the 
> concerns surrounding FILE*.
>  
> 
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Change lldb_assert() to use llvm::sys::PrintBacktrace

2015-03-04 Thread Enrico Granata

> On Mar 4, 2015, at 5:36 PM, Zachary Turner  wrote:
> 
> We don't have the wheel though.  For example, it's not implemented on Android 
> and it's not implemented on Windows.  I could duplicate a bunch of code from 
> LLVM, but why?  The code is already there in LLVM.  And what about the 
> Android people?  There's currently about 3 completely different 
> implementations of backtracing (MacOSX, FreeBSD, Linux).  All of them print 
> backtraces in a different format.  We can call 1 function and have backtraces 
> in the same format for everyone, including Windows and Android, right now.  
> This seems like kind of a straightforward case of code reuse to me, and a 
> clear win, so I'm not sure why it's that contentious.
> 

Two things worry me about this:

1) we have a sanctioned LLDB facility that retrieves a host backtrace, but 
we’re saying that it does not work on all platforms, and instead of making it 
work on all platforms, we’re going to use another API, but have no plan to 
either improve or remove the existing LLDB API for this

Given that we have an LLDB API to do this task, we should use it. If it is not 
an API that we can reasonably support on all platforms we care about, then we 
should remove it in favor of one that we can support on all platforms we care 
about. But we should not be ad-hoc choosing to use one or another way to do 
this task

2) the LLDB API interoperates nicely with our Streams, whereas the LLVM one 
only supports FILE*. In general, Streams are a much nicer interface to work 
with than FILE* are.

In this case we could get away with the lesser interface (FILE*), that’s true. 
However, if - say - we ended up deciding that the output of lldbassert() should 
go to the user’s terminal AND to a log file, this would be trivial to do with a 
StreamTee, but it would require more fiddling with a FILE*

> If we need to interoperate with StreamString, then we should implement an 
> overload **in LLVM** that returns an std::string.
> 
> On Wed, Mar 4, 2015 at 5:30 PM Enrico Granata  <mailto:egran...@apple.com>> wrote:
>> On Mar 4, 2015, at 5:18 PM, Zachary Turner > <mailto:ztur...@google.com>> wrote:
>> 
>> Hmm, I'm not sure I agree.  Whether it prints to a Stream or directly to 
>> stderr is kind of an implementation detail.  Not very important since it 
>> just ends up to stdout or stderr anwyay and we don't do anything else with 
>> the backtrace except print it and throw it away.  
>> 
>> llvm already has functionality built in to serve exactly this purpose.  Why 
>> shouldn't we use it?  Not only are we sure that it's implemented on all 
>> platforms that LLVM supports,
> 
> If that is a concern, I posit that we should implement Host::Backtrace() on 
> all platforms
> 
> The alternative of course would be to get rid of Host::Backtrace() entirely, 
> and use the similar LLVM facility - but given how our own facility uses 
> Streams instead of FILE*, I don’t think that is actually a good change
> 
>> but the format is consistent on all of these platforms, and anyway why 
>> reinvent the wheel?
> 
> Except in this case we already have the wheel
> 
> 
>> 
>> On Wed, Mar 4, 2015 at 5:15 PM Enrico Granata > <mailto:granata.enr...@gmail.com>> wrote:
>> 
>> Comment at: source/Utility/LLDBAssert.cpp:14
>> @@ -13,1 +13,3 @@
>> +
>> +#include "llvm/Support/Signals.h"
>> 
>> 
>> I would not do this.
>> Printing to a Stream is the LLDB way to do this, no reason for switching to 
>> this LLVM API
>> 
>> 
>> Comment at: source/Utility/LLDBAssert.cpp:36
>> @@ -37,1 +35,3 @@
>> +llvm::sys::PrintStackTrace(stderr);
>> +fprintf(stderr, "please file a bug report against lldb reporting 
>> this failure log, and as many details as possible\n");
>>  }
>> 
>> Printing to stderr is probably a good idea
>> But, again, I prefer to stick to the LLDB host layer
>> 
>> It's probably fine to reimplement Host::Backtrace() in terms of LLVM APIs if 
>> it can be done generally and with decent performance, but I don't see much 
>> in terms of added value in this change
>> 
>> http://reviews.llvm.org/D8069 <http://reviews.llvm.org/D8069>
>> 
>> EMAIL PREFERENCES
>>   http://reviews.llvm.org/settings/panel/emailpreferences/ 
>> <http://reviews.llvm.org/settings/panel/emailpreferences/>
>> 
>> 
> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@cs.uiuc.edu <mailto:lldb-commits@cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits 
>> <http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits>
> 

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Change lldb_assert() to use llvm::sys::PrintBacktrace

2015-03-04 Thread Enrico Granata

> On Mar 4, 2015, at 5:18 PM, Zachary Turner  wrote:
> 
> Hmm, I'm not sure I agree.  Whether it prints to a Stream or directly to 
> stderr is kind of an implementation detail.  Not very important since it just 
> ends up to stdout or stderr anwyay and we don't do anything else with the 
> backtrace except print it and throw it away.  
> 
> llvm already has functionality built in to serve exactly this purpose.  Why 
> shouldn't we use it?  Not only are we sure that it's implemented on all 
> platforms that LLVM supports,

If that is a concern, I posit that we should implement Host::Backtrace() on all 
platforms

The alternative of course would be to get rid of Host::Backtrace() entirely, 
and use the similar LLVM facility - but given how our own facility uses Streams 
instead of FILE*, I don’t think that is actually a good change

> but the format is consistent on all of these platforms, and anyway why 
> reinvent the wheel?

Except in this case we already have the wheel

> 
> On Wed, Mar 4, 2015 at 5:15 PM Enrico Granata  <mailto:granata.enr...@gmail.com>> wrote:
> 
> Comment at: source/Utility/LLDBAssert.cpp:14
> @@ -13,1 +13,3 @@
> +
> +#include "llvm/Support/Signals.h"
> 
> 
> I would not do this.
> Printing to a Stream is the LLDB way to do this, no reason for switching to 
> this LLVM API
> 
> 
> Comment at: source/Utility/LLDBAssert.cpp:36
> @@ -37,1 +35,3 @@
> +llvm::sys::PrintStackTrace(stderr);
> +fprintf(stderr, "please file a bug report against lldb reporting 
> this failure log, and as many details as possible\n");
>  }
> 
> Printing to stderr is probably a good idea
> But, again, I prefer to stick to the LLDB host layer
> 
> It's probably fine to reimplement Host::Backtrace() in terms of LLVM APIs if 
> it can be done generally and with decent performance, but I don't see much in 
> terms of added value in this change
> 
> http://reviews.llvm.org/D8069 <http://reviews.llvm.org/D8069>
> 
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/ 
> <http://reviews.llvm.org/settings/panel/emailpreferences/>
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Change lldb_assert() to use llvm::sys::PrintBacktrace

2015-03-04 Thread Enrico Granata

Comment at: source/Utility/LLDBAssert.cpp:14
@@ -13,1 +13,3 @@
+
+#include "llvm/Support/Signals.h"
 

I would not do this.
Printing to a Stream is the LLDB way to do this, no reason for switching to 
this LLVM API


Comment at: source/Utility/LLDBAssert.cpp:36
@@ -37,1 +35,3 @@
+llvm::sys::PrintStackTrace(stderr);
+fprintf(stderr, "please file a bug report against lldb reporting this 
failure log, and as many details as possible\n");
 }

Printing to stderr is probably a good idea
But, again, I prefer to stick to the LLDB host layer

It's probably fine to reimplement Host::Backtrace() in terms of LLVM APIs if it 
can be done generally and with decent performance, but I don't see much in 
terms of added value in this change

http://reviews.llvm.org/D8069

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r231310 - Introduce lldbassert(x)

2015-03-04 Thread Enrico Granata

> On Mar 4, 2015, at 4:39 PM, Zachary Turner  wrote:
> 
> BTW, I have just uploaded http://reviews.llvm.org/D8068 
> <http://reviews.llvm.org/D8068> to LLVM which implements backtracing of self 
> on Windows (previously only backtracing of other threads was supported).  So 
> once that goes through, if we switch this code to using 
> llvm::sys::PrintBacktrace(),

I don’t think we should make this change.
Host::Backtrace prints to an lldb_private::Stream which is our preferred API 
for accumulating output - the LLVM version of this seems to print to a FILE* 
which is much less general

I understand using LLVM facilities where it makes sense, but we should not be 
doing so blindly when the net effect is a loss of functionality for us

If you can implement Host::Backtrace in general on all platforms via LLVM, feel 
free to do so - but we should still go through lldb's Host::Backtrace for this, 
and Host::Backtrace should still use our Streams

> we should have a standard backtrace format across all platforms that LLVM 
> supports.
> 
> I like this feature now that I understand the use case, thanks for 
> introducing it.
> 

We had a power outage here in Cupertino, which delayed my reply
Glad to hear we all agree on this :-)

> On Wed, Mar 4, 2015 at 3:31 PM Siva Chandra  <mailto:sivachan...@google.com>> wrote:
> On Wed, Mar 4, 2015 at 2:59 PM, Enrico Granata  <mailto:egran...@apple.com>> wrote:
> > +#ifdef LLDB_CONFIGURATION_DEBUG
> > +#define lldbassert(x) assert(x)
> > +#else
> > +#define lldbassert(x) lldb_private::lldb_assert(x, #x, __FUNCTION__, 
> > __FILE__, __LINE__)
> > +#endif
> 
> Why should we have this ifdef? As in, why shouldn't we use lldb_assert
> unconditionally, always (giving us the benefit of backtraces always)?
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu <mailto:lldb-commits@cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits 
> <http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits>

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




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r231310 - Introduce lldbassert(x)

2015-03-04 Thread Enrico Granata

> On Mar 4, 2015, at 3:13 PM, Zachary Turner  wrote:
> 
> Doesn't LLVM already have this functionality built in?  How is this different 
> than writing:
> 
>   llvm::sys::PrintStackTraceOnErrorSignal();

This one is triggered on an error signal, and then exits. I don’t want to exit.

>   llvm::PrettyStackTraceProgram X(argc_, argv_);
> 

This looks like a program-wide crash handler. I don’t want to crash.

> in main?
> 

I want this to work everywhere, not only in main.

> On Wed, Mar 4, 2015 at 3:06 PM Enrico Granata  <mailto:egran...@apple.com>> wrote:
> Author: enrico
> Date: Wed Mar  4 16:59:20 2015
> New Revision: 231310
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=231310&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=231310&view=rev>
> Log:
> Introduce lldbassert(x)
> 
> We would like it if LLDB never crashed, especially if we never caused LLDB to 
> crash
> On the other hand, having assertions can sometimes be useful
> 
> lldbassert(x) is the best of both worlds:
> - in debug builds, it turns into a regular assert, which is fine because we 
> don't mind debug LLDB to crash on development machines
> - in non-debug builds, it emits a message formatted just like assert(x) 
> would, but then instead of crashing, it dumps a backtrace, suggests filing a 
> bug, and keeps running
> 
> 
> Added:
> lldb/trunk/include/lldb/Utility/LLDBAssert.h
> lldb/trunk/source/Utility/LLDBAssert.cpp
> Modified:
> lldb/trunk/lldb.xcodeproj/project.pbxproj
> 
> Added: lldb/trunk/include/lldb/Utility/LLDBAssert.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/LLDBAssert.h?rev=231310&view=auto
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/LLDBAssert.h?rev=231310&view=auto>
> ==
> --- lldb/trunk/include/lldb/Utility/LLDBAssert.h (added)
> +++ lldb/trunk/include/lldb/Utility/LLDBAssert.h Wed Mar  4 16:59:20 2015
> @@ -0,0 +1,30 @@
> +//===- LLDBAssert.h *- C++ 
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===--===//
> +
> +#ifndef utility_LLDBAssert_h_
> +#define utility_LLDBAssert_h_
> +
> +#include 
> +
> +#ifdef LLDB_CONFIGURATION_DEBUG
> +#define lldbassert(x) assert(x)
> +#else
> +#define lldbassert(x) lldb_private::lldb_assert(x, #x, __FUNCTION__, 
> __FILE__, __LINE__)
> +#endif
> +
> +namespace lldb_private {
> +void
> +lldb_assert (int expression,
> + const char* expr_text,
> + const char* func,
> + const char* file,
> + unsigned int line);
> +}
> +
> +#endif // utility_LLDBAssert_h_
> 
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=231310&r1=231309&r2=231310&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=231310&r1=231309&r2=231310&view=diff>
> ==
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Mar  4 16:59:20 2015
> @@ -770,6 +770,7 @@
> 942AFF0719F84C02007B43B4 /* LibCxxInitializerList.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 942AFF0619F84C02007B43B4 /* 
> LibCxxInitializerList.cpp */; };
> 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 */; 
> };
> 944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* 
> RegisterContextDummy.cpp */; };
> 944372DD171F6B4300E57C32 /* RegisterContextDummy.h in Headers 
> */ = {isa = PBXBuildFile; fileRef = 944372DB171F6B4300E57C32 /* 
> RegisterContextDummy.h */; };
> 9443B122140C18C40013457C /* SBData.cpp in Sour

[Lldb-commits] [lldb] r231315 - Appease the Windows bot

2015-03-04 Thread Enrico Granata
Author: enrico
Date: Wed Mar  4 17:19:36 2015
New Revision: 231315

URL: http://llvm.org/viewvc/llvm-project?rev=231315&view=rev
Log:
Appease the Windows bot

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

Modified: lldb/trunk/source/Utility/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/CMakeLists.txt?rev=231315&r1=231314&r2=231315&view=diff
==
--- lldb/trunk/source/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Utility/CMakeLists.txt Wed Mar  4 17:19:36 2015
@@ -5,6 +5,7 @@ add_lldb_library(lldbUtility
   ARM64_DWARF_Registers.cpp
   JSON.cpp
   KQueue.cpp
+  LLDBAssert.cpp
   PseudoTerminal.cpp
   Range.cpp
   RegisterNumber.cpp


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r231310 - Introduce lldbassert(x)

2015-03-04 Thread Enrico Granata
Author: enrico
Date: Wed Mar  4 16:59:20 2015
New Revision: 231310

URL: http://llvm.org/viewvc/llvm-project?rev=231310&view=rev
Log:
Introduce lldbassert(x)

We would like it if LLDB never crashed, especially if we never caused LLDB to 
crash
On the other hand, having assertions can sometimes be useful

lldbassert(x) is the best of both worlds:
- in debug builds, it turns into a regular assert, which is fine because we 
don't mind debug LLDB to crash on development machines
- in non-debug builds, it emits a message formatted just like assert(x) would, 
but then instead of crashing, it dumps a backtrace, suggests filing a bug, and 
keeps running


Added:
lldb/trunk/include/lldb/Utility/LLDBAssert.h
lldb/trunk/source/Utility/LLDBAssert.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Added: lldb/trunk/include/lldb/Utility/LLDBAssert.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/LLDBAssert.h?rev=231310&view=auto
==
--- lldb/trunk/include/lldb/Utility/LLDBAssert.h (added)
+++ lldb/trunk/include/lldb/Utility/LLDBAssert.h Wed Mar  4 16:59:20 2015
@@ -0,0 +1,30 @@
+//===- LLDBAssert.h *- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef utility_LLDBAssert_h_
+#define utility_LLDBAssert_h_
+
+#include 
+
+#ifdef LLDB_CONFIGURATION_DEBUG
+#define lldbassert(x) assert(x)
+#else
+#define lldbassert(x) lldb_private::lldb_assert(x, #x, __FUNCTION__, __FILE__, 
__LINE__)
+#endif
+
+namespace lldb_private {
+void
+lldb_assert (int expression,
+ const char* expr_text,
+ const char* func,
+ const char* file,
+ unsigned int line);
+}
+
+#endif // utility_LLDBAssert_h_

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=231310&r1=231309&r2=231310&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Mar  4 16:59:20 2015
@@ -770,6 +770,7 @@
942AFF0719F84C02007B43B4 /* LibCxxInitializerList.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 942AFF0619F84C02007B43B4 /* 
LibCxxInitializerList.cpp */; };
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 */; };
944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* 
RegisterContextDummy.cpp */; };
944372DD171F6B4300E57C32 /* RegisterContextDummy.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = 944372DB171F6B4300E57C32 /* 
RegisterContextDummy.h */; };
9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
@@ -2397,6 +2398,8 @@
94380B8019940B0300BFE4A8 /* StringLexer.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringLexer.h; 
path = include/lldb/Utility/StringLexer.h; sourceTree = ""; };
94380B8119940B0A00BFE4A8 /* StringLexer.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = StringLexer.cpp; path = source/Utility/StringLexer.cpp; sourceTree = 
""; };
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 = 
""; };
944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = RegisterContextDummy.cpp; path = Utility/RegisterContextD

[Lldb-commits] [lldb] r231288 - Add a required #include

2015-03-04 Thread Enrico Granata
Author: enrico
Date: Wed Mar  4 15:33:45 2015
New Revision: 231288

URL: http://llvm.org/viewvc/llvm-project?rev=231288&view=rev
Log:
Add a required #include


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

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=231288&r1=231287&r2=231288&view=diff
==
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Wed Mar  4 15:33:45 2015
@@ -56,6 +56,7 @@
 #include "lldb/Target/LanguageRuntime.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/TargetList.h"
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r230661 - Fix a bug where LLDB could be convinced to attempt to extract a bitfield of size 0, and consequently crash

2015-02-26 Thread Enrico Granata
Author: enrico
Date: Thu Feb 26 13:00:23 2015
New Revision: 230661

URL: http://llvm.org/viewvc/llvm-project?rev=230661&view=rev
Log:
Fix a bug where LLDB could be convinced to attempt to extract a bitfield of 
size 0, and consequently crash

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

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=230661&r1=230660&r2=230661&view=diff
==
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Feb 26 13:00:23 2015
@@ -1710,7 +1710,7 @@ DataExtractor::Dump (Stream *s,
 {
 size_t complex_int_byte_size = item_byte_size / 2;
 
-if (complex_int_byte_size <= 8)
+if (complex_int_byte_size > 0 && complex_int_byte_size <= 8)
 {
 s->Printf("%" PRIu64, GetMaxU64Bitfield(&offset, 
complex_int_byte_size, 0, 0));
 s->Printf(" + %" PRIu64 "i", GetMaxU64Bitfield(&offset, 
complex_int_byte_size, 0, 0));


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r230602 - If we are trying to load the scripting resource for a module whose name happens to be a Python keyword, then prefix the filename with an _ (e.g. a module named def will

2015-02-25 Thread Enrico Granata
Author: enrico
Date: Wed Feb 25 19:37:26 2015
New Revision: 230602

URL: http://llvm.org/viewvc/llvm-project?rev=230602&view=rev
Log:
If we are trying to load the scripting resource for a module whose name happens 
to be a Python keyword, then prefix the filename with an _ (e.g. a module named 
def will load _def.py)

Fixes rdar://13893506


Modified:
lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h?rev=230602&r1=230601&r2=230602&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Wed Feb 25 19:37:26 
2015
@@ -601,6 +601,12 @@ public:
 error.SetErrorString("loading unimplemented");
 return false;
 }
+
+virtual bool
+IsReservedWord (const char* word)
+{
+return false;
+}
 
 virtual lldb::ScriptInterpreterObjectSP
 MakeScriptObject (void* object)

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=230602&r1=230601&r2=230602&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h Wed Feb 25 
19:37:26 2015
@@ -248,6 +248,9 @@ public:
  lldb_private::Error& error,
  lldb::ScriptInterpreterObjectSP* module_sp = nullptr) 
override;
 
+bool
+IsReservedWord (const char* word) override;
+
 lldb::ScriptInterpreterObjectSP
 MakeScriptObject (void* object) override;
 

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=230602&r1=230601&r2=230602&view=diff
==
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Wed Feb 25 
19:37:26 2015
@@ -195,7 +195,7 @@ ScriptInterpreterPython::ScriptInterpret
 
 int old_count = Debugger::TestDebuggerRefCount();
 
-run_string.Printf ("run_one_line (%s, 'import copy, os, re, sys, uuid, 
lldb')", m_dictionary_name.c_str());
+run_string.Printf ("run_one_line (%s, 'import copy, keyword, os, re, sys, 
uuid, lldb')", m_dictionary_name.c_str());
 PyRun_SimpleString (run_string.GetData());
 
 // WARNING: temporary code that loads Cocoa formatters - this should be 
done on a per-platform basis rather than loading the whole set
@@ -2582,6 +2582,21 @@ ScriptInterpreterPython::LoadScriptingMo
 }
 }
 
+bool
+ScriptInterpreterPython::IsReservedWord (const char* word)
+{
+StreamString command_stream;
+command_stream.Printf("keyword.iskeyword('%s')", word);
+bool result;
+ExecuteScriptOptions options;
+options.SetEnableIO(false);
+options.SetMaskoutErrors(true);
+options.SetSetLLDBGlobals(false);
+if (ExecuteOneLineWithReturn(command_stream.GetData(), 
ScriptInterpreter::eScriptReturnTypeBool, &result, options))
+return result;
+return false;
+}
+
 lldb::ScriptInterpreterObjectSP
 ScriptInterpreterPython::MakeScriptObject (void* object)
 {

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=230602&r1=230601&r2=230602&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed Feb 25 
19:37:26 2015
@@ -26,6 +26,7 @@
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Symbols.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
@@ -67,6 +68,8 @@ PlatformDarwin::LocateExecutableScriptin
 // should not lose ".file" but GetFileNameStrippingExtension() will do 
precisely that.
 // Ideally, we should have a per-platform list of extensions (".exe", 
".app", ".dSYM", ".framework")
 // which should be stripped while leaving "this.binary.file" as-is.
+ScriptInterpreter *script_interpreter = 
target->GetDebugger().GetCommandInterprete

Re: [Lldb-commits] [PATCH] Move the shell expansion code to Host/common

2015-02-25 Thread Enrico Granata

> On Feb 25, 2015, at 10:29 AM, Zachary Turner  wrote:
> 
> Well, I agree in principle that the API is meant to support process 
> launching.  But if its utility can be trivially extended to support other use 
> cases, then why not?
> 

YAGNI - also, ProcessLaunchInfo isn’t that hard to construct

> FWIW, when I decided to do this, it was only to enable the functionality for 
> other platforms (i.e. moving from specific dirs to common), because only 
> Windows is going to have a different codepath here so it didn't make sense to 
> increase the code debt for everyone just because of Windows.  Then changing 
> of the signature was just something I noticed on the side.  I can change it 
> back if people feel strongly,

Please do
FWIW, I think that the environment variables in the launch info should ALSO be 
passed down (they aren’t now, but it’s not by design), so with your change, I’d 
have to go add yet another argument when I have time to get that piece of work 
done - and by then, I am passing essentially all the guts of a 
ProcessLaunchInfo, but not the actual ProcessLaunchInfo for no clear reason

> but at the same time, I really like making code as general as possible, as 
> long as the generality doesn't hinder the readability or usability for the 
> primary use case (which in this case I don't think it does)

I don’t think I agree with that (i.e., I think it does make our real use case 
for this less readable and usable)

> 
> On Wed, Feb 25, 2015 at 10:24 AM Enrico Granata  <mailto:egran...@apple.com>> wrote:
> -
> -void
> -SetShellExpandArguments (bool glob);
> -
> +
> +void SetShellExpandArguments(bool expand);
> +
> 
> Yes, totally
> 
> -static Error
> -ShellExpandArguments (ProcessLaunchInfo &launch_info);
> -
> +static Error ShellExpandArguments(llvm::StringRef input, llvm::StringRef 
> working_dir, std::vector &expanded);
> +
> 
> Why? I see no benefit to doing this. This API is clearly meant to support 
> process launching. This change seems a net loss to me.
> 
> The actual moving of the argdumper logic to Host/common is fine (as long as 
> the mechanism for individual platforms to opt out is trivial, that is) - the 
> change in signature from ProcessLaunchInfo to bunch-of-stuff not so much
> 
> -if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments))
> 
> This should be fine do to do, yes
> 
> 
>> On Feb 24, 2015, at 7:31 PM, Zachary Turner > <mailto:ztur...@google.com>> wrote:
>> 
> 
>> Anyone have thoughts on this?  If there's no suggestions I'd like to commit, 
>> but I'll give another day or two for comments.
>> 
>> 
>> http://reviews.llvm.org/D7805 <http://reviews.llvm.org/D7805>
>> 
>> EMAIL PREFERENCES
>>  http://reviews.llvm.org/settings/panel/emailpreferences/ 
>> <http://reviews.llvm.org/settings/panel/emailpreferences/>
>> 
>> 
>> 
> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@cs.uiuc.edu <mailto:lldb-commits@cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits 
>> <http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits>
> 
> Thanks,
> - Enrico
> 📩 egranata@.com ☎️ 27683
> 
> 
> 
> 

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




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r230065 - Start the refactoring of globbing

2015-02-20 Thread Enrico Granata
My best guess is a missing include, which I added in 230080. If that doesn’t 
fix it, I am going to need somebody who knows their way around Windows to help 
out

> On Feb 20, 2015, at 2:41 PM, Zachary Turner  wrote:
> 
> You probably already saw the bot failure email, but you can take a look at 
> this:
> 
> http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds//steps/build/logs/stdio
>  
> <http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds//steps/build/logs/stdio>
> 
> It looks like probably a missing #include, let me know if it's more difficult 
> though.
> 
> On Fri Feb 20 2015 at 2:26:38 PM Zachary Turner  <mailto:ztur...@google.com>> wrote:
> Might it ever be possible to expand a string for purposes other than 
> forwarding those arguments on to another executable?  For example, maybe we 
> want shell expansion to specify the name of the executable in the first 
> place.  Like imagine you're trying to debug "foo", and the path of foo is 
> $FOODIR/foo.  In this case the expansion doesn't happen on the argument to 
> the command but the command itself.  
> 
> And...  I just saw your other email come through.  ShellExpandArguments() 
> sounds fine.
> 
> On Fri Feb 20 2015 at 2:00:36 PM Enrico Granata  <mailto:egran...@apple.com>> wrote:
> Fair enough - ShellExpand is not bad, but I feel like Arguments should be in 
> there somewhere
> 
> Collective hivemind, something less verbose than ShellStyleExpandArguments 
> maybe?
> 
>> On Feb 20, 2015, at 1:57 PM, Zachary Turner > <mailto:ztur...@google.com>> wrote:
>> 
>> In a followup patch, would you mind changing the terminology from 
>> GlobArguments to something more descriptive, like ShellExpand?  When I think 
>> glob I only think of wildcards, not full shell exnapsion.  So I think it 
>> would be better if it were more explicit.
>> 
>> On Fri Feb 20 2015 at 1:51:26 PM Enrico Granata > <mailto:egran...@apple.com>> wrote:
>> Author: enrico
>> Date: Fri Feb 20 15:48:38 2015
>> New Revision: 230065
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=230065&view=rev 
>> <http://llvm.org/viewvc/llvm-project?rev=230065&view=rev>
>> Log:
>> Start the refactoring of globbing
>> 
>> - Add Host::GlobArguments() to perform local-globbing
>> I implemented this on OSX and Windows in terms of argdumper (Windows 
>> implementation is essentially the same as the OSX version + a change in 
>> binary name and some string magic)
>> Other platforms did not specifically chime in, so I left it unimplemented 
>> for them for the time being. Please feel free to fill in the blanks
>> 
>> - Add Platform::GlobArguments() to support remote-globbing
>> For now, no feature change here - but now we have infrastructure to help 
>> GDBRemote targets to support globbing - and patches to that effect will 
>> follow
>> 
>> No visible feature change
>> 
>> 
>> Modified:
>> lldb/trunk/include/lldb/Host/Host.h
>> lldb/trunk/include/lldb/Target/Platform.h
>> lldb/trunk/source/Host/freebsd/Host.cpp
>> lldb/trunk/source/Host/linux/Host.cpp
>> lldb/trunk/source/Host/macosx/Host.mm
>> lldb/trunk/source/Host/windows/Host.cpp
>> lldb/trunk/source/Target/Platform.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Host/Host.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=230065&r1=230064&r2=230065&view=diff
>>  
>> <http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=230065&r1=230064&r2=230065&view=diff>
>> ==
>> --- lldb/trunk/include/lldb/Host/Host.h (original)
>> +++ lldb/trunk/include/lldb/Host/Host.h Fri Feb 20 15:48:38 2015
>> @@ -253,6 +253,16 @@ public:
>>  static Error
>>  LaunchProcess (ProcessLaunchInfo &launch_info);
>> 
>> +//--
>> +/// Perform globbing of the command-line for this launch info
>> +/// This can potentially involve wildcard expansion
>> +//  environment variable replacement, and whatever other
>> +//  argument magic the platform defines as part of its typical
>> +//  user experience
>> +//--
>> +static Error
>> +GlobArguments (ProcessLaunchInfo &launch_info);
>> +
>>  static Error
>>  RunShellCommand (const 

  1   2   3   4   5   >