[Lldb-commits] [PATCH] D24863: Keep dependencies separated between static and dynamic libraries. Fix for bug #28127.

2016-10-03 Thread Pablo Oliveira via lldb-commits
pablooliveira added a comment.

> If you are fine with having lldb-server link against libLLVM in the 
> LLVM_LINK_LLVM_DYLIB case, I can make an lldb-only change that makes it work. 
> It won't affect our use case as we don't use that flag.

@labath, I think that would be fine in the context of the Debian package. 
Thanks !


Repository:
  rL LLVM

https://reviews.llvm.org/D24863



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


[Lldb-commits] [lldb] r283186 - Finish adding the individual instruction tests to the x86 unwinder

2016-10-03 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct  4 00:10:06 2016
New Revision: 283186

URL: http://llvm.org/viewvc/llvm-project?rev=283186=rev
Log:
Finish adding the individual instruction tests to the x86 unwinder
unittests.  If I have time, I'd like to see if I can write some
tests of the eh_frame augmentation which is a wholly separate code
path (it seems like maybe it should be rolled into the main instruction
scanning codepath, to be honest, and operate on the generated
UnwindPlan instead of bothering with raw instructions at all).  

Outside the eh_frame augmentation, I'm comfortable that this unwind
generator is being tested well now.


Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=283186=283185=283186=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Tue Oct  4 
00:10:06 2016
@@ -748,6 +748,10 @@ Error PlatformRemoteiOS::GetSharedModule
 
 size_t num_module_search_paths = module_search_paths_ptr->GetSize();
 for (size_t i = 0; i < num_module_search_paths; ++i) {
+  Log *log_verbose = 
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST |
+LIBLLDB_LOG_VERBOSE);
+  if (log_verbose)
+  log_verbose->Printf ("PlatformRemoteiOS::GetSharedModule searching 
for binary in search-path %s", 
module_search_paths_ptr->GetFileSpecAtIndex(i).GetPath().c_str());
   // Create a new FileSpec with this module_search_paths_ptr
   // plus just the filename ("UIFoundation"), then the parent
   // dir plus filename ("UIFoundation.framework/UIFoundation")

Modified: 
lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp?rev=283186=283185=283186=diff
==
--- 
lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp 
Tue Oct  4 00:10:06 2016
@@ -346,6 +346,20 @@ bool x86AssemblyInspectionEngine::push_e
   return false;
 }
 
+// instructions only valid in 32-bit mode:
+// 0x0e - push cs
+// 0x16 - push ss
+// 0x1e - push ds
+// 0x06 - push es
+bool x86AssemblyInspectionEngine::push_misc_reg_p() {
+  uint8_t p = *m_cur_insn;
+  if (m_wordsize == 4) {
+if (p == 0x0e || p == 0x16 || p == 0x1e || p == 0x06)
+  return true;
+  }
+  return false;
+}
+
 // pushq %rbx
 // pushl %ebx
 bool x86AssemblyInspectionEngine::push_reg_p(int ) {
@@ -462,6 +476,19 @@ bool x86AssemblyInspectionEngine::pop_rb
   return (*p == 0x5d);
 }
 
+// instructions valid only in 32-bit mode:
+// 0x1f - pop ds
+// 0x07 - pop es
+// 0x17 - pop ss
+bool x86AssemblyInspectionEngine::pop_misc_reg_p() {
+  uint8_t p = *m_cur_insn;
+  if (m_wordsize == 4) {
+if (p == 0x1f || p == 0x07 || p == 0x17)
+  return true;
+  }
+  return false;
+}
+
 // leave [0xc9]
 bool x86AssemblyInspectionEngine::leave_pattern_p() {
   uint8_t *p = m_cur_insn;
@@ -725,6 +752,15 @@ bool x86AssemblyInspectionEngine::GetNon
   }
 }
 
+else if (pop_misc_reg_p()) {
+  current_sp_bytes_offset_from_cfa -= m_wordsize;
+  if (row->GetCFAValue().GetRegisterNumber() == m_lldb_sp_regnum) {
+row->GetCFAValue().SetIsRegisterPlusOffset(
+m_lldb_sp_regnum, current_sp_bytes_offset_from_cfa);
+row_updated = true;
+  }
+}
+
 // The LEAVE instruction moves the value from rbp into rsp and pops
 // a value off the stack into rbp (restoring the caller's rbp value).
 // It is the opposite of ENTER, or 'push rbp, mov rsp rbp'.
@@ -788,7 +824,8 @@ bool x86AssemblyInspectionEngine::GetNon
   in_epilogue = true;
 }
 
-else if (push_extended_pattern_p() || push_imm_pattern_p()) {
+else if (push_extended_pattern_p() || push_imm_pattern_p() ||
+ push_misc_reg_p()) {
   current_sp_bytes_offset_from_cfa += m_wordsize;
   if (row->GetCFAValue().GetRegisterNumber() == m_lldb_sp_regnum) {
 row->GetCFAValue().SetOffset(current_sp_bytes_offset_from_cfa);
@@ -1026,6 +1063,16 @@ bool x86AssemblyInspectionEngine::Augmen
 continue;
   }
 
+  if (pop_misc_reg_p()) {
+row->SetOffset(offset);
+row->GetCFAValue().IncOffset(-m_wordsize);
+
+

[Lldb-commits] [PATCH] D25057: Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints

2016-10-03 Thread Muhammad Omair Javaid via lldb-commits
omjavaid added a comment.

@labath Referring to your email on the mailing list.

Thanks for helping out with this work.

I think we should push this fix, as you suggested this does not fix everything 
in a holistic way but it corrects the functionality that is currently available 
right now with limitations ofcourse.

So here is functionality we are currently lacking:

- Ability to put multiple watchpoints with same address range.

This is more concerning because we cannot put a watch on say byte 0 and byte 7 
in case of aarch64.

- Ability to use single slot for multiple watchpoints.

This is more like a nice to have and I think if we fix the above functionality 
this may well be fixed automatically.

This is what I think LLDB client or server has to do:

- Keep a cache of watchpoint registers available and modify registers in cache 
when a set/remove request is made.
- As pre-req for set/remove is to have the target in stopped state this will 
mean that when we set/remove we make changes to actual registers before we 
resume for continue or stepping.
- I dont think keeping the cache and then updating on resume actually means we 
are lying to client. Cache will also remain limited and will behave like an 
actual write to the registers. It will serve us well to support the 
functionality we intend to support.

In case of GDB this functionality is handled by gdbserver and gdb client is not 
aware of the fact that watchpoint registers are not actually written until we 
resume.

To implement this in LLDB client or server is a design decision and I just see 
that it should be easier to achieve on LLDB server side though it may require 
changes to the way we approach watchpoint for all targets but it will then 
remain restricted to the concerning target specific area.

I am OOO till 16th If you are OK with this  change I will push it whenever it 
gets a LGTM.


https://reviews.llvm.org/D25057



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


[Lldb-commits] [PATCH] D25158: Convert some Breakpoint to StringRef

2016-10-03 Thread Jim Ingham via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

This looks correct to me.  I had a couple of trivial inline comments, but this 
looks fine.



> BreakpointID.cpp:80-81
>  
> -bool BreakpointID::ParseCanonicalReference(const char *input,
> +bool BreakpointID::ParseCanonicalReference(llvm::StringRef input,
> break_id_t *break_id_ptr,
> break_id_t *break_loc_id_ptr) {

This really should return a BreakpointID not pointers to the break & loc ID's.  
It always gets used that way, not sure why it wasn't written that way...  
That's not a necessary change but while you are cleaning this stuff up...

> BreakpointIDList.cpp:350-351
>  
> -bool BreakpointIDList::StringContainsIDRangeExpression(const char *in_string,
> -   size_t 
> *range_start_len,
> -   size_t 
> *range_end_pos) {
> -  bool is_range_expression = false;
> -  std::string arg_str = in_string;
> -  std::string::size_type idx;
> -  std::string::size_type start_pos = 0;
> -
> -  *range_start_len = 0;
> -  *range_end_pos = 0;
> -
> -  int specifiers_size = 0;
> -  for (int i = 0; BreakpointID::g_range_specifiers[i] != nullptr; ++i)
> -++specifiers_size;
> -
> -  for (int i = 0; i < specifiers_size && !is_range_expression; ++i) {
> -const char *specifier_str = BreakpointID::g_range_specifiers[i];
> -size_t len = strlen(specifier_str);
> -idx = arg_str.find(BreakpointID::g_range_specifiers[i]);
> -if (idx != std::string::npos) {
> -  *range_start_len = idx - start_pos;
> -  std::string start_str = arg_str.substr(start_pos, *range_start_len);
> -  if (idx + len < arg_str.length()) {
> -*range_end_pos = idx + len;
> -std::string end_str = arg_str.substr(*range_end_pos);
> -if (BreakpointID::IsValidIDExpression(start_str.c_str()) &&
> -BreakpointID::IsValidIDExpression(end_str.c_str())) {
> -  is_range_expression = true;
> -  //*range_start = start_str;
> -  //*range_end = end_str;
> -}
> -  }
> -}
> -  }
> +std::pair
> +BreakpointIDList::SplitIDRangeExpression(llvm::StringRef in_string) {
> +  for (auto specifier_str : BreakpointID::GetRangeSpecifiers()) {

Can you add a comment here saying what is returned, particularly that you 
return a pair of empty string refs when it isn't an ID range?

https://reviews.llvm.org/D25158



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


[Lldb-commits] [lldb] r283176 - Fix TestNestedAliases.py

2016-10-03 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Oct  3 20:34:39 2016
New Revision: 283176

URL: http://llvm.org/viewvc/llvm-project?rev=283176=rev
Log:
Fix TestNestedAliases.py

I missed an if/else branch when doing the conversion.

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

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=283176=283175=283176=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Oct  3 20:34:39 
2016
@@ -1373,12 +1373,13 @@ CommandObject *CommandInterpreter::Build
index);
   result.SetStatus(eReturnStatusFailed);
   return nullptr;
+} else {
+  size_t strpos = 
raw_input_string.find(cmd_args.GetArgumentAtIndex(index));
+  if (strpos != std::string::npos)
+raw_input_string = raw_input_string.erase(
+strpos, strlen(cmd_args.GetArgumentAtIndex(index)));
+  result_str.Printf("%s", cmd_args.GetArgumentAtIndex(index));
 }
-size_t strpos = raw_input_string.find(cmd_args.GetArgumentAtIndex(index));
-if (strpos != std::string::npos)
-  raw_input_string = raw_input_string.erase(
-  strpos, strlen(cmd_args.GetArgumentAtIndex(index)));
-result_str.Printf("%s", cmd_args.GetArgumentAtIndex(index));
   }
 
   alias_result = result_str.GetData();


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


[Lldb-commits] [PATCH] D24863: Keep dependencies separated between static and dynamic libraries. Fix for bug #28127.

2016-10-03 Thread Pavel Labath via lldb-commits
labath added a comment.

@pablooliveira @sylvestre.ledru :

If you are fine with having lldb-server link against libLLVM in the 
LLVM_LINK_LLVM_DYLIB case, I can make an lldb-only change that makes it work. 
It won't affect our use case as we don't use that flag.


Repository:
  rL LLVM

https://reviews.llvm.org/D24863



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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Pavel Labath via lldb-commits
labath added inline comments.


> dvlahovski wrote in TestMiniDumpNew.py:19
> But, should `test_deeper_stack_in_mini_dump` and 
> `test_local_variables_in_mini_dump` not have this decorator ?

They are not building any code, so the would behave the same way anyway. You 
would be just running the test 2--3 times for nothing.

https://reviews.llvm.org/D25196



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


[Lldb-commits] [lldb] r283171 - Fix test when using remote debugging.

2016-10-03 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Oct  3 19:32:20 2016
New Revision: 283171

URL: http://llvm.org/viewvc/llvm-project?rev=283171=rev
Log:
Fix test when using remote debugging.

Summary:
Use os.getcwd() instead of get_process_working_directory() as prefix for
souce file.

Reviewers: labath

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py?rev=283171=283170=283171=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
 Mon Oct  3 19:32:20 2016
@@ -46,7 +46,7 @@ class BreakpointCaseSensitivityTestCase(
 # Create a target by the debugger.
 self.target = self.dbg.CreateTarget(exe)
 self.assertTrue(self.target, VALID_TARGET)
-cwd = self.get_process_working_directory()
+cwd = os.getcwd()
 
 # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
 for regex in [False, True]:


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


[Lldb-commits] [PATCH] D25217: Fix test when using remote debugging.

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

lgtm, thanks.


https://reviews.llvm.org/D25217



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


[Lldb-commits] [PATCH] D25217: Fix test when using remote debugging.

2016-10-03 Thread Andrew Ford via lldb-commits
andrewford created this revision.
andrewford added a reviewer: labath.
andrewford added a subscriber: lldb-commits.

Use os.getcwd() instead of get_process_working_directory() as prefix for
souce file.


https://reviews.llvm.org/D25217

Files:
  
packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py


Index: 
packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
===
--- 
packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
+++ 
packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
@@ -46,7 +46,7 @@
 # Create a target by the debugger.
 self.target = self.dbg.CreateTarget(exe)
 self.assertTrue(self.target, VALID_TARGET)
-cwd = self.get_process_working_directory()
+cwd = os.getcwd()
 
 # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
 for regex in [False, True]:


Index: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
===
--- packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
+++ packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
@@ -46,7 +46,7 @@
 # Create a target by the debugger.
 self.target = self.dbg.CreateTarget(exe)
 self.assertTrue(self.target, VALID_TARGET)
-cwd = self.get_process_working_directory()
+cwd = os.getcwd()
 
 # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
 for regex in [False, True]:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283168 - Try to fix failing tests when running remote test suite.

2016-10-03 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Oct  3 19:09:44 2016
New Revision: 283168

URL: http://llvm.org/viewvc/llvm-project?rev=283168=rev
Log:
Try to fix failing tests when running remote test suite.

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

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp?rev=283168=283167=283168=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp Mon 
Oct  3 19:09:44 2016
@@ -66,7 +66,7 @@ void ProcessGDBRemoteLog::DisableLog(con
   if (log) {
 uint32_t flag_bits = 0;
 
-if (categories[0] != NULL) {
+if (categories && categories[0]) {
   flag_bits = log->GetMask().Get();
   for (size_t i = 0; categories[i] != NULL; ++i) {
 const char *arg = categories[i];


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


[Lldb-commits] [lldb] r283167 - Fix the data formatter for std::multiset in libc++ - this is a trivial amount of extra change on top of multimap

2016-10-03 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Oct  3 19:07:42 2016
New Revision: 283167

URL: http://llvm.org/viewvc/llvm-project?rev=283167=rev
Log:
Fix the data formatter for std::multiset in libc++ - this is a trivial amount 
of extra change on top of multimap

Also, proper formatting..


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

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp?rev=283167=283166=283167=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp Mon Oct  3 
19:07:42 2016
@@ -39,21 +39,26 @@ public:
 static ConstString g_left("__left_");
 if (!m_entry_sp)
   return m_entry_sp;
-return m_entry_sp->GetSyntheticChildAtOffset(0, 
m_entry_sp->GetCompilerType(), true);
+return m_entry_sp->GetSyntheticChildAtOffset(
+0, m_entry_sp->GetCompilerType(), true);
   }
 
   ValueObjectSP right() const {
 static ConstString g_right("__right_");
 if (!m_entry_sp)
   return m_entry_sp;
-return 
m_entry_sp->GetSyntheticChildAtOffset(m_entry_sp->GetProcessSP()->GetAddressByteSize(),
 m_entry_sp->GetCompilerType(), true);
+return m_entry_sp->GetSyntheticChildAtOffset(
+m_entry_sp->GetProcessSP()->GetAddressByteSize(),
+m_entry_sp->GetCompilerType(), true);
   }
 
   ValueObjectSP parent() const {
 static ConstString g_parent("__parent_");
 if (!m_entry_sp)
   return m_entry_sp;
-return 
m_entry_sp->GetSyntheticChildAtOffset(2*m_entry_sp->GetProcessSP()->GetAddressByteSize(),
 m_entry_sp->GetCompilerType(), true);
+return m_entry_sp->GetSyntheticChildAtOffset(
+2 * m_entry_sp->GetProcessSP()->GetAddressByteSize(),
+m_entry_sp->GetCompilerType(), true);
   }
 
   uint64_t value() const {
@@ -244,20 +249,29 @@ bool lldb_private::formatters::LibcxxStd
 return false;
   deref = deref->GetChildMemberWithName(g___value_, true);
   if (deref) {
-  m_element_type = deref->GetCompilerType();
-  return true;
+m_element_type = deref->GetCompilerType();
+return true;
   }
   lldb::TemplateArgumentKind kind;
-  deref = m_backend.GetChildAtNamePath( {g_tree_, g_pair3} );
+  deref = m_backend.GetChildAtNamePath({g_tree_, g_pair3});
   if (!deref)
 return false;
-  m_element_type = deref->GetCompilerType().GetTemplateArgument(1, 
kind).GetTemplateArgument(1, kind);
-  if (!m_element_type)
-return false;
-  std::string name; uint64_t bit_offset_ptr; uint32_t bitfield_bit_size_ptr; 
bool is_bitfield_ptr;
-  m_element_type = m_element_type.GetFieldAtIndex(0, name, _offset_ptr, 
_bit_size_ptr, _bitfield_ptr);
-  m_element_type = m_element_type.GetTypedefedType();
-  return m_element_type.IsValid();
+  m_element_type =
+  deref->GetCompilerType().GetTemplateArgument(1, 
kind).GetTemplateArgument(
+  1, kind);
+  if (m_element_type) {
+std::string name;
+uint64_t bit_offset_ptr;
+uint32_t bitfield_bit_size_ptr;
+bool is_bitfield_ptr;
+m_element_type = m_element_type.GetFieldAtIndex(
+0, name, _offset_ptr, _bit_size_ptr, _bitfield_ptr);
+m_element_type = m_element_type.GetTypedefedType();
+return m_element_type.IsValid();
+  } else {
+m_element_type = m_backend.GetCompilerType().GetTemplateArgument(0, kind);
+return m_element_type.IsValid();
+  }
 }
 
 void lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset(
@@ -271,18 +285,18 @@ void lldb_private::formatters::LibcxxStd
   if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset) !=
   UINT32_MAX) {
 m_skip_size = bit_offset / 8u;
-  }
-  else {
-ClangASTContext *ast_ctx = 
llvm::dyn_cast_or_null(node_type.GetTypeSystem());
+  } else {
+ClangASTContext *ast_ctx =
+llvm::dyn_cast_or_null(node_type.GetTypeSystem());
 if (!ast_ctx)
   return;
-CompilerType tree_node_type = 
ast_ctx->CreateStructForIdentifier(ConstString(), {
-  {"ptr0",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
-  {"ptr1",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
-  {"ptr2",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
-  {"cw",ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
-  {"payload",m_element_type}
-});
+CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
+ConstString(),
+{{"ptr0", 
ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+ {"ptr1", 
ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+ {"ptr2", 
ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+ {"cw", ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
+ {"payload", (m_element_type.GetCompleteType(), m_element_type)}});
 std::string 

Re: [Lldb-commits] [lldb] r283160 - Changes to the std::multimap formatter to make it work against trunk libc++

2016-10-03 Thread Enrico Granata via lldb-commits
Woops... Guess I am just gonna reformat the entire file...

Sorry about that!

On 10/03/16 04:43 PM, Zachary Turner   wrote: 
> 
> 
> Was this clang-formatted? some of these lines look way longer than 80 columns.
> 
> 
> 
> On Mon, Oct 3, 2016 at 4:41 PM Enrico Granata via lldb-commits 
>  wrote:
> 
> > Author: enrico
> > Date: Mon Oct 3 18:33:00 2016
> > New Revision: 283160
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=283160=rev
> > Log:
> > Changes to the std::multimap formatter to make it work against trunk libc++
> > 
> > Fixes rdar://28237486
> > 
> > 
> > Modified:
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
> > 
> > Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
> > URL: 
> > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp?rev=283160=283159=283160=diff
> > ==
> > --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (original)
> > +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp Mon Oct 3 
> > 18:33:00 2016
> > @@ -39,21 +39,21 @@ public:
> >  static ConstString g_left("__left_");
> >  if (!m_entry_sp)
> >  return m_entry_sp;
> > - return m_entry_sp->GetChildMemberWithName(g_left, true);
> > + return m_entry_sp->GetSyntheticChildAtOffset(0, 
> > m_entry_sp->GetCompilerType(), true);
> >  }
> > 
> >  ValueObjectSP right() const {
> >  static ConstString g_right("__right_");
> >  if (!m_entry_sp)
> >  return m_entry_sp;
> > - return m_entry_sp->GetChildMemberWithName(g_right, true);
> > + return 
> > m_entry_sp->GetSyntheticChildAtOffset(m_entry_sp->GetProcessSP()->GetAddressByteSize(),
> >  m_entry_sp->GetCompilerType(), true);
> >  }
> > 
> >  ValueObjectSP parent() const {
> >  static ConstString g_parent("__parent_");
> >  if (!m_entry_sp)
> >  return m_entry_sp;
> > - return m_entry_sp->GetChildMemberWithName(g_parent, true);
> > + return 
> > m_entry_sp->GetSyntheticChildAtOffset(2*m_entry_sp->GetProcessSP()->GetAddressByteSize(),
> >  m_entry_sp->GetCompilerType(), true);
> >  }
> > 
> >  uint64_t value() const {
> > @@ -231,6 +231,8 @@ size_t lldb_private::formatters::LibcxxS
> > 
> >  bool 
> > lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
> >  static ConstString g___value_("__value_");
> > + static ConstString g_tree_("__tree_");
> > + static ConstString g_pair3("__pair3_");
> > 
> >  if (m_element_type.GetOpaqueQualType() && m_element_type.GetTypeSystem())
> >  return true;
> > @@ -241,10 +243,21 @@ bool lldb_private::formatters::LibcxxStd
> >  if (!deref || error.Fail())
> >  return false;
> >  deref = deref->GetChildMemberWithName(g___value_, true);
> > + if (deref) {
> > + m_element_type = deref->GetCompilerType();
> > + return true;
> > + }
> > + lldb::TemplateArgumentKind kind;
> > + deref = m_backend.GetChildAtNamePath( {g_tree_, g_pair3} );
> >  if (!deref)
> >  return false;
> > - m_element_type = deref->GetCompilerType();
> > - return true;
> > + m_element_type = deref->GetCompilerType().GetTemplateArgument(1, 
> > kind).GetTemplateArgument(1, kind);
> > + if (!m_element_type)
> > + return false;
> > + std::string name; uint64_t bit_offset_ptr; uint32_t 
> > bitfield_bit_size_ptr; bool is_bitfield_ptr;
> > + m_element_type = m_element_type.GetFieldAtIndex(0, name, _offset_ptr, 
> > _bit_size_ptr, _bitfield_ptr);
> > + m_element_type = m_element_type.GetTypedefedType();
> > + return m_element_type.IsValid();
> >  }
> > 
> >  void 
> > lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset(
> > @@ -255,10 +268,32 @@ void lldb_private::formatters::LibcxxStd
> >  return;
> >  CompilerType node_type(node->GetCompilerType());
> >  uint64_t bit_offset;
> > - if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset) ==
> > - UINT32_MAX)
> > - return;
> > - m_skip_size = bit_offset / 8u;
> > + if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset) !=
> > + UINT32_MAX) {
> > + m_skip_size = bit_offset / 8u;
> > + }
> > + else {
> > + ClangASTContext *ast_ctx = 
> > llvm::dyn_cast_or_null(node_type.GetTypeSystem());
> > + if (!ast_ctx)
> > + return;
> > + CompilerType tree_node_type = 
> > ast_ctx->CreateStructForIdentifier(ConstString(), {
> > + {"ptr0",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> > + {"ptr1",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> > + {"ptr2",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> > + {"cw",ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
> > + {"payload",m_element_type}
> > + });
> > + std::string child_name;
> > + uint32_t child_byte_size;
> > + int32_t child_byte_offset = 0;
> > + uint32_t child_bitfield_bit_size;
> > + uint32_t child_bitfield_bit_offset;
> > + bool child_is_base_class;
> > + bool child_is_deref_of_parent;
> > + uint64_t language_flags;
> > + if 

Re: [Lldb-commits] [lldb] r283160 - Changes to the std::multimap formatter to make it work against trunk libc++

2016-10-03 Thread Zachary Turner via lldb-commits
Was this clang-formatted?  some of these lines look way longer than 80
columns.

On Mon, Oct 3, 2016 at 4:41 PM Enrico Granata via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: enrico
> Date: Mon Oct  3 18:33:00 2016
> New Revision: 283160
>
> URL: http://llvm.org/viewvc/llvm-project?rev=283160=rev
> Log:
> Changes to the std::multimap formatter to make it work against trunk libc++
>
> Fixes rdar://28237486
>
>
> Modified:
> lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
>
> Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp?rev=283160=283159=283160=diff
>
> ==
> --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (original)
> +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp Mon Oct  3
> 18:33:00 2016
> @@ -39,21 +39,21 @@ public:
>  static ConstString g_left("__left_");
>  if (!m_entry_sp)
>return m_entry_sp;
> -return m_entry_sp->GetChildMemberWithName(g_left, true);
> +return m_entry_sp->GetSyntheticChildAtOffset(0,
> m_entry_sp->GetCompilerType(), true);
>}
>
>ValueObjectSP right() const {
>  static ConstString g_right("__right_");
>  if (!m_entry_sp)
>return m_entry_sp;
> -return m_entry_sp->GetChildMemberWithName(g_right, true);
> +return
> m_entry_sp->GetSyntheticChildAtOffset(m_entry_sp->GetProcessSP()->GetAddressByteSize(),
> m_entry_sp->GetCompilerType(), true);
>}
>
>ValueObjectSP parent() const {
>  static ConstString g_parent("__parent_");
>  if (!m_entry_sp)
>return m_entry_sp;
> -return m_entry_sp->GetChildMemberWithName(g_parent, true);
> +return
> m_entry_sp->GetSyntheticChildAtOffset(2*m_entry_sp->GetProcessSP()->GetAddressByteSize(),
> m_entry_sp->GetCompilerType(), true);
>}
>
>uint64_t value() const {
> @@ -231,6 +231,8 @@ size_t lldb_private::formatters::LibcxxS
>
>  bool
> lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
>static ConstString g___value_("__value_");
> +  static ConstString g_tree_("__tree_");
> +  static ConstString g_pair3("__pair3_");
>
>if (m_element_type.GetOpaqueQualType() &&
> m_element_type.GetTypeSystem())
>  return true;
> @@ -241,10 +243,21 @@ bool lldb_private::formatters::LibcxxStd
>if (!deref || error.Fail())
>  return false;
>deref = deref->GetChildMemberWithName(g___value_, true);
> +  if (deref) {
> +  m_element_type = deref->GetCompilerType();
> +  return true;
> +  }
> +  lldb::TemplateArgumentKind kind;
> +  deref = m_backend.GetChildAtNamePath( {g_tree_, g_pair3} );
>if (!deref)
>  return false;
> -  m_element_type = deref->GetCompilerType();
> -  return true;
> +  m_element_type = deref->GetCompilerType().GetTemplateArgument(1,
> kind).GetTemplateArgument(1, kind);
> +  if (!m_element_type)
> +return false;
> +  std::string name; uint64_t bit_offset_ptr; uint32_t
> bitfield_bit_size_ptr; bool is_bitfield_ptr;
> +  m_element_type = m_element_type.GetFieldAtIndex(0, name,
> _offset_ptr, _bit_size_ptr, _bitfield_ptr);
> +  m_element_type = m_element_type.GetTypedefedType();
> +  return m_element_type.IsValid();
>  }
>
>  void
> lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset(
> @@ -255,10 +268,32 @@ void lldb_private::formatters::LibcxxStd
>  return;
>CompilerType node_type(node->GetCompilerType());
>uint64_t bit_offset;
> -  if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset)
> ==
> -  UINT32_MAX)
> -return;
> -  m_skip_size = bit_offset / 8u;
> +  if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset)
> !=
> +  UINT32_MAX) {
> +m_skip_size = bit_offset / 8u;
> +  }
> +  else {
> +ClangASTContext *ast_ctx =
> llvm::dyn_cast_or_null(node_type.GetTypeSystem());
> +if (!ast_ctx)
> +  return;
> +CompilerType tree_node_type =
> ast_ctx->CreateStructForIdentifier(ConstString(), {
> +
> {"ptr0",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> +
> {"ptr1",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> +
> {"ptr2",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
> +  {"cw",ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
> +  {"payload",m_element_type}
> +});
> +std::string child_name;
> +uint32_t child_byte_size;
> +int32_t child_byte_offset = 0;
> +uint32_t child_bitfield_bit_size;
> +uint32_t child_bitfield_bit_offset;
> +bool child_is_base_class;
> +bool child_is_deref_of_parent;
> +uint64_t language_flags;
> +if (tree_node_type.GetChildCompilerTypeAtIndex(nullptr, 4, true,
> true, true, child_name, child_byte_size, child_byte_offset,
> child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
> child_is_deref_of_parent, nullptr, 

[Lldb-commits] [lldb] r283160 - Changes to the std::multimap formatter to make it work against trunk libc++

2016-10-03 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Oct  3 18:33:00 2016
New Revision: 283160

URL: http://llvm.org/viewvc/llvm-project?rev=283160=rev
Log:
Changes to the std::multimap formatter to make it work against trunk libc++ 

Fixes rdar://28237486


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

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp?rev=283160=283159=283160=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp Mon Oct  3 
18:33:00 2016
@@ -39,21 +39,21 @@ public:
 static ConstString g_left("__left_");
 if (!m_entry_sp)
   return m_entry_sp;
-return m_entry_sp->GetChildMemberWithName(g_left, true);
+return m_entry_sp->GetSyntheticChildAtOffset(0, 
m_entry_sp->GetCompilerType(), true);
   }
 
   ValueObjectSP right() const {
 static ConstString g_right("__right_");
 if (!m_entry_sp)
   return m_entry_sp;
-return m_entry_sp->GetChildMemberWithName(g_right, true);
+return 
m_entry_sp->GetSyntheticChildAtOffset(m_entry_sp->GetProcessSP()->GetAddressByteSize(),
 m_entry_sp->GetCompilerType(), true);
   }
 
   ValueObjectSP parent() const {
 static ConstString g_parent("__parent_");
 if (!m_entry_sp)
   return m_entry_sp;
-return m_entry_sp->GetChildMemberWithName(g_parent, true);
+return 
m_entry_sp->GetSyntheticChildAtOffset(2*m_entry_sp->GetProcessSP()->GetAddressByteSize(),
 m_entry_sp->GetCompilerType(), true);
   }
 
   uint64_t value() const {
@@ -231,6 +231,8 @@ size_t lldb_private::formatters::LibcxxS
 
 bool lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
   static ConstString g___value_("__value_");
+  static ConstString g_tree_("__tree_");
+  static ConstString g_pair3("__pair3_");
 
   if (m_element_type.GetOpaqueQualType() && m_element_type.GetTypeSystem())
 return true;
@@ -241,10 +243,21 @@ bool lldb_private::formatters::LibcxxStd
   if (!deref || error.Fail())
 return false;
   deref = deref->GetChildMemberWithName(g___value_, true);
+  if (deref) {
+  m_element_type = deref->GetCompilerType();
+  return true;
+  }
+  lldb::TemplateArgumentKind kind;
+  deref = m_backend.GetChildAtNamePath( {g_tree_, g_pair3} );
   if (!deref)
 return false;
-  m_element_type = deref->GetCompilerType();
-  return true;
+  m_element_type = deref->GetCompilerType().GetTemplateArgument(1, 
kind).GetTemplateArgument(1, kind);
+  if (!m_element_type)
+return false;
+  std::string name; uint64_t bit_offset_ptr; uint32_t bitfield_bit_size_ptr; 
bool is_bitfield_ptr;
+  m_element_type = m_element_type.GetFieldAtIndex(0, name, _offset_ptr, 
_bit_size_ptr, _bitfield_ptr);
+  m_element_type = m_element_type.GetTypedefedType();
+  return m_element_type.IsValid();
 }
 
 void lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset(
@@ -255,10 +268,32 @@ void lldb_private::formatters::LibcxxStd
 return;
   CompilerType node_type(node->GetCompilerType());
   uint64_t bit_offset;
-  if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset) ==
-  UINT32_MAX)
-return;
-  m_skip_size = bit_offset / 8u;
+  if (node_type.GetIndexOfFieldWithName("__value_", nullptr, _offset) !=
+  UINT32_MAX) {
+m_skip_size = bit_offset / 8u;
+  }
+  else {
+ClangASTContext *ast_ctx = 
llvm::dyn_cast_or_null(node_type.GetTypeSystem());
+if (!ast_ctx)
+  return;
+CompilerType tree_node_type = 
ast_ctx->CreateStructForIdentifier(ConstString(), {
+  {"ptr0",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+  {"ptr1",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+  {"ptr2",ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
+  {"cw",ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
+  {"payload",m_element_type}
+});
+std::string child_name;
+uint32_t child_byte_size;
+int32_t child_byte_offset = 0;
+uint32_t child_bitfield_bit_size;
+uint32_t child_bitfield_bit_offset;
+bool child_is_base_class;
+bool child_is_deref_of_parent;
+uint64_t language_flags;
+if (tree_node_type.GetChildCompilerTypeAtIndex(nullptr, 4, true, true, 
true, child_name, child_byte_size, child_byte_offset, child_bitfield_bit_size, 
child_bitfield_bit_offset, child_is_base_class, child_is_deref_of_parent, 
nullptr, language_flags).IsValid())
+  m_skip_size = (uint32_t)child_byte_offset;
+  }
 }
 
 lldb::ValueObjectSP
@@ -301,7 +336,12 @@ lldb_private::formatters::LibcxxStdMapSy
 return lldb::ValueObjectSP();
   }
   GetValueOffset(iterated_sp);
-  iterated_sp = iterated_sp->GetChildMemberWithName(g___value_, true);
+  auto child_sp = iterated_sp->GetChildMemberWithName(g___value_, true);
+ 

[Lldb-commits] [lldb] r283159 - Modernize some code related to Args usage / implementation.

2016-10-03 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Oct  3 18:20:36 2016
New Revision: 283159

URL: http://llvm.org/viewvc/llvm-project?rev=283159=rev
Log:
Modernize some code related to Args usage / implementation.

Mostly this involves simplifying some logical constructs and using
some ranges instead of index-based iteration.  NFC

Modified:
lldb/trunk/include/lldb/Interpreter/Args.h
lldb/trunk/source/Interpreter/Args.cpp
lldb/trunk/source/Interpreter/CommandAlias.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/include/lldb/Interpreter/Args.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=283159=283158=283159=diff
==
--- lldb/trunk/include/lldb/Interpreter/Args.h (original)
+++ lldb/trunk/include/lldb/Interpreter/Args.h Mon Oct  3 18:20:36 2016
@@ -27,9 +27,7 @@
 
 namespace lldb_private {
 
-typedef std::pair OptionArgValue;
-typedef std::pair OptionArgPair;
-typedef std::vector OptionArgVector;
+typedef std::vector> OptionArgVector;
 typedef std::shared_ptr OptionArgVectorSP;
 
 struct OptionArgElement {

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=283159=283158=283159=diff
==
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Mon Oct  3 18:20:36 2016
@@ -1015,6 +1015,7 @@ void Args::ParseAliasOptions(Options 
 
   std::unique_lock lock;
   OptionParser::Prepare(lock);
+  result.SetStatus(eReturnStatusSuccessFinishNoResult);
   int val;
   while (1) {
 int long_options_index = -1;
@@ -1049,95 +1050,73 @@ void Args::ParseAliasOptions(Options 
 }
 
 // See if the option takes an argument, and see if one was supplied.
-if (long_options_index >= 0) {
-  StreamString option_str;
-  option_str.Printf("-%c", val);
-  const OptionDefinition *def = 
long_options[long_options_index].definition;
-  int has_arg =
-  (def == nullptr) ? OptionParser::eNoArgument : def->option_has_arg;
-
-  switch (has_arg) {
-  case OptionParser::eNoArgument:
-option_arg_vector->push_back(OptionArgPair(
-std::string(option_str.GetData()),
-OptionArgValue(OptionParser::eNoArgument, "")));
-result.SetStatus(eReturnStatusSuccessFinishNoResult);
-break;
-  case OptionParser::eRequiredArgument:
-if (OptionParser::GetOptionArgument() != nullptr) {
-  option_arg_vector->push_back(OptionArgPair(
-  std::string(option_str.GetData()),
-  OptionArgValue(OptionParser::eRequiredArgument,
- std::string(OptionParser::GetOptionArgument();
-  result.SetStatus(eReturnStatusSuccessFinishNoResult);
-} else {
-  result.AppendErrorWithFormat(
-  "Option '%s' is missing argument specifier.\n",
-  option_str.GetData());
-  result.SetStatus(eReturnStatusFailed);
-}
-break;
-  case OptionParser::eOptionalArgument:
-if (OptionParser::GetOptionArgument() != nullptr) {
-  option_arg_vector->push_back(OptionArgPair(
-  std::string(option_str.GetData()),
-  OptionArgValue(OptionParser::eOptionalArgument,
- std::string(OptionParser::GetOptionArgument();
-  result.SetStatus(eReturnStatusSuccessFinishNoResult);
-} else {
-  option_arg_vector->push_back(
-  OptionArgPair(std::string(option_str.GetData()),
-OptionArgValue(OptionParser::eOptionalArgument,
-   "")));
-  result.SetStatus(eReturnStatusSuccessFinishNoResult);
-}
-break;
-  default:
-result.AppendErrorWithFormat("error with options table; invalid value "
- "in has_arg field for option '%c'.\n",
- val);
-result.SetStatus(eReturnStatusFailed);
-break;
-  }
-} else {
+if (long_options_index == -1) {
   result.AppendErrorWithFormat("Invalid option with value '%c'.\n", val);
   result.SetStatus(eReturnStatusFailed);
+  return;
 }
 
-if (long_options_index >= 0) {
-  // Find option in the argument list; also see if it was supposed to take
-  // an argument and if one was
-  // supplied.  Remove option (and argument, if given) from the argument
-  // list.  Also remove them from
-  // the raw_input_string, if one was passed in.
-  size_t idx = FindArgumentIndexForOption(long_options, 
long_options_index);
-  if (idx < GetArgumentCount()) {
+StreamString option_str;
+

[Lldb-commits] [lldb] r283157 - Refactor the Args class.

2016-10-03 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Oct  3 17:51:09 2016
New Revision: 283157

URL: http://llvm.org/viewvc/llvm-project?rev=283157=rev
Log:
Refactor the Args class.

There were a number of issues with the Args class preventing
efficient use of strings and incoporating LLVM's StringRef class.
The two biggest were:

1. Backing memory stored in a std::string, so we would frequently
   have to use const_cast to get a mutable buffer for passing to
   various low level APIs.
2. backing std::strings stored in a std::list, which doesn't
   provide random access.

I wanted to solve these two issues so that we could provide
StringRef access to the underlying arguments, and also a way
to provide range-based access to the underlying argument array
while still providing convenient c-style access via an argv style
const char**.

The solution here is to store arguments in a single "entry" class
which contains the backing memory, a StringRef with precomputed
length, and the quote char.  The backing memory is a manually
allocated const char* so that it is not invalidated when the
container is resized, and there is a separate argv array provided
for c-style access.

Differential revision: https://reviews.llvm.org/D25099

Modified:
lldb/trunk/include/lldb/Interpreter/Args.h
lldb/trunk/source/Core/Logging.cpp
lldb/trunk/source/Core/StringList.cpp
lldb/trunk/source/Interpreter/Args.cpp
lldb/trunk/unittests/Interpreter/TestArgs.cpp

Modified: lldb/trunk/include/lldb/Interpreter/Args.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=283157=283156=283157=diff
==
--- lldb/trunk/include/lldb/Interpreter/Args.h (original)
+++ lldb/trunk/include/lldb/Interpreter/Args.h Mon Oct  3 17:51:09 2016
@@ -58,6 +58,22 @@ typedef std::vector Op
 //--
 class Args {
 public:
+  struct ArgEntry {
+  private:
+friend class Args;
+std::unique_ptr ptr;
+
+char *data() { return ptr.get(); }
+
+  public:
+ArgEntry() = default;
+ArgEntry(llvm::StringRef str, char quote);
+
+llvm::StringRef ref;
+char quote;
+const char *c_str() const { return ptr.get(); }
+  };
+
   //--
   /// Construct with an option command string.
   ///
@@ -71,7 +87,7 @@ public:
 
   Args(const Args );
 
-  const Args =(const Args );
+  Args =(const Args );
 
   //--
   /// Destructor.
@@ -186,50 +202,6 @@ public:
 
   void AppendArguments(const char **argv);
 
-  // Delete const char* versions of StringRef functions.  Normally this would
-  // not be necessary, as const char * is implicitly convertible to StringRef.
-  // However, since the use of const char* is so pervasive, and since StringRef
-  // will assert if you try to construct one from nullptr, this allows the
-  // compiler to catch instances of the function being invoked with a
-  // const char *, allowing us to replace them with explicit conversions at 
each
-  // call-site.  This ensures that no callsites slip through the cracks where
-  // we would be trying to implicitly convert from nullptr, since it will force
-  // us to evaluate and explicitly convert each one.
-  //
-  // Once StringRef use becomes more pervasive, there will be fewer
-  // implicit conversions because we will be using StringRefs across the whole
-  // pipeline, so we won't have to have this "glue" that converts between the
-  // two, and at that point it becomes easy to just make sure you don't pass
-  // nullptr into the function on the odd occasion that you do pass a
-  // const char *.
-  // Call-site fixing methodology:
-  //   1. If you know the string cannot be null (e.g. it's a const char[], or
-  //  it's been checked for null), use llvm::StringRef(ptr).
-  //   2. If you don't know if it can be null (e.g. it's returned from a
-  //  function whose semantics are unclear), use
-  //  llvm::StringRef::withNullAsEmpty(ptr).
-  //   3. If it's .c_str() of a std::string, just pass the std::string 
directly.
-  //   4. If it's .str().c_str() of a StringRef, just pass the StringRef
-  //  directly.
-  void ReplaceArgumentAtIndex(size_t, const char *, char = '\0') = delete;
-  void AppendArgument(const char *arg_str, char quote_char = '\0') = delete;
-  void InsertArgumentAtIndex(size_t, const char *, char = '\0') = delete;
-  static bool StringToBoolean(const char *, bool, bool *) = delete;
-  static lldb::ScriptLanguage
-  StringToScriptLanguage(const char *, lldb::ScriptLanguage, bool *) = delete;
-  static lldb::Encoding
-  StringToEncoding(const char *,
-   lldb::Encoding = lldb::eEncodingInvalid) = delete;
-  static uint32_t StringToGenericRegister(const char *) = delete;
-  static bool StringToVersion(const char *, uint32_t &, uint32_t &,
-

[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

I also just added a test case to validate we get a non-None answer to test 
instance self.id() calls.  We use it in several places, so might as well make 
that explicit.

That went in as r283156.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [lldb] r283156 - add a simple test case to validate test id()

2016-10-03 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Mon Oct  3 17:49:13 2016
New Revision: 283156

URL: http://llvm.org/viewvc/llvm-project?rev=283156=rev
Log:
add a simple test case to validate test id()

Since we count on it in a few places, the test verifies that the
test instance has an id() method that returns something non-None.

Added:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/TestTestId.py

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/TestTestId.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/TestTestId.py?rev=283156=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/TestTestId.py 
(added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/testid/TestTestId.py 
Mon Oct  3 17:49:13 2016
@@ -0,0 +1,17 @@
+"""
+Add a test to verify our test instance returns something non-None for
+an id(). Other parts of the test running infrastructure are counting on this.
+"""
+
+from __future__ import print_function
+from lldbsuite.test.lldbtest import TestBase
+
+class TestIdTestCase(TestBase):
+
+NO_DEBUG_INFO_TESTCASE = True
+
+mydir = TestBase.compute_mydir(__file__)
+
+def test_id_exists(self):
+self.assertIsNotNone(self.id(), "Test instance should have an id()")
+


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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Much better.  I see you found test.id(), which gets as the 
module.class.test_method setup.  That will be unique.

Thanks!  LGTM.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 73363.
fjricci added a comment.

Fix typo


https://reviews.llvm.org/D24988

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,8 +18,6 @@
 # Third-party modules
 import unittest2
 
-from unittest2.util import strclass
-
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -139,8 +137,7 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +158,7 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +232,7 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addExpectedFailure(test, err, None)
 return
 
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,7 +96,7 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
-group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+group.add_argument('--excluded', metavar='exclusion-file', action='append', help=textwrap.dedent(
 '''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
-parseExclusion(args.excluded)
+for excl_file in args.excluded:
+  

[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 73362.
fjricci added a comment.

Match against filename + test case + method name


https://reviews.llvm.org/D24988

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,8 +18,6 @@
 # Third-party modules
 import unittest2
 
-from unittest2.util import strclass
-
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -139,8 +137,7 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +158,7 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +232,7 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.addExpectedFailure(test, err, None)
 return
 
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,7 +96,7 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
-group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+group.add_argument('--excluded', metavar='exclusion-file', action='append', help=textwrap.dedent(
 '''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
-parseExclusion(args.excluded)
+for 

Re: [Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Zachary Turner via lldb-commits
Thanks, I'll fix it up before submitting
On Mon, Oct 3, 2016 at 2:40 PM Jim Ingham  wrote:

> jingham added a comment.
>
> You messed up the meaning of one comment (noted inline).  Otherwise this
> looks fine to me too.
>
>
>
> > Args.cpp:97-98
> > +  // Argument can be split into multiple discontiguous pieces, for
> example:
> > +  //  "Hello " "World"
> > +  // this would result in a single argument "Hello World" (without the
> quotes)
> > +  // since the quotes would be removed and there is not space between
> the
>
> The example needs to be "Hello ""World" or it doesn't make sense.  "Hello
> " "World" with a space in between would be two arguments.
>
> https://reviews.llvm.org/D25099
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

In https://reviews.llvm.org/D24988#559775, @tfiala wrote:

> In https://reviews.llvm.org/D24988#559314, @fjricci wrote:
>
> > For an example of something that couldn't be disabled with the original 
> > implementation, consider a test like:
> >
> > `CreateDuringStepTestCase.test_step_inst`
> >
> > Disabling by method name (`test_step_inst`) would also disable 
> > `CreateDuringInstructionStepTestCase.test_step_inst`.
>
>
> I see what you're saying there.
>
> The part you're missing is that the Test Case class name itself does not have 
> to be unique, either.  i.e. You *can* have two CreateDuringStepTestCase 
> classes in different files.  Nothing uniquifies at that level.


Ahh, I see. I didn't realize that we could have duplication in the test case 
names as well.

> That is why I'm saying you need to include the module name, which comes from 
> the filename, or have it be something like FileBaseName:TestCase.test_method. 
> I have to do this in the test runner architecture for this very reason. And 
> you will find at least some test cases that are cut and pasted and therefore 
> have duplicate test case names (at least, they used to exist, and nothing 
> enforces them being different in the runner logic).

I'll try this then.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Jim Ingham via lldb-commits
jingham added a comment.

You messed up the meaning of one comment (noted inline).  Otherwise this looks 
fine to me too.



> Args.cpp:97-98
> +  // Argument can be split into multiple discontiguous pieces, for example:
> +  //  "Hello " "World"
> +  // this would result in a single argument "Hello World" (without the 
> quotes)
> +  // since the quotes would be removed and there is not space between the

The example needs to be "Hello ""World" or it doesn't make sense.  "Hello " 
"World" with a space in between would be two arguments.

https://reviews.llvm.org/D25099



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


Re: [Lldb-commits] [lldb] r282966 - IsValid is the way to ask a breakpoint location whether it is valid.

2016-10-03 Thread Jim Ingham via lldb-commits
Ah, okay, thanks!

Jim

> On Oct 3, 2016, at 1:44 PM, Pavel Labath  wrote:
> 
> The test fails on remote targets because it tries to set breakpoints based on 
> remote paths. We'll have that fixed shortly.
> 
> On 3 October 2016 at 11:13, Jim Ingham via lldb-commits 
>  wrote:
> These tests were failing for a bogus reason, so I fixed the bogus reason and 
> let them try again.  They succeed on MacOS, but apparently there's another 
> failure reason for these configurations.
> 
> Do you know the configuration for (in terms of the testsuite's "oslist"?  If 
> not, I'll find out what to xfail.
> 
> Jim
> 
> 
> 
> > On Oct 3, 2016, at 3:12 AM, Dimitar Vlahovski  wrote:
> >
> > Hi,
> > Are these build breakages somehow connected to this commit?
> > http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/8703
> > http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-android/builds/9655
> >
> > Thanks,
> > Dimitar
> >
> > On Fri, Sep 30, 2016 at 11:07 PM, Jim Ingham via lldb-commits 
> >  wrote:
> > Author: jingham
> > Date: Fri Sep 30 17:07:41 2016
> > New Revision: 282966
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=282966=rev
> > Log:
> > IsValid is the way to ask a breakpoint location whether it is valid.
> >
> > Modified:
> > 
> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> >
> > Modified: 
> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> > URL: 
> > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py?rev=282966=282965=282966=diff
> > ==
> > --- 
> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> >  (original)
> > +++ 
> > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> >  Fri Sep 30 17:07:41 2016
> > @@ -27,7 +27,7 @@ class BreakpointCaseSensitivityTestCase(
> >
> >  @skipIf(oslist=['windows'])  # Skip for windows platforms
> >  # Failing for unknown reason on non-Windows platforms.
> > -@expectedFailureAll()
> > +
> >  def test_breakpoint_doesnt_match_file_with_different_case(self):
> >  """Set breakpoint on file, shouldn't match files with different 
> > case on POSIX systems"""
> >  self.build()
> > @@ -98,7 +98,8 @@ class BreakpointCaseSensitivityTestCase(
> >  # Get the breakpoint location from breakpoint after we verified 
> > that,
> >  # indeed, it has one location.
> >  location = breakpoint.GetLocationAtIndex(0)
> > -self.assertEqual(location and location.IsEnabled(),
> > +
> > +self.assertEqual(location.IsValid(),
> >   should_hit,
> >   VALID_BREAKPOINT_LOCATION + desc)
> >
> >
> >
> > ___
> > lldb-commits mailing list
> > lldb-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> >
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 

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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In https://reviews.llvm.org/D24988#559314, @fjricci wrote:

> For an example of something that couldn't be disabled with the original 
> implementation, consider a test like:
>
> `CreateDuringStepTestCase.test_step_inst`
>
> Disabling by method name (`test_step_inst`) would also disable 
> `CreateDuringInstructionStepTestCase.test_step_inst`.


I see what you're saying there.

The part you're missing is that the Test Case class name itself does not have 
to be unique, either.  i.e. You *can* have two CreateDuringStepTestCase classes 
in different files.  Nothing uniquifies at that level.

You can convince yourself of this by doing what I just did:

$ cd packages/Python/lldbsuite/test
$ cp -r driver/batch_mode deleteme

now you have tests/deleteme with contents of batch_mode
===

$ cd deleteme
$ cp TestBatchMode.py TestBatchMode2.py

Now you have two files with the same exact contents, both of which will run 
just fine.  i.e. you're still not unique with test case names - they can be the 
same.
=

edit Makefile to fix the redirection back to the master makefile rules
==

run the test suite and tell it to run deleteme dir
==

test/dotest.py --test-subdir deleteme

You'll get results like this:

  $ test/dotest.py --executable `pwd`/build/Debug/lldb --test-subdir deleteme
  Testing: 2 test suites, 8 threads
  2 out of 2 test suites processed - TestBatchMode2.py
  ===
  Test Result Summary
  ===
  Test Methods: 18
  Reruns:0
  Success:  18
  Expected Failure:  0
  Failure:   0
  Error: 0
  Exceptional Exit:  0
  Unexpected Success:0
  Skip:  0
  Timeout:   0
  Expected Timeout:  0

That is why I'm saying you need to include the module name, which comes from 
the filename, or have it be something like FileBaseName:TestCase.test_method.  
I have to do this in the test runner architecture for this very reason.  And 
you will find at least some test cases that are cut and pasted and therefore 
have duplicate test case names (at least, they used to exist, and nothing 
enforces them being different in the runner logic).


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added inline comments.


> labath wrote in TestMiniDumpNew.py:19
> You can replace these with `NO_DEBUG_INFO_TESTCASE = True` at class level.

But, should `test_deeper_stack_in_mini_dump` and 
`test_local_variables_in_mini_dump` not have this decorator ?

https://reviews.llvm.org/D25196



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


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

That works fine.

LGTM.


https://reviews.llvm.org/D25099



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


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In https://reviews.llvm.org/D25099#559701, @zturner wrote:

> I know what this is.  It should be fixed in this patch, I guess I didn't have 
> the newest patch uploaded.


Okay, I'll give that a shot now.


https://reviews.llvm.org/D25099



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


Re: [Lldb-commits] [lldb] r282966 - IsValid is the way to ask a breakpoint location whether it is valid.

2016-10-03 Thread Pavel Labath via lldb-commits
The test fails on remote targets because it tries to set breakpoints based
on remote paths. We'll have that fixed shortly.

On 3 October 2016 at 11:13, Jim Ingham via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> These tests were failing for a bogus reason, so I fixed the bogus reason
> and let them try again.  They succeed on MacOS, but apparently there's
> another failure reason for these configurations.
>
> Do you know the configuration for (in terms of the testsuite's "oslist"?
> If not, I'll find out what to xfail.
>
> Jim
>
>
>
> > On Oct 3, 2016, at 3:12 AM, Dimitar Vlahovski 
> wrote:
> >
> > Hi,
> > Are these build breakages somehow connected to this commit?
> > http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/8703
> > http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-
> 14.04-android/builds/9655
> >
> > Thanks,
> > Dimitar
> >
> > On Fri, Sep 30, 2016 at 11:07 PM, Jim Ingham via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
> > Author: jingham
> > Date: Fri Sep 30 17:07:41 2016
> > New Revision: 282966
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=282966=rev
> > Log:
> > IsValid is the way to ask a breakpoint location whether it is valid.
> >
> > Modified:
> > lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/breakpoint/breakpoint_case_sensitivity/
> TestBreakpointCaseSensitivity.py
> >
> > Modified: lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/breakpoint/breakpoint_case_sensitivity/
> TestBreakpointCaseSensitivity.py
> > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/breakpoint/
> breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.
> py?rev=282966=282965=282966=diff
> > 
> ==
> > --- lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/breakpoint/breakpoint_case_sensitivity/
> TestBreakpointCaseSensitivity.py (original)
> > +++ lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/breakpoint/breakpoint_case_sensitivity/
> TestBreakpointCaseSensitivity.py Fri Sep 30 17:07:41 2016
> > @@ -27,7 +27,7 @@ class BreakpointCaseSensitivityTestCase(
> >
> >  @skipIf(oslist=['windows'])  # Skip for windows platforms
> >  # Failing for unknown reason on non-Windows platforms.
> > -@expectedFailureAll()
> > +
> >  def test_breakpoint_doesnt_match_file_with_different_case(self):
> >  """Set breakpoint on file, shouldn't match files with different
> case on POSIX systems"""
> >  self.build()
> > @@ -98,7 +98,8 @@ class BreakpointCaseSensitivityTestCase(
> >  # Get the breakpoint location from breakpoint after we verified
> that,
> >  # indeed, it has one location.
> >  location = breakpoint.GetLocationAtIndex(0)
> > -self.assertEqual(location and location.IsEnabled(),
> > +
> > +self.assertEqual(location.IsValid(),
> >   should_hit,
> >   VALID_BREAKPOINT_LOCATION + desc)
> >
> >
> >
> > ___
> > lldb-commits mailing list
> > lldb-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> >
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 73335.
zturner added a comment.

I know what this is.  It should be fixed in this patch, I guess I didn't have 
the newest patch uploaded.


https://reviews.llvm.org/D25099

Files:
  include/lldb/Interpreter/Args.h
  source/Core/Logging.cpp
  source/Core/StringList.cpp
  source/Interpreter/Args.cpp
  unittests/Interpreter/TestArgs.cpp

Index: unittests/Interpreter/TestArgs.cpp
===
--- unittests/Interpreter/TestArgs.cpp
+++ unittests/Interpreter/TestArgs.cpp
@@ -66,6 +66,109 @@
   EXPECT_STREQ(args.GetArgumentAtIndex(1), "second_arg");
 }
 
+TEST(ArgsTest, TestInsertArg) {
+  Args args;
+  args.AppendArgument("1");
+  args.AppendArgument("2");
+  args.AppendArgument("3");
+  args.InsertArgumentAtIndex(1, "1.5");
+  args.InsertArgumentAtIndex(4, "3.5");
+
+  ASSERT_EQ(5u, args.GetArgumentCount());
+  EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+  EXPECT_STREQ("1.5", args.GetArgumentAtIndex(1));
+  EXPECT_STREQ("2", args.GetArgumentAtIndex(2));
+  EXPECT_STREQ("3", args.GetArgumentAtIndex(3));
+  EXPECT_STREQ("3.5", args.GetArgumentAtIndex(4));
+}
+
+TEST(ArgsTest, TestArgv) {
+  Args args;
+  EXPECT_EQ(nullptr, args.GetArgumentVector());
+
+  args.AppendArgument("1");
+  EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[1]);
+
+  args.AppendArgument("2");
+  EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
+
+  args.AppendArgument("3");
+  EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[3]);
+
+  args.InsertArgumentAtIndex(1, "1.5");
+  EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
+
+  args.InsertArgumentAtIndex(4, "3.5");
+  EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
+  EXPECT_NE(nullptr, args.GetArgumentVector()[4]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[5]);
+}
+
+TEST(ArgsTest, GetQuotedCommandString) {
+  Args args;
+  const char *str = "process launch -o stdout.txt -- \"a b c\"";
+  args.SetCommandString(str);
+
+  std::string stdstr;
+  ASSERT_TRUE(args.GetQuotedCommandString(stdstr));
+  EXPECT_EQ(str, stdstr);
+}
+
+TEST(ArgsTest, BareSingleQuote) {
+  Args args;
+  args.SetCommandString("a\\'b");
+  EXPECT_EQ(1u, args.GetArgumentCount());
+
+  EXPECT_STREQ("a'b", args.GetArgumentAtIndex(0));
+}
+
+TEST(ArgsTest, DoubleQuotedItem) {
+  Args args;
+  args.SetCommandString("\"a b c\"");
+  EXPECT_EQ(1u, args.GetArgumentCount());
+
+  EXPECT_STREQ("a b c", args.GetArgumentAtIndex(0));
+}
+
+TEST(ArgsTest, AppendArguments) {
+  Args args;
+  const char *argv[] = {"1", "2", nullptr};
+  const char *argv2[] = {"3", "4", nullptr};
+
+  args.AppendArguments(argv);
+  ASSERT_EQ(2u, args.GetArgumentCount());
+  EXPECT_STREQ("1", args.GetArgumentVector()[0]);
+  EXPECT_STREQ("2", args.GetArgumentVector()[1]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
+  EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+  EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
+
+  args.AppendArguments(argv2);
+  ASSERT_EQ(4u, args.GetArgumentCount());
+  EXPECT_STREQ("1", args.GetArgumentVector()[0]);
+  EXPECT_STREQ("2", args.GetArgumentVector()[1]);
+  EXPECT_STREQ("3", args.GetArgumentVector()[2]);
+  EXPECT_STREQ("4", args.GetArgumentVector()[3]);
+  EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
+  EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+  EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
+  EXPECT_STREQ("3", args.GetArgumentAtIndex(2));
+  EXPECT_STREQ("4", args.GetArgumentAtIndex(3));
+}
+
 TEST(ArgsTest, StringToBoolean) {
   bool success = false;
   EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("true"), false, nullptr));
Index: source/Interpreter/Args.cpp
===
--- source/Interpreter/Args.cpp
+++ source/Interpreter/Args.cpp
@@ -25,95 +25,12 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringSwitch.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-//--
-// Args constructor
-//--
-Args::Args(llvm::StringRef command) : m_args(), m_argv(), m_args_quote_char() {
-  SetCommandString(command);
-}
-

[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added a comment.

In https://reviews.llvm.org/D25196#559368, @amccarth wrote:

> I was hoping that, with your new mini dump parser, you'd be able to eliminate 
> the need for the Windows-specific minidump process plugin.
>
> When I wrote the Windows mini dump plugin, I tried to isolate the Windows 
> API-specific bits using the pimpl idiom.  Now that you've written a mini dump 
> parser, we shouldn't need the Windows API calls, and nearly all the rest of 
> the code should be shareable between Windows and Linux.  Is there a plan to 
> eliminate this redundancy and merge this new mini dump process plugin with 
> the Windows-specific one?


Yes, the plan is that my plugin will replace the Windows one. (and it has 
almost the same functionality)

What I have been doing so far is actually copying all of the methods from the 
WinMinidump plugin to mine and changing them to use the new Minidump parser.

Probably I could have fitted into you pimpl implementation pattern, but I chose 
just to start a 'new' plugin and copy everything from the WinMinidump, and then 
change it accordingly.


https://reviews.llvm.org/D25196



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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added inline comments.


> labath wrote in ProcessMinidump.cpp:67
> It already is return true.
> 
> Is that correct?

What I meant here is: is there functionality that needs to be added here.
In the WinMinidump plugin, this method is only returning true (as mine) and has 
a TODO saying that it should have actual logic in it

https://reviews.llvm.org/D25196



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


Re: [Lldb-commits] [lldb] r282966 - IsValid is the way to ask a breakpoint location whether it is valid.

2016-10-03 Thread Jim Ingham via lldb-commits
These tests were failing for a bogus reason, so I fixed the bogus reason and 
let them try again.  They succeed on MacOS, but apparently there's another 
failure reason for these configurations.

Do you know the configuration for (in terms of the testsuite's "oslist"?  If 
not, I'll find out what to xfail.

Jim
 


> On Oct 3, 2016, at 3:12 AM, Dimitar Vlahovski  wrote:
> 
> Hi,
> Are these build breakages somehow connected to this commit?
> http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/8703
> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-android/builds/9655
> 
> Thanks,
> Dimitar
> 
> On Fri, Sep 30, 2016 at 11:07 PM, Jim Ingham via lldb-commits 
>  wrote:
> Author: jingham
> Date: Fri Sep 30 17:07:41 2016
> New Revision: 282966
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=282966=rev
> Log:
> IsValid is the way to ask a breakpoint location whether it is valid.
> 
> Modified:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> 
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py?rev=282966=282965=282966=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
>  Fri Sep 30 17:07:41 2016
> @@ -27,7 +27,7 @@ class BreakpointCaseSensitivityTestCase(
> 
>  @skipIf(oslist=['windows'])  # Skip for windows platforms
>  # Failing for unknown reason on non-Windows platforms.
> -@expectedFailureAll()
> +
>  def test_breakpoint_doesnt_match_file_with_different_case(self):
>  """Set breakpoint on file, shouldn't match files with different case 
> on POSIX systems"""
>  self.build()
> @@ -98,7 +98,8 @@ class BreakpointCaseSensitivityTestCase(
>  # Get the breakpoint location from breakpoint after we verified that,
>  # indeed, it has one location.
>  location = breakpoint.GetLocationAtIndex(0)
> -self.assertEqual(location and location.IsEnabled(),
> +
> +self.assertEqual(location.IsValid(),
>   should_hit,
>   VALID_BREAKPOINT_LOCATION + desc)
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 

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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

I was hoping that, with your new mini dump parser, you'd be able to eliminate 
the need for the Windows-specific minidump process plugin.

When I wrote the Windows mini dump plugin, I tried to isolate the Windows 
API-specific bits using the pimpl idiom.  Now that you've written a mini dump 
parser, we shouldn't need the Windows API calls, and nearly all the rest of the 
code should be shareable between Windows and Linux.  Is there a plan to 
eliminate this redundancy and merge this new mini dump process plugin with the 
Windows-specific one?


https://reviews.llvm.org/D25196



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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Pavel Labath via lldb-commits
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

I have a bunch of small comments. I'll have another look through this once they 
are done.

The high-level change we need is to avoid choosing the plugin to use at 
compile-time (your plugin should be host independent, so-lets use it 
everywhere). Since you still don't have full feature parity with the windows 
plugin, add a runtime check, which makes sure that your plugin does not kick in 
for windows minidump files.  Once you have feature parity, we can remove that 
check and ask Zachary and Adrian to validate everything still works as they 
expect.



> TestMiniDumpNew.py:19
> +
> +@no_debug_info_test
> +def test_process_info_in_mini_dump(self):

You can replace these with `NO_DEBUG_INFO_TESTCASE = True` at class level.

> TestMiniDumpNew.py:66
> +
> +@not_remote_testsuite_ready
> +def test_deeper_stack_in_mini_dump(self):

I don't think these are necessary.

> MinidumpParser.cpp:228
> +
> +bool MinidumpParser::FindMemoryRange(lldb::addr_t addr, Range *range_out) {
> +  llvm::ArrayRef data = GetStream(MinidumpStreamType::MemoryList);

Return `llvm::Optional` ?

> MinidumpParser.h:36
> +  lldb::addr_t start; // virtual address of the beginning of the range
> +  size_t size;// size of the range in bytes
> +  const uint8_t *ptr; // absolute pointer to the first byte of the range

Make these two an ArrayRef ?

> ProcessMinidump.cpp:47
> +  lldb::ProcessSP process_sp;
> +  if (crash_file) {
> +// Read enough data for the Minidump header

Please rewrite this to use the early-return style:

  if (!crash_file)
return nullptr;

etc.

> ProcessMinidump.cpp:55
> +
> +if (data_sp && data_sp->GetByteSize() == header_size && header != 
> nullptr) {
> +  lldb::DataBufferSP all_data_sp(crash_file->MemoryMapFileContents());

the check for non-nullness of `data_sp` is superfluous (or too late).

> ProcessMinidump.cpp:67
> +
> +// TODO leave it to be only "return true" ?
> +bool ProcessMinidump::CanDebug(lldb::TargetSP target_sp,

It already is return true.

Is that correct?

> ProcessMinidump.cpp:121
> +
> +// TODO is this ok? copied from gdb-remote
> +DynamicLoader *ProcessMinidump::GetDynamicLoader() {

I think it is. You can remove the TODO.

> ThreadMinidump.cpp:37
> +: Thread(process, td.thread_id), m_thread_reg_ctx_sp(), 
> m_gpregset_data() {
> +  ProcessMinidump *process_ =
> +  static_cast(GetProcess().get());

If you make the constructor take a `ProcessMinidump &` you can avoid this cast. 
(although, if we change the code below, you may not even need it).

> ThreadMinidump.cpp:39
> +  static_cast(GetProcess().get());
> +  llvm::ArrayRef 
> arr_ref(process_->m_minidump_parser.GetData().data() +
> +  td.thread_context.rva,

This should be implemented inside the minidump parser. There's no reason for 
doing memory slicing at this level.

> ThreadMinidump.cpp:48
> +ThreadMinidump::~ThreadMinidump() {
> +  // TODO should we use this? WinMinidump doesn't use it but elf-core does
> +  DestroyThread();

If you don't know whether this is necessary, prefer simplicity and don't do it

> ThreadMinidump.cpp:66
> +RegisterContextSP ThreadMinidump::GetRegisterContext() {
> +  if (m_reg_context_sp.get() == NULL) {
> +m_reg_context_sp = CreateRegisterContextForFrame(NULL);

`if (!m_reg_context_sp)`

also use `nullptr` instead of `NULL`.

> ThreadMinidump.h:1
> +//===-- ThreadMinidump.-h ---*- C++ 
> -*-===//
> +//

typo (`-h`)

> MinidumpParserTest.cpp:142
>  
> +//TODO add tests for MemoryList parsing
> +

Please do this now.

https://reviews.llvm.org/D25196



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


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

I will test this on macOS.  I will have the results this afternoon.


https://reviews.llvm.org/D25099



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

For an example of something that couldn't be disabled with the original 
implementation, consider a test like:

`CreateDuringStepTestCase.test_step_inst`

Disabling by method name (`test_step_inst`) would also disable 
`CreateDuringInstructionStepTestCase.test_step_inst`.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

The problem with the existing code is that file names are required to be 
unique, but method names are not. So if the user wants to disable an individual 
test method with a non-unique name, there is no way to do so. This patch still 
allows the tests to be disabled by file name, but removes the ability to 
disable by only method name, instead requiring the method name as a modifier to 
the file.

I may have used the wrong terminology when I said .. 
Here, I meant essentially what is printed by the test runner when a test fails. 
So, for example:

`BadAddressBreakpointTestCase.test_bad_address_breakpoints_dwarf`
`LldbGdbServerTestCase.test_Hc_then_Csignal_signals_correct_thread_launch_llgs`

These names are guaranteed to be unique, and so I think they're the better way 
to go. The user can still disable an entire file, by passing something 
something like:

`TestConcurrentEvents`


https://reviews.llvm.org/D24988



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


Re: [Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Todd Fiala via lldb-commits
Yep I plan on doing that.

-Todd

> On Oct 3, 2016, at 10:29 AM, Zachary Turner  wrote:
> 
> He lgtm'ed my last patch, so I guess he's ok with the general concept.  
> Perhaps if someone could just run the test suite for me that would be good 
> enough.
> 
>> On Mon, Oct 3, 2016 at 10:25 AM Todd Fiala  wrote:
>> tfiala added a comment.
>> 
>> @zturner , Greg is out this week (and was last Friday as well).
>> 
>> I'll get somebody over here to review.
>> 
>> 
>> https://reviews.llvm.org/D25099
>> 
>> 
>> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added a comment.

So, there will be changes to the way I handle the case where there is no 
ExceptionStream - I will probably create a StopReason = None. But I have to 
investigate if in that case lldb still hangs because it's trying to resume a 
process (that does not exists). I will ask Jim Ingham about some insight about 
StopReasons


https://reviews.llvm.org/D25196



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


Re: [Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Zachary Turner via lldb-commits
He lgtm'ed my last patch, so I guess he's ok with the general concept.
Perhaps if someone could just run the test suite for me that would be good
enough.

On Mon, Oct 3, 2016 at 10:25 AM Todd Fiala  wrote:

> tfiala added a comment.
>
> @zturner , Greg is out this week (and was last Friday as well).
>
> I'll get somebody over here to review.
>
>
> https://reviews.llvm.org/D25099
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

@zturner , Greg is out this week (and was last Friday as well).

I'll get somebody over here to review.


https://reviews.llvm.org/D25099



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Hey @fjricci ,

What is the motivation for this change?  It looks like the existing code works 
based on file names, which are required to be unique in the system.  It looks 
like you're attempting to move it over to a classname.method scheme.  Is that 
right?  If so, classname.method is not guaranteed to be unique, either.  It 
would have to include the module name, which is essentially the file name, 
which is required to be unique.  (Maybe when you said ., 
your  element is fully qualified, including the module name?  If so, 
then that should be guaranteed to be unique).

All the same, I'd like to better understand what you're looking to accomplish, 
since what I'm reading in the description seems to be doing the opposite of 
what I think you're trying to do.  (I'm probably just misunderstanding).

Thanks!


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Since this is strictly an improvement and simplification, and won't break 
anyone's workflow because it's still a new feature, I'll plan on merging this 
tomorrow unless I hear any objections.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D25196: Adding a new Minidump post-mortem debugging plugin

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
dvlahovski created this revision.
dvlahovski added reviewers: labath, zturner.
dvlahovski added subscribers: lldb-commits, amccarth.
Herald added subscribers: modocache, mgorny, beanz.

This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.


https://reviews.llvm.org/D25196

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/Makefile
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.cpp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.dmp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.dmp
  source/API/SystemInitializerFull.cpp
  source/Plugins/Process/minidump/CMakeLists.txt
  source/Plugins/Process/minidump/MinidumpParser.cpp
  source/Plugins/Process/minidump/MinidumpParser.h
  source/Plugins/Process/minidump/MinidumpTypes.cpp
  source/Plugins/Process/minidump/MinidumpTypes.h
  source/Plugins/Process/minidump/ProcessMinidump.cpp
  source/Plugins/Process/minidump/ProcessMinidump.h
  source/Plugins/Process/minidump/ThreadMinidump.cpp
  source/Plugins/Process/minidump/ThreadMinidump.h
  unittests/Process/minidump/MinidumpParserTest.cpp

Index: unittests/Process/minidump/MinidumpParserTest.cpp
===
--- unittests/Process/minidump/MinidumpParserTest.cpp
+++ unittests/Process/minidump/MinidumpParserTest.cpp
@@ -139,6 +139,8 @@
   ASSERT_EQ(11UL, exception_stream->exception_record.exception_code);
 }
 
+//TODO add tests for MemoryList parsing
+
 // Windows Minidump tests
 // fizzbuzz_no_heap.dmp is copied from the WinMiniDump tests
 TEST_F(MinidumpParserTest, GetArchitectureWindows) {
@@ -172,7 +174,6 @@
 }
 
 // Register stuff
-// TODO probably split register stuff tests into different file?
 #define REG_VAL(x) *(reinterpret_cast(x))
 
 TEST_F(MinidumpParserTest, ConvertRegisterContext) {
Index: source/Plugins/Process/minidump/ThreadMinidump.h
===
--- /dev/null
+++ source/Plugins/Process/minidump/ThreadMinidump.h
@@ -0,0 +1,51 @@
+//===-- ThreadMinidump.-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_ThreadMinidump_h_
+#define liblldb_ThreadMinidump_h_
+
+// Project includes
+#include "MinidumpTypes.h"
+
+// Other libraries and framework includes
+#include "lldb/Target/Thread.h"
+
+// C Includes
+// C++ Includes
+
+namespace lldb_private {
+
+namespace minidump {
+
+class ThreadMinidump : public Thread {
+public:
+  ThreadMinidump(Process , const MinidumpThread );
+
+  ~ThreadMinidump() override;
+
+  void RefreshStateAfterStop() override;
+
+  lldb::RegisterContextSP GetRegisterContext() override;
+
+  lldb::RegisterContextSP
+  CreateRegisterContextForFrame(StackFrame *frame) override;
+
+  void ClearStackFrames() override;
+
+protected:
+  lldb::RegisterContextSP m_thread_reg_ctx_sp;
+  llvm::ArrayRef m_gpregset_data;
+
+  bool CalculateStopInfo() override;
+};
+
+} // namespace minidump
+} // namespace lldb_private
+
+#endif // liblldb_ThreadMinidump_h_
Index: source/Plugins/Process/minidump/ThreadMinidump.cpp
===
--- /dev/null
+++ source/Plugins/Process/minidump/ThreadMinidump.cpp
@@ -0,0 +1,121 @@
+//===-- ThreadMinidump.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// Project includes
+#include "ThreadMinidump.h"
+#include "ProcessMinidump.h"
+
+#include "RegisterContextMinidump_x86_64.h"
+
+// Other 

[Lldb-commits] [PATCH] D25099: Refactor Args a different way

2016-10-03 Thread Zachary Turner via lldb-commits
zturner added a comment.

Hi Greg, might you have a chance to look at this today?  I've got a huge 
backlog of CLs to get in.  The rest probably won't require reviews, but this 
one is a precursor to everything else.


https://reviews.llvm.org/D25099



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


[Lldb-commits] [PATCH] D24603: [LLDB][MIPS] fix Floating point register read/write for big endian

2016-10-03 Thread Nitesh Jain via lldb-commits
nitesh.jain updated this revision to Diff 73278.
nitesh.jain added a comment.

These diff remove manually bit twiddling due to the size of the floating point 
register that can change. We use register offset to get floating point register 
data based on endianess and it's size. We have not remove bit twiddling for MSA 
register since it's need to be tested( require support in ptrace).

Thanks


https://reviews.llvm.org/D24603

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
  source/Plugins/Process/Utility/RegisterInfos_mips.h
  source/Plugins/Process/Utility/RegisterInfos_mips64.h
  source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h

Index: source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h
===
--- source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h
+++ source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h
@@ -282,6 +282,84 @@
 k_num_fpr_registers_mips64 +
 k_num_msa_registers_mips64
 };
+
+// Register no. for RegisterKind = eRegisterKindProcessPlugin
+// The ptrace request PTRACE_PEEKUSER/PTRACE_POKEUSER used this number
+enum {
+  ptrace_zero_mips, 
+  ptrace_r1_mips,
+  ptrace_r2_mips,
+  ptrace_r3_mips,
+  ptrace_r4_mips,
+  ptrace_r5_mips,
+  ptrace_r6_mips,
+  ptrace_r7_mips,
+  ptrace_r8_mips,
+  ptrace_r9_mips,
+  ptrace_r10_mips,
+  ptrace_r11_mips,
+  ptrace_r12_mips,
+  ptrace_r13_mips,
+  ptrace_r14_mips,
+  ptrace_r15_mips,
+  ptrace_r16_mips,
+  ptrace_r17_mips,
+  ptrace_r18_mips,
+  ptrace_r19_mips,
+  ptrace_r20_mips,
+  ptrace_r21_mips,
+  ptrace_r22_mips,
+  ptrace_r23_mips,
+  ptrace_r24_mips,
+  ptrace_r25_mips,
+  ptrace_r26_mips,
+  ptrace_r27_mips,
+  ptrace_gp_mips,
+  ptrace_sp_mips,
+  ptrace_r30_mips,
+  ptrace_ra_mips,
+  ptrace_f0_mips,
+  ptrace_f1_mips,
+  ptrace_f2_mips,
+  ptrace_f3_mips,
+  ptrace_f4_mips,
+  ptrace_f5_mips,
+  ptrace_f6_mips,
+  ptrace_f7_mips,
+  ptrace_f8_mips,
+  ptrace_f9_mips,
+  ptrace_f10_mips,
+  ptrace_f11_mips,
+  ptrace_f12_mips,
+  ptrace_f13_mips,
+  ptrace_f14_mips,
+  ptrace_f15_mips,
+  ptrace_f16_mips,
+  ptrace_f17_mips,
+  ptrace_f18_mips,
+  ptrace_f19_mips,
+  ptrace_f20_mips,
+  ptrace_f21_mips,
+  ptrace_f22_mips,
+  ptrace_f23_mips,
+  ptrace_f24_mips,
+  ptrace_f25_mips,
+  ptrace_f26_mips,
+  ptrace_f27_mips,
+  ptrace_f28_mips,
+  ptrace_f29_mips,
+  ptrace_f30_mips,
+  ptrace_f31_mips,
+  ptrace_pc_mips,
+  ptrace_cause_mips,
+  ptrace_badvaddr_mips,
+  ptrace_mulhi_mips,
+  ptrace_mullo_mips,
+  ptrace_fcsr_mips,
+  ptrace_fir_mips,
+  ptrace_sr_mips,
+  ptrace_config5_mips
+};
 }
 
 #endif // #ifndef lldb_mips_linux_register_enums_h
Index: source/Plugins/Process/Utility/RegisterInfos_mips64.h
===
--- source/Plugins/Process/Utility/RegisterInfos_mips64.h
+++ source/Plugins/Process/Utility/RegisterInfos_mips64.h
@@ -42,11 +42,11 @@
 
 // Note that the size and offset will be updated by platform-specific classes.
 #ifdef LINUX_MIPS64
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4)   \
+#define DEFINE_GPR(reg, alt, kind1, kind2, kind3)  \
   {\
 #reg, alt, sizeof(((GPR_linux_mips *) 0)->reg),\
   GPR_OFFSET(reg), eEncodingUint, eFormatHex,  \
- {kind1, kind2, kind3, kind4,  \
+ {kind1, kind2, kind3, ptrace_##reg##_mips,\
   gpr_##reg##_mips64 },\
   NULL, NULL, NULL, 0  \
   }
@@ -61,11 +61,11 @@
   }
 #endif
 
-#define DEFINE_GPR_INFO(reg, alt, kind1, kind2, kind3, kind4)  \
+#define DEFINE_GPR_INFO(reg, alt, kind1, kind2, kind3) \
   {\
 #reg, alt, sizeof(((GPR_linux_mips *) 0)->reg) / 2,\
   GPR_OFFSET(reg), eEncodingUint, eFormatHex,  \
- {kind1, kind2, kind3, kind4,  \
+ {kind1, kind2, kind3, ptrace_##reg##_mips,\
   gpr_##reg##_mips64 },\
   NULL, NULL, NULL, 0  \
   }
@@ -75,21 +75,21 @@
 llvm::dwarf::DW_OP_lit26, llvm::dwarf::DW_OP_shl, llvm::dwarf::DW_OP_and,
 llvm::dwarf::DW_OP_lit26, llvm::dwarf::DW_OP_shr};
 
-#define DEFINE_FPR(reg, alt, kind1, kind2, kind3, kind4)   \
+#define DEFINE_FPR(reg, alt, kind1, 

Re: [Lldb-commits] [lldb] r282966 - IsValid is the way to ask a breakpoint location whether it is valid.

2016-10-03 Thread Dimitar Vlahovski via lldb-commits
Hi,
Are these build breakages somehow connected to this commit?
http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/8703
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-
14.04-android/builds/9655

Thanks,
Dimitar

On Fri, Sep 30, 2016 at 11:07 PM, Jim Ingham via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: jingham
> Date: Fri Sep 30 17:07:41 2016
> New Revision: 282966
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282966=rev
> Log:
> IsValid is the way to ask a breakpoint location whether it is valid.
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/
> breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/breakpoint/breakpoint_case_sensitivity/
> TestBreakpointCaseSensitivity.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/breakpoint/
> breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.
> py?rev=282966=282965=282966=diff
> 
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/
> breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/
> breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py Fri Sep 30
> 17:07:41 2016
> @@ -27,7 +27,7 @@ class BreakpointCaseSensitivityTestCase(
>
>  @skipIf(oslist=['windows'])  # Skip for windows platforms
>  # Failing for unknown reason on non-Windows platforms.
> -@expectedFailureAll()
> +
>  def test_breakpoint_doesnt_match_file_with_different_case(self):
>  """Set breakpoint on file, shouldn't match files with different
> case on POSIX systems"""
>  self.build()
> @@ -98,7 +98,8 @@ class BreakpointCaseSensitivityTestCase(
>  # Get the breakpoint location from breakpoint after we verified
> that,
>  # indeed, it has one location.
>  location = breakpoint.GetLocationAtIndex(0)
> -self.assertEqual(location and location.IsEnabled(),
> +
> +self.assertEqual(location.IsValid(),
>   should_hit,
>   VALID_BREAKPOINT_LOCATION + desc)
>
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-03 Thread Richard Chamberlain via lldb-commits
rnchamberlain added a comment.

More information, including readelf output from the dump, in the bugzilla here: 
https://llvm.org/bugs/show_bug.cgi?id=30485


https://reviews.llvm.org/D25179



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


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-03 Thread Richard Chamberlain via lldb-commits
rnchamberlain created this revision.
rnchamberlain added reviewers: clayborg, ted, hhellyer.
rnchamberlain added a subscriber: lldb-commits.

ObjectFileELF::RefineModuleDetailsFromNote() identifies Linux core dumps by 
searching for
 library paths starting with /lib/x86_64-linux-gnu or /lib/i386-linux-gnu. This 
change widens the
test to allow for linux installations which have addition directories in the 
path.


https://reviews.llvm.org/D25179

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,8 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.find("/lib/x86_64-linux-gnu") != llvm::StringRef::npos ||
+  path.find("/lib/i386-linux-gnu") != llvm::StringRef::npos) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,8 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.find("/lib/x86_64-linux-gnu") != llvm::StringRef::npos ||
+  path.find("/lib/i386-linux-gnu") != llvm::StringRef::npos) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits