Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Zachary Turner via lldb-commits
zturner added a comment.

In http://reviews.llvm.org/D14673#290280, @jingham wrote:

> If the problem is that the self of the test object doesn't always have a 
> debug_info setting, why not just always initialize it to None?  Seems weird 
> to have a general property like this that we don't initialize.


Gotta love Python.  But yea, that seems like a reasonable solution as well, and 
makes the code cleaner.

I'm still unsure if the change to the compiler here check was the result of a 
failure or just a drive-by change.  It always has a `getCompiler()` method 
right?  So why was that particular change needed?  Maybe it wasn't?


http://reviews.llvm.org/D14673



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


[Lldb-commits] [PATCH] D14718: Insert the SWIG version into LLDB's __init__.py

2015-11-16 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

The goal here is to allow us to add expectedFailure / etc decorators
based on SWIG version.

The end result of this is that patch is that after running SWIG generation
you will have a line such as the following at the top of your `__init__.py`.

swig_version = (3,0,7)


http://reviews.llvm.org/D14718

Files:
  scripts/Python/modify-python-lldb.py

Index: scripts/Python/modify-python-lldb.py
===
--- scripts/Python/modify-python-lldb.py
+++ scripts/Python/modify-python-lldb.py
@@ -44,6 +44,11 @@
 # print "output_name is '" + output_name + "'"
 
 #
+# Version string
+# 
+version_line = "swig_version = %s"
+
+#
 # Residues to be removed.
 #
 c_endif_swig = "#endif"
@@ -308,6 +313,9 @@
 with open(output_name, 'r') as f_in:
 content = f_in.read()
 
+# The pattern for recognizing the SWIG Version string
+version_pattern = re.compile("^# Version:? (.*)$")
+
 # The pattern for recognizing the beginning of an SB class definition.
 class_pattern = re.compile("^class (SB.*)\(_object\):$")
 
@@ -318,10 +326,11 @@
 isvalid_pattern = re.compile("^def IsValid\(")
 
 # These define the states of our finite state machine.
-NORMAL = 0
-DEFINING_ITERATOR = 1
-DEFINING_EQUALITY = 2
-CLEANUP_DOCSTRING = 4
+EXPECTING_VERSION = 0
+NORMAL = 1
+DEFINING_ITERATOR = 2
+DEFINING_EQUALITY = 4
+CLEANUP_DOCSTRING = 8
 
 # The lldb_iter_def only needs to be inserted once.
 lldb_iter_defined = False;
@@ -343,13 +352,16 @@
 # The FSM, in all possible states, also checks the current input for IsValid()
 # definition, and inserts a __nonzero__() method definition to implement truth
 # value testing and the built-in operation bool().
-state = NORMAL
+state = EXPECTING_VERSION
+
+swig_version_tuple = None
 for line in content.splitlines():
 # Handle the state transition into CLEANUP_DOCSTRING state as it is 
possible
 # to enter this state from either NORMAL or DEFINING_ITERATOR/EQUALITY.
 #
 # If '"""' is the sole line, prepare to transition to the
 # CLEANUP_DOCSTRING state or out of it.
+
 if line == toggle_docstring_cleanup_line:
 if state & CLEANUP_DOCSTRING:
 # Special handling of the trailing blank line right before the 
'"""'
@@ -359,6 +371,19 @@
 else:
 state |= CLEANUP_DOCSTRING
 
+if state == EXPECTING_VERSION:
+# We haven't read the version yet, read it now.
+if swig_version_tuple is None:
+match = version_pattern.search(line)
+if match:
+v = match.group(1)
+swig_version_tuple = tuple(map(int, (v.split("."
+elif not line.startswith('#'):
+# This is the first non-comment line after the header.  Inject the 
version
+new_line = version_line % str(swig_version_tuple)
+new_content.add_line(new_line)
+state = NORMAL
+
 if state == NORMAL:
 match = class_pattern.search(line)
 # Inserts lldb_helpers and the lldb_iter() definition before the first


Index: scripts/Python/modify-python-lldb.py
===
--- scripts/Python/modify-python-lldb.py
+++ scripts/Python/modify-python-lldb.py
@@ -44,6 +44,11 @@
 # print "output_name is '" + output_name + "'"
 
 #
+# Version string
+# 
+version_line = "swig_version = %s"
+
+#
 # Residues to be removed.
 #
 c_endif_swig = "#endif"
@@ -308,6 +313,9 @@
 with open(output_name, 'r') as f_in:
 content = f_in.read()
 
+# The pattern for recognizing the SWIG Version string
+version_pattern = re.compile("^# Version:? (.*)$")
+
 # The pattern for recognizing the beginning of an SB class definition.
 class_pattern = re.compile("^class (SB.*)\(_object\):$")
 
@@ -318,10 +326,11 @@
 isvalid_pattern = re.compile("^def IsValid\(")
 
 # These define the states of our finite state machine.
-NORMAL = 0
-DEFINING_ITERATOR = 1
-DEFINING_EQUALITY = 2
-CLEANUP_DOCSTRING = 4
+EXPECTING_VERSION = 0
+NORMAL = 1
+DEFINING_ITERATOR = 2
+DEFINING_EQUALITY = 4
+CLEANUP_DOCSTRING = 8
 
 # The lldb_iter_def only needs to be inserted once.
 lldb_iter_defined = False;
@@ -343,13 +352,16 @@
 # The FSM, in all possible states, also checks the current input for IsValid()
 # definition, and inserts a __nonzero__() method definition to implement truth
 # value testing and the built-in operation bool().
-state = NORMAL
+state = EXPECTING_VERSION
+
+swig_version_tuple = None
 for line in content.splitlines():
 # Handle the state transition into CLEANUP_DOCSTRING state as it is possible
 # to enter this state from either NORMAL or DEFINING_ITERATOR/EQUALITY.
 #
 # If '"""' is the sole line, prepare to transition to the
 # CLEANUP_DOCSTRING state or out of it.
+
 if line == toggle_docstring_cleanup_line:
 if state & 

Re: [Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

2015-11-16 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
This revision now requires changes to proceed.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1378
@@ -1377,2 +1377,3 @@
 GPR_linux_mips regs;
+lldb_private::ArchSpec arch;
 ::memset(, 0, sizeof(GPR_linux_mips));

tberghammer wrote:
> You use this variable without initializing it. You can call SetBytes with an 
> explicit byte order value (e.g. eByteOrderLittle) as it isn't matter during 0 
> initialization.
Remove this.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1382
@@ -1379,1 +1381,3 @@
+// Clear all bits in RegisterValue before writing actual value read from 
ptrace to avoid garbage value in 32-bit MSB 
+value.SetBytes((void *)(((unsigned char *)) + offset), 8, 
arch.GetByteOrder());
 Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, 
m_thread.GetID(), NULL, , sizeof regs);

Just call the member function GetByteOrder() that is built into 
NativeRegisterContextLinux:

```
value.SetBytes((void *)(((unsigned char *)) + offset), 8, GetByteOrder());
```


Repository:
  rL LLVM

http://reviews.llvm.org/D14633



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


Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Jim Ingham via lldb-commits
jingham added a comment.

If the problem is that the self of the test object doesn't always have a 
debug_info setting, why not just always initialize it to None?  Seems weird to 
have a general property like this that we don't initialize.


http://reviews.llvm.org/D14673



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


[Lldb-commits] [lldb] r253263 - Add the ability to xfail or skip based on swig / python version.

2015-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Nov 16 16:40:30 2015
New Revision: 253263

URL: http://llvm.org/viewvc/llvm-project?rev=253263=rev
Log:
Add the ability to xfail or skip based on swig / python version.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253263=253262=253263=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Nov 16 16:40:30 
2015
@@ -37,6 +37,7 @@ from __future__ import absolute_import
 # System modules
 import abc
 import collections
+from distutils.version import LooseVersion
 import gc
 import glob
 import os, sys, traceback
@@ -472,6 +473,29 @@ def android_device_api():
 ">>> stderr:\n%s\n" % (stdout, stderr))
 return android_device_api.result
 
+def check_expected_version(comparison, expected, actual):
+def fn_leq(x,y): return x <= y
+def fn_less(x,y): return x < y
+def fn_geq(x,y): return x >= y
+def fn_greater(x,y): return x > y
+def fn_eq(x,y): return x == y
+def fn_neq(x,y): return x != y
+
+op_lookup = {
+"==": fn_eq,
+"=": fn_eq,
+"!=": fn_neq,
+"<>": fn_neq,
+">": fn_greater,
+"<": fn_less,
+">=": fn_geq,
+"<=": fn_leq
+}
+expected_str = '.'.join([str(x) for x in expected])
+actual_str = '.'.join([str(x) for x in actual])
+
+return op_lookup[comparison](LooseVersion(actual_str), 
LooseVersion(expected_str))
+
 #
 # Decorators for categorizing test cases.
 #
@@ -620,13 +644,23 @@ def expectedFailure(expected_fn, bugnumb
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all 
platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
-def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None):
+def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None, 
swig_version=None, py_version=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
-self.expectedArch(archs) and
-(triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())) and
-(debug_info is None or self.debug_info in debug_info))
+oslist_passes = oslist is None or self.getPlatform() in oslist
+compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+arch_passes = self.expectedArch(archs)
+triple_passes = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
+debug_info_passes = debug_info is None or self.debug_info in debug_info
+swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
+py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
+
+return (oslist_passes and
+compiler_passes and
+arch_passes and
+triple_passes and
+debug_info_passes and
+swig_version_passes and
+py_version_passes)
 return expectedFailure(fn, bugnumber)
 
 def expectedFailureDwarf(bugnumber=None):
@@ -1048,12 +1082,21 @@ def skipIfLinuxClang(func):
 # @skipIf(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), skip for 
gcc>=4.9 on linux with i386
 
 # TODO: refactor current code, to make skipIfxxx functions to call this 
function
-def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, 
archs=None, debug_info=None):
+def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, 
archs=None, debug_info=None, swig_version=None, py_version=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
-self.expectedArch(archs) and
-(debug_info is None or self.debug_info in debug_info))
+oslist_passes = oslist is None or self.getPlatform() in oslist
+compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+arch_passes = 

[Lldb-commits] [lldb] r253262 - Insert the SWIG version into LLDB's __init__.py

2015-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Nov 16 16:40:20 2015
New Revision: 253262

URL: http://llvm.org/viewvc/llvm-project?rev=253262=rev
Log:
Insert the SWIG version into LLDB's __init__.py

The goal here is to allow us to add skip / xfail decorators
based on SWIG version.

Modified:
lldb/trunk/scripts/Python/modify-python-lldb.py

Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=253262=253261=253262=diff
==
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Mon Nov 16 16:40:20 2015
@@ -44,6 +44,11 @@ else:
 # print "output_name is '" + output_name + "'"
 
 #
+# Version string
+# 
+version_line = "swig_version = %s"
+
+#
 # Residues to be removed.
 #
 c_endif_swig = "#endif"
@@ -308,6 +313,9 @@ new_content = NewContent()
 with open(output_name, 'r') as f_in:
 content = f_in.read()
 
+# The pattern for recognizing the SWIG Version string
+version_pattern = re.compile("^# Version:? (.*)$")
+
 # The pattern for recognizing the beginning of an SB class definition.
 class_pattern = re.compile("^class (SB.*)\(_object\):$")
 
@@ -318,10 +326,11 @@ init_pattern = re.compile("^def __in
 isvalid_pattern = re.compile("^def IsValid\(")
 
 # These define the states of our finite state machine.
-NORMAL = 0
-DEFINING_ITERATOR = 1
-DEFINING_EQUALITY = 2
-CLEANUP_DOCSTRING = 4
+EXPECTING_VERSION = 0
+NORMAL = 1
+DEFINING_ITERATOR = 2
+DEFINING_EQUALITY = 4
+CLEANUP_DOCSTRING = 8
 
 # The lldb_iter_def only needs to be inserted once.
 lldb_iter_defined = False;
@@ -343,13 +352,16 @@ lldb_iter_defined = False;
 # The FSM, in all possible states, also checks the current input for IsValid()
 # definition, and inserts a __nonzero__() method definition to implement truth
 # value testing and the built-in operation bool().
-state = NORMAL
+state = EXPECTING_VERSION
+
+swig_version_tuple = None
 for line in content.splitlines():
 # Handle the state transition into CLEANUP_DOCSTRING state as it is 
possible
 # to enter this state from either NORMAL or DEFINING_ITERATOR/EQUALITY.
 #
 # If '"""' is the sole line, prepare to transition to the
 # CLEANUP_DOCSTRING state or out of it.
+
 if line == toggle_docstring_cleanup_line:
 if state & CLEANUP_DOCSTRING:
 # Special handling of the trailing blank line right before the 
'"""'
@@ -359,6 +371,19 @@ for line in content.splitlines():
 else:
 state |= CLEANUP_DOCSTRING
 
+if state == EXPECTING_VERSION:
+# We haven't read the version yet, read it now.
+if swig_version_tuple is None:
+match = version_pattern.search(line)
+if match:
+v = match.group(1)
+swig_version_tuple = tuple(map(int, (v.split("."
+elif not line.startswith('#'):
+# This is the first non-comment line after the header.  Inject the 
version
+new_line = version_line % str(swig_version_tuple)
+new_content.add_line(new_line)
+state = NORMAL
+
 if state == NORMAL:
 match = class_pattern.search(line)
 # Inserts lldb_helpers and the lldb_iter() definition before the first


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


[Lldb-commits] [lldb] r253261 - Python3 - Fix some issues related to `PythonFile` class.

2015-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Nov 16 16:40:12 2015
New Revision: 253261

URL: http://llvm.org/viewvc/llvm-project?rev=253261=rev
Log:
Python3 - Fix some issues related to `PythonFile` class.

Python 3 has lots of new debug asserts, and some of these were
firing on PythonFile.  Specifically related to handling of invalid
files.

Modified:
lldb/trunk/scripts/Python/python-typemaps.swig
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Modified: lldb/trunk/scripts/Python/python-typemaps.swig
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-typemaps.swig?rev=253261=253260=253261=diff
==
--- lldb/trunk/scripts/Python/python-typemaps.swig (original)
+++ lldb/trunk/scripts/Python/python-typemaps.swig Mon Nov 16 16:40:12 2015
@@ -552,6 +552,11 @@
File file($1, false);
PythonFile py_file(file, mode);
$result = py_file.release();
+   if (!$result)
+   {
+   $result = Py_None;
+   Py_INCREF(Py_None);
+   }
 }
 
 %typemap(in) (const char* string, int len) {

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp?rev=253261=253260=253261=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
Mon Nov 16 16:40:12 2015
@@ -1035,6 +1035,12 @@ PythonFile::Reset(PyRefType type, PyObje
 void
 PythonFile::Reset(File , const char *mode)
 {
+if (!file.IsValid())
+{
+Reset();
+return;
+}
+
 char *cmode = const_cast(mode);
 #if PY_MAJOR_VERSION >= 3
 Reset(PyRefType::Owned,


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


Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Ying Chen via lldb-commits
chying added a comment.

In http://reviews.llvm.org/D14673#290556, @zturner wrote:

> Ahh, sorry.  I litearlly just committed a change to the same function.  You 
> may have to do a merge, sorry about that.


Ahh, I see, will merge again.


http://reviews.llvm.org/D14673



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


Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Ying Chen via lldb-commits
chying updated this revision to Diff 40347.
chying added a comment.

Recommit r253106 - Add a "not_in()" function you can apply to the list type 
arguments to expectedFailureAll ... 
Initialize self.debug_info in Base::setUp()
Check for None before calling "value in list"


http://reviews.llvm.org/D14673

Files:
  
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
  packages/Python/lldbsuite/test/lldbtest.py

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -620,13 +620,30 @@
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all 
platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
+
+# You can also pass not_in(list) to reverse the sense of the test for the 
arguments that
+# are simple lists, namely oslist, compiler and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in 
list_or_lambda
+
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
+os_list_passes = check_list_or_lambda(oslist, self.getPlatform())
+compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) 
and self.expectedCompilerVersion(compiler_version)
+debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
+
+return (os_list_passes  and
+compiler_passes and
 self.expectedArch(archs) and
 (triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())) and
-(debug_info is None or self.debug_info in debug_info))
+debug_info_passes)
 return expectedFailure(fn, bugnumber)
 
 def expectedFailureDwarf(bugnumber=None):
@@ -1459,6 +1476,9 @@
 
 self.enableLogChannelsForCurrentTest()
 
+#Initialize debug_info
+self.debug_info = None
+
 def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
 """Perform the run hooks to bring lldb debugger to the desired state.
 
Index: 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
===
--- 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
@@ -15,7 +15,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@unittest2.expectedFailure("llvm.org/pr23478")
+@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
 def test (self):
 self.build ()
 self.consecutive_breakpoints_tests()


Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -620,13 +620,30 @@
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386
+
+# You can also pass not_in(list) to reverse the sense of the test for the arguments that
+# are simple lists, namely oslist, compiler and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in list_or_lambda
+
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, compiler_version=None, archs=None, triple=None, debug_info=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version))) and
+os_list_passes = check_list_or_lambda(oslist, self.getPlatform())
+compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) and self.expectedCompilerVersion(compiler_version)
+debug_info_passes 

Re: [Lldb-commits] [PATCH] D14631: [dwarf] Handle DWARF forms for address other than DW_FORM_GNU_addr_index and DW_FORM_addr.

2015-11-16 Thread Dawn Perchik via lldb-commits
dawn added a comment.

In http://reviews.llvm.org/D14631#289917, @tberghammer wrote:

> How you end up in calling DWARFFormValue::Address() with a value what have a 
> form type other then DW_FORM_addr and DW_FORM_GNU_addr_index? What is the 
> attribute tag and the form type used? Can you post a call stack for the case 
> when you hit this issue?


We see it in the comp unit's low_pc:

  0x000b:  DW_TAG_compile_unit: abbrev_num=1
  0x000c:  DW_AT_producer : DW_FORM_strp   string=Embarcadero 
Technologies Inc. clang version 3.1 (33931.6d56f68.9eae00b) (based on LLVM 
3.1svn)
  0x0010:  DW_AT_language : DW_FORM_data2  uval=0x4
   language=DW_LANG_C_plus_plus
  0x0012:  DW_AT_name : DW_FORM_strp   string=cprops.cpp
  0x0016:  DW_AT_low_pc   : DW_FORM_data4  uval=0x0

Address is called at the beginning of reading the CU's DIE.


Repository:
  rL LLVM

http://reviews.llvm.org/D14631



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


Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Ying Chen via lldb-commits
chying added a comment.

The compiler None check is because inside of check_list_or_lambda function, it 
checks for "value in list_or_lamda", which will throw exception if value is None
I agree that the code will be cleaner if debug_info is initialized to None.
Will try to upload another patch soon.


http://reviews.llvm.org/D14673



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


[Lldb-commits] [PATCH] D14726: Add the ability to skip or xfail based on Python and/or SWIG version

2015-11-16 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: tfiala, clayborg.
zturner added a subscriber: lldb-commits.

http://reviews.llvm.org/D14726

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

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -37,6 +37,7 @@
 # System modules
 import abc
 import collections
+from distutils.version import LooseVersion
 import gc
 import glob
 import os, sys, traceback
@@ -472,6 +473,29 @@
 ">>> stderr:\n%s\n" % (stdout, stderr))
 return android_device_api.result
 
+def check_expected_version(comparison, expected, actual):
+def fn_leq(x,y): return x <= y
+def fn_less(x,y): return x < y
+def fn_geq(x,y): return x >= y
+def fn_greater(x,y): return x > y
+def fn_eq(x,y): return x == y
+def fn_neq(x,y): return x != y
+
+op_lookup = {
+"==": fn_eq,
+"=": fn_eq,
+"!=": fn_neq,
+"<>": fn_neq,
+">": fn_greater,
+"<": fn_less,
+">=": fn_geq,
+"<=": fn_leq
+}
+expected_str = '.'.join([str(x) for x in expected])
+actual_str = '.'.join([str(x) for x in actual])
+
+return op_lookup[comparison](LooseVersion(actual_str), 
LooseVersion(expected_str))
+
 #
 # Decorators for categorizing test cases.
 #
@@ -622,11 +646,21 @@
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
-self.expectedArch(archs) and
-(triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())) and
-(debug_info is None or self.debug_info in debug_info))
+oslist_passes = oslist is None or self.getPlatform() in oslist
+compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+arch_passes = self.expectedArch(archs)
+triple_passes = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
+debug_info_passes = debug_info is None or self.debug_info in debug_info
+swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
+py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
+
+return (oslist_passes and
+compiler_passes and
+arch_passes and
+triple_passes and
+debug_info_passes and
+swig_version_passes and
+py_version_passes)
 return expectedFailure(fn, bugnumber)
 
 def expectedFailureDwarf(bugnumber=None):
@@ -1048,12 +1082,21 @@
 # @skipIf(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), skip for 
gcc>=4.9 on linux with i386
 
 # TODO: refactor current code, to make skipIfxxx functions to call this 
function
-def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, 
archs=None, debug_info=None):
+def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, 
archs=None, debug_info=None, swig_version=None, py_version=None):
 def fn(self):
-return ((oslist is None or self.getPlatform() in oslist) and
-(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
-self.expectedArch(archs) and
-(debug_info is None or self.debug_info in debug_info))
+oslist_passes = oslist is None or self.getPlatform() in oslist
+compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+arch_passes = self.expectedArch(archs)
+debug_info_passes = debug_info is None or self.debug_info in debug_info
+swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
+py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
+
+return (oslist_passes and
+compiler_passes and
+arch_passes and
+debug_info_passes and
+swig_version_passes and
+py_version_passes)
 return skipTestIfFn(fn, bugnumber, skipReason="skipping because os:%s 
compiler: %s %s arch: %s 

Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Ying Chen via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL253272: Re-Apply "Add a "not_in()" function you can apply to 
the list type arguments… (authored by chying).

Changed prior to commit:
  http://reviews.llvm.org/D14673?vs=40353=40357#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14673

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -638,19 +638,31 @@
 else:
 return expectedFailure_impl
 
+# You can also pass not_in(list) to reverse the sense of the test for the 
arguments that
+# are simple lists, namely oslist, compiler, and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in 
list_or_lambda
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and 
thus means for all
 # for example,
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all 
platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None, 
swig_version=None, py_version=None):
 def fn(self):
-oslist_passes = oslist is None or self.getPlatform() in oslist
-compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+oslist_passes = check_list_or_lambda(oslist, self.getPlatform())
+compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) 
and self.expectedCompilerVersion(compiler_version)
 arch_passes = self.expectedArch(archs)
 triple_passes = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
-debug_info_passes = debug_info is None or self.debug_info in debug_info
+debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
 swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
 py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
 
@@ -1502,6 +1514,9 @@
 
 self.enableLogChannelsForCurrentTest()
 
+#Initialize debug_info
+self.debug_info = None
+
 def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
 """Perform the run hooks to bring lldb debugger to the desired state.
 
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
@@ -15,7 +15,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@unittest2.expectedFailure("llvm.org/pr23478")
+@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
 def test (self):
 self.build ()
 self.consecutive_breakpoints_tests()


Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -638,19 +638,31 @@
 else:
 return expectedFailure_impl
 
+# You can also pass not_in(list) to reverse the sense of the test for the arguments that
+# are simple lists, namely oslist, compiler, and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in list_or_lambda
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and thus means for all
 # for example,
 # @expectedFailureAll, xfail for all 

Re: [Lldb-commits] [PATCH] D14689: Embed libpanel(3) for NetBSD-7.0

2015-11-16 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

I will go with other way around. If curses(3) or libpanel(3) is missing, 
disable the curses(3) option for LLDB.


Repository:
  rL LLVM

http://reviews.llvm.org/D14689



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


Re: [Lldb-commits] [PATCH] D14673: Fix buildbot breakage after r253106

2015-11-16 Thread Ying Chen via lldb-commits
chying updated this revision to Diff 40353.
chying added a comment.

Rebase on the latest commit.


http://reviews.llvm.org/D14673

Files:
  
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
  packages/Python/lldbsuite/test/lldbtest.py

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -638,19 +638,31 @@
 else:
 return expectedFailure_impl
 
+# You can also pass not_in(list) to reverse the sense of the test for the 
arguments that
+# are simple lists, namely oslist, compiler, and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in 
list_or_lambda
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and 
thus means for all
 # for example,
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all 
platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None, 
swig_version=None, py_version=None):
 def fn(self):
-oslist_passes = oslist is None or self.getPlatform() in oslist
-compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+oslist_passes = check_list_or_lambda(oslist, self.getPlatform())
+compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) 
and self.expectedCompilerVersion(compiler_version)
 arch_passes = self.expectedArch(archs)
 triple_passes = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
-debug_info_passes = debug_info is None or self.debug_info in debug_info
+debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
 swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
 py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
 
@@ -1502,6 +1514,9 @@
 
 self.enableLogChannelsForCurrentTest()
 
+#Initialize debug_info
+self.debug_info = None
+
 def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
 """Perform the run hooks to bring lldb debugger to the desired state.
 
Index: 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
===
--- 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ 
packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
@@ -15,7 +15,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@unittest2.expectedFailure("llvm.org/pr23478")
+@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
 def test (self):
 self.build ()
 self.consecutive_breakpoints_tests()


Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -638,19 +638,31 @@
 else:
 return expectedFailure_impl
 
+# You can also pass not_in(list) to reverse the sense of the test for the arguments that
+# are simple lists, namely oslist, compiler, and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in list_or_lambda
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and thus means for all
 # for example,
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, compiler_version=None, archs=None, triple=None, 

[Lldb-commits] LLVM buildmaster will be restarted tonight

2015-11-16 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated restarted after 7 PM Pacific time today.

Thanks

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


[Lldb-commits] [lldb] r253273 - Python 3 - Skip a certain test for a particular (swig, python) combo.

2015-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Nov 16 17:58:20 2015
New Revision: 253273

URL: http://llvm.org/viewvc/llvm-project?rev=253273=rev
Log:
Python 3 - Skip a certain test for a particular (swig,python) combo.

Current versions of SWIG have a bug with Python 3 that causes
Python to assert when iterating over a generator.  This patch
skips the test for the right combination of Python version and
SWIG version.  I'm attempting to upstream a patch to SWIG to
fix this in a subsequent as-of-yet unreleased version, but
I don't know how long that will take.

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

lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253273=253272=253273=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Nov 16 17:58:20 
2015
@@ -40,6 +40,7 @@ import collections
 from distutils.version import LooseVersion
 import gc
 import glob
+import inspect
 import os, sys, traceback
 import os.path
 import re
@@ -1109,7 +1110,13 @@ def skipIf(bugnumber=None, oslist=None,
 debug_info_passes and
 swig_version_passes and
 py_version_passes)
-return skipTestIfFn(fn, bugnumber, skipReason="skipping because os:%s 
compiler: %s %s arch: %s debug info: %s"%(oslist, compiler, compiler_version, 
archs, debug_info))
+
+local_vars = locals()
+args = [x for x in inspect.getargspec(skipIf).args]
+arg_vals = [eval(x, globals(), local_vars) for x in args]
+args = [x for x in zip(args, arg_vals) if x[1] is not None]
+reasons = ['%s=%s' % (x, str(y)) for (x,y) in args]
+return skipTestIfFn(fn, bugnumber, skipReason='skipping because ' + ' && 
'.join(reasons))
 
 def skipIfDebugInfo(bugnumber=None, debug_info=None):
 return skipIf(bugnumber=bugnumber, debug_info=debug_info)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=253273=253272=253273=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
 Mon Nov 16 17:58:20 2015
@@ -227,6 +227,8 @@ class APIDefaultConstructorTestCase(Test
 
 @add_test_categories(['pyapi'])
 @no_debug_info_test
+# Py3 asserts due to a bug in SWIG.  Trying to upstream a patch to fix 
this in 3.0.8
+@skipIf(py_version=['>=', (3,0)], swig_version=['<', (3,0,8)])
 def test_SBModule(self):
 obj = lldb.SBModule()
 if self.TraceOn():


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


Re: [Lldb-commits] [PATCH] D14689: Embed libpanel(3) for NetBSD-7.0

2015-11-16 Thread Tamas Berghammer via lldb-commits
tberghammer added a subscriber: tberghammer.
tberghammer added a comment.

Can't you address this issue with compiling LLDB on NetBSD with 
-DLLDB_DISABLE_CURSES?

If you want to go with the current approach then you should add somebody who 
can verify that committing it in to the LLVM source tree is fine from licensing 
perspective (I don't know who).


Repository:
  rL LLVM

http://reviews.llvm.org/D14689



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


[Lldb-commits] [PATCH] D14740: Define LLDB_DISABLE_CURSES as a fallback for missing curses(3) or panel(3)

2015-11-16 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: clayborg, emaste.
krytarowski added subscribers: lldb-commits, joerg, brucem.
krytarowski set the repository for this revision to rL LLVM.

This enables build on NetBSD-7.0. It would be nice to have a fall-back for
externally provided ncurses via pkgsrc, but it's left after the scheduled drop
of the autoconf/gmake build system. For not it's not worth the effort.

Repository:
  rL LLVM

http://reviews.llvm.org/D14740

Files:
  cmake/modules/LLDBConfig.cmake

Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -2,6 +2,8 @@
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
+include(CheckIncludeFiles)
+
 set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES 
"Darwin")
   # The Darwin linker doesn't understand --start-group/--end-group.
@@ -42,6 +44,23 @@
   add_definitions( -DHAVE_ROUND )
 endif()
 
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel 
library")
+check_include_files(panel.h HAVE_PANEL_H)
+if (NOT CURSES_FOUND OR NOT CURSES_PANEL_LIBRARY OR NOT HAVE_PANEL_H)
+message("-- Unable to find pair curses and libpanel")
+set(LLDB_DISABLE_CURSES 1)
+else ()
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
+endif ()
+
 if (LLDB_DISABLE_CURSES)
   add_definitions( -DLLDB_DISABLE_CURSES )
 endif()
@@ -395,18 +414,3 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
-
-if (NOT LLDB_DISABLE_CURSES)
-find_package(Curses REQUIRED)
-
-find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel 
library")
-if (NOT CURSES_PANEL_LIBRARY)
-message(FATAL_ERROR "A required curses' panel library not found.")
-endif ()
-
-# Add panels to the library path
-set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
-
-list(APPEND system_libs ${CURSES_LIBRARIES})
-include_directories(${CURSES_INCLUDE_DIR})
-endif ()


Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -2,6 +2,8 @@
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
+include(CheckIncludeFiles)
+
 set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
   # The Darwin linker doesn't understand --start-group/--end-group.
@@ -42,6 +44,23 @@
   add_definitions( -DHAVE_ROUND )
 endif()
 
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
+check_include_files(panel.h HAVE_PANEL_H)
+if (NOT CURSES_FOUND OR NOT CURSES_PANEL_LIBRARY OR NOT HAVE_PANEL_H)
+message("-- Unable to find pair curses and libpanel")
+set(LLDB_DISABLE_CURSES 1)
+else ()
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
+endif ()
+
 if (LLDB_DISABLE_CURSES)
   add_definitions( -DLLDB_DISABLE_CURSES )
 endif()
@@ -395,18 +414,3 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
-
-if (NOT LLDB_DISABLE_CURSES)
-find_package(Curses REQUIRED)
-
-find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
-if (NOT CURSES_PANEL_LIBRARY)
-message(FATAL_ERROR "A required curses' panel library not found.")
-endif ()
-
-# Add panels to the library path
-set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
-
-list(APPEND system_libs ${CURSES_LIBRARIES})
-include_directories(${CURSES_INCLUDE_DIR})
-endif ()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r253272 - Re-Apply "Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll ..." with fix

2015-11-16 Thread Ying Chen via lldb-commits
Author: chying
Date: Mon Nov 16 17:41:02 2015
New Revision: 253272

URL: http://llvm.org/viewvc/llvm-project?rev=253272=rev
Log:
Re-Apply "Add a "not_in()" function you can apply to the list type arguments to 
expectedFailureAll ..." with fix

Summary:
- Re-Commit r253106
- Initialize self.debug_info in Base::setUp()
- Fix argument order when calling check_list_or_lambda for compiler

Reviewers: jingham

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py?rev=253272=253271=253272=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
 Mon Nov 16 17:41:02 2015
@@ -15,7 +15,7 @@ class ConsecutiveBreakpoitsTestCase(Test
 
 mydir = TestBase.compute_mydir(__file__)
 
-@unittest2.expectedFailure("llvm.org/pr23478")
+@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
 def test (self):
 self.build ()
 self.consecutive_breakpoints_tests()

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253272=253271=253272=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Nov 16 17:41:02 
2015
@@ -638,6 +638,18 @@ def expectedFailure(expected_fn, bugnumb
 else:
 return expectedFailure_impl
 
+# You can also pass not_in(list) to reverse the sense of the test for the 
arguments that
+# are simple lists, namely oslist, compiler, and debug_info.
+
+def not_in (iterable):
+return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+if six.callable(list_or_lambda):
+return list_or_lambda(value)
+else:
+return list_or_lambda is None or value is None or value in 
list_or_lambda
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and 
thus means for all
 # for example,
@@ -646,11 +658,11 @@ def expectedFailure(expected_fn, bugnumb
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None, 
swig_version=None, py_version=None):
 def fn(self):
-oslist_passes = oslist is None or self.getPlatform() in oslist
-compiler_passes = compiler is None or (compiler in self.getCompiler() 
and self.expectedCompilerVersion(compiler_version))
+oslist_passes = check_list_or_lambda(oslist, self.getPlatform())
+compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) 
and self.expectedCompilerVersion(compiler_version)
 arch_passes = self.expectedArch(archs)
 triple_passes = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
-debug_info_passes = debug_info is None or self.debug_info in debug_info
+debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
 swig_version_passes = (swig_version is None) or (not hasattr(lldb, 
'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], 
lldb.swig_version))
 py_version_passes = (py_version is None) or 
check_expected_version(py_version[0], py_version[1], sys.version_info)
 
@@ -1502,6 +1514,9 @@ class Base(unittest2.TestCase):
 
 self.enableLogChannelsForCurrentTest()
 
+#Initialize debug_info
+self.debug_info = None
+
 def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
 """Perform the run hooks to bring lldb debugger to the desired state.
 


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


[Lldb-commits] [lldb] r253308 - Add the ability (through the SB API & command line) to specify an address

2015-11-16 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Mon Nov 16 21:39:13 2015
New Revision: 253308

URL: http://llvm.org/viewvc/llvm-project?rev=253308=rev
Log:
Add the ability (through the SB API & command line) to specify an address
breakpoint as "file address" so that the address breakpoint will track that
module even if it gets loaded in a different place.  Also fixed the Address
breakpoint resolver so that it handles this tracking correctly.


Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/main.c
Modified:
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/scripts/interface/SBTarget.i
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=253308=253307=253308=diff
==
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Mon Nov 16 21:39:13 2015
@@ -689,6 +689,9 @@ public:
 lldb::SBBreakpoint
 BreakpointCreateByAddress (addr_t address);
 
+lldb::SBBreakpoint
+BreakpointCreateBySBAddress (SBAddress );
+
 uint32_t
 GetNumBreakpoints () const;
 

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h?rev=253308=253307=253308=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h Mon Nov 16 
21:39:13 2015
@@ -15,6 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Breakpoint/BreakpointResolver.h"
+#include "lldb/Core/ModuleSpec.h"
 
 namespace lldb_private {
 
@@ -31,6 +32,10 @@ public:
 BreakpointResolverAddress (Breakpoint *bkpt,
const Address );
 
+BreakpointResolverAddress (Breakpoint *bkpt,
+   const Address ,
+   const FileSpec _spec);
+
 ~BreakpointResolverAddress() override;
 
 void
@@ -65,8 +70,11 @@ public:
 CopyForBreakpoint (Breakpoint ) override;
 
 protected:
-Address m_addr;
-
+Address  m_addr; // The address - may be Section Offset or may be 
just an offset
+lldb::addr_t m_resolved_addr; // The current value of the resolved load 
address for this breakpoint,
+FileSpec m_module_filespec; // If this filespec is Valid, and m_addr 
is an offset, then it will be converted
+// to a Section+Offset address in this 
module, whenever that module gets around to
+// being loaded.
 private:
 DISALLOW_COPY_AND_ASSIGN(BreakpointResolverAddress);
 };

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=253308=253307=253308=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Mon Nov 16 21:39:13 2015
@@ -778,9 +778,16 @@ public:
   bool internal,
   bool request_hardware);
 
+// Use this to create a breakpoint from a load address and a module file 
spec
+lldb::BreakpointSP
+CreateAddressInModuleBreakpoint (lldb::addr_t file_addr,
+ bool internal,
+ const FileSpec *file_spec,
+ bool request_hardware);
+
 // Use this to create Address breakpoints:
 lldb::BreakpointSP
-CreateBreakpoint (Address ,
+CreateBreakpoint (const Address ,
   bool internal,
   bool request_hardware);
 

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/Makefile?rev=253308=auto
==
--- 

Re: [Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

2015-11-16 Thread Sagar Thakur via lldb-commits
sagar updated this revision to Diff 40256.
sagar added a comment.

Addressed review comments.


Repository:
  rL LLVM

http://reviews.llvm.org/D14633

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp

Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -1375,7 +1375,11 @@
RegisterValue )
 {
 GPR_linux_mips regs;
+lldb_private::ArchSpec arch;
 ::memset(, 0, sizeof(GPR_linux_mips));
+
+// Clear all bits in RegisterValue before writing actual value read from 
ptrace to avoid garbage value in 32-bit MSB 
+value.SetBytes((void *)(((unsigned char *)) + offset), 8, 
arch.GetByteOrder());
 Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, 
m_thread.GetID(), NULL, , sizeof regs);
 if (error.Success())
 {


Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -1375,7 +1375,11 @@
RegisterValue )
 {
 GPR_linux_mips regs;
+lldb_private::ArchSpec arch;
 ::memset(, 0, sizeof(GPR_linux_mips));
+
+// Clear all bits in RegisterValue before writing actual value read from ptrace to avoid garbage value in 32-bit MSB 
+value.SetBytes((void *)(((unsigned char *)) + offset), 8, arch.GetByteOrder());
 Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, , sizeof regs);
 if (error.Success())
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

2015-11-16 Thread Sagar Thakur via lldb-commits
sagar added a comment.

> Admittedly it's a bit unintuitive for an unsigned 32-bit value from a MIPS32 
> binary to be represented in a 64-bit register as, for example, 
> 0x8000 but the debugger shouldn't normally admit to the existence 
> of the extra bits when debugging 32-bit code so the user won't normally see 
> this.


In case of MIPS32 the 0x value in 32 MSB will always be truncated out 
of RegisterValue, since SetBytes() will only write lower 4 bytes of the value 
into RegisterValue. The problem here is that RegisterValue initially contains 
garbage value. Therefore clearing all bits in RegisterValue before writing 
actual 32-bit value solves the problem.


Repository:
  rL LLVM

http://reviews.llvm.org/D14633



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


Re: [Lldb-commits] [PATCH] D14689: Embed libpanel(3) for NetBSD-7.0

2015-11-16 Thread Joerg Sonnenberger via lldb-commits
joerg added a comment.

I'd settle for requiring ncurses for 7.0 and get libpanel into 7.1.


Repository:
  rL LLVM

http://reviews.llvm.org/D14689



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


Re: [Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

2015-11-16 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Looks much better, but I think the root cause of your problem is that you are 
using RegisterValue::SetBytes instead of RegisterValue::SetUInt. I would 
suggest to use a code like this (I don't have a mips environment at the moment 
to try it out):

  Error
  NativeRegisterContextLinux_mips64::DoReadRegisterValue(uint32_t offset,
 const char* reg_name,
 uint32_t size,
 RegisterValue )
  {
  GPR_linux_mips regs;
  ::memset(, 0, sizeof(GPR_linux_mips));
  Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, 
m_thread.GetID(), NULL, , sizeof regs);
  if (error.Success())
  {
  lldb_private::ArchSpec arch;
  if (m_thread.GetProcess()->GetArchitecture(arch))
  value.SetUInt(*(uint64_t*)(((uint8_t*)) + offset), 
arch.GetAddressByteSize());
  else
  error.SetErrorString("failed to get architecture");
  }
  return error;
  }



Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1378
@@ -1377,2 +1377,3 @@
 GPR_linux_mips regs;
+lldb_private::ArchSpec arch;
 ::memset(, 0, sizeof(GPR_linux_mips));

You use this variable without initializing it. You can call SetBytes with an 
explicit byte order value (e.g. eByteOrderLittle) as it isn't matter during 0 
initialization.


Repository:
  rL LLVM

http://reviews.llvm.org/D14633



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


Re: [Lldb-commits] [PATCH] D14631: [dwarf] Handle DWARF forms for address other than DW_FORM_GNU_addr_index and DW_FORM_addr.

2015-11-16 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

The feature Greg mentioned is already implemented in 
DWARFDebugInfoEntry::GetAttributeHighPC and we shouldn't move it to 
DWARFFormValue::Address because it is only needed for DW_AT_high_pc but 
DWARFFormValue::Address used for other places as well (e.g. DW_AT_low_pc).

I think what we are seeing isn't a compiler bug, but I need a little bit more 
information to be sure.

How you end up in calling DWARFFormValue::Address() with a value what have a 
form type other then DW_FORM_addr and DW_FORM_GNU_addr_index? What is the 
attribute tag and the form type used? Can you post a call stack for the case 
when you hit this issue?


Repository:
  rL LLVM

http://reviews.llvm.org/D14631



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


[Lldb-commits] [lldb] r253197 - Revert "Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll to reverse"

2015-11-16 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Nov 16 05:11:10 2015
New Revision: 253197

URL: http://llvm.org/viewvc/llvm-project?rev=253197=rev
Log:
Revert "Add a "not_in()" function you can apply to the list type arguments to 
expectedFailureAll to reverse"

This reverts commit r253106.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py?rev=253197=253196=253197=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
 Mon Nov 16 05:11:10 2015
@@ -15,7 +15,7 @@ class ConsecutiveBreakpoitsTestCase(Test
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
+@unittest2.expectedFailure("llvm.org/pr23478")
 def test (self):
 self.build ()
 self.consecutive_breakpoints_tests()

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253197=253196=253197=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Nov 16 05:11:10 
2015
@@ -620,30 +620,13 @@ def expectedFailure(expected_fn, bugnumb
 # @expectedFailureAll, xfail for all platform/compiler/arch,
 # @expectedFailureAll(compiler='gcc'), xfail for gcc on all 
platform/architecture
 # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), 
xfail for gcc>=4.9 on linux with i386
-
-# You can also pass not_in(list) to reverse the sense of the test for the 
arguments that
-# are simple lists, namely oslist, compiler and debug_info.
- 
-def not_in (iterable):
-return lambda x : x not in iterable
-
-def check_list_or_lambda (list_or_lambda, value):
-if six.callable(list_or_lambda):
-return list_or_lambda(value)
-else:
-return list_or_lambda is None or value in list_or_lambda
-
 def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, 
compiler_version=None, archs=None, triple=None, debug_info=None):
 def fn(self):
-os_list_passes = check_list_or_lambda(oslist, self.getPlatform())
-compiler_passes = check_list_or_lambda(compiler, self.getCompiler()) 
and self.expectedCompilerVersion(compiler_version)
-debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
-
-return (os_list_passes  and
-compiler_passes and
+return ((oslist is None or self.getPlatform() in oslist) and
+(compiler is None or (compiler in self.getCompiler() and 
self.expectedCompilerVersion(compiler_version))) and
 self.expectedArch(archs) and
 (triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())) and
-debug_info_passes)
+(debug_info is None or self.debug_info in debug_info))
 return expectedFailure(fn, bugnumber)
 
 def expectedFailureDwarf(bugnumber=None):


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


[Lldb-commits] [lldb] r253319 - Revert out Xcode hookup of r253317.

2015-11-16 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 17 01:56:42 2015
New Revision: 253319

URL: http://llvm.org/viewvc/llvm-project?rev=253319=rev
Log:
Revert out Xcode hookup of r253317.

The green dragon OS X builder doesn't have swig on the path.
I need to enable behavior where we can look for it
in some well known spots.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=253319=253318=253319=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov 17 01:56:42 2015
@@ -5984,7 +5984,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2668020B115FD0EE008E1FE4 /* 
Build configuration list for PBXNativeTarget "LLDB" */;
buildPhases = (
-   26DC6A5813380D4300FF7998 /* Prepare Swig 
Bindings */,
+   26DC6A5813380D4300FF7998 /* Build swig wrapper 
classes */,
26680202115FD0ED008E1FE4 /* Headers */,
26680203115FD0ED008E1FE4 /* Resources */,
26680204115FD0ED008E1FE4 /* Sources */,
@@ -6214,19 +6214,19 @@
shellPath = /bin/sh;
shellScript = "perl $SRCROOT/scripts/build-llvm.pl";
};
-   26DC6A5813380D4300FF7998 /* Prepare Swig Bindings */ = {
+   26DC6A5813380D4300FF7998 /* Build swig wrapper classes */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
-   name = "Prepare Swig Bindings";
+   name = "Build swig wrapper classes";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
-   shellPath = /bin/bash;
-   shellScript = "/usr/bin/python 
$SRCROOT/scripts/prepare_bindings.py --framework --src-root $SRCROOT 
--target-dir $TARGET_BUILD_DIR --config-build-dir $CONFIGURATION_BUILD_DIR 
--swig-executable `which swig`";
+   shellPath = /bin/sh;
+   shellScript = 
"$SRCROOT/scripts/build-swig-wrapper-classes.sh $SRCROOT $TARGET_BUILD_DIR 
$CONFIGURATION_BUILD_DIR \"\"\n";
};
4959511A1A1ACE9500F6F8FC /* Install Clang compiler headers */ = 
{
isa = PBXShellScriptBuildPhase;


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


Re: [Lldb-commits] [PATCH] D14726: Add the ability to skip or xfail based on Python and/or SWIG version

2015-11-16 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.

Yep, looks good.


http://reviews.llvm.org/D14726



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


[Lldb-commits] [lldb] r253317 - Add Pythonic language binding wrapper generation script.

2015-11-16 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 17 01:17:38 2015
New Revision: 253317

URL: http://llvm.org/viewvc/llvm-project?rev=253317=rev
Log:
Add Pythonic language binding wrapper generation script.

This is only used by Xcode at the moment.  It replaces the
buildSwigWrapperClasses.py and related per-script-language
scripts.  It also fixes a couple bugs in those w/r/t Xcode
usage:

* the presence of the GCC_PREPROCESSOR_DEFINITIONS env var
  should not be short-circuiting generation of the language
  binding; rather, only if LLDB_DISABLE_PYTHON is present
  within that environment variable.

* some logic around what to do when building in "non-Makefile"
  mode.  I've switched the handling of that to be on a
  "--framework" flag - if specified, we build an OS X-style
  framework; otherwise, we go with non.

Putting this up now only attached to the Xcode build so
others can look at it but not be affected by it yet.
After this, I'll tackle the finalizer, along with trying
it locally on Linux.

Added:
lldb/trunk/scripts/Python/prepare_binding_Python.py
lldb/trunk/scripts/prepare_bindings.py   (with props)
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=253317=253316=253317=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov 17 01:17:38 2015
@@ -5984,7 +5984,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2668020B115FD0EE008E1FE4 /* 
Build configuration list for PBXNativeTarget "LLDB" */;
buildPhases = (
-   26DC6A5813380D4300FF7998 /* Build swig wrapper 
classes */,
+   26DC6A5813380D4300FF7998 /* Prepare Swig 
Bindings */,
26680202115FD0ED008E1FE4 /* Headers */,
26680203115FD0ED008E1FE4 /* Resources */,
26680204115FD0ED008E1FE4 /* Sources */,
@@ -6214,19 +6214,19 @@
shellPath = /bin/sh;
shellScript = "perl $SRCROOT/scripts/build-llvm.pl";
};
-   26DC6A5813380D4300FF7998 /* Build swig wrapper classes */ = {
+   26DC6A5813380D4300FF7998 /* Prepare Swig Bindings */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
-   name = "Build swig wrapper classes";
+   name = "Prepare Swig Bindings";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
-   shellPath = /bin/sh;
-   shellScript = 
"$SRCROOT/scripts/build-swig-wrapper-classes.sh $SRCROOT $TARGET_BUILD_DIR 
$CONFIGURATION_BUILD_DIR \"\"\n";
+   shellPath = /bin/bash;
+   shellScript = "/usr/bin/python 
$SRCROOT/scripts/prepare_bindings.py --framework --src-root $SRCROOT 
--target-dir $TARGET_BUILD_DIR --config-build-dir $CONFIGURATION_BUILD_DIR 
--swig-executable `which swig`";
};
4959511A1A1ACE9500F6F8FC /* Install Clang compiler headers */ = 
{
isa = PBXShellScriptBuildPhase;

Added: lldb/trunk/scripts/Python/prepare_binding_Python.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/prepare_binding_Python.py?rev=253317=auto
==
--- lldb/trunk/scripts/Python/prepare_binding_Python.py (added)
+++ lldb/trunk/scripts/Python/prepare_binding_Python.py Tue Nov 17 01:17:38 2015
@@ -0,0 +1,435 @@
+"""
+ The LLVM Compiler Infrastructure
+
+This file is distributed under the University of Illinois Open Source
+License. See LICENSE.TXT for details.
+
+Python binding preparation script.
+"""
+
+# Python modules:
+from __future__ import print_function
+
+import logging
+import os
+import re
+import shutil
+import subprocess
+import sys
+
+
+class SwigSettings(object):
+"""Provides a single object to represent swig files and settings."""
+def __init__(self):
+self.extensions_file = None
+self.header_files = None
+self.input_file = None
+self.interface_files = None
+self.output_file = None
+self.safecast_file = None
+self.typemaps_file = None
+self.wrapper_file = None
+
+@classmethod
+def _any_files_newer(cls, files, check_mtime):
+"""Returns if any of the given files has a newer modified time.
+
+@param cls the class
+@param 

Re: [Lldb-commits] [PATCH] D14718: Insert the SWIG version into LLDB's __init__.py

2015-11-16 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D14718



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