[Lldb-commits] [PATCH] D15487: [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets

2015-12-14 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: jaydeep, clayborg.
nitesh.jain added subscribers: bhushan, sagar, mohit.bhakkad, lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

This Patch will allowed LLDB to debug respective instruction sets binaries.

Repository:
  rL LLVM

http://reviews.llvm.org/D15487

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
@@ -328,6 +328,11 @@
 
 switch (mips_arch)
 {
+case llvm::ELF::EF_MIPS_ARCH_1:
+case llvm::ELF::EF_MIPS_ARCH_2:
+case llvm::ELF::EF_MIPS_ARCH_3:
+case llvm::ELF::EF_MIPS_ARCH_4:
+case llvm::ELF::EF_MIPS_ARCH_5:
 case llvm::ELF::EF_MIPS_ARCH_32:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32el : 
ArchSpec::eMIPSSubType_mips32;
 case llvm::ELF::EF_MIPS_ARCH_32R2:


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -328,6 +328,11 @@
 
 switch (mips_arch)
 {
+case llvm::ELF::EF_MIPS_ARCH_1:
+case llvm::ELF::EF_MIPS_ARCH_2:
+case llvm::ELF::EF_MIPS_ARCH_3:
+case llvm::ELF::EF_MIPS_ARCH_4:
+case llvm::ELF::EF_MIPS_ARCH_5:
 case llvm::ELF::EF_MIPS_ARCH_32:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32el : ArchSpec::eMIPSSubType_mips32;
 case llvm::ELF::EF_MIPS_ARCH_32R2:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15487: [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets

2015-12-14 Thread Jaydeep Patil via lldb-commits
jaydeep accepted this revision.
jaydeep added a comment.
This revision is now accepted and ready to land.

Looks good to me.


Repository:
  rL LLVM

http://reviews.llvm.org/D15487



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


Re: [Lldb-commits] [PATCH] D15355: Add failure paths to a few JSONNumber members

2015-12-14 Thread Muhammad Omair Javaid via lldb-commits
omjavaid abandoned this revision.
omjavaid added a comment.

Correction made upstream by @tberghammer.


http://reviews.llvm.org/D15355



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


Re: [Lldb-commits] [PATCH] D15357: Update code to silent some ARM/ARM64 specific compiler warnings

2015-12-14 Thread Muhammad Omair Javaid via lldb-commits
omjavaid abandoned this revision.
omjavaid added a comment.

Let the warnings stay for now.


http://reviews.llvm.org/D15357



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


[Lldb-commits] [PATCH] D15488: [LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic sequences are yet to be supported in LLDB

2015-12-14 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad created this revision.
mohit.bhakkad added a reviewer: jaydeep.
mohit.bhakkad added a subscriber: lldb-commits.
mohit.bhakkad set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D15488

Files:
  
packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py

Index: 
packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
===
--- 
packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ 
packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -21,6 +21,7 @@
 import lldbsuite.test.lldbutil as lldbutil
 
 @skipIfWindows
+@expectedFailureAll(archs=['mips64', 'mips64el']) # Atomic sequences are not 
supported yet for MIPS in LLDB. 
 class ConcurrentEventsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


Index: packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -21,6 +21,7 @@
 import lldbsuite.test.lldbutil as lldbutil
 
 @skipIfWindows
+@expectedFailureAll(archs=['mips64', 'mips64el']) # Atomic sequences are not supported yet for MIPS in LLDB. 
 class ConcurrentEventsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15488: [LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic sequences are yet to be supported in LLDB

2015-12-14 Thread Jaydeep Patil via lldb-commits
jaydeep accepted this revision.
jaydeep added a comment.
This revision is now accepted and ready to land.

Looks good to me.


Repository:
  rL LLVM

http://reviews.llvm.org/D15488



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


Re: [Lldb-commits] [PATCH] D15488: [LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic sequences are yet to be supported in LLDB

2015-12-14 Thread Mohit Bhakkad via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255488: [LLDB][MIPS] Mark TestConcurrentEvents.py expected 
failure, as MIPS atomic… (authored by mohit.bhakkad).

Changed prior to commit:
  http://reviews.llvm.org/D15488?vs=42693&id=42695#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15488

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -21,6 +21,7 @@
 import lldbsuite.test.lldbutil as lldbutil
 
 @skipIfWindows
+@expectedFailureAll(archs=['mips64', 'mips64el']) # Atomic sequences are not 
supported yet for MIPS in LLDB. 
 class ConcurrentEventsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -21,6 +21,7 @@
 import lldbsuite.test.lldbutil as lldbutil
 
 @skipIfWindows
+@expectedFailureAll(archs=['mips64', 'mips64el']) # Atomic sequences are not supported yet for MIPS in LLDB. 
 class ConcurrentEventsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255488 - [LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic sequences are yet to be supported in LLDB

2015-12-14 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Mon Dec 14 04:26:18 2015
New Revision: 255488

URL: http://llvm.org/viewvc/llvm-project?rev=255488&view=rev
Log:
[LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic 
sequences are yet to be supported in LLDB

Reviewers: jaydeep.
Subscribers: lldb-commits.
Differential Revision: http://reviews.llvm.org/D15488

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py?rev=255488&r1=255487&r2=255488&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
 Mon Dec 14 04:26:18 2015
@@ -21,6 +21,7 @@ from lldbsuite.test.lldbtest import *
 import lldbsuite.test.lldbutil as lldbutil
 
 @skipIfWindows
+@expectedFailureAll(archs=['mips64', 'mips64el']) # Atomic sequences are not 
supported yet for MIPS in LLDB. 
 class ConcurrentEventsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


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


Re: [Lldb-commits] [PATCH] D15355: Add failure paths to a few JSONNumber members

2015-12-14 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

I don't know what correction you are referring to as I haven't made any change 
in JSON.{h,cpp} since you created this patch but I am happy with the current 
situation (no warning on clang)


http://reviews.llvm.org/D15355



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


[Lldb-commits] [lldb] r255490 - XFAIL TestNamespaceLookup for linux

2015-12-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Dec 14 05:05:44 2015
New Revision: 255490

URL: http://llvm.org/viewvc/llvm-project?rev=255490&view=rev
Log:
XFAIL TestNamespaceLookup for linux

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py?rev=255490&r1=255489&r2=255490&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 Mon Dec 14 05:05:44 2015
@@ -33,6 +33,7 @@ class NamespaceLookupTestCase(TestBase):
 substrs = ['stopped',
'stop reason = breakpoint'])
 
+@expectedFailureLinux("llvm.org/pr25819")
 def test_scope_lookup_with_run_command(self):
 """Test scope lookup of functions in lldb."""
 self.build()
@@ -142,6 +143,7 @@ class NamespaceLookupTestCase(TestBase):
 # finds the global ::func().
 self.expect("expr -- func()", startstr = "(int) $0 = 2")
 
+@expectedFailureAll(bugnumber="llvm.org/pr25819", oslist=["linux"], 
compiler="gcc")
 def test_scope_lookup_before_using_with_run_command(self):
 """Test scope lookup before using in lldb."""
 self.build()
@@ -156,6 +158,7 @@ class NamespaceLookupTestCase(TestBase):
 
 # NOTE: this test may fail on older systems that don't emit import
 # emtries in DWARF - may need to add checks for compiler versions here.
+@expectedFailureLinux("llvm.org/pr25819")
 def test_scope_after_using_directive_lookup_with_run_command(self):
 """Test scope lookup after using directive in lldb."""
 self.build()
@@ -198,6 +201,7 @@ class NamespaceLookupTestCase(TestBase):
 # the same type.
 self.expect("expr -- func()", startstr = "error")
 
+@expectedFailureLinux("llvm.org/pr25819")
 def test_scope_lookup_shadowed_by_using_with_run_command(self):
 """Test scope lookup shadowed by using in lldb."""
 self.build()


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


Re: [Lldb-commits] [PATCH] D15451: Make test categories composable

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


Comment at: packages/Python/lldbsuite/test/lldbtest.py:518
@@ +517,3 @@
+if hasattr(func, "categories"):
+cat.extend(func.categories)
+func.categories = cat

tfiala wrote:
> This code could potentially accept a single category and drop the need for 
> the list.  It could check the type of the input (i.e. the categories input) 
> and, if a single element rather than a list, it could just cat.append() it.
> 
> That would enable a single argument passed to @add_test_categories()
> 
> Totally minor and you can skip this, it just makes for a nice usability 
> enhancement provided the decorator is documented as such.
+1: I think we will (accidentally) call the function by a single string in some 
case so accepting it would be a good idea.


http://reviews.llvm.org/D15451



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


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

2015-12-14 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.
labath added a comment.

Hi,

all of the new tests in TestNamespaceLookup were failing on linux, against all 
tested compilers 
(http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/9405), 
so I have XFAILed them. I don't know if this is something you're interested 
about, but I thought I'd point out that now all test in this file are marked as 
XFAIL on linux.


Repository:
  rL LLVM

http://reviews.llvm.org/D15312



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


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

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


Comment at: 
packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py:9
@@ -8,4 +8,3 @@
 
-@dwarf_test
-def test_with_dwarf(self):
-self.buildDwarf()
+@skipIf(debug_info=not_in(["dwarf"]))
+def test_limit_debug_info(self):

Considering your change in lldbtest.py:2227 I think you should annotate the 
function with add_test_categories(["dwarf"]) instead


Comment at: packages/Python/lldbsuite/test/lldbtest.py:2227-2228
@@ +2226,4 @@
+
+# If any debug info categories were explicitly tagged, assume 
that list to be
+# authoritative.  If none were specified, try with all debug 
info formats.
+all_dbginfo_categories = 
set(test_categories.debug_info_categories)

I think this won't work if the list of debug info formats are specified on 
class level instead of at function level.


http://reviews.llvm.org/D15428



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


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

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


Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp:38-41
@@ +37,6 @@
+
+if (flags & OPCODE_OPERANDS_TABLE_MASK)
+{
+OperandTable::ReadOperandTable(debug_macro_data, offset, 
&header.m_operand_table);
+}
+

If we can get rid of all OperandTable related data then this can become a call 
to the SkipOperandTable function. (What is the purpose of the operand table if 
you can process everything without using it?).


Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h:49
@@ +48,3 @@
+uint8_t m_entry_count;
+std::map m_entry_map; // Mapping from 
opcode number to its entry.
+

Constructing it is quite expensive as we insert a new entry for each operand 
into a std::map what will involve a binary search and most likely a heap 
allocation. As we don't use it for anything I would prefer to remove it because 
we don't want to pay the computation cost required to create it for nothing. We 
can add it back when we have a use case for it.

Going forward in this route I don't see any code reading 
DWARFDebugMacroHeader::m_operand_table either. I might miss something but if 
nobody is reading it then we can remove DWARFDebugMacroHeader::m_operand_table, 
DWARFDebugMacroHeader::OperandTable, DWARFDebugMacroHeader::OperandTableEntry 
and the call to DWARFDebugMacroHeader::OperandTable::ReadOperandTable what 
would simplify the code and also improve the efficiency as we don't do a lot of 
useless work.


Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:563
@@ +562,3 @@
+typedef std::map 
DebugMacrosMap;
+DebugMacrosMap m_debug_macros_map;
+

Should we use std::map or std::unordered_map here?


http://reviews.llvm.org/D15437



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


[Lldb-commits] [lldb] r255492 - Extend XFAIL on TestNamespaceLookup on linux

2015-12-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Dec 14 06:09:28 2015
New Revision: 255492

URL: http://llvm.org/viewvc/llvm-project?rev=255492&view=rev
Log:
Extend XFAIL on TestNamespaceLookup on linux

one of the tests seems to (occasionally) fail with clang as well.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py?rev=255492&r1=255491&r2=255492&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 Mon Dec 14 06:09:28 2015
@@ -143,7 +143,7 @@ class NamespaceLookupTestCase(TestBase):
 # finds the global ::func().
 self.expect("expr -- func()", startstr = "(int) $0 = 2")
 
-@expectedFailureAll(bugnumber="llvm.org/pr25819", oslist=["linux"], 
compiler="gcc")
+@expectedFailureLinux("llvm.org/pr25819")
 def test_scope_lookup_before_using_with_run_command(self):
 """Test scope lookup before using in lldb."""
 self.build()


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


Re: [Lldb-commits] [PATCH] D15451: Make test categories composable

2015-12-14 Thread Pavel Labath via lldb-commits
labath added inline comments.


Comment at: packages/Python/lldbsuite/test/lldbtest.py:518
@@ +517,3 @@
+if hasattr(func, "categories"):
+cat.extend(func.categories)
+func.categories = cat

tberghammer wrote:
> tfiala wrote:
> > This code could potentially accept a single category and drop the need for 
> > the list.  It could check the type of the input (i.e. the categories input) 
> > and, if a single element rather than a list, it could just cat.append() it.
> > 
> > That would enable a single argument passed to @add_test_categories()
> > 
> > Totally minor and you can skip this, it just makes for a nice usability 
> > enhancement provided the decorator is documented as such.
> +1: I think we will (accidentally) call the function by a single string in 
> some case so accepting it would be a good idea.
The test_categories.validate will catch the case where you forget to put the 
braces and throw errors at you, so it's not possible to get unexpected behavior 
here.

I may be old-fashioned, but I like when things have a single type, which is 
obvious from the code. Look at all the cases where we do `callable(bugnumber)` 
and tell me if it's obvious why a "bug number" should be "callable". Plus, none 
of our other decorators taking lists have this kind of magic in them (imagine 
how would this complicate the logic of expectedFailureAll).

If we want to provide a simpler syntax for adding a single category, i would go 
for adding a separate `@add_test_category` decorator for that.


http://reviews.llvm.org/D15451



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


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Joerg Sonnenberger via lldb-commits
joerg accepted this revision.
joerg added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


Re: [Lldb-commits] [PATCH] D15451: Make test categories composable

2015-12-14 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255493: Make test categories composable (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D15451?vs=42522&id=42704#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15451

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

Index: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py
@@ -97,22 +97,17 @@
 else:
 return str(test)
 
-def getCategoriesForTest(self,test):
-if hasattr(test,"_testMethodName"):
-test_method = getattr(test,"_testMethodName")
-test_method = getattr(test,test_method)
-else:
-test_method = None
-if test_method != None and hasattr(test_method,"getCategories"):
-test_categories = test_method.getCategories(test)
-elif hasattr(test,"getCategories"):
-test_categories = test.getCategories()
-elif inspect.ismethod(test) and test.__self__ != None and 
hasattr(test.__self__,"getCategories"):
-test_categories = test.__self__.getCategories()
-else:
-test_categories = []
-if test_categories == None:
-test_categories = []
+def getCategoriesForTest(self, test):
+"""
+Gets all the categories for the currently running test method in test 
case
+"""
+test_categories = []
+test_method = getattr(test, test._testMethodName)
+if test_method != None and hasattr(test_method, "categories"):
+test_categories.extend(test_method.categories)
+
+test_categories.extend(test.getCategories())
+
 return test_categories
 
 def hardMarkAsSkipped(self,test):
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
@@ -509,12 +509,18 @@
 # Decorators for categorizing test cases.
 #
 from functools import wraps
+
 def add_test_categories(cat):
-"""Decorate an item with test categories"""
+"""Add test categories to a TestCase method"""
 cat = test_categories.validate(cat, True)
 def impl(func):
-func.getCategories = lambda test: cat
+if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+raise Exception("@add_test_categories can only be used to decorate 
a test method")
+if hasattr(func, "categories"):
+cat.extend(func.categories)
+func.categories = cat
 return func
+
 return impl
 
 def benchmarks_test(func):
Index: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
+++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
@@ -3,6 +3,7 @@
 """
 
 from __future__ import absolute_import
+from __future__ import print_function
 
 # System modules
 import sys


Index: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py
@@ -97,22 +97,17 @@
 else:
 return str(test)
 
-def getCategoriesForTest(self,test):
-if hasattr(test,"_testMethodName"):
-test_method = getattr(test,"_testMethodName")
-test_method = getattr(test,test_method)
-else:
-test_method = None
-if test_method != None and hasattr(test_method,"getCategories"):
-test_categories = test_method.getCategories(test)
-elif hasattr(test,"getCategories"):
-test_categories = test.getCategories()
-elif inspect.ismethod(test) and test.__self__ != None and hasattr(test.__self__,"getCategories"):
-test_categories = test.__self__.getCategories()
-else:
-test_categories = []
-if test_categories == None:
-test_categories = []
+def getCategoriesForTest(self, test):
+"""
+Gets all the categories for the currently running test method in test case
+"""
+test_categories = []
+test_method = getattr(test, test._testMethodName)
+if test_method != None and hasattr(test_method, "categories"):
+test_categories.extend(test_method.categories)
+
+test_categories.extend(test.getCategories())
+
 return test_categories
 
 def hardMarkAsS

[Lldb-commits] [lldb] r255493 - Make test categories composable

2015-12-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Dec 14 07:17:18 2015
New Revision: 255493

URL: http://llvm.org/viewvc/llvm-project?rev=255493&view=rev
Log:
Make test categories composable

Summary:
Previously the add_test_categories would simply overwrite the current set of 
categories for a
method. This change makes the decorator truly "add" categories, by extending 
the current set of
categories instead of replacing it.

To do this, I have:
- replaced the getCategories() property on a method (which was itself a 
method), with a simple
  list property "categories". This makes add_test_categories easier to 
implement, and test
  categories isn't something which should change between calls anyway.
- rewritten the getCategoriesForTest function to merge method categories with 
the categories of
  the test case. Previously, it would just use the method categories if they 
were present. I have
  also greatly simplified this method. Originally, it would use a lot of 
introspection to enable
  it being called on various types of objects. Based on my tests, it was only 
ever being called
  on a test case. The new function uses much less introspection then the 
preivous one, so we
  should easily catch any stray uses, if there are any, as they will generate 
exceptions now.

Reviewers: zturner, tfiala, tberghammer

Subscribers: lldb-commits

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.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=255493&r1=255492&r2=255493&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 07:17:18 
2015
@@ -509,12 +509,18 @@ def check_expected_version(comparison, e
 # Decorators for categorizing test cases.
 #
 from functools import wraps
+
 def add_test_categories(cat):
-"""Decorate an item with test categories"""
+"""Add test categories to a TestCase method"""
 cat = test_categories.validate(cat, True)
 def impl(func):
-func.getCategories = lambda test: cat
+if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+raise Exception("@add_test_categories can only be used to decorate 
a test method")
+if hasattr(func, "categories"):
+cat.extend(func.categories)
+func.categories = cat
 return func
+
 return impl
 
 def benchmarks_test(func):

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=255493&r1=255492&r2=255493&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Mon Dec 14 
07:17:18 2015
@@ -3,6 +3,7 @@ Provides definitions for various lldb te
 """
 
 from __future__ import absolute_import
+from __future__ import print_function
 
 # System modules
 import sys

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_result.py?rev=255493&r1=255492&r2=255493&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py Mon Dec 14 
07:17:18 2015
@@ -97,22 +97,17 @@ class LLDBTestResult(unittest2.TextTestR
 else:
 return str(test)
 
-def getCategoriesForTest(self,test):
-if hasattr(test,"_testMethodName"):
-test_method = getattr(test,"_testMethodName")
-test_method = getattr(test,test_method)
-else:
-test_method = None
-if test_method != None and hasattr(test_method,"getCategories"):
-test_categories = test_method.getCategories(test)
-elif hasattr(test,"getCategories"):
-test_categories = test.getCategories()
-elif inspect.ismethod(test) and test.__self__ != None and 
hasattr(test.__self__,"getCategories"):
-test_categories = test.__self__.getCategories()
-else:
-test_categories = []
-if test_categories == None:
-test_categories = []
+def getCategoriesForTest(self, test):
+"""
+Gets all the categories for the currently running test method in test 
case
+"""
+test_categories = []
+test_method = getattr(test, test._testMethodName)
+if test_method != None and 

Re: [Lldb-commits] [PATCH] D15355: Add failure paths to a few JSONNumber members

2015-12-14 Thread Muhammad Omair Javaid via lldb-commits
omjavaid updated this revision to Diff 42706.
omjavaid added a comment.

Sorry @tberghammer there was corruption in my setup showing changes which i 
just made internally.

I have updated this diff as per suggestions.

LGTM?


http://reviews.llvm.org/D15355

Files:
  include/lldb/Utility/JSON.h
  source/Utility/JSON.cpp

Index: source/Utility/JSON.cpp
===
--- source/Utility/JSON.cpp
+++ source/Utility/JSON.cpp
@@ -12,6 +12,7 @@
 #include 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -72,9 +73,10 @@
 case DataType::Double:
 return (uint64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
-uint64_t
+int64_t
 JSONNumber::GetAsSigned() const
 {
 switch (m_data_type)
@@ -86,6 +88,7 @@
 case DataType::Double:
 return (int64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 double
@@ -100,6 +103,7 @@
 case DataType::Double:
 return m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 void
Index: include/lldb/Utility/JSON.h
===
--- include/lldb/Utility/JSON.h
+++ include/lldb/Utility/JSON.h
@@ -145,7 +145,7 @@
 uint64_t
 GetAsUnsigned() const;
 
-uint64_t
+int64_t
 GetAsSigned() const;
 
 double


Index: source/Utility/JSON.cpp
===
--- source/Utility/JSON.cpp
+++ source/Utility/JSON.cpp
@@ -12,6 +12,7 @@
 #include 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -72,9 +73,10 @@
 case DataType::Double:
 return (uint64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
-uint64_t
+int64_t
 JSONNumber::GetAsSigned() const
 {
 switch (m_data_type)
@@ -86,6 +88,7 @@
 case DataType::Double:
 return (int64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 double
@@ -100,6 +103,7 @@
 case DataType::Double:
 return m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 void
Index: include/lldb/Utility/JSON.h
===
--- include/lldb/Utility/JSON.h
+++ include/lldb/Utility/JSON.h
@@ -145,7 +145,7 @@
 uint64_t
 GetAsUnsigned() const;
 
-uint64_t
+int64_t
 GetAsSigned() const;
 
 double
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15355: Add failure paths to a few JSONNumber members

2015-12-14 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

LGTM



Comment at: include/lldb/Utility/JSON.h:148
@@ -147,3 +147,3 @@
 
-uint64_t
+int64_t
 GetAsSigned() const;

Nice catch!


http://reviews.llvm.org/D15355



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


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

2015-12-14 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D15428#308401, @zturner wrote:

> In hindsight I wonder if I even needed to manually mark the test with a debug 
> info.  Maybe we can say that tests should *never* be manually marked with a 
> debug info category, and only use the skip decorators.  That should still 
> work, because it will be auto-multiplied to every debug format, and then some 
> of them will be skipped.


I quite like that. `@dwarf_test` essentially means "skip if debug info is not 
dwarf", so why not state that explicitly... I'm not going to ask you to rewrite 
it again, but if you feel like it, then by all means go for it.



Comment at: packages/Python/lldbsuite/test/lldbtest.py:2227-2228
@@ +2226,4 @@
+
+# If any debug info categories were explicitly tagged, assume 
that list to be
+# authoritative.  If none were specified, try with all debug 
info formats.
+all_dbginfo_categories = 
set(test_categories.debug_info_categories)

tberghammer wrote:
> I think this won't work if the list of debug info formats are specified on 
> class level instead of at function level.
That's true, but given that it's difficult to access the class annotations from 
this context, I'm fine with living with this "defect", at least for now. 
Although, it sounds like that if we go with the option Zachary proposes, this 
problem would go away...


http://reviews.llvm.org/D15428



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


Re: [Lldb-commits] [PATCH] D15451: Make test categories composable

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


Comment at: packages/Python/lldbsuite/test/lldbtest.py:518
@@ +517,3 @@
+if hasattr(func, "categories"):
+cat.extend(func.categories)
+func.categories = cat

labath wrote:
> tberghammer wrote:
> > tfiala wrote:
> > > This code could potentially accept a single category and drop the need 
> > > for the list.  It could check the type of the input (i.e. the categories 
> > > input) and, if a single element rather than a list, it could just 
> > > cat.append() it.
> > > 
> > > That would enable a single argument passed to @add_test_categories()
> > > 
> > > Totally minor and you can skip this, it just makes for a nice usability 
> > > enhancement provided the decorator is documented as such.
> > +1: I think we will (accidentally) call the function by a single string in 
> > some case so accepting it would be a good idea.
> The test_categories.validate will catch the case where you forget to put the 
> braces and throw errors at you, so it's not possible to get unexpected 
> behavior here.
> 
> I may be old-fashioned, but I like when things have a single type, which is 
> obvious from the code. Look at all the cases where we do 
> `callable(bugnumber)` and tell me if it's obvious why a "bug number" should 
> be "callable". Plus, none of our other decorators taking lists have this kind 
> of magic in them (imagine how would this complicate the logic of 
> expectedFailureAll).
> 
> If we want to provide a simpler syntax for adding a single category, i would 
> go for adding a separate `@add_test_category` decorator for that.
I think the pythonic way is to accept (almost) any type of argument including a 
single element string and any iterable (list, set, generator expression, 
etc...). In long term I would like to see all of our decorator taking single 
and multi argument at the same time but we can make that change later with 
refactoring all decorator to support it (it can be handled easily by a utility 
function).


Repository:
  rL LLVM

http://reviews.llvm.org/D15451



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


[Lldb-commits] [lldb] r255499 - Add failure paths to a few JSONNumber members

2015-12-14 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Mon Dec 14 08:52:07 2015
New Revision: 255499

URL: http://llvm.org/viewvc/llvm-project?rev=255499&view=rev
Log:
Add failure paths to a few JSONNumber members

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


Modified:
lldb/trunk/include/lldb/Utility/JSON.h
lldb/trunk/source/Utility/JSON.cpp

Modified: lldb/trunk/include/lldb/Utility/JSON.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/JSON.h?rev=255499&r1=255498&r2=255499&view=diff
==
--- lldb/trunk/include/lldb/Utility/JSON.h (original)
+++ lldb/trunk/include/lldb/Utility/JSON.h Mon Dec 14 08:52:07 2015
@@ -145,7 +145,7 @@ namespace lldb_private {
 uint64_t
 GetAsUnsigned() const;
 
-uint64_t
+int64_t
 GetAsSigned() const;
 
 double

Modified: lldb/trunk/source/Utility/JSON.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/JSON.cpp?rev=255499&r1=255498&r2=255499&view=diff
==
--- lldb/trunk/source/Utility/JSON.cpp (original)
+++ lldb/trunk/source/Utility/JSON.cpp Mon Dec 14 08:52:07 2015
@@ -12,6 +12,7 @@
 #include 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -72,9 +73,10 @@ JSONNumber::GetAsUnsigned() const
 case DataType::Double:
 return (uint64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
-uint64_t
+int64_t
 JSONNumber::GetAsSigned() const
 {
 switch (m_data_type)
@@ -86,6 +88,7 @@ JSONNumber::GetAsSigned() const
 case DataType::Double:
 return (int64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 double
@@ -100,6 +103,7 @@ JSONNumber::GetAsDouble() const
 case DataType::Double:
 return m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 void


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


Re: [Lldb-commits] [PATCH] D15355: Add failure paths to a few JSONNumber members

2015-12-14 Thread Muhammad Omair Javaid via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255499: Add failure paths to a few JSONNumber members 
(authored by omjavaid).

Changed prior to commit:
  http://reviews.llvm.org/D15355?vs=42706&id=42712#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15355

Files:
  lldb/trunk/include/lldb/Utility/JSON.h
  lldb/trunk/source/Utility/JSON.cpp

Index: lldb/trunk/include/lldb/Utility/JSON.h
===
--- lldb/trunk/include/lldb/Utility/JSON.h
+++ lldb/trunk/include/lldb/Utility/JSON.h
@@ -145,7 +145,7 @@
 uint64_t
 GetAsUnsigned() const;
 
-uint64_t
+int64_t
 GetAsSigned() const;
 
 double
Index: lldb/trunk/source/Utility/JSON.cpp
===
--- lldb/trunk/source/Utility/JSON.cpp
+++ lldb/trunk/source/Utility/JSON.cpp
@@ -12,6 +12,7 @@
 #include 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -72,9 +73,10 @@
 case DataType::Double:
 return (uint64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
-uint64_t
+int64_t
 JSONNumber::GetAsSigned() const
 {
 switch (m_data_type)
@@ -86,6 +88,7 @@
 case DataType::Double:
 return (int64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 double
@@ -100,6 +103,7 @@
 case DataType::Double:
 return m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 void


Index: lldb/trunk/include/lldb/Utility/JSON.h
===
--- lldb/trunk/include/lldb/Utility/JSON.h
+++ lldb/trunk/include/lldb/Utility/JSON.h
@@ -145,7 +145,7 @@
 uint64_t
 GetAsUnsigned() const;
 
-uint64_t
+int64_t
 GetAsSigned() const;
 
 double
Index: lldb/trunk/source/Utility/JSON.cpp
===
--- lldb/trunk/source/Utility/JSON.cpp
+++ lldb/trunk/source/Utility/JSON.cpp
@@ -12,6 +12,7 @@
 #include 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -72,9 +73,10 @@
 case DataType::Double:
 return (uint64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
-uint64_t
+int64_t
 JSONNumber::GetAsSigned() const
 {
 switch (m_data_type)
@@ -86,6 +88,7 @@
 case DataType::Double:
 return (int64_t)m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 double
@@ -100,6 +103,7 @@
 case DataType::Double:
 return m_data.m_double;
 }
+llvm_unreachable("Unhandled data type");
 }
 
 void
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Ed Maste via lldb-commits
emaste added inline comments.


Comment at: source/Plugins/Process/Utility/CMakeLists.txt:6
@@ -5,2 +5,3 @@
   FreeBSDSignals.cpp
+  NetBSDSignals.cpp
   GDBRemoteSignals.cpp

Should keep these in alpha order


Comment at: source/Target/UnixSignals.cpp:66
@@ -64,4 +65,3 @@
 case llvm::Triple::FreeBSD:
 case llvm::Triple::OpenBSD:
 return std::make_shared();

Not part of your change, but just spotted it during this review; The default 
case should probably be used for OpenBSD. We can change it later.


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


Re: [Lldb-commits] [PATCH] D15451: Make test categories composable

2015-12-14 Thread Todd Fiala via lldb-commits
On Mon, Dec 14, 2015 at 5:39 AM, Tamas Berghammer 
wrote:

> tberghammer added inline comments.
>
> 
> Comment at: packages/Python/lldbsuite/test/lldbtest.py:518
> @@ +517,3 @@
> +if hasattr(func, "categories"):
> +cat.extend(func.categories)
> +func.categories = cat
> 
> labath wrote:
> > tberghammer wrote:
> > > tfiala wrote:
> > > > This code could potentially accept a single category and drop the
> need for the list.  It could check the type of the input (i.e. the
> categories input) and, if a single element rather than a list, it could
> just cat.append() it.
> > > >
> > > > That would enable a single argument passed to @add_test_categories()
> > > >
> > > > Totally minor and you can skip this, it just makes for a nice
> usability enhancement provided the decorator is documented as such.
> > > +1: I think we will (accidentally) call the function by a single
> string in some case so accepting it would be a good idea.
> > The test_categories.validate will catch the case where you forget to put
> the braces and throw errors at you, so it's not possible to get unexpected
> behavior here.
> >
> > I may be old-fashioned, but I like when things have a single type, which
> is obvious from the code. Look at all the cases where we do
> `callable(bugnumber)` and tell me if it's obvious why a "bug number" should
> be "callable". Plus, none of our other decorators taking lists have this
> kind of magic in them (imagine how would this complicate the logic of
> expectedFailureAll).
> >
> > If we want to provide a simpler syntax for adding a single category, i
> would go for adding a separate `@add_test_category` decorator for that.
> I think the pythonic way is to accept (almost) any type of argument
> including a single element string and any iterable (list, set, generator
> expression, etc...). In long term I would like to see all of our decorator
> taking single and multi argument at the same time but we can make that
> change later with refactoring all decorator to support it (it can be
> handled easily by a utility function).
>

I agree with Tamas on this.  We don't  get much static-time feedback from
dynamic scripting languages, so I'd rather err on the side of making it
easier for the user of the feature rather than making them think in a
static-language mindset without static-language help to point out misuses.
In these cases, where we're talking about "one or more of these" (where
these is some kind of argument, like one or more OSes as in oslist) I'd
prefer them to take a single or plural literal in the future.  We can wrap
them in a python sequence helper that handles accepting a singular or
plural form of argument.

e.g.

def list_of(singular_or_plural_arg):
# Check type in here, return list/sequence if it is one, otherwise wrap
in list.
...

def some_decorator_logic(os_one_or_more):
# Do something with the singular or plural form of os_one_or_more,
# Use the list_of() helper to make sure we always treat in sequence
context.
for os in list_of(os_one_or_more):
# do something with the one or more OS entries.

Something like that.  We probably have a few categories of helpers we'd
need (checking if an entry is in a one-or-more set, etc.)

-Todd


>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D15451
>
>
>
>


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


[Lldb-commits] [PATCH] D15498: Merge ENABLE_THREADS and ENABLE_STD_THREADS markers

2015-12-14 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added reviewers: labath, zturner.
tberghammer added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer.

Merge ENABLE_THREADS and ENABLE_STD_THREADS markers

Both of these markers are used in the test suit for annotating when a test 
needs multi threaded support. Previously they had slightly different meaning 
but they converged to the point where they are used interchangeably. This CL 
removes the ENABLE_STD_THREADS one to simplify the test suite and avoid some 
confusion.

Note: This CL is a preparation to get test running on android compiled with 
clang

http://reviews.llvm.org/D15498

Files:
  packages/Python/lldbsuite/test/api/multithreaded/Makefile
  
packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/Makefile
  packages/Python/lldbsuite/test/functionalities/thread/Makefile
  packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile
  
packages/Python/lldbsuite/test/functionalities/thread/break_after_join/Makefile
  
packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/Makefile
  
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/Makefile
  
packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/Makefile
  
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/Makefile
  packages/Python/lldbsuite/test/make/Makefile.rules
  packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/Makefile

Index: packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/Makefile
===
--- packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/Makefile
+++ packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/Makefile
@@ -1,6 +1,6 @@
 LEVEL = ../../../make
 
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/make/Makefile.rules
===
--- packages/Python/lldbsuite/test/make/Makefile.rules
+++ packages/Python/lldbsuite/test/make/Makefile.rules
@@ -208,7 +208,7 @@
 LDFLAGS ?= $(CFLAGS)
 LDFLAGS += $(LD_EXTRAS)
 ifeq (,$(filter $(OS), Windows_NT Android))
-	ifneq (,$(filter YES,$(ENABLE_THREADS) $(ENABLE_STD_THREADS)))
+	ifneq (,$(filter YES,$(ENABLE_THREADS)))
 		LDFLAGS += -pthread
 	endif
 endif
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/Makefile
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/Makefile
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/Makefile
@@ -1,6 +1,6 @@
 LEVEL = ../../../make
 
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/Makefile
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/Makefile
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/Makefile
@@ -1,6 +1,6 @@
 LEVEL = ../../../make
 
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/Makefile
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/Makefile
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/Makefile
@@ -1,6 +1,6 @@
 LEVEL = ../../../make
 
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/Makefile
===
--- packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/Makefile
+++ packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/Makefile
@@ -1,5 +1,5 @@
 LEVEL = ../../../make
 
 CXX_SOURCES := main.cpp
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/functionalities/thread/break_after_join/Makefile
===
--- packages/Python/lldbsuite/test/functionalities/thread/break_after_join/Makefile
+++ packages/Python/lldbsuite/test/functionalities/thread/break_after_join/Makefile
@@ -1,5 +1,5 @@
 LEVEL = ../../../make
 
 CXX_SOURCES := main.cpp
-ENABLE_STD_THREADS := YES
+ENABLE_THREADS := YES
 include $(LEVEL)/Makefile.rules
Index: packages/Python/lldbsuite/test/functionalities/thread/backtra

Re: [Lldb-commits] [PATCH] D15498: Merge ENABLE_THREADS and ENABLE_STD_THREADS markers

2015-12-14 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks like a nice simplification.


http://reviews.llvm.org/D15498



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


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

2015-12-14 Thread Zachary Turner via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255525: Make debug info specification use categories system. 
(authored by zturner).

Changed prior to commit:
  http://reviews.llvm.org/D15428?vs=42550&id=42739#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15428

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

Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -59,7 +59,6 @@
 
 # Test filtering options
 group = parser.add_argument_group('Test filtering options')
-group.add_argument('-N', choices=['dwarf', 'dwo', 'dsym'], help="Don't do test cases marked with the @dsym_test/@dwarf_test/@dwo_test decorator by passing dsym/dwarf/dwo as the option arg")
 group.add_argument('-f', metavar='filterspec', action='append', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite')  # FIXME: Example?
 X('-l', "Don't skip long running tests")
 group.add_argument('-p', metavar='pattern', help='Specify a regexp filename pattern for inclusion in the test suite')
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
@@ -549,48 +549,6 @@
 wrapper.__no_debug_info_test__ = True
 return wrapper
 
-def dsym_test(func):
-"""Decorate the item as a dsym test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dsym_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dsym_test:
-self.skipTest("dsym tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dsym_test__ = True
-return wrapper
-
-def dwarf_test(func):
-"""Decorate the item as a dwarf test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwarf_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwarf_test:
-self.skipTest("dwarf tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwarf_test__ = True
-return wrapper
-
-def dwo_test(func):
-"""Decorate the item as a dwo test."""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@dwo_test can only be used to decorate a test method")
-@wraps(func)
-def wrapper(self, *args, **kwargs):
-if configuration.dont_do_dwo_test:
-self.skipTest("dwo tests")
-return func(self, *args, **kwargs)
-
-# Mark this function as such to separate them from the regular tests.
-wrapper.__dwo_test__ = True
-return wrapper
-
 def debugserver_test(func):
 """Decorate the item as a debugserver test."""
 if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -2270,32 +2228,26 @@
 newattrs = {}
 for attrname, attrvalue in attrs.items():
 if attrname.startswith("test") and not getattr(attrvalue, "__no_debug_info_test__", False):
-@dsym_test
-@wraps(attrvalue)
-def dsym_test_method(self, attrvalue=attrvalue):
-self.debug_info = "dsym"
-return attrvalue(self)
-dsym_method_name = attrname + "_dsym"
-dsym_test_method.__name__ = dsym_method_name
-newattrs[dsym_method_name] = dsym_test_method
-
-@dwarf_test
-@wraps(attrvalue)
-def dwarf_test_method(self, attrvalue=attrvalue):
-self.debug_info = "dwarf"
-return attrvalue(self)
-dwarf_method_name = attrname + "_dwarf"
-dwarf_test_method.__name__ = dwarf_method_name
-newattrs[dwarf_method_name] = dwarf_test_method
-

[Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Dec 14 12:49:16 2015
New Revision: 255525

URL: http://llvm.org/viewvc/llvm-project?rev=255525&view=rev
Log:
Make debug info specification use categories system.

Reviewed By: Tamas Berghammer, Pavel Labath
Differential Revision: http://reviews.llvm.org/D15428

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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/packages/Python/lldbsuite/test/test_categories.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255525&r1=255524&r2=255525&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Mon Dec 14 
12:49:16 2015
@@ -56,10 +56,6 @@ def setupCrashInfoHook():
 # The test suite.
 suite = unittest2.TestSuite()
 
-dont_do_dsym_test = False
-dont_do_dwarf_test = False
-dont_do_dwo_test = False
-
 # The list of categories we said we care about
 categoriesList = None
 # set to true if we are going to use categories for cherry-picking test cases

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255525&r1=255524&r2=255525&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Dec 14 12:49:16 2015
@@ -281,14 +281,6 @@ def parseOptionsAndInitTestdirs():
 cflags_extras = args.E
 os.environ['CFLAGS_EXTRAS'] = cflags_extras
 
-# argparse makes sure we have correct options
-if args.N == 'dwarf':
-configuration.dont_do_dwarf_test = True
-elif args.N == 'dwo':
-configuration.dont_do_dwo_test = True
-elif args.N == 'dsym':
-configuration.dont_do_dsym_test = True
-
 if args.d:
 sys.stdout.write("Suspending the process %d to wait for debugger to 
attach...\n" % os.getpid())
 sys.stdout.flush()
@@ -945,15 +937,6 @@ def run_suite():
 
 target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
 
-# By default, both dsym, dwarf and dwo tests are performed.
-# Use @dsym_test, @dwarf_test or @dwo_test decorators, defined in 
lldbtest.py, to mark a test as
-# a dsym, dwarf or dwo test.  Use '-N dsym', '-N dwarf' or '-N dwo' to 
exclude dsym, dwarf or
-# dwo tests from running.
-configuration.dont_do_dsym_test = configuration.dont_do_dsym_test \
-or any(platform in target_platform for platform in ["linux", 
"freebsd", "windows"])
-configuration.dont_do_dwo_test = configuration.dont_do_dwo_test \
-or any(platform in target_platform for platform in ["darwin", 
"macosx", "ios"])
-
 # Don't do debugserver tests on everything except OS X.
 configuration.dont_do_debugserver_test = "linux" in target_platform or 
"freebsd" in target_platform or "windows" in target_platform
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255525&r1=255524&r2=255525&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Mon Dec 14 
12:49:16 2015
@@ -59,7 +59,6 @@ def create_parser():
 
 # Test filtering options
 group = parser.add_argument_group('Test filtering options')
-group.add_argument('-N', choices=['dwarf', 'dwo', 'dsym'], help="Don't do 
test cases marked with the @dsym_test/@dwarf_test/@dwo_test decorator by 
passing dsym/dwarf/dwo as the option arg")
 group.add_argument('-f', metavar='filterspec', action='append', 
help='Specify a filter, which consists of the test class name, a dot, followed 
by the test method, to only admit such test into the test suite')  # FIXME: 
Example?
 X('-l', "Don't skip long running tests")
 group.add_argument('-p', metavar='pattern', help='Specify a regexp 
filename pattern for inclusion in the test suite')

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalit

Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Tamas Berghammer via lldb-commits
Hi Zachary,

This change broke TestLimitDebugInfo with the following error
message(copied from the Linux buildbot):
==
ERROR: test_limit_debug_info_dwarf
(TestWithLimitDebugInfo.TestWithLimitDebugInfo)
--
Traceback (most recent call last):
File
"/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 2247, in test_method return attrvalue(self)
File
"/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1134, in wrapper if expected_fn(self):
File
"/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1096, in fn debug_info_passes = debug_info is None or self.debug_info
in debug_info
TypeError: argument of type 'function' is not iterable Config=i386-clang-3.5

Can you take a look?

Thanks,
Tamas

On Mon, Dec 14, 2015 at 6:52 PM Zachary Turner via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: zturner
> Date: Mon Dec 14 12:49:16 2015
> New Revision: 255525
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255525&view=rev
> Log:
> Make debug info specification use categories system.
>
> Reviewed By: Tamas Berghammer, Pavel Labath
> Differential Revision: http://reviews.llvm.org/D15428
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/configuration.py
> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
> lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
>
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
> lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
> lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255525&r1=255524&r2=255525&view=diff
>
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Mon Dec 14
> 12:49:16 2015
> @@ -56,10 +56,6 @@ def setupCrashInfoHook():
>  # The test suite.
>  suite = unittest2.TestSuite()
>
> -dont_do_dsym_test = False
> -dont_do_dwarf_test = False
> -dont_do_dwo_test = False
> -
>  # The list of categories we said we care about
>  categoriesList = None
>  # set to true if we are going to use categories for cherry-picking test
> cases
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255525&r1=255524&r2=255525&view=diff
>
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Dec 14
> 12:49:16 2015
> @@ -281,14 +281,6 @@ def parseOptionsAndInitTestdirs():
>  cflags_extras = args.E
>  os.environ['CFLAGS_EXTRAS'] = cflags_extras
>
> -# argparse makes sure we have correct options
> -if args.N == 'dwarf':
> -configuration.dont_do_dwarf_test = True
> -elif args.N == 'dwo':
> -configuration.dont_do_dwo_test = True
> -elif args.N == 'dsym':
> -configuration.dont_do_dsym_test = True
> -
>  if args.d:
>  sys.stdout.write("Suspending the process %d to wait for debugger
> to attach...\n" % os.getpid())
>  sys.stdout.flush()
> @@ -945,15 +937,6 @@ def run_suite():
>
>  target_platform =
> lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
>
> -# By default, both dsym, dwarf and dwo tests are performed.
> -# Use @dsym_test, @dwarf_test or @dwo_test decorators, defined in
> lldbtest.py, to mark a test as
> -# a dsym, dwarf or dwo test.  Use '-N dsym', '-N dwarf' or '-N dwo'
> to exclude dsym, dwarf or
> -# dwo tests from running.
> -configuration.dont_do_dsym_test = configuration.dont_do_dsym_test \
> -or any(platform in target_platform for platform in ["linux",
> "freebsd", "windows"])
> -configuration.dont_do_dwo_test = configuration.dont_do_dwo_test \
> -or any(platform in target_platform for platform in ["darwin",
> "macosx", "ios"])
> -
>  # Don't do debugserver tests on everything except OS X.
>  configuration.dont_do_debugserver_test = "linux" in target_platform
> or "freebsd" in target_platform or "windows" in target_platform
>
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/

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

2015-12-14 Thread Siva Chandra via lldb-commits
sivachandra updated this revision to Diff 42754.
sivachandra marked 2 inline comments as done.
sivachandra added a comment.

Remove storing of an unused data structure.


http://reviews.llvm.org/D15437

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

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

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

2015-12-14 Thread Siva Chandra via lldb-commits
sivachandra updated this revision to Diff 42758.
sivachandra added a comment.

Use std::unordered_map instead of std::map.


http://reviews.llvm.org/D15437

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

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

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

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

PTAL


http://reviews.llvm.org/D15437



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


Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Zachary Turner via lldb-commits
Sure, sorry about that

On Mon, Dec 14, 2015 at 11:52 AM Tamas Berghammer 
wrote:

> Hi Zachary,
>
> This change broke TestLimitDebugInfo with the following error
> message(copied from the Linux buildbot):
> ==
> ERROR: test_limit_debug_info_dwarf
> (TestWithLimitDebugInfo.TestWithLimitDebugInfo)
> --
> Traceback (most recent call last):
> File
> "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
> line 2247, in test_method return attrvalue(self)
> File
> "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
> line 1134, in wrapper if expected_fn(self):
> File
> "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
> line 1096, in fn debug_info_passes = debug_info is None or self.debug_info
> in debug_info
> TypeError: argument of type 'function' is not iterable
> Config=i386-clang-3.5
>
> Can you take a look?
>
> Thanks,
> Tamas
>
>
> On Mon, Dec 14, 2015 at 6:52 PM Zachary Turner via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: zturner
>> Date: Mon Dec 14 12:49:16 2015
>> New Revision: 255525
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=255525&view=rev
>> Log:
>> Make debug info specification use categories system.
>>
>> Reviewed By: Tamas Berghammer, Pavel Labath
>> Differential Revision: http://reviews.llvm.org/D15428
>>
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/configuration.py
>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>> lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
>> lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
>>
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255525&r1=255524&r2=255525&view=diff
>>
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Mon Dec 14
>> 12:49:16 2015
>> @@ -56,10 +56,6 @@ def setupCrashInfoHook():
>>  # The test suite.
>>  suite = unittest2.TestSuite()
>>
>> -dont_do_dsym_test = False
>> -dont_do_dwarf_test = False
>> -dont_do_dwo_test = False
>> -
>>  # The list of categories we said we care about
>>  categoriesList = None
>>  # set to true if we are going to use categories for cherry-picking test
>> cases
>>
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255525&r1=255524&r2=255525&view=diff
>>
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Dec 14
>> 12:49:16 2015
>> @@ -281,14 +281,6 @@ def parseOptionsAndInitTestdirs():
>>  cflags_extras = args.E
>>  os.environ['CFLAGS_EXTRAS'] = cflags_extras
>>
>> -# argparse makes sure we have correct options
>> -if args.N == 'dwarf':
>> -configuration.dont_do_dwarf_test = True
>> -elif args.N == 'dwo':
>> -configuration.dont_do_dwo_test = True
>> -elif args.N == 'dsym':
>> -configuration.dont_do_dsym_test = True
>> -
>>  if args.d:
>>  sys.stdout.write("Suspending the process %d to wait for debugger
>> to attach...\n" % os.getpid())
>>  sys.stdout.flush()
>> @@ -945,15 +937,6 @@ def run_suite():
>>
>>  target_platform =
>> lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
>>
>> -# By default, both dsym, dwarf and dwo tests are performed.
>> -# Use @dsym_test, @dwarf_test or @dwo_test decorators, defined in
>> lldbtest.py, to mark a test as
>> -# a dsym, dwarf or dwo test.  Use '-N dsym', '-N dwarf' or '-N dwo'
>> to exclude dsym, dwarf or
>> -# dwo tests from running.
>> -configuration.dont_do_dsym_test = configuration.dont_do_dsym_test \
>> -or any(platform in target_platform for platform in ["linux",
>> "freebsd", "windows"])
>> -configuration.dont_do_dwo_test = configuration.dont_do_dwo_test \
>> -or any(platform in target_platform for platform in ["darwin",
>> "macosx", "ios"])
>> -
>>  # Don't do debugserver tests on everything except OS X.
>>  configuration.dont_do_debugserver_test = "linux" in 

[Lldb-commits] [lldb] r255542 - Make skipIf decorator support not_in() functor.

2015-12-14 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Dec 14 15:26:49 2015
New Revision: 255542

URL: http://llvm.org/viewvc/llvm-project?rev=255542&view=rev
Log:
Make skipIf decorator support not_in() functor.

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=255542&r1=255541&r2=255542&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 15:26:49 
2015
@@ -613,14 +613,16 @@ def expectedFailure(expected_fn, bugnumb
 # 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):
+def not_in(iterable):
 return lambda x : x not in iterable
 
-def check_list_or_lambda (list_or_lambda, value):
+def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-else:
+elif isinstance(list_or_lambda, list):
 return list_or_lambda is None or value is None or value in 
list_or_lambda
+else:
+return list_or_lambda == value
 
 # 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
@@ -1090,10 +1092,10 @@ def skipIfLinuxClang(func):
 # 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, swig_version=None, py_version=None, remote=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)
-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)
 remote_passes = (remote is None) or (remote == (lldb.remote_platform 
is not None))


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


[Lldb-commits] [lldb] r255543 - test infra: enable single-worker rerun phase for flakey tests.

2015-12-14 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Mon Dec 14 15:28:46 2015
New Revision: 255543

URL: http://llvm.org/viewvc/llvm-project?rev=255543&view=rev
Log:
test infra: enable single-worker rerun phase for flakey tests.

Use of --rerun-all-issues will enable any test method failure, not just
test methods marked with the flakey decorator, to rerun.

Currently this does not change the flakey logic's immediate rerun
attempt.  I want to make sure this doesn't cause any significant issues
before changing that part.

The rerun reporting is only known to work properly with the
default (new) BasicResultsFormatter reporting.  Once we work out
any issues, I'll go back and make sure the curses output handles
it properly as well.

Added:

lldb/trunk/packages/Python/lldbsuite/test/issue_verification/TestRerunFail.py.park

lldb/trunk/packages/Python/lldbsuite/test/issue_verification/TestRerunTimeout.py.park
lldb/trunk/packages/Python/lldbsuite/test/issue_verification/rerun_base.py
Modified:
lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py?rev=255543&r1=255542&r2=255543&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py Mon 
Dec 14 15:28:46 2015
@@ -31,6 +31,11 @@ class BasicResultsFormatter(result_forma
 action="store_true",
 help=('cause unknown test events to generate '
   'a python assert.  Default is to ignore.'))
+parser.add_argument(
+"--dump-results",
+action="store_true",
+help=('dump the raw results data after printing '
+  'the summary output.'))
 return parser
 
 def __init__(self, out_file, options):
@@ -56,21 +61,21 @@ class BasicResultsFormatter(result_forma
 if event_type is None:
 return
 
-if event_type == "terminate":
+if event_type == EventBuilder.TYPE_SESSION_TERMINATE:
 self._finish_output()
-elif event_type == "test_start":
+elif event_type == EventBuilder.TYPE_TEST_START:
 self.track_start_time(
 test_event["test_class"],
 test_event["test_name"],
 test_event["event_time"])
-elif event_type == "test_result":
+elif event_type == EventBuilder.TYPE_TEST_RESULT:
 # Build the test key.
 test_key = test_event.get("test_filename", None)
 if test_key is None:
 raise Exception(
 "failed to find test filename for test event {}".format(
 test_event))
-test_key += ".{}.{}".format(
+test_key += ":{}.{}".format(
 test_event.get("test_class", ""),
 test_event.get("test_name", ""))
 
@@ -91,14 +96,8 @@ class BasicResultsFormatter(result_forma
 self.result_status_counts[old_status] -= 1
 
 self.test_method_rerun_count += 1
-if self.options.warn_on_multiple_results:
-print(
-"WARNING: test key {} already has a result: "
-"old:{} new:{}",
-self.result_events[test_key],
-test_event)
 self.result_events[test_key] = test_event
-elif event_type == "job_result":
+elif event_type == EventBuilder.TYPE_JOB_RESULT:
 # Build the job key.
 test_key = test_event.get("test_filename", None)
 if test_key is None:
@@ -336,6 +335,15 @@ class BasicResultsFormatter(result_forma
 self._print_summary_counts(
 categories, result_events_by_status, extra_results)
 
+if self.options.dump_results:
+# Debug dump of the key/result info for all categories.
+self._print_banner("Results Dump")
+for status, events_by_key in result_events_by_status.items():
+print("\nSTATUS: {}".format(status))
+for key, event in events_by_key:
+print("key:   {}".format(key))
+print("event: {}".format(event))
+
 def _finish_output(self):
 """Prepare and write the results report as all incoming events have
 arrived.

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org

[Lldb-commits] [lldb] r255547 - Correction in TestFrames.py test for arm targets in thumb mode

2015-12-14 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Mon Dec 14 15:41:18 2015
New Revision: 255547

URL: http://llvm.org/viewvc/llvm-project?rev=255547&view=rev
Log:
Correction in TestFrames.py test for arm targets in thumb mode

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


Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py?rev=255547&r1=255546&r2=255547&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py 
Mon Dec 14 15:41:18 2015
@@ -80,9 +80,12 @@ class FrameAPITestCase(TestBase):
 gpr_reg_set = lldbutil.get_GPRs(frame)
 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
 self.assertTrue (pc_value, "We should have a valid PC.")
-pc_value_str = pc_value.GetValue()
-self.assertTrue (pc_value_str, "We should have a valid PC 
string.")
-self.assertTrue (int(pc_value_str, 0) == frame.GetPC(), "PC 
gotten as a value should equal frame's GetPC")
+pc_value_int = int(pc_value.GetValue(), 0)
+# Make sure on arm targets we dont mismatch PC value on the 
basis of thumb bit.
+# Frame PC will not have thumb bit set in case of a thumb 
instruction as PC.
+if self.getArchitecture() in ['arm']:
+pc_value_int &= ~1
+self.assertTrue (pc_value_int == frame.GetPC(), "PC gotten as 
a value should equal frame's GetPC")
 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
 self.assertTrue (sp_value, "We should have a valid Stack 
Pointer.")
 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), 
"SP gotten as a value should equal frame's GetSP")


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


Re: [Lldb-commits] [PATCH] D15061: Correction in TestFrames.py test for arm targets in thumb mode

2015-12-14 Thread Muhammad Omair Javaid via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255547: Correction in TestFrames.py test for arm targets in 
thumb mode (authored by omjavaid).

Changed prior to commit:
  http://reviews.llvm.org/D15061?vs=41359&id=42765#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15061

Files:
  lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py

Index: lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -80,9 +80,12 @@
 gpr_reg_set = lldbutil.get_GPRs(frame)
 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
 self.assertTrue (pc_value, "We should have a valid PC.")
-pc_value_str = pc_value.GetValue()
-self.assertTrue (pc_value_str, "We should have a valid PC 
string.")
-self.assertTrue (int(pc_value_str, 0) == frame.GetPC(), "PC 
gotten as a value should equal frame's GetPC")
+pc_value_int = int(pc_value.GetValue(), 0)
+# Make sure on arm targets we dont mismatch PC value on the 
basis of thumb bit.
+# Frame PC will not have thumb bit set in case of a thumb 
instruction as PC.
+if self.getArchitecture() in ['arm']:
+pc_value_int &= ~1
+self.assertTrue (pc_value_int == frame.GetPC(), "PC gotten as 
a value should equal frame's GetPC")
 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
 self.assertTrue (sp_value, "We should have a valid Stack 
Pointer.")
 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), 
"SP gotten as a value should equal frame's GetSP")


Index: lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -80,9 +80,12 @@
 gpr_reg_set = lldbutil.get_GPRs(frame)
 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
 self.assertTrue (pc_value, "We should have a valid PC.")
-pc_value_str = pc_value.GetValue()
-self.assertTrue (pc_value_str, "We should have a valid PC string.")
-self.assertTrue (int(pc_value_str, 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
+pc_value_int = int(pc_value.GetValue(), 0)
+# Make sure on arm targets we dont mismatch PC value on the basis of thumb bit.
+# Frame PC will not have thumb bit set in case of a thumb instruction as PC.
+if self.getArchitecture() in ['arm']:
+pc_value_int &= ~1
+self.assertTrue (pc_value_int == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
 self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255548 - [Editline] Redesign automatic indentation fix command for robustness

2015-12-14 Thread Kate Stone via lldb-commits
Author: kate
Date: Mon Dec 14 15:43:59 2015
New Revision: 255548

URL: http://llvm.org/viewvc/llvm-project?rev=255548&view=rev
Log:
[Editline] Redesign automatic indentation fix command for robustness

The FixIndentationCommand implementation has proven to be fragile across 
various libedit iterations. This patch reworks the command to use the same 
basic strategy as when moving between lines in a multi-line edit session: when 
indentation changes are required, exit line editing completely and restart with 
amended content. This approach won't be susceptible to subtle behavior 
differences libedit has introduced over time.

Modified:
lldb/trunk/source/Host/common/Editline.cpp

Modified: lldb/trunk/source/Host/common/Editline.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=255548&r1=255547&r2=255548&view=diff
==
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Mon Dec 14 15:43:59 2015
@@ -863,37 +863,50 @@ Editline::NextLineCommand (int ch)
 unsigned char
 Editline::FixIndentationCommand (int ch)
 {
-if (!m_fix_indentation_callback) 
+if (!m_fix_indentation_callback)
 return CC_NORM;
-
-// Insert the character by hand prior to correction
+
+// Insert the character typed before proceeding
 EditLineCharType inserted[] = { (EditLineCharType)ch, 0 };
 el_winsertstr (m_editline, inserted);
-SaveEditedLine();
-StringList lines = GetInputAsStringList (m_current_line_index + 1);
-
-// Determine the cursor position
 LineInfoW * info = const_cast(el_wline (m_editline));
 int cursor_position = info->cursor - info->buffer;
-
+
+// Save the edits and determine the correct indentation level
+SaveEditedLine();
+StringList lines = GetInputAsStringList (m_current_line_index + 1);
 int indent_correction = m_fix_indentation_callback (this, lines, 
cursor_position, m_fix_indentation_callback_baton);
-
-// Adjust the input buffer to correct indentation
+
+// If it is already correct no special work is needed
+if (indent_correction == 0)
+return CC_REFRESH;
+
+// Change the indentation level of the line
+std::string currentLine = lines.GetStringAtIndex (m_current_line_index);
 if (indent_correction > 0)
 {
-info->cursor = info->buffer;
-el_winsertstr (m_editline, EditLineStringType (indent_correction, 
EditLineCharType(' ')).c_str());
+currentLine = currentLine.insert (0, indent_correction, ' ');
 }
-else if (indent_correction < 0)
+else
 {
-// Delete characters for the unindentation AND including the character 
we just added.
-el_wdeletestr (m_editline, -indent_correction + 1);
-
-// Rewrite the character that caused the unindentation.
-el_winsertstr (m_editline, inserted);
+currentLine = currentLine.erase (0, -indent_correction);
 }
-info->cursor = info->buffer + cursor_position + indent_correction;
-return CC_REFRESH;
+#if LLDB_EDITLINE_USE_WCHAR
+m_input_lines[m_current_line_index] = m_utf8conv.from_bytes (currentLine);
+#else
+m_input_lines[m_current_line_index] = currentLine;
+#endif
+
+// Update the display to reflect the change
+MoveCursor (CursorLocation::EditingCursor, CursorLocation::EditingPrompt);
+DisplayInput (m_current_line_index);
+
+// Reposition the cursor back on the original line and prepare to restart 
editing
+// with a new cursor position
+SetCurrentLine (m_current_line_index);
+MoveCursor (CursorLocation::BlockEnd, CursorLocation::EditingPrompt);
+m_revert_cursor_index = cursor_position + indent_correction;
+return CC_NEWLINE;
 }
 
 unsigned char


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


[Lldb-commits] [lldb] r255549 - Temporarily skip TestWithLimitDebugInfo on Darwin and OS X

2015-12-14 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Mon Dec 14 15:49:39 2015
New Revision: 255549

URL: http://llvm.org/viewvc/llvm-project?rev=255549&view=rev
Log:
Temporarily skip TestWithLimitDebugInfo on Darwin and OS X

This test is erroring out on a sequence call to a function.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=255549&r1=255548&r2=255549&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
 Mon Dec 14 15:49:39 2015
@@ -6,6 +6,8 @@ class TestWithLimitDebugInfo(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipIfLinux
+@skipIfDarwin
 @skipIf(debug_info=not_in(["dwarf"]))
 def test_limit_debug_info(self):
 self.build()


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


Re: [Lldb-commits] [lldb] r255549 - Temporarily skip TestWithLimitDebugInfo on Darwin and OS X

2015-12-14 Thread Siva Chandra via lldb-commits
I believe zturner already fixed this. However, there is a problem with
his original change itself; will bring it up in a different thread.

On Mon, Dec 14, 2015 at 1:49 PM, Todd Fiala via lldb-commits
 wrote:
> Author: tfiala
> Date: Mon Dec 14 15:49:39 2015
> New Revision: 255549
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255549&view=rev
> Log:
> Temporarily skip TestWithLimitDebugInfo on Darwin and OS X
>
> This test is erroring out on a sequence call to a function.
>
> Modified:
> 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=255549&r1=255548&r2=255549&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>  Mon Dec 14 15:49:39 2015
> @@ -6,6 +6,8 @@ class TestWithLimitDebugInfo(TestBase):
>
>  mydir = TestBase.compute_mydir(__file__)
>
> +@skipIfLinux
> +@skipIfDarwin
>  @skipIf(debug_info=not_in(["dwarf"]))
>  def test_limit_debug_info(self):
>  self.build()
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Siva Chandra via lldb-commits
On Mon, Dec 14, 2015 at 10:49 AM, Zachary Turner via lldb-commits
 wrote:
> 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=255525&r1=255524&r2=255525&view=diff
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 12:49:16 
> 2015
> @@ -549,48 +549,6 @@ def no_debug_info_test(func):
>  wrapper.__no_debug_info_test__ = True
>  return wrapper
>
> -def dsym_test(func):
> -"""Decorate the item as a dsym test."""
> -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> -raise Exception("@dsym_test can only be used to decorate a test 
> method")
> -@wraps(func)
> -def wrapper(self, *args, **kwargs):
> -if configuration.dont_do_dsym_test:
> -self.skipTest("dsym tests")
> -return func(self, *args, **kwargs)
> -
> -# Mark this function as such to separate them from the regular tests.
> -wrapper.__dsym_test__ = True
> -return wrapper
> -
> -def dwarf_test(func):
> -"""Decorate the item as a dwarf test."""
> -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> -raise Exception("@dwarf_test can only be used to decorate a test 
> method")
> -@wraps(func)
> -def wrapper(self, *args, **kwargs):
> -if configuration.dont_do_dwarf_test:
> -self.skipTest("dwarf tests")
> -return func(self, *args, **kwargs)
> -
> -# Mark this function as such to separate them from the regular tests.
> -wrapper.__dwarf_test__ = True
> -return wrapper
> -
> -def dwo_test(func):
> -"""Decorate the item as a dwo test."""
> -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> -raise Exception("@dwo_test can only be used to decorate a test 
> method")
> -@wraps(func)
> -def wrapper(self, *args, **kwargs):
> -if configuration.dont_do_dwo_test:
> -self.skipTest("dwo tests")
> -return func(self, *args, **kwargs)
> -
> -# Mark this function as such to separate them from the regular tests.
> -wrapper.__dwo_test__ = True
> -return wrapper
> -
>  def debugserver_test(func):
>  """Decorate the item as a debugserver test."""
>  if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> @@ -2270,32 +2228,26 @@ class LLDBTestCaseFactory(type):
>  newattrs = {}
>  for attrname, attrvalue in attrs.items():
>  if attrname.startswith("test") and not getattr(attrvalue, 
> "__no_debug_info_test__", False):
> -@dsym_test
> -@wraps(attrvalue)
> -def dsym_test_method(self, attrvalue=attrvalue):
> -self.debug_info = "dsym"
> -return attrvalue(self)
> -dsym_method_name = attrname + "_dsym"
> -dsym_test_method.__name__ = dsym_method_name
> -newattrs[dsym_method_name] = dsym_test_method
> -
> -@dwarf_test
> -@wraps(attrvalue)
> -def dwarf_test_method(self, attrvalue=attrvalue):
> -self.debug_info = "dwarf"
> -return attrvalue(self)
> -dwarf_method_name = attrname + "_dwarf"
> -dwarf_test_method.__name__ = dwarf_method_name
> -newattrs[dwarf_method_name] = dwarf_test_method
> -
> -@dwo_test
> -@wraps(attrvalue)
> -def dwo_test_method(self, attrvalue=attrvalue):
> -self.debug_info = "dwo"
> -return attrvalue(self)
> -dwo_method_name = attrname + "_dwo"
> -dwo_test_method.__name__ = dwo_method_name
> -newattrs[dwo_method_name] = dwo_test_method
> +target_platform = 
> lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
> +
> +# If any debug info categories were explicitly tagged, 
> assume that list to be
> +# authoritative.  If none were specified, try with all debug 
> info formats.
> +all_dbginfo_categories = 
> set(test_categories.debug_info_categories)
> +categories = set(getattr(attrvalue, "categories", [])) & 
> all_dbginfo_categories
> +if not categories:
> +categories = all_dbginfo_categories
> +
> +supported_categories = [x for x in categories
> +if 
> test_categories.is_supported_on_platform(x, target_platform)]
> +for category in supported_categories:
> +@add_test_categories([category])
> +@wraps(attrvalue)
> +def test_method(self, attrv

Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Zachary Turner via lldb-commits
The previous code was just an unrolled loop as far as I can tell.  Do you
mean the loop has different behavior than the unrolled loop?  Because it
looks identical to me (although admittedly python has a lot of nuances that
I don't understand in great detail)

On Mon, Dec 14, 2015 at 1:59 PM Siva Chandra  wrote:

> On Mon, Dec 14, 2015 at 10:49 AM, Zachary Turner via lldb-commits
>  wrote:
> > 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=255525&r1=255524&r2=255525&view=diff
> >
> ==
> > --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
> > +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14
> 12:49:16 2015
> > @@ -549,48 +549,6 @@ def no_debug_info_test(func):
> >  wrapper.__no_debug_info_test__ = True
> >  return wrapper
> >
> > -def dsym_test(func):
> > -"""Decorate the item as a dsym test."""
> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> > -raise Exception("@dsym_test can only be used to decorate a test
> method")
> > -@wraps(func)
> > -def wrapper(self, *args, **kwargs):
> > -if configuration.dont_do_dsym_test:
> > -self.skipTest("dsym tests")
> > -return func(self, *args, **kwargs)
> > -
> > -# Mark this function as such to separate them from the regular
> tests.
> > -wrapper.__dsym_test__ = True
> > -return wrapper
> > -
> > -def dwarf_test(func):
> > -"""Decorate the item as a dwarf test."""
> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> > -raise Exception("@dwarf_test can only be used to decorate a
> test method")
> > -@wraps(func)
> > -def wrapper(self, *args, **kwargs):
> > -if configuration.dont_do_dwarf_test:
> > -self.skipTest("dwarf tests")
> > -return func(self, *args, **kwargs)
> > -
> > -# Mark this function as such to separate them from the regular
> tests.
> > -wrapper.__dwarf_test__ = True
> > -return wrapper
> > -
> > -def dwo_test(func):
> > -"""Decorate the item as a dwo test."""
> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> > -raise Exception("@dwo_test can only be used to decorate a test
> method")
> > -@wraps(func)
> > -def wrapper(self, *args, **kwargs):
> > -if configuration.dont_do_dwo_test:
> > -self.skipTest("dwo tests")
> > -return func(self, *args, **kwargs)
> > -
> > -# Mark this function as such to separate them from the regular
> tests.
> > -wrapper.__dwo_test__ = True
> > -return wrapper
> > -
> >  def debugserver_test(func):
> >  """Decorate the item as a debugserver test."""
> >  if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> > @@ -2270,32 +2228,26 @@ class LLDBTestCaseFactory(type):
> >  newattrs = {}
> >  for attrname, attrvalue in attrs.items():
> >  if attrname.startswith("test") and not getattr(attrvalue,
> "__no_debug_info_test__", False):
> > -@dsym_test
> > -@wraps(attrvalue)
> > -def dsym_test_method(self, attrvalue=attrvalue):
> > -self.debug_info = "dsym"
> > -return attrvalue(self)
> > -dsym_method_name = attrname + "_dsym"
> > -dsym_test_method.__name__ = dsym_method_name
> > -newattrs[dsym_method_name] = dsym_test_method
> > -
> > -@dwarf_test
> > -@wraps(attrvalue)
> > -def dwarf_test_method(self, attrvalue=attrvalue):
> > -self.debug_info = "dwarf"
> > -return attrvalue(self)
> > -dwarf_method_name = attrname + "_dwarf"
> > -dwarf_test_method.__name__ = dwarf_method_name
> > -newattrs[dwarf_method_name] = dwarf_test_method
> > -
> > -@dwo_test
> > -@wraps(attrvalue)
> > -def dwo_test_method(self, attrvalue=attrvalue):
> > -self.debug_info = "dwo"
> > -return attrvalue(self)
> > -dwo_method_name = attrname + "_dwo"
> > -dwo_test_method.__name__ = dwo_method_name
> > -newattrs[dwo_method_name] = dwo_test_method
> > +target_platform =
> lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
> > +
> > +# If any debug info categories were explicitly tagged,
> assume that list to be
> > +# authoritative.  If none were specified, try with all
> debug info formats.
> > +all_dbginfo_categories =
> set(test_categories.debug_info_categories)
> > +categories = set(getattr(attrvalue, "categories", []))
> & all_dbgin

Re: [Lldb-commits] [lldb] r255549 - Temporarily skip TestWithLimitDebugInfo on Darwin and OS X

2015-12-14 Thread Siva Chandra via lldb-commits
Looks like, though that particular test was "fixed", zturner's change
triggered a whole bunch of other failures:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/9446

On Mon, Dec 14, 2015 at 1:56 PM, Siva Chandra  wrote:
> I believe zturner already fixed this. However, there is a problem with
> his original change itself; will bring it up in a different thread.
>
> On Mon, Dec 14, 2015 at 1:49 PM, Todd Fiala via lldb-commits
>  wrote:
>> Author: tfiala
>> Date: Mon Dec 14 15:49:39 2015
>> New Revision: 255549
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=255549&view=rev
>> Log:
>> Temporarily skip TestWithLimitDebugInfo on Darwin and OS X
>>
>> This test is erroring out on a sequence call to a function.
>>
>> Modified:
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>>
>> Modified: 
>> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=255549&r1=255548&r2=255549&view=diff
>> ==
>> --- 
>> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>>  (original)
>> +++ 
>> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
>>  Mon Dec 14 15:49:39 2015
>> @@ -6,6 +6,8 @@ class TestWithLimitDebugInfo(TestBase):
>>
>>  mydir = TestBase.compute_mydir(__file__)
>>
>> +@skipIfLinux
>> +@skipIfDarwin
>>  @skipIf(debug_info=not_in(["dwarf"]))
>>  def test_limit_debug_info(self):
>>  self.build()
>>
>>
>> ___
>> 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] [lldb] r255557 - Revert "Temporarily skip TestWithLimitDebugInfo on Darwin and OS X"

2015-12-14 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Mon Dec 14 16:04:20 2015
New Revision: 27

URL: http://llvm.org/viewvc/llvm-project?rev=27&view=rev
Log:
Revert "Temporarily skip TestWithLimitDebugInfo on Darwin and OS X"

This reverts commit 30ed0826a1bb800454088ea1ae16c113a69b92b1.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=27&r1=26&r2=27&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
 Mon Dec 14 16:04:20 2015
@@ -6,8 +6,6 @@ class TestWithLimitDebugInfo(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIfLinux
-@skipIfDarwin
 @skipIf(debug_info=not_in(["dwarf"]))
 def test_limit_debug_info(self):
 self.build()


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


Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Siva Chandra via lldb-commits
Previously, self.debug_info was under different functions
(dwarf_test_method, dwo_test_method etc.). Now, they are all under
test_method. Even I am equally ignorant about the Python nuances here.

On Mon, Dec 14, 2015 at 2:04 PM, Zachary Turner  wrote:
> The previous code was just an unrolled loop as far as I can tell.  Do you
> mean the loop has different behavior than the unrolled loop?  Because it
> looks identical to me (although admittedly python has a lot of nuances that
> I don't understand in great detail)
>
> On Mon, Dec 14, 2015 at 1:59 PM Siva Chandra  wrote:
>>
>> On Mon, Dec 14, 2015 at 10:49 AM, Zachary Turner via lldb-commits
>>  wrote:
>> > 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=255525&r1=255524&r2=255525&view=diff
>> >
>> > ==
>> > --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
>> > +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14
>> > 12:49:16 2015
>> > @@ -549,48 +549,6 @@ def no_debug_info_test(func):
>> >  wrapper.__no_debug_info_test__ = True
>> >  return wrapper
>> >
>> > -def dsym_test(func):
>> > -"""Decorate the item as a dsym test."""
>> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
>> > -raise Exception("@dsym_test can only be used to decorate a test
>> > method")
>> > -@wraps(func)
>> > -def wrapper(self, *args, **kwargs):
>> > -if configuration.dont_do_dsym_test:
>> > -self.skipTest("dsym tests")
>> > -return func(self, *args, **kwargs)
>> > -
>> > -# Mark this function as such to separate them from the regular
>> > tests.
>> > -wrapper.__dsym_test__ = True
>> > -return wrapper
>> > -
>> > -def dwarf_test(func):
>> > -"""Decorate the item as a dwarf test."""
>> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
>> > -raise Exception("@dwarf_test can only be used to decorate a
>> > test method")
>> > -@wraps(func)
>> > -def wrapper(self, *args, **kwargs):
>> > -if configuration.dont_do_dwarf_test:
>> > -self.skipTest("dwarf tests")
>> > -return func(self, *args, **kwargs)
>> > -
>> > -# Mark this function as such to separate them from the regular
>> > tests.
>> > -wrapper.__dwarf_test__ = True
>> > -return wrapper
>> > -
>> > -def dwo_test(func):
>> > -"""Decorate the item as a dwo test."""
>> > -if isinstance(func, type) and issubclass(func, unittest2.TestCase):
>> > -raise Exception("@dwo_test can only be used to decorate a test
>> > method")
>> > -@wraps(func)
>> > -def wrapper(self, *args, **kwargs):
>> > -if configuration.dont_do_dwo_test:
>> > -self.skipTest("dwo tests")
>> > -return func(self, *args, **kwargs)
>> > -
>> > -# Mark this function as such to separate them from the regular
>> > tests.
>> > -wrapper.__dwo_test__ = True
>> > -return wrapper
>> > -
>> >  def debugserver_test(func):
>> >  """Decorate the item as a debugserver test."""
>> >  if isinstance(func, type) and issubclass(func, unittest2.TestCase):
>> > @@ -2270,32 +2228,26 @@ class LLDBTestCaseFactory(type):
>> >  newattrs = {}
>> >  for attrname, attrvalue in attrs.items():
>> >  if attrname.startswith("test") and not getattr(attrvalue,
>> > "__no_debug_info_test__", False):
>> > -@dsym_test
>> > -@wraps(attrvalue)
>> > -def dsym_test_method(self, attrvalue=attrvalue):
>> > -self.debug_info = "dsym"
>> > -return attrvalue(self)
>> > -dsym_method_name = attrname + "_dsym"
>> > -dsym_test_method.__name__ = dsym_method_name
>> > -newattrs[dsym_method_name] = dsym_test_method
>> > -
>> > -@dwarf_test
>> > -@wraps(attrvalue)
>> > -def dwarf_test_method(self, attrvalue=attrvalue):
>> > -self.debug_info = "dwarf"
>> > -return attrvalue(self)
>> > -dwarf_method_name = attrname + "_dwarf"
>> > -dwarf_test_method.__name__ = dwarf_method_name
>> > -newattrs[dwarf_method_name] = dwarf_test_method
>> > -
>> > -@dwo_test
>> > -@wraps(attrvalue)
>> > -def dwo_test_method(self, attrvalue=attrvalue):
>> > -self.debug_info = "dwo"
>> > -return attrvalue(self)
>> > -dwo_method_name = attrname + "_dwo"
>> > -dwo_test_method.__name__ = dwo_method_name
>> > -newattrs[dwo_method_name] = dwo_test_method
>> > +target_platform =
>> > lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]

Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Zachary Turner via lldb-commits
Diff looks like this:

-@dwarf_test
-@wraps(attrvalue)
-def dwarf_test_method(self, attrvalue=attrvalue):
-self.debug_info = "dwarf"
-return attrvalue(self)
-dwarf_method_name = attrname + "_dwarf"
-dwarf_test_method.__name__ = dwarf_method_name
-newattrs[dwarf_method_name] = dwarf_test_method

...

+for category in supported_categories:
+@add_test_categories([category])
+@wraps(attrvalue)
+def test_method(self, attrvalue=attrvalue):
+self.debug_info = category
+return attrvalue(self)
+method_name = attrname + "_" + category
+test_method.__name__ = method_name
+newattrs[method_name] = test_method


So it looks like it's still under a different function.  The
difference is that before (in the - section of the diff) there were 3
different functions with 3 different names.  For example
`dwarf_test_method` above.  In the new code (+ section of the diff) it
looks like one function defined 3 different times with the same name
`test_method`.  But each of these should be a distinct function object
that is defined in the context of the closure determined by the
enclosing scope (the for loop in this case).  So all 3 functions are
actually different.  self is just an argument to the function, not
some magic value like `this` in C++, so as in the previous version,
the `debug_info` that gets modified is on whatever instance of `self`
gets passed into the function, same as before.

Tamas or Pavel can probably clarify, but that's my understanding.


On Mon, Dec 14, 2015 at 2:09 PM Siva Chandra  wrote:

> Previously, self.debug_info was under different functions
> (dwarf_test_method, dwo_test_method etc.). Now, they are all under
> test_method. Even I am equally ignorant about the Python nuances here.
>
> On Mon, Dec 14, 2015 at 2:04 PM, Zachary Turner 
> wrote:
> > The previous code was just an unrolled loop as far as I can tell.  Do you
> > mean the loop has different behavior than the unrolled loop?  Because it
> > looks identical to me (although admittedly python has a lot of nuances
> that
> > I don't understand in great detail)
> >
> > On Mon, Dec 14, 2015 at 1:59 PM Siva Chandra 
> wrote:
> >>
> >> On Mon, Dec 14, 2015 at 10:49 AM, Zachary Turner via lldb-commits
> >>  wrote:
> >> > 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=255525&r1=255524&r2=255525&view=diff
> >> >
> >> >
> ==
> >> > --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
> >> > +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14
> >> > 12:49:16 2015
> >> > @@ -549,48 +549,6 @@ def no_debug_info_test(func):
> >> >  wrapper.__no_debug_info_test__ = True
> >> >  return wrapper
> >> >
> >> > -def dsym_test(func):
> >> > -"""Decorate the item as a dsym test."""
> >> > -if isinstance(func, type) and issubclass(func,
> unittest2.TestCase):
> >> > -raise Exception("@dsym_test can only be used to decorate a
> test
> >> > method")
> >> > -@wraps(func)
> >> > -def wrapper(self, *args, **kwargs):
> >> > -if configuration.dont_do_dsym_test:
> >> > -self.skipTest("dsym tests")
> >> > -return func(self, *args, **kwargs)
> >> > -
> >> > -# Mark this function as such to separate them from the regular
> >> > tests.
> >> > -wrapper.__dsym_test__ = True
> >> > -return wrapper
> >> > -
> >> > -def dwarf_test(func):
> >> > -"""Decorate the item as a dwarf test."""
> >> > -if isinstance(func, type) and issubclass(func,
> unittest2.TestCase):
> >> > -raise Exception("@dwarf_test can only be used to decorate a
> >> > test method")
> >> > -@wraps(func)
> >> > -def wrapper(self, *args, **kwargs):
> >> > -if configuration.dont_do_dwarf_test:
> >> > -self.skipTest("dwarf tests")
> >> > -return func(self, *args, **kwargs)
> >> > -
> >> > -# Mark this function as such to separate them from the regular
> >> > tests.
> >> > -wrapper.__dwarf_test__ = True
> >> > -return wrapper
> >> > -
> >> > -def dwo_test(func):
> >> > -"""Decorate the item as a dwo test."""
> >> > -if isinstance(func, type) and issubclass(func,
> unittest2.TestCase):
> >> > -raise Exception("@dwo_test can only be used to decorate a
> test
> >> > method")
> >> > -@wraps(func)
> >> > -def wrapper(self, *args, **kwargs):
> >> > -if configuration.dont_do_dwo_test:
> >> > -self.skipTest("dwo tests")
> >> > -return func(self, *args, **kwargs)
> >> > -
> >> > -# Mark this fun

Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Siva Chandra via lldb-commits
On Mon, Dec 14, 2015 at 2:15 PM, Zachary Turner  wrote:
> Diff looks like this:
>
> -@dwarf_test
> -@wraps(attrvalue)
> -def dwarf_test_method(self, attrvalue=attrvalue):
> -self.debug_info = "dwarf"
> -return attrvalue(self)
> -dwarf_method_name = attrname + "_dwarf"
> -dwarf_test_method.__name__ = dwarf_method_name
> -newattrs[dwarf_method_name] = dwarf_test_method
>
> ...
>
> +for category in supported_categories:
> +@add_test_categories([category])
> +@wraps(attrvalue)
> +def test_method(self, attrvalue=attrvalue):
> +self.debug_info = category
> +return attrvalue(self)
> +method_name = attrname + "_" + category
> +test_method.__name__ = method_name
> +newattrs[method_name] = test_method
>
>
> So it looks like it's still under a different function.  The difference is
> that before (in the - section of the diff) there were 3 different functions
> with 3 different names.  For example `dwarf_test_method` above.  In the new
> code (+ section of the diff) it looks like one function defined 3 different
> times with the same name `test_method`.  But each of these should be a
> distinct function object that is defined in the context of the closure
> determined by the enclosing scope (the for loop in this case).  So all 3
> functions are actually different.  self is just an argument to the function,
> not some magic value like `this` in C++, so as in the previous version, the
> `debug_info` that gets modified is on whatever instance of `self` gets
> passed into the function, same as before.

I think you are right. I am only basing my theories by feeling the
elephant blind here. When running TestWithLimitDebugInfo, I have
printed the |category| value from test_method and it only prints
"dwo". So, it is |category| which is at fault here as it is the loop
variable. Though two different methods are actually getting added,
self.debug_info refers to the last value of |category|.

> Tamas or Pavel can probably clarify, but that's my understanding.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255567 - Remove the multiplier loop.

2015-12-14 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Dec 14 16:58:16 2015
New Revision: 255567

URL: http://llvm.org/viewvc/llvm-project?rev=255567&view=rev
Log:
Remove the multiplier loop.

This is leading to some kind of subtle issue related to local
functions and closures, so let's just go back to the old way for
now.

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=255567&r1=255566&r2=255567&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 16:58:16 
2015
@@ -2241,15 +2241,35 @@ class LLDBTestCaseFactory(type):
 
 supported_categories = [x for x in categories 
 if 
test_categories.is_supported_on_platform(x, target_platform)]
-for category in supported_categories:
-@add_test_categories([category])
+if "dsym" in supported_categories:
+@add_test_categories(["dsym"])
 @wraps(attrvalue)
-def test_method(self, attrvalue=attrvalue):
-self.debug_info = category
+def dsym_test_method(self, attrvalue=attrvalue):
+self.debug_info = "dsym"
 return attrvalue(self)
-method_name = attrname + "_" + category
-test_method.__name__ = method_name
-newattrs[method_name] = test_method
+dsym_method_name = attrname + "_dsym"
+dsym_test_method.__name__ = dsym_method_name
+newattrs[dsym_method_name] = dsym_test_method
+
+if "dwarf" in supported_categories:
+@add_test_categories(["dwarf"])
+@wraps(attrvalue)
+def dwarf_test_method(self, attrvalue=attrvalue):
+self.debug_info = "dwarf"
+return attrvalue(self)
+dwarf_method_name = attrname + "_dwarf"
+dwarf_test_method.__name__ = dwarf_method_name
+newattrs[dwarf_method_name] = dwarf_test_method
+
+if "dwo" in supported_categories:
+@add_test_categories(["dwo"])
+@wraps(attrvalue)
+def dwo_test_method(self, attrvalue=attrvalue):
+self.debug_info = "dwo"
+return attrvalue(self)
+dwo_method_name = attrname + "_dwo"
+dwo_test_method.__name__ = dwo_method_name
+newattrs[dwo_method_name] = dwo_test_method
 else:
 newattrs[attrname] = attrvalue
 return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, 
newattrs)


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


Re: [Lldb-commits] [lldb] r255525 - Make debug info specification use categories system.

2015-12-14 Thread Zachary Turner via lldb-commits
Alright, I'll revert this loop for now.  This is in at r255567.

On Mon, Dec 14, 2015 at 2:33 PM Siva Chandra  wrote:

> On Mon, Dec 14, 2015 at 2:15 PM, Zachary Turner 
> wrote:
> > Diff looks like this:
> >
> > -@dwarf_test
> > -@wraps(attrvalue)
> > -def dwarf_test_method(self, attrvalue=attrvalue):
> > -self.debug_info = "dwarf"
> > -return attrvalue(self)
> > -dwarf_method_name = attrname + "_dwarf"
> > -dwarf_test_method.__name__ = dwarf_method_name
> > -newattrs[dwarf_method_name] = dwarf_test_method
> >
> > ...
> >
> > +for category in supported_categories:
> > +@add_test_categories([category])
> > +@wraps(attrvalue)
> > +def test_method(self, attrvalue=attrvalue):
> > +self.debug_info = category
> > +return attrvalue(self)
> > +method_name = attrname + "_" + category
> > +test_method.__name__ = method_name
> > +newattrs[method_name] = test_method
> >
> >
> > So it looks like it's still under a different function.  The difference
> is
> > that before (in the - section of the diff) there were 3 different
> functions
> > with 3 different names.  For example `dwarf_test_method` above.  In the
> new
> > code (+ section of the diff) it looks like one function defined 3
> different
> > times with the same name `test_method`.  But each of these should be a
> > distinct function object that is defined in the context of the closure
> > determined by the enclosing scope (the for loop in this case).  So all 3
> > functions are actually different.  self is just an argument to the
> function,
> > not some magic value like `this` in C++, so as in the previous version,
> the
> > `debug_info` that gets modified is on whatever instance of `self` gets
> > passed into the function, same as before.
>
> I think you are right. I am only basing my theories by feeling the
> elephant blind here. When running TestWithLimitDebugInfo, I have
> printed the |category| value from test_method and it only prints
> "dwo". So, it is |category| which is at fault here as it is the loop
> variable. Though two different methods are actually getting added,
> self.debug_info refers to the last value of |category|.
>
> > Tamas or Pavel can probably clarify, but that's my understanding.
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255568 - [Test] Addresses failing test when path to make contains spaces

2015-12-14 Thread Kate Stone via lldb-commits
Author: kate
Date: Mon Dec 14 16:59:26 2015
New Revision: 255568

URL: http://llvm.org/viewvc/llvm-project?rev=255568&view=rev
Log:
[Test] Addresses failing test when path to make contains spaces


Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk?rev=255568&r1=255567&r2=255568&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk 
Mon Dec 14 16:59:26 2015
@@ -17,7 +17,7 @@ include $(LEVEL)/Makefile.rules
 $(DYLIB_FILENAME): lib_b
 
 lib_b:
-   $(MAKE) -f b.mk
+   "$(MAKE)" -f b.mk
 
 clean::
-   $(MAKE) -f b.mk clean
+   "$(MAKE)" -f b.mk clean


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


[Lldb-commits] [lldb] r255581 - test infra: catch and print exception info on test runner socket listener

2015-12-14 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Mon Dec 14 17:45:38 2015
New Revision: 255581

URL: http://llvm.org/viewvc/llvm-project?rev=255581&view=rev
Log:
test infra: catch and print exception info on test runner socket listener

This is the listener's spawned connection, not the listener itself.
(i.e. this is the test runner's receiving side of test event sockets).
A standard socket.error will just issue an INFO statement and continue.
Something other than a socket.error will get an ERROR: printed (and
also continue).

Hopefully this gets us more info and also handles the completely
to-be-expected scenario that the test inferior might go down at
any point.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py?rev=255581&r1=255580&r2=255581&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py Mon Dec 14 
17:45:38 2015
@@ -27,6 +27,7 @@ from six.moves import cPickle
 
 # LLDB modules
 
+
 class UnpicklingForwardingReaderChannel(asyncore.dispatcher):
 """Provides an unpickling, forwarding asyncore dispatch channel reader.
 
@@ -71,7 +72,7 @@ class UnpicklingForwardingReaderChannel(
 
 full_header_len = 4
 
-assert(len(self.header_contents) < full_header_len)
+assert len(self.header_contents) < full_header_len
 
 bytes_avail = len(data)
 bytes_needed = full_header_len - len(self.header_contents)
@@ -80,7 +81,8 @@ class UnpicklingForwardingReaderChannel(
 if len(self.header_contents) == full_header_len:
 import struct
 # End of header.
-self.packet_bytes_remaining = struct.unpack("!I", 
self.header_contents)[0]
+self.packet_bytes_remaining = struct.unpack(
+"!I", self.header_contents)[0]
 self.header_contents = b""
 self.reading_header = False
 return data[header_bytes_avail:]
@@ -130,9 +132,23 @@ class UnpicklingForwardingReaderChannel(
 return data
 
 def handle_read(self):
-data = self.recv(8192)
-# print('driver socket READ: %d bytes' % len(data))
+# Read some data from the socket.
+try:
+data = self.recv(8192)
+# print('driver socket READ: %d bytes' % len(data))
+except socket.error as socket_error:
+print(
+"\nINFO: received socket error when reading data "
+"from test inferior:\n{}".format(socket_error))
+# Should be good to return here.
+return
+except Exception as general_exception:
+print(
+"\nERROR: received non-socket error when reading data "
+"from the test inferior:\n{}".format(general_exception))
+return
 
+# Consume the message content.
 while data and (len(data) > 0):
 # If we're reading the header, gather header bytes.
 if self.reading_header:


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


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

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

Thank you. After fixing the order I'm going to land this diff.



Comment at: source/Plugins/Process/Utility/CMakeLists.txt:6
@@ -5,2 +5,3 @@
   FreeBSDSignals.cpp
+  NetBSDSignals.cpp
   GDBRemoteSignals.cpp

emaste wrote:
> Should keep these in alpha order
Good catch.


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: source/Target/UnixSignals.cpp:66
@@ -64,4 +65,3 @@
 case llvm::Triple::FreeBSD:
 case llvm::Triple::OpenBSD:
 return std::make_shared();

emaste wrote:
> Not part of your change, but just spotted it during this review; The default 
> case should probably be used for OpenBSD. We can change it later.
I will leave it as it is.


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


Re: [Lldb-commits] [PATCH] D15407: When stepping in/over source lines, combine the addr ranges of all line table entries w/ same line num

2015-12-14 Thread Jim Ingham via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

That looks fine.


http://reviews.llvm.org/D15407



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


Re: [Lldb-commits] [lldb] r255542 - Make skipIf decorator support not_in() functor.

2015-12-14 Thread Siva Chandra via lldb-commits
This change looks very innocent, but:

On Mon, Dec 14, 2015 at 1:26 PM, Zachary Turner via lldb-commits
 wrote:
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255542&r1=255541&r2=255542&view=diff
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 15:26:49 
> 2015
> @@ -613,14 +613,16 @@ def expectedFailure(expected_fn, bugnumb
>  # 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):
> +def not_in(iterable):
>  return lambda x : x not in iterable
>
> -def check_list_or_lambda (list_or_lambda, value):
> +def check_list_or_lambda(list_or_lambda, value):
>  if six.callable(list_or_lambda):
>  return list_or_lambda(value)
> -else:
> +elif isinstance(list_or_lambda, list):

Previously, list_or_lambda could be a string. It cannot be now. That
is, we should have:

elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):

>  return list_or_lambda is None or value is None or value in 
> list_or_lambda
> +else:
> +return list_or_lambda == value

Previously, if value or list_or_lambda were None, this function
returned True. It returns False now unless both are None. That is, it
should be:

else:
return list_or_lambda is None or value is None or list_or_lambda == value

Will send a change list soon with the above fixed.

>
>  # 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
> @@ -1090,10 +1092,10 @@ def skipIfLinuxClang(func):
>  # 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, swig_version=None, 
> py_version=None, remote=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)
> -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)
>  remote_passes = (remote is None) or (remote == (lldb.remote_platform 
> is not None))
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Siva Chandra via lldb-commits
sivachandra created this revision.
sivachandra added a reviewer: zturner.
sivachandra added a subscriber: lldb-commits.

http://reviews.llvm.org/D15511

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
@@ -619,10 +619,10 @@
 def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in 
list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda
 else:
-return list_or_lambda == value
+return list_or_lambda is None or value is None or list_or_lambda == 
value
 
 # 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


Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -619,10 +619,10 @@
 def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda
 else:
-return list_or_lambda == value
+return list_or_lambda is None or value is None or list_or_lambda == value
 
 # 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
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 42800.
krytarowski added a comment.

Improve abc order of source files


Repository:
  rL LLVM

http://reviews.llvm.org/D15482

Files:
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/NetBSDSignals.cpp
  source/Plugins/Process/Utility/NetBSDSignals.h
  source/Target/UnixSignals.cpp

Index: source/Target/UnixSignals.cpp
===
--- source/Target/UnixSignals.cpp
+++ source/Target/UnixSignals.cpp
@@ -19,6 +19,7 @@
 #include "Plugins/Process/Utility/FreeBSDSignals.h"
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/Utility/MipsLinuxSignals.h"
+#include "Plugins/Process/Utility/NetBSDSignals.h"
 
 using namespace lldb_private;
 
@@ -63,8 +64,9 @@
 }
 case llvm::Triple::FreeBSD:
 case llvm::Triple::OpenBSD:
-case llvm::Triple::NetBSD:
 return std::make_shared();
+case llvm::Triple::NetBSD:
+return std::make_shared();
 default:
 return std::make_shared();
 }
Index: source/Plugins/Process/Utility/NetBSDSignals.h
===
--- /dev/null
+++ source/Plugins/Process/Utility/NetBSDSignals.h
@@ -0,0 +1,31 @@
+//===-- NetBSDSignals.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_NetBSDSignals_H_
+#define liblldb_NetBSDSignals_H_
+
+// Project includes
+#include "lldb/Target/UnixSignals.h"
+
+namespace lldb_private {
+
+/// NetBSD specific set of Unix signals.
+class NetBSDSignals : public UnixSignals
+{
+public:
+NetBSDSignals();
+
+private:
+void
+Reset() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_NetBSDSignals_H_
Index: source/Plugins/Process/Utility/NetBSDSignals.cpp
===
--- /dev/null
+++ source/Plugins/Process/Utility/NetBSDSignals.cpp
@@ -0,0 +1,34 @@
+//===-- NetBSDSignals.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "NetBSDSignals.h"
+
+using namespace lldb_private;
+
+NetBSDSignals::NetBSDSignals()
+: UnixSignals()
+{
+Reset();
+}
+
+void
+NetBSDSignals::Reset()
+{
+UnixSignals::Reset();
+//SIGNO  NAME  SUPPRESS STOP   NOTIFY DESCRIPTION
+//==    == == ===
+AddSignal (32,   "SIGPWR", false,   true , true , "power fail/restart (not reset when caught)");
+#ifdef SIGRTMIN /* SIGRTMAX */
+/* Kernel only; not exposed to userland yet */
+#endif
+}
Index: source/Plugins/Process/Utility/CMakeLists.txt
===
--- source/Plugins/Process/Utility/CMakeLists.txt
+++ source/Plugins/Process/Utility/CMakeLists.txt
@@ -9,6 +9,7 @@
   InferiorCallPOSIX.cpp
   LinuxSignals.cpp
   MipsLinuxSignals.cpp
+  NetBSDSignals.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
   RegisterContextDarwin_i386.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

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

I went ahead and committed this.


Repository:
  rL LLVM

http://reviews.llvm.org/D15511



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


[Lldb-commits] [lldb] r255584 - Make few adjustments after r255542.

2015-12-14 Thread Siva Chandra via lldb-commits
Author: sivachandra
Date: Mon Dec 14 18:26:52 2015
New Revision: 255584

URL: http://llvm.org/viewvc/llvm-project?rev=255584&view=rev
Log:
Make few adjustments after r255542.

Reviewers: zturner

Subscribers: lldb-commits

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

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=255584&r1=255583&r2=255584&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 18:26:52 
2015
@@ -619,10 +619,10 @@ def not_in(iterable):
 def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in 
list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda
 else:
-return list_or_lambda == value
+return list_or_lambda is None or value is None or list_or_lambda == 
value
 
 # 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


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


Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Siva Chandra via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255584: Make few adjustments after r255542. (authored by 
sivachandra).

Changed prior to commit:
  http://reviews.llvm.org/D15511?vs=42796&id=42802#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15511

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

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -619,10 +619,10 @@
 def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in 
list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda
 else:
-return list_or_lambda == value
+return list_or_lambda is None or value is None or list_or_lambda == 
value
 
 # 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


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
@@ -619,10 +619,10 @@
 def check_list_or_lambda(list_or_lambda, value):
 if six.callable(list_or_lambda):
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda
 else:
-return list_or_lambda == value
+return list_or_lambda is None or value is None or list_or_lambda == value
 
 # 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
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15407: When stepping in/over source lines, combine the addr ranges of all line table entries w/ same line num

2015-12-14 Thread Jason Molenda via lldb-commits
jasonmolenda closed this revision.
jasonmolenda added a comment.

Sendinginclude/lldb/Symbol/LineEntry.h
Sendinginclude/lldb/Target/Thread.h
Sendingsource/API/SBThread.cpp
Sendingsource/Commands/CommandObjectThread.cpp
Sendingsource/Symbol/LineEntry.cpp
Sendingsource/Target/Thread.cpp
Sendingsource/Target/ThreadPlanStepRange.cpp
Transmitting file data ...
Committed revision 255590.


http://reviews.llvm.org/D15407



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


[Lldb-commits] [lldb] r255590 - When constructing an address range to "step" or "next" through,

2015-12-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 14 18:40:30 2015
New Revision: 255590

URL: http://llvm.org/viewvc/llvm-project?rev=255590&view=rev
Log:
When constructing an address range to "step" or "next" through,
find the largest address range (possibly combining multiple 
LineEntry's for this line number) that is contiguous.

This allows lldb's fast-step stepping algorithm to potentially
run for a longer address range than if we have to stop at every
LineEntry indicating a subexpression in the source line.

http://reviews.llvm.org/D15407
 

Modified:
lldb/trunk/include/lldb/Symbol/LineEntry.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/source/API/SBThread.cpp
lldb/trunk/source/Commands/CommandObjectThread.cpp
lldb/trunk/source/Symbol/LineEntry.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadPlanStepRange.cpp

Modified: lldb/trunk/include/lldb/Symbol/LineEntry.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/LineEntry.h?rev=255590&r1=255589&r2=255590&view=diff
==
--- lldb/trunk/include/lldb/Symbol/LineEntry.h (original)
+++ lldb/trunk/include/lldb/Symbol/LineEntry.h Mon Dec 14 18:40:30 2015
@@ -140,6 +140,32 @@ struct LineEntry
 static int
 Compare (const LineEntry& lhs, const LineEntry& rhs);
 
+//--
+/// Give the range for this LineEntry + any additional LineEntries for
+/// this same source line that are contiguous.
+///
+/// A compiler may emit multiple line entries for a single source line,
+/// e.g. to indicate subexpressions at different columns.  This method
+/// will get the AddressRange for all of the LineEntries for this source 
+/// line that are contiguous.
+//
+/// Line entries with a line number of 0 are treated specially - these
+/// are compiler-generated line table entries that the user did not
+/// write in their source code, and we want to skip past in the debugger.  
+/// If this LineEntry is for line 32, and the following LineEntry is for 
+/// line 0, we will extend the range to include the AddressRange of the 
+/// line 0 LineEntry (and it will include the range of the following 
+/// LineEntries that match either 32 or 0.)
+///
+/// If the initial LineEntry this method is called on is a line #0, only
+/// the range of contiuous LineEntries with line #0 will be included in
+/// the complete range.
+/// 
+/// @return
+/// The contiguous AddressRange for this source line.
+//--
+AddressRange
+GetSameLineContiguousAddressRange () const;
 
 //--
 // Member variables.

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=255590&r1=255589&r2=255590&view=diff
==
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Mon Dec 14 18:40:30 2015
@@ -754,6 +754,15 @@ public:
  lldb::RunMode stop_other_threads,
  LazyBool 
step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
 
+// Helper function that takes a LineEntry to step, insted of an 
AddressRange.  This may combine multiple
+// LineEntries of the same source line number to step over a longer 
address range in a single operation.
+virtual lldb::ThreadPlanSP
+QueueThreadPlanForStepOverRange (bool abort_other_plans,
+ const LineEntry &line_entry,
+ const SymbolContext &addr_context,
+ lldb::RunMode stop_other_threads,
+ LazyBool 
step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
+
 //--
 /// Queues the plan used to step through an address range, stepping into 
functions.
 ///
@@ -797,6 +806,17 @@ public:
const SymbolContext &addr_context,
const char *step_in_target,
lldb::RunMode stop_other_threads,
+   LazyBool 
step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
+   LazyBool 
step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
+
+// Helper function that takes a LineEntry to step, insted of an 
AddressRange.  This may combine multiple
+// LineEntries of the same source line number to step over a longer 
address range in a single operation.
+virtual lldb::ThreadPl

[Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Dec 14 18:50:19 2015
New Revision: 255592

URL: http://llvm.org/viewvc/llvm-project?rev=255592&view=rev
Log:
Welcome to NetBSD signals

Summary:
Signals 1-32 are matching the default UNIX platform.

There are platform specific ones above 32.

From the `/usr/include/sys/signal.h` header:

```
#define SIGPWR  32  /* power fail/restart (not reset when caught) */
#ifdef _KERNEL
#define SIGRTMIN33  /* Kernel only; not exposed to userland yet */
#define SIGRTMAX63  /* Kernel only; not exposed to userland yet */
#endif
```

Reviewers: emaste, joerg

Subscribers: lldb-commits

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

Added:
lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
Modified:
lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
lldb/trunk/source/Target/UnixSignals.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt?rev=255592&r1=255591&r2=255592&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Mon Dec 14 
18:50:19 2015
@@ -9,6 +9,7 @@ add_lldb_library(lldbPluginProcessUtilit
   InferiorCallPOSIX.cpp
   LinuxSignals.cpp
   MipsLinuxSignals.cpp
+  NetBSDSignals.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
   RegisterContextDarwin_i386.cpp

Added: lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp?rev=255592&view=auto
==
--- lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp (added)
+++ lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp Mon Dec 14 
18:50:19 2015
@@ -0,0 +1,34 @@
+//===-- NetBSDSignals.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "NetBSDSignals.h"
+
+using namespace lldb_private;
+
+NetBSDSignals::NetBSDSignals()
+: UnixSignals()
+{
+Reset();
+}
+
+void
+NetBSDSignals::Reset()
+{
+UnixSignals::Reset();
+//SIGNO  NAME  SUPPRESS STOP   NOTIFY DESCRIPTION
+//==    == == 
===
+AddSignal (32,   "SIGPWR", false,   true , true , "power fail/restart 
(not reset when caught)");
+#ifdef SIGRTMIN /* SIGRTMAX */
+/* Kernel only; not exposed to userland yet */
+#endif
+}

Added: lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h?rev=255592&view=auto
==
--- lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h (added)
+++ lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h Mon Dec 14 
18:50:19 2015
@@ -0,0 +1,31 @@
+//===-- NetBSDSignals.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_NetBSDSignals_H_
+#define liblldb_NetBSDSignals_H_
+
+// Project includes
+#include "lldb/Target/UnixSignals.h"
+
+namespace lldb_private {
+
+/// NetBSD specific set of Unix signals.
+class NetBSDSignals : public UnixSignals
+{
+public:
+NetBSDSignals();
+
+private:
+void
+Reset() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_NetBSDSignals_H_

Modified: lldb/trunk/source/Target/UnixSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/UnixSignals.cpp?rev=255592&r1=255591&r2=255592&view=diff
==
--- lldb/trunk/source/Target/UnixSignals.cpp (original)
+++ lldb/trunk/source/Target/UnixSignals.cpp Mon Dec 14 18:50:19 2015
@@ -19,6 +19,7 @@
 #include "Plugins/Process/Utility/FreeBSDSignals.h"
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/Utility/MipsLinuxSignals.h"
+#include "Plugins/Process/Utility/NetBSDSignals.h"
 
 using namespace lldb_private;
 
@@ -63,8 +64,9 @@ UnixSignals::Create(const ArchSpec &a

Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Yep this fixed the issues I was having on OS X with the related change.  
Thanks, Siva!


Repository:
  rL LLVM

http://reviews.llvm.org/D15511



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


[Lldb-commits] [lldb] r255597 - Add NetBSDSignals.cpp to the xcode project file.

2015-12-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 14 19:26:25 2015
New Revision: 255597

URL: http://llvm.org/viewvc/llvm-project?rev=255597&view=rev
Log:
Add NetBSDSignals.cpp to the xcode project file.

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=255597&r1=255596&r2=255597&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Dec 14 19:26:25 2015
@@ -593,8 +593,8 @@
26BF51F61B3C754400016294 /* ABISysV_i386.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */; 
};
26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };
-   26C7C4831BFFEA7E009BD01F /* WindowsMiniDump.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp 
*/; settings = {ASSET_TAGS = (); }; };
-   26C7C4841BFFEA7E009BD01F /* WindowsMiniDump.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h 
*/; settings = {ASSET_TAGS = (); }; };
+   26C7C4831BFFEA7E009BD01F /* WindowsMiniDump.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp 
*/; };
+   26C7C4841BFFEA7E009BD01F /* WindowsMiniDump.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h 
*/; };
26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26CA979F172B1FD5005DC71B /* 
RegisterContextThreadMemory.cpp */; };
26CEB5EF18761CB2008F575A /* libedit.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
26CEB5F218762056008F575A /* CommandObjectGUI.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 26CEB5F018762056008F575A /* 
CommandObjectGUI.cpp */; };
@@ -634,8 +634,8 @@
26E152261419CAD4007967D0 /* ObjectFilePECOFF.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 26E152231419CACA007967D0 /* 
ObjectFilePECOFF.cpp */; };
26ECA04313665FED008D1F18 /* ARM_DWARF_Registers.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26ECA04213665FED008D1F18 /* 
ARM_DWARF_Registers.cpp */; };
26ED3D6D13C563810017D45E /* OptionGroupVariable.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26ED3D6C13C563810017D45E /* 
OptionGroupVariable.cpp */; };
-   26EFB61B1BFE8D3E00544801 /* PlatformNetBSD.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp 
*/; settings = {ASSET_TAGS = (); }; };
-   26EFB61C1BFE8D3E00544801 /* PlatformNetBSD.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */; 
settings = {ASSET_TAGS = (); }; };
+   26EFB61B1BFE8D3E00544801 /* PlatformNetBSD.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp 
*/; };
+   26EFB61C1BFE8D3E00544801 /* PlatformNetBSD.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */; 
};
26EFC4CD18CFAF0D00865D87 /* ObjectFileJIT.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26EFC4CA18CFAF0D00865D87 /* ObjectFileJIT.cpp 
*/; };
26F006561B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26F006541B4DD86700B872E5 /* 
DynamicLoaderWindowsDYLD.cpp */; };
26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */; 
};
@@ -884,6 +884,8 @@
AF26703B1852D01E00B6CC36 /* QueueList.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF2670391852D01E00B6CC36 /* QueueList.cpp */; };
AF2BA6EC1A707E3400C5248A /* UriParser.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 33064C991A5C7A330033D415 /* UriParser.cpp */; };
AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; 
};
+   AF33B4BE1C1FA441001B28D9 /* NetBSDSignals.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp 
*/; };
+   AF33B4BF1C1FA441001B28D9 /* NetBSDSignals.h in Headers */ = 
{isa = PBXBuildFile; fileRef = AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */; 
};
 

[Lldb-commits] [lldb] r255598 - Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings in some files in source/Target/.

2015-12-14 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Mon Dec 14 19:33:19 2015
New Revision: 255598

URL: http://llvm.org/viewvc/llvm-project?rev=255598&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr 
warnings in some files in source/Target/.

Simplify smart pointers checks in conditions. Other minor fixes.

Modified:
lldb/trunk/source/Target/TargetList.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadList.cpp
lldb/trunk/source/Target/ThreadPlan.cpp
lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
lldb/trunk/source/Target/ThreadPlanCallFunctionUsingABI.cpp
lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
lldb/trunk/source/Target/ThreadPlanStepOut.cpp
lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
lldb/trunk/source/Target/ThreadPlanStepRange.cpp
lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
lldb/trunk/source/Target/ThreadPlanTracer.cpp
lldb/trunk/source/Target/ThreadSpec.cpp

Modified: lldb/trunk/source/Target/TargetList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=255598&r1=255597&r2=255598&view=diff
==
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Mon Dec 14 19:33:19 2015
@@ -10,6 +10,8 @@
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
+#include "llvm/ADT/SmallString.h"
+
 // Project includes
 #include "lldb/Core/Broadcaster.h"
 #include "lldb/Core/Debugger.h"
@@ -27,8 +29,6 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/TargetList.h"
 
-#include "llvm/ADT/SmallString.h"
-
 using namespace lldb;
 using namespace lldb_private;
 
@@ -227,7 +227,7 @@ TargetList::CreateTargetInternal (Debugg
 // since the user may have specified it.
 if (platform_sp)
 {
-if 
(platform_sp->IsCompatibleArchitecture(module_spec.GetArchitecture(), false, 
NULL))
+if 
(platform_sp->IsCompatibleArchitecture(module_spec.GetArchitecture(), false, 
nullptr))
 {
 platforms.push_back(platform_sp);
 continue;
@@ -237,7 +237,7 @@ TargetList::CreateTargetInternal (Debugg
 // Next check the host platform it if wasn't 
already checked above
 if (host_platform_sp && (!platform_sp || 
host_platform_sp->GetName() != platform_sp->GetName()))
 {
-if 
(host_platform_sp->IsCompatibleArchitecture(module_spec.GetArchitecture(), 
false, NULL))
+if 
(host_platform_sp->IsCompatibleArchitecture(module_spec.GetArchitecture(), 
false, nullptr))
 {
 platforms.push_back(host_platform_sp);
 continue;
@@ -253,7 +253,7 @@ TargetList::CreateTargetInternal (Debugg
 }
 }
 
-Platform *platform_ptr = NULL;
+Platform *platform_ptr = nullptr;
 bool more_than_one_platforms = false;
 for (const auto &the_platform_sp : platforms)
 {
@@ -262,7 +262,7 @@ TargetList::CreateTargetInternal (Debugg
 if (platform_ptr->GetName() != 
the_platform_sp->GetName())
 {
 more_than_one_platforms = true;
-platform_ptr = NULL;
+platform_ptr = nullptr;
 break;
 }
 }
@@ -386,7 +386,6 @@ TargetList::CreateTargetInternal (Debugg
   lldb::TargetSP &target_sp,
   bool is_dummy_target)
 {
-
 Timer scoped_timer (__PRETTY_FUNCTION__,
 "TargetList::CreateTarget (file = '%s', arch = '%s')",
 user_exe_path,
@@ -397,7 +396,7 @@ TargetList::CreateTargetInternal (Debugg
 
 if (arch.IsValid())
 {
-if (!platform_sp || !platform_sp->IsCompatibleArchitecture(arch, 
false, NULL))
+if (!platform_sp || !platform_sp->IsCompatibleArchitecture(arch, 
false, nullptr))
 platform_sp = Platform::GetPlatformForArchitecture(specified_arch, 
&arch);
 }
 
@@ -453,14 +452,14 @@ TargetList::CreateTargetInternal (Debugg
 {
 

Re: [Lldb-commits] [lldb] r255598 - Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings in some files in source/Target/.

2015-12-14 Thread Jim Ingham via lldb-commits
I see the value of replacing NULL with nullptr, but I don't see the value of 
these sorts of changes:

> On Dec 14, 2015, at 5:33 PM, Eugene Zelenko via lldb-commits 
>  wrote:
> 
> @@ -118,19 +111,13 @@ ThreadPlanStepInstruction::IsPlanStale (
> StackID cur_frame_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
> if (cur_frame_id == m_stack_id)
> {
> -if (m_thread.GetRegisterContext()->GetPC(0) != m_instruction_addr)
> -return true;
> -else
> -return false;
> +return (m_thread.GetRegisterContext()->GetPC(0) != 
> m_instruction_addr);
> }

To my eye the second version though more dense, is actually harder to read.  I 
tend to write returns this way because I like it this way.  It mirrors the 
thought process - I'm testing something, then doing something, and makes the 
various bits of code that do these tests have some uniformity, rather than 
burying them behind an assignment or return.  Moreover, I don't see the point 
of going through and changing code you didn't write to fit your or clang tidy's 
preferences.  It just sprinkles more random changes into the history that folks 
doing archeology now have to look past, and makes the code look like it wasn't 
written by whoever wrote it.  I don't see the value in either of these.

Jim

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


[Lldb-commits] [lldb] r255603 - Fix a bug where language categories would hold on to their caches even after changes

2015-12-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Dec 14 20:20:48 2015
New Revision: 255603

URL: http://llvm.org/viewvc/llvm-project?rev=255603&view=rev
Log:
Fix a bug where language categories would hold on to their caches even after 
changes


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

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=255603&r1=255602&r2=255603&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Dec 14 20:20:48 
2015
@@ -238,11 +238,7 @@ public:
 ShouldPrintAsOneLiner (ValueObject& valobj);
 
 void
-Changed () override
-{
-++m_last_revision;
-m_format_cache.Clear ();
-}
+Changed () override;
 
 uint32_t
 GetCurrentRevision () override
@@ -290,13 +286,13 @@ private:
 bool did_strip_ref,
 bool did_strip_typedef,
 bool root_level = false);
-
+
+std::atomic m_last_revision;
 FormatCache m_format_cache;
+Mutex m_language_categories_mutex;
+LanguageCategories m_language_categories_map;
 NamedSummariesMap m_named_summaries_map;
-std::atomic m_last_revision;
 TypeCategoryMap m_categories_map;
-LanguageCategories m_language_categories_map;
-Mutex m_language_categories_mutex;
 
 ConstString m_default_category_name;
 ConstString m_system_category_name;

Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=255603&r1=255602&r2=255603&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Dec 14 
20:20:48 2015
@@ -69,6 +69,9 @@ public:
 lldb::TypeCategoryImplSP
 GetCategory () const;
 
+FormatCache&
+GetFormatCache ();
+
 void
 Enable ();
 

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=255603&r1=255602&r2=255603&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Dec 14 20:20:48 2015
@@ -123,6 +123,19 @@ GetFormatFromFormatName (const char *for
 return false;
 }
 
+void
+FormatManager::Changed ()
+{
+++m_last_revision;
+m_format_cache.Clear ();
+Mutex::Locker lang_locker(m_language_categories_mutex);
+for (auto& iter : m_language_categories_map)
+{
+if (iter.second)
+iter.second->GetFormatCache().Clear();
+}
+}
+
 bool
 FormatManager::GetFormatFromCString (const char *format_cstr,
  bool partial_match_ok,
@@ -1043,12 +1056,12 @@ FormatManager::GetHardcodedValidator (Fo
 }
 
 FormatManager::FormatManager() :
+m_last_revision(0),
 m_format_cache(),
+m_language_categories_mutex(Mutex::eMutexTypeRecursive),
+m_language_categories_map(),
 m_named_summaries_map(this),
-m_last_revision(0),
 m_categories_map(this),
-m_language_categories_map(),
-m_language_categories_mutex(Mutex::eMutexTypeRecursive),
 m_default_category_name(ConstString("default")),
 m_system_category_name(ConstString("system")), 
 m_vectortypes_category_name(ConstString("VectorTypes"))
@@ -1063,7 +1076,6 @@ FormatManager::FormatManager() :
 void
 FormatManager::LoadSystemFormatters()
 {
-
 TypeSummaryImpl::Flags string_flags;
 string_flags.SetCascades(true)
 .SetSkipPointers(true)

Modified: lldb/trunk/source/DataFormatters/LanguageCategory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LanguageCategory.cpp?rev=255603&r1=255602&r2=255603&view=diff
==
--- lldb/trunk/source/DataFormatters/LanguageCategory.cpp (original)
+++ lldb/trunk/source/DataFormatters/LanguageCategory.cpp Mon Dec 14 20:20:48 
2015
@@ -242,6 +242,12 @@ LanguageCategory::GetCategory () const
 return m_category_sp;
 }
 
+FormatCache&
+LanguageCategory::GetFormatCache ()
+{
+return m_format_cache;
+}
+
 void
 LanguageCategory::Enable ()
 {


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

Re: [Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Siva Chandra via lldb-commits
On Mon, Dec 14, 2015 at 4:50 PM, Kamil Rytarowski via lldb-commits
 wrote:
> Author: kamil
> Date: Mon Dec 14 18:50:19 2015
> New Revision: 255592
>
> Added:
> lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
> lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h

Should these files be added to the xcode build? If yes, can someone
help with this?

> Modified:
> lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
> lldb/trunk/source/Target/UnixSignals.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Jim Ingham via lldb-commits
I think Jason already did (r255597).

Jim

> On Dec 14, 2015, at 6:35 PM, Siva Chandra via lldb-commits 
>  wrote:
> 
> On Mon, Dec 14, 2015 at 4:50 PM, Kamil Rytarowski via lldb-commits
>  wrote:
>> Author: kamil
>> Date: Mon Dec 14 18:50:19 2015
>> New Revision: 255592
>> 
>> Added:
>>lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
>>lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
> 
> Should these files be added to the xcode build? If yes, can someone
> help with this?
> 
>> Modified:
>>lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
>>lldb/trunk/source/Target/UnixSignals.cpp
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


Re: [Lldb-commits] [lldb] r255542 - Make skipIf decorator support not_in() functor.

2015-12-14 Thread Zachary Turner via lldb-commits
On Mon, Dec 14, 2015 at 4:10 PM Siva Chandra  wrote:

> This change looks very innocent, but:
>
> On Mon, Dec 14, 2015 at 1:26 PM, Zachary Turner via lldb-commits
>  wrote:
> > URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255542&r1=255541&r2=255542&view=diff
> >
> ==
> > --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
> > +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14
> 15:26:49 2015
> > @@ -613,14 +613,16 @@ def expectedFailure(expected_fn, bugnumb
> >  # 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):
> > +def not_in(iterable):
> >  return lambda x : x not in iterable
> >
> > -def check_list_or_lambda (list_or_lambda, value):
> > +def check_list_or_lambda(list_or_lambda, value):
> >  if six.callable(list_or_lambda):
> >  return list_or_lambda(value)
> > -else:
> > +elif isinstance(list_or_lambda, list):
>
> Previously, list_or_lambda could be a string. It cannot be now. That
> is, we should have:
>
> elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
>
Then won't that check `value in list_or_lambda` where `list_or_lambda` is a
string, meaning it would only pass if `value` is a character?  That seems
wrong.


>
> >  return list_or_lambda is None or value is None or value in
> list_or_lambda
> > +else:
> > +return list_or_lambda == value
>
> Previously, if value or list_or_lambda were None, this function
> returned True. It returns False now unless both are None. That is, it
> should be:
>
> else:
> return list_or_lambda is None or value is None or list_or_lambda ==
> value
>
> Will send a change list soon with the above fixed.
>
That definitely seems like a good fix.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622
@@ -621,3 +621,3 @@
 return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-return list_or_lambda is None or value is None or value in 
list_or_lambda
+elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
+return value is None or value in list_or_lambda

I mentioned this in the other thread, but I'm not sure we want the string 
check.  if `list_or_lambda` is a string, then I think it should just check 
`list_or_lambda == value`.  Otherwise the test only passes when `value` is a 
character, which is not now we use any of the decorators.


Repository:
  rL LLVM

http://reviews.llvm.org/D15511



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


Re: [Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Siva Chandra via lldb-commits
Ah, yes! Thank you.

On Mon, Dec 14, 2015 at 6:41 PM, Jim Ingham  wrote:
> I think Jason already did (r255597).
>
> Jim
>
>> On Dec 14, 2015, at 6:35 PM, Siva Chandra via lldb-commits 
>>  wrote:
>>
>> On Mon, Dec 14, 2015 at 4:50 PM, Kamil Rytarowski via lldb-commits
>>  wrote:
>>> Author: kamil
>>> Date: Mon Dec 14 18:50:19 2015
>>> New Revision: 255592
>>>
>>> Added:
>>>lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
>>>lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
>>
>> Should these files be added to the xcode build? If yes, can someone
>> help with this?
>>
>>> Modified:
>>>lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
>>>lldb/trunk/source/Target/UnixSignals.cpp
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Siva Chandra via lldb-commits
On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner  wrote:
> zturner added inline comments.
>
> 
> Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622
> @@ -621,3 +621,3 @@
>  return list_or_lambda(value)
> -elif isinstance(list_or_lambda, list):
> -return list_or_lambda is None or value is None or value in 
> list_or_lambda
> +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str):
> +return value is None or value in list_or_lambda
> 
> I mentioned this in the other thread, but I'm not sure we want the string 
> check.  if `list_or_lambda` is a string, then I think it should just check 
> `list_or_lambda == value`.  Otherwise the test only passes when `value` is a 
> character, which is not now we use any of the decorators.

AFAIK, there is no character type in Python. The code 'value in
list_or_lambda' returns True if |value| is a substring of
|list_or_lambda|. For example, 'db' in 'lldb' evaluates to True.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255603 - Fix a bug where language categories would hold on to their caches even after changes

2015-12-14 Thread Zachary Turner via lldb-commits
A unit test would be good at catching bugs like this.

On Mon, Dec 14, 2015 at 6:23 PM Enrico Granata via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: enrico
> Date: Mon Dec 14 20:20:48 2015
> New Revision: 255603
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255603&view=rev
> Log:
> Fix a bug where language categories would hold on to their caches even
> after changes
>
>
> Modified:
> lldb/trunk/include/lldb/DataFormatters/FormatManager.h
> lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
> lldb/trunk/source/DataFormatters/FormatManager.cpp
> lldb/trunk/source/DataFormatters/LanguageCategory.cpp
>
> Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=255603&r1=255602&r2=255603&view=diff
>
> ==
> --- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
> +++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Dec 14
> 20:20:48 2015
> @@ -238,11 +238,7 @@ public:
>  ShouldPrintAsOneLiner (ValueObject& valobj);
>
>  void
> -Changed () override
> -{
> -++m_last_revision;
> -m_format_cache.Clear ();
> -}
> +Changed () override;
>
>  uint32_t
>  GetCurrentRevision () override
> @@ -290,13 +286,13 @@ private:
>  bool did_strip_ref,
>  bool did_strip_typedef,
>  bool root_level = false);
> -
> +
> +std::atomic m_last_revision;
>  FormatCache m_format_cache;
> +Mutex m_language_categories_mutex;
> +LanguageCategories m_language_categories_map;
>  NamedSummariesMap m_named_summaries_map;
> -std::atomic m_last_revision;
>  TypeCategoryMap m_categories_map;
> -LanguageCategories m_language_categories_map;
> -Mutex m_language_categories_mutex;
>
>  ConstString m_default_category_name;
>  ConstString m_system_category_name;
>
> Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=255603&r1=255602&r2=255603&view=diff
>
> ==
> --- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
> +++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Dec 14
> 20:20:48 2015
> @@ -69,6 +69,9 @@ public:
>  lldb::TypeCategoryImplSP
>  GetCategory () const;
>
> +FormatCache&
> +GetFormatCache ();
> +
>  void
>  Enable ();
>
>
> Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=255603&r1=255602&r2=255603&view=diff
>
> ==
> --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
> +++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Dec 14 20:20:48
> 2015
> @@ -123,6 +123,19 @@ GetFormatFromFormatName (const char *for
>  return false;
>  }
>
> +void
> +FormatManager::Changed ()
> +{
> +++m_last_revision;
> +m_format_cache.Clear ();
> +Mutex::Locker lang_locker(m_language_categories_mutex);
> +for (auto& iter : m_language_categories_map)
> +{
> +if (iter.second)
> +iter.second->GetFormatCache().Clear();
> +}
> +}
> +
>  bool
>  FormatManager::GetFormatFromCString (const char *format_cstr,
>   bool partial_match_ok,
> @@ -1043,12 +1056,12 @@ FormatManager::GetHardcodedValidator (Fo
>  }
>
>  FormatManager::FormatManager() :
> +m_last_revision(0),
>  m_format_cache(),
> +m_language_categories_mutex(Mutex::eMutexTypeRecursive),
> +m_language_categories_map(),
>  m_named_summaries_map(this),
> -m_last_revision(0),
>  m_categories_map(this),
> -m_language_categories_map(),
> -m_language_categories_mutex(Mutex::eMutexTypeRecursive),
>  m_default_category_name(ConstString("default")),
>  m_system_category_name(ConstString("system")),
>  m_vectortypes_category_name(ConstString("VectorTypes"))
> @@ -1063,7 +1076,6 @@ FormatManager::FormatManager() :
>  void
>  FormatManager::LoadSystemFormatters()
>  {
> -
>  TypeSummaryImpl::Flags string_flags;
>  string_flags.SetCascades(true)
>  .SetSkipPointers(true)
>
> Modified: lldb/trunk/source/DataFormatters/LanguageCategory.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LanguageCategory.cpp?rev=255603&r1=255602&r2=255603&view=diff
>
> ==
> --- lldb/trunk/source/DataFormatters/LanguageCategory.cpp (original)
> +++ lldb/trunk/source/DataFormatters/LanguageCategory.cpp Mon Dec 14
> 20:20:48 2015
> @@ 

Re: [Lldb-commits] [lldb] r255603 - Fix a bug where language categories would hold on to their caches even after changes

2015-12-14 Thread Enrico Granata via lldb-commits
It’s a hard unit test to write though

I caught this because I deleted a formatter in a language category and saw it 
still applied

Problem is that you can’t add new formatters or add back previously deleted 
formatters to a language category, and the FormatManager is global state, so a 
deletion is forever, which worries me as potentially affecting downstream tests

I’ll keep this in mind though, if I can come up with a good way to cons a test 
up, I’ll definitely make it happen

> On Dec 14, 2015, at 6:45 PM, Zachary Turner  wrote:
> 
> A unit test would be good at catching bugs like this.
> 
> On Mon, Dec 14, 2015 at 6:23 PM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: enrico
> Date: Mon Dec 14 20:20:48 2015
> New Revision: 255603
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=255603&view=rev 
> 
> Log:
> Fix a bug where language categories would hold on to their caches even after 
> changes
> 
> 
> Modified:
> lldb/trunk/include/lldb/DataFormatters/FormatManager.h
> lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
> lldb/trunk/source/DataFormatters/FormatManager.cpp
> lldb/trunk/source/DataFormatters/LanguageCategory.cpp
> 
> Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=255603&r1=255602&r2=255603&view=diff
>  
> 
> ==
> --- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
> +++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Dec 14 
> 20:20:48 2015
> @@ -238,11 +238,7 @@ public:
>  ShouldPrintAsOneLiner (ValueObject& valobj);
> 
>  void
> -Changed () override
> -{
> -++m_last_revision;
> -m_format_cache.Clear ();
> -}
> +Changed () override;
> 
>  uint32_t
>  GetCurrentRevision () override
> @@ -290,13 +286,13 @@ private:
>  bool did_strip_ref,
>  bool did_strip_typedef,
>  bool root_level = false);
> -
> +
> +std::atomic m_last_revision;
>  FormatCache m_format_cache;
> +Mutex m_language_categories_mutex;
> +LanguageCategories m_language_categories_map;
>  NamedSummariesMap m_named_summaries_map;
> -std::atomic m_last_revision;
>  TypeCategoryMap m_categories_map;
> -LanguageCategories m_language_categories_map;
> -Mutex m_language_categories_mutex;
> 
>  ConstString m_default_category_name;
>  ConstString m_system_category_name;
> 
> Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=255603&r1=255602&r2=255603&view=diff
>  
> 
> ==
> --- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
> +++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Dec 14 
> 20:20:48 2015
> @@ -69,6 +69,9 @@ public:
>  lldb::TypeCategoryImplSP
>  GetCategory () const;
> 
> +FormatCache&
> +GetFormatCache ();
> +
>  void
>  Enable ();
> 
> 
> Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=255603&r1=255602&r2=255603&view=diff
>  
> 
> ==
> --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
> +++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Dec 14 20:20:48 
> 2015
> @@ -123,6 +123,19 @@ GetFormatFromFormatName (const char *for
>  return false;
>  }
> 
> +void
> +FormatManager::Changed ()
> +{
> +++m_last_revision;
> +m_format_cache.Clear ();
> +Mutex::Locker lang_locker(m_language_categories_mutex);
> +for (auto& iter : m_language_categories_map)
> +{
> +if (iter.second)
> +iter.second->GetFormatCache().Clear();
> +}
> +}
> +
>  bool
>  FormatManager::GetFormatFromCString (const char *format_cstr,
>   bool partial_match_ok,
> @@ -1043,12 +1056,12 @@ FormatManager::GetHardcodedValidator (Fo
>  }
> 
>  FormatManager::FormatManager() :
> +m_last_revision(0),
>  m_format_cache(),
> +m_language_categories_mutex(Mutex::eMutexTypeRecursive),
> +m_language_categories_map

Re: [Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sorry, only NetBSD around :-) (I'm ok to port xcode to it, perhaps it
might run with the Darwin compat layer..)

Thanks for fixing xcode.

I'm planning to land more NetBSD platform parts in the following days.

Keep tuned and thank you!

On 15.12.2015 03:43, Siva Chandra wrote:
> Ah, yes! Thank you.
> 
> On Mon, Dec 14, 2015 at 6:41 PM, Jim Ingham 
> wrote:
>> I think Jason already did (r255597).
>> 
>> Jim
>> 
>>> On Dec 14, 2015, at 6:35 PM, Siva Chandra via lldb-commits
>>>  wrote:
>>> 
>>> On Mon, Dec 14, 2015 at 4:50 PM, Kamil Rytarowski via
>>> lldb-commits  wrote:
 Author: kamil Date: Mon Dec 14 18:50:19 2015 New Revision:
 255592
 
 Added: 
 lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp 
 lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
>>> 
>>> Should these files be added to the xcode build? If yes, can
>>> someone help with this?
>>> 
 Modified: 
 lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt 
 lldb/trunk/source/Target/UnixSignals.cpp
>>> ___ lldb-commits
>>> mailing list lldb-commits@lists.llvm.org 
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWb4OAAAoJEEuzCOmwLnZs5UoP/38XNH+tNaeY0rRmDtuY3x0i
YpXdF+/2NVbdvjpZggd2VjNg0QlKoXnxoMcBVQQsP6so06sBApY2rJZICqrp6hOR
SDOxCOf3L4dA62m0ylHXR8EmUFz5meUZwrfWDaAF2FlQUnKjNkk9EXJcBBcpBcbw
b+g0FGO+Z1dhfjPCWuc2sc/pVDoL/I1l1CUya5g2OaWX/V9+yJ2H1OMXG3N47ivR
gPYAu/L5Gs779GJ13AUXfTdynr+MZxIpDhzTgpRnbBin7+cWA4g1oD0HArwmOxzF
adpkuhozH9WT7Ay72rGLcH9WX1bnXBQp+pUlqwMyYrRTZQIlyUo6eD15xcxVj9bX
2YWnJvqYkdRCwceVJAc3dyUJ4SJymMrdb0K6FFRrPhGfVZOX+8rkYYtxjXPMP/Yk
R9KJaqFEyE5Hp+QmjpfsmdLb79mTNA+JEpasXzHfNdewqgSVfAJIxnrxmz5KUiEH
oCti+vRu0HReOBbO3ZMI8VN0fy+cvNm39m4BkcbfXcJplIMxjG9mfUm04QstujEA
bN+tZBB7o9j03sxM8O36ifyc7jeRn6DJytBy9Qij87s4w2iFHYMC5MHXzqmzmAtQ
FVffreqxKjjY6Q5QhjIJ/CewyULQvRbR4RpAefcAYkYPFboeo+/ZAV4KpGQuKPUE
nybiAlCRgCZ3tNoyi9vK
=MoxW
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255603 - Fix a bug where language categories would hold on to their caches even after changes

2015-12-14 Thread Zachary Turner via lldb-commits
Ahh.  Is there any way to change that behavior so that you can add back
deleted formatters?   Or make it so that FormatManager itself can be
created and then destroyed.  i.e. we could still use it as a singleton /
global state in LLDB, but we could create and destroy them with each test
in the test suite.

On Mon, Dec 14, 2015 at 6:48 PM Enrico Granata  wrote:

> It’s a hard unit test to write though
>
> I caught this because I deleted a formatter in a language category and saw
> it still applied
>
> Problem is that you can’t add new formatters or add back previously
> deleted formatters to a language category, and the FormatManager is global
> state, so a deletion is forever, which worries me as potentially affecting
> downstream tests
>
> I’ll keep this in mind though, if I can come up with a good way to cons a
> test up, I’ll definitely make it happen
>
> On Dec 14, 2015, at 6:45 PM, Zachary Turner  wrote:
>
> A unit test would be good at catching bugs like this.
>
> On Mon, Dec 14, 2015 at 6:23 PM Enrico Granata via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: enrico
>> Date: Mon Dec 14 20:20:48 2015
>> New Revision: 255603
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=255603&view=rev
>> Log:
>> Fix a bug where language categories would hold on to their caches even
>> after changes
>>
>>
>> Modified:
>> lldb/trunk/include/lldb/DataFormatters/FormatManager.h
>> lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
>> lldb/trunk/source/DataFormatters/FormatManager.cpp
>> lldb/trunk/source/DataFormatters/LanguageCategory.cpp
>>
>> Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=255603&r1=255602&r2=255603&view=diff
>>
>> ==
>> --- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
>> +++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Dec 14
>> 20:20:48 2015
>> @@ -238,11 +238,7 @@ public:
>>  ShouldPrintAsOneLiner (ValueObject& valobj);
>>
>>  void
>> -Changed () override
>> -{
>> -++m_last_revision;
>> -m_format_cache.Clear ();
>> -}
>> +Changed () override;
>>
>>  uint32_t
>>  GetCurrentRevision () override
>> @@ -290,13 +286,13 @@ private:
>>  bool did_strip_ref,
>>  bool did_strip_typedef,
>>  bool root_level = false);
>> -
>> +
>> +std::atomic m_last_revision;
>>  FormatCache m_format_cache;
>> +Mutex m_language_categories_mutex;
>> +LanguageCategories m_language_categories_map;
>>  NamedSummariesMap m_named_summaries_map;
>> -std::atomic m_last_revision;
>>  TypeCategoryMap m_categories_map;
>> -LanguageCategories m_language_categories_map;
>> -Mutex m_language_categories_mutex;
>>
>>  ConstString m_default_category_name;
>>  ConstString m_system_category_name;
>>
>> Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=255603&r1=255602&r2=255603&view=diff
>>
>> ==
>> --- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
>> +++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Dec 14
>> 20:20:48 2015
>> @@ -69,6 +69,9 @@ public:
>>  lldb::TypeCategoryImplSP
>>  GetCategory () const;
>>
>> +FormatCache&
>> +GetFormatCache ();
>> +
>>  void
>>  Enable ();
>>
>>
>> Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=255603&r1=255602&r2=255603&view=diff
>>
>> ==
>> --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
>> +++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Dec 14
>> 20:20:48 2015
>> @@ -123,6 +123,19 @@ GetFormatFromFormatName (const char *for
>>  return false;
>>  }
>>
>> +void
>> +FormatManager::Changed ()
>> +{
>> +++m_last_revision;
>> +m_format_cache.Clear ();
>> +Mutex::Locker lang_locker(m_language_categories_mutex);
>> +for (auto& iter : m_language_categories_map)
>> +{
>> +if (iter.second)
>> +iter.second->GetFormatCache().Clear();
>> +}
>> +}
>> +
>>  bool
>>  FormatManager::GetFormatFromCString (const char *format_cstr,
>>   bool partial_match_ok,
>> @@ -1043,12 +1056,12 @@ FormatManager::GetHardcodedValidator (Fo
>>  }
>>
>>  FormatManager::FormatManager() :
>> +m_last_revision(0),
>>  m_format_cache(),
>> +m_language_categories_mutex(Mutex::eMutexTypeRecursive),
>> +m_language_categories_map(),
>>  

Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Todd Fiala via lldb-commits
This seems right:

python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> s = 'abc'
>>> 'bc' in 'abc'
True
>>> 'bc' in s
True
>>> 'clang' in 'clang'
True

On Mon, Dec 14, 2015 at 6:45 PM, Siva Chandra 
wrote:

> On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner 
> wrote:
> > zturner added inline comments.
> >
> > 
> > Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622
> > @@ -621,3 +621,3 @@
> >  return list_or_lambda(value)
> > -elif isinstance(list_or_lambda, list):
> > -return list_or_lambda is None or value is None or value in
> list_or_lambda
> > +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda,
> str):
> > +return value is None or value in list_or_lambda
> > 
> > I mentioned this in the other thread, but I'm not sure we want the
> string check.  if `list_or_lambda` is a string, then I think it should just
> check `list_or_lambda == value`.  Otherwise the test only passes when
> `value` is a character, which is not now we use any of the decorators.
>
> AFAIK, there is no character type in Python. The code 'value in
> list_or_lambda' returns True if |value| is a substring of
> |list_or_lambda|. For example, 'db' in 'lldb' evaluates to True.
>



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


Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Zachary Turner via lldb-commits
I tried to google the semantics of the in keyword, but Python documentation
is so horrible.  I literally couldn't find a description of how it works
:-/  Anyway, thanks!

On Mon, Dec 14, 2015 at 7:27 PM Todd Fiala  wrote:

> This seems right:
>
> python
> Python 2.7.10 (default, Oct 23 2015, 18:05:06)
> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> s = 'abc'
> >>> 'bc' in 'abc'
> True
> >>> 'bc' in s
> True
> >>> 'clang' in 'clang'
> True
>
> On Mon, Dec 14, 2015 at 6:45 PM, Siva Chandra 
> wrote:
>
>> On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner 
>> wrote:
>> > zturner added inline comments.
>> >
>> > 
>> > Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622
>> > @@ -621,3 +621,3 @@
>> >  return list_or_lambda(value)
>> > -elif isinstance(list_or_lambda, list):
>> > -return list_or_lambda is None or value is None or value in
>> list_or_lambda
>> > +elif isinstance(list_or_lambda, list) or
>> isinstance(list_or_lambda, str):
>> > +return value is None or value in list_or_lambda
>> > 
>> > I mentioned this in the other thread, but I'm not sure we want the
>> string check.  if `list_or_lambda` is a string, then I think it should just
>> check `list_or_lambda == value`.  Otherwise the test only passes when
>> `value` is a character, which is not now we use any of the decorators.
>>
>> AFAIK, there is no character type in Python. The code 'value in
>> list_or_lambda' returns True if |value| is a substring of
>> |list_or_lambda|. For example, 'db' in 'lldb' evaluates to True.
>>
>
>
>
> --
> -Todd
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255603 - Fix a bug where language categories would hold on to their caches even after changes

2015-12-14 Thread Enrico Granata via lldb-commits
All of these things are theoretically possible (i.e. They can be done by 
writing enough code :-), but I would love if there were a real feature driver 
for them before I sit down and write said code.

The most interesting avenue is making the FormatManager be a per-debugger 
entity instead of a shared singleton, but given my last try it is quite a bit 
of work. Possible to do, unlikely to happen anytime soon though.

The easier thing to do might be allowing the addition of formatters to language 
categories via the command line/API. Then one could have an ad-hoc formatter 
added just for testing.

Sent from my iPhone

> On Dec 14, 2015, at 7:07 PM, Zachary Turner  wrote:
> 
> Ahh.  Is there any way to change that behavior so that you can add back 
> deleted formatters?   Or make it so that FormatManager itself can be created 
> and then destroyed.  i.e. we could still use it as a singleton / global state 
> in LLDB, but we could create and destroy them with each test in the test 
> suite.
> 
>> On Mon, Dec 14, 2015 at 6:48 PM Enrico Granata  wrote:
>> It’s a hard unit test to write though
>> 
>> I caught this because I deleted a formatter in a language category and saw 
>> it still applied
>> 
>> Problem is that you can’t add new formatters or add back previously deleted 
>> formatters to a language category, and the FormatManager is global state, so 
>> a deletion is forever, which worries me as potentially affecting downstream 
>> tests
>> 
>> I’ll keep this in mind though, if I can come up with a good way to cons a 
>> test up, I’ll definitely make it happen
>> 
>>> On Dec 14, 2015, at 6:45 PM, Zachary Turner  wrote:
>>> 
>>> A unit test would be good at catching bugs like this.
>>> 
 On Mon, Dec 14, 2015 at 6:23 PM Enrico Granata via lldb-commits 
  wrote:
 Author: enrico
 Date: Mon Dec 14 20:20:48 2015
 New Revision: 255603
 
 URL: http://llvm.org/viewvc/llvm-project?rev=255603&view=rev
 Log:
 Fix a bug where language categories would hold on to their caches even 
 after changes
 
 
 Modified:
 lldb/trunk/include/lldb/DataFormatters/FormatManager.h
 lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
 lldb/trunk/source/DataFormatters/FormatManager.cpp
 lldb/trunk/source/DataFormatters/LanguageCategory.cpp
 
 Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=255603&r1=255602&r2=255603&view=diff
 ==
 --- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
 +++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Dec 14 
 20:20:48 2015
 @@ -238,11 +238,7 @@ public:
  ShouldPrintAsOneLiner (ValueObject& valobj);
 
  void
 -Changed () override
 -{
 -++m_last_revision;
 -m_format_cache.Clear ();
 -}
 +Changed () override;
 
  uint32_t
  GetCurrentRevision () override
 @@ -290,13 +286,13 @@ private:
  bool did_strip_ref,
  bool did_strip_typedef,
  bool root_level = false);
 -
 +
 +std::atomic m_last_revision;
  FormatCache m_format_cache;
 +Mutex m_language_categories_mutex;
 +LanguageCategories m_language_categories_map;
  NamedSummariesMap m_named_summaries_map;
 -std::atomic m_last_revision;
  TypeCategoryMap m_categories_map;
 -LanguageCategories m_language_categories_map;
 -Mutex m_language_categories_mutex;
 
  ConstString m_default_category_name;
  ConstString m_system_category_name;
 
 Modified: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=255603&r1=255602&r2=255603&view=diff
 ==
 --- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
 +++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h Mon Dec 14 
 20:20:48 2015
 @@ -69,6 +69,9 @@ public:
  lldb::TypeCategoryImplSP
  GetCategory () const;
 
 +FormatCache&
 +GetFormatCache ();
 +
  void
  Enable ();
 
 
 Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=255603&r1=255602&r2=255603&view=diff
 ==
 --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
 +++ lldb/trunk/source/DataFormatters/FormatManager.cpp

Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.

2015-12-14 Thread Todd Fiala via lldb-commits
Yeah I find some of these things not always obvious (I'm sure the docs are
there, but I don't always find them ;-)).  What I was hoping was this
wasn't a python 2 vs. 3 thing.

On Mon, Dec 14, 2015 at 7:30 PM, Zachary Turner  wrote:

> I tried to google the semantics of the in keyword, but Python
> documentation is so horrible.  I literally couldn't find a description of
> how it works :-/  Anyway, thanks!
>
> On Mon, Dec 14, 2015 at 7:27 PM Todd Fiala  wrote:
>
>> This seems right:
>>
>> python
>> Python 2.7.10 (default, Oct 23 2015, 18:05:06)
>> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> s = 'abc'
>> >>> 'bc' in 'abc'
>> True
>> >>> 'bc' in s
>> True
>> >>> 'clang' in 'clang'
>> True
>>
>> On Mon, Dec 14, 2015 at 6:45 PM, Siva Chandra 
>> wrote:
>>
>>> On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner 
>>> wrote:
>>> > zturner added inline comments.
>>> >
>>> > 
>>> > Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622
>>> > @@ -621,3 +621,3 @@
>>> >  return list_or_lambda(value)
>>> > -elif isinstance(list_or_lambda, list):
>>> > -return list_or_lambda is None or value is None or value in
>>> list_or_lambda
>>> > +elif isinstance(list_or_lambda, list) or
>>> isinstance(list_or_lambda, str):
>>> > +return value is None or value in list_or_lambda
>>> > 
>>> > I mentioned this in the other thread, but I'm not sure we want the
>>> string check.  if `list_or_lambda` is a string, then I think it should just
>>> check `list_or_lambda == value`.  Otherwise the test only passes when
>>> `value` is a character, which is not now we use any of the decorators.
>>>
>>> AFAIK, there is no character type in Python. The code 'value in
>>> list_or_lambda' returns True if |value| is a substring of
>>> |list_or_lambda|. For example, 'db' in 'lldb' evaluates to True.
>>>
>>
>>
>>
>> --
>> -Todd
>>
>


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


[Lldb-commits] [lldb] r255619 - [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets

2015-12-14 Thread Sagar Thakur via lldb-commits
Author: slthakur
Date: Mon Dec 14 23:50:55 2015
New Revision: 255619

URL: http://llvm.org/viewvc/llvm-project?rev=255619&view=rev
Log:
[LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction 
sets

Patch by Nitesh Jain.

Summary: This Patch will allowed LLDB to debug respective instruction sets 
binaries.

Reviewers: jaydeep, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan
Differential: http://reviews.llvm.org/D15487

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=255619&r1=255618&r2=255619&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Dec 14 
23:50:55 2015
@@ -328,6 +328,11 @@ mipsVariantFromElfFlags(const elf::elf_w
 
 switch (mips_arch)
 {
+case llvm::ELF::EF_MIPS_ARCH_1:
+case llvm::ELF::EF_MIPS_ARCH_2:
+case llvm::ELF::EF_MIPS_ARCH_3:
+case llvm::ELF::EF_MIPS_ARCH_4:
+case llvm::ELF::EF_MIPS_ARCH_5:
 case llvm::ELF::EF_MIPS_ARCH_32:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32el : 
ArchSpec::eMIPSSubType_mips32;
 case llvm::ELF::EF_MIPS_ARCH_32R2:


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


Re: [Lldb-commits] [PATCH] D15487: [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets

2015-12-14 Thread Sagar Thakur via lldb-commits
sagar closed this revision.
sagar added a comment.

Committed in revision 255619 on behalf of Nitesh Jain.


Repository:
  rL LLVM

http://reviews.llvm.org/D15487



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