[Lldb-commits] [PATCH] D24284: [lldb] Read modules from memory when a local copy is not available

2016-10-06 Thread walter erquinigo via lldb-commits
wallace added a comment.

F2469236: before.txt 

F2469237: after.txt 

These are the output from running the tests. Btw, this was failing before 
because it was reading the export table incorrectly, but I updated it and it 
should be correct now


https://reviews.llvm.org/D24284



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


[Lldb-commits] [PATCH] D25328: Improve test for Intel(R) MPX registers.

2016-10-06 Thread Valentina Giusti via lldb-commits
valentinagiusti created this revision.
valentinagiusti added a reviewer: zturner.
valentinagiusti added a subscriber: lldb-commits.

Let the inferior test code determine if CPU and kernel support Intel(R)
MPX and cleanup test script.

Signed-off-by: Valentina Giusti 


https://reviews.llvm.org/D25328

Files:
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp


Index: 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
===
--- 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
+++ 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
@@ -14,23 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
-unsigned int rax, rbx, rcx, rdx;
-
-// Check if XSAVE is enabled.
-if (!__get_cpuid(1, &rax, &rbx, &rcx, &rdx) || (rcx & bit_OSXSAVE) != 
bit_OSXSAVE)
-return -1;
-
-// Check if MPX is enabled.
-if (__get_cpuid_max(0, NULL) > 7)
-{
-__cpuid_count(7, 0, rax, rbx, rcx, rdx);
-if ((rbx & bit_MPX) != bit_MPX)
-return -1;
-}
-else
+// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;
 
-// Run MPX test code.
+// Run Intel(R) MPX test code.
 #if defined(__x86_64__)
 asm("mov $16, %rax\n\t"
 "mov $9, %rdx\n\t"
Index: 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
===
--- 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
+++ 
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
@@ -1,5 +1,5 @@
 """
-Test the MPX registers.
+Test the Intel(R) MPX registers.
 """
 
 from __future__ import print_function
@@ -21,23 +21,18 @@
 
 def setUp(self):
 TestBase.setUp(self)
-self.has_teardown = False
-
-def tearDown(self):
-self.dbg.GetSelectedTarget().GetProcess().Destroy()
-TestBase.tearDown(self)
 
 @skipIf(compiler="clang")
-@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports MPX.
 @skipIf(oslist=no_match(['linux']))
 @skipIf(archs=no_match(['i386', 'x86_64']))
+@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports Intel(R) MPX.
 def test_mpx_registers_with_example_code(self):
-"""Test MPX registers with example code."""
+"""Test Intel(R) MPX registers with example code."""
 self.build()
 self.mpx_registers_with_example_code()
 
 def mpx_registers_with_example_code(self):
-"""Test MPX registers after running example code."""
+"""Test Intel(R) MPX registers after running example code."""
 self.line = line_number('main.cpp', '// Set a break point here.')
 
 exe = os.path.join(os.getcwd(), "a.out")
@@ -50,7 +45,7 @@
 process = target.GetProcess()
 
 if (process.GetState() == lldb.eStateExited):
-self.skipTest("HW doesn't support MPX feature.")
+self.skipTest("Intel(R) MPX is not supported.")
 else:
 self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
 substrs = ["stop reason = breakpoint 1."])


Index: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
===
--- packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
+++ packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
@@ -14,23 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
-unsigned int rax, rbx, rcx, rdx;
-
-// Check if XSAVE is enabled.
-if (!__get_cpuid(1, &rax, &rbx, &rcx, &rdx) || (rcx & bit_OSXSAVE) != bit_OSXSAVE)
-return -1;
-
-// Check if MPX is enabled.
-if (__get_cpuid_max(0, NULL) > 7)
-{
-__cpuid_count(7, 0, rax, rbx, rcx, rdx);
-if ((rbx & bit_MPX) != bit_MPX)
-return -1;
-}
-else
+// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;
 
-// Run MPX test code.
+// Run Intel(R) MPX test code.
 #if defined(__x86_64__)
 asm("mov $16, %rax\n\t"
 "mov $9, %rdx\n\t"
Index: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
===
--- packages/Python/lldbsuite/test/functionalities/register/i

[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Valentina Giusti via lldb-commits
valentinagiusti created this revision.
valentinagiusti added reviewers: zturner, labath.
valentinagiusti added subscribers: emaste, lldb-commits.

This patch adds support for handling the SIGSEGV signal with 'si_code ==
SEGV_BNDERR', which is thrown when a bound violation is caught by the
Intel(R) MPX technology.

Signed-off-by: Valentina Giusti 


https://reviews.llvm.org/D25329

Files:
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  source/Plugins/Process/Linux/NativeThreadLinux.cpp
  source/Plugins/Process/POSIX/CrashReason.cpp
  source/Plugins/Process/POSIX/CrashReason.h

Index: source/Plugins/Process/POSIX/CrashReason.h
===
--- source/Plugins/Process/POSIX/CrashReason.h
+++ source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,7 @@
   // SIGSEGV crash reasons.
   eInvalidAddress,
   ePrivilegedAddress,
+  eBoundViolation,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
@@ -49,7 +50,7 @@
   eFloatSubscriptRange
 };
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr);
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info);
 
 const char *CrashReasonAsString(CrashReason reason);
 
Index: source/Plugins/Process/POSIX/CrashReason.cpp
===
--- source/Plugins/Process/POSIX/CrashReason.cpp
+++ source/Plugins/Process/POSIX/CrashReason.cpp
@@ -19,6 +19,19 @@
   str += ss.str();
 }
 
+void AppendBounds(std::string &str, lldb::addr_t lower_bound,
+  lldb::addr_t upper_bound, lldb::addr_t addr) {
+  std::stringstream ss;
+  if ((unsigned long)addr < lower_bound)
+ss << ": lower bound violation ";
+  else
+ss << ": upper bound violation ";
+  ss << "(fault address: 0x" << std::hex << addr << ",";
+  ss << " lower bound: 0x" << std::hex << lower_bound << ",";
+  ss << " upper bound: 0x" << std::hex << upper_bound << ")";
+  str += ss.str();
+}
+
 CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   assert(info.si_signo == SIGSEGV);
 
@@ -34,6 +47,11 @@
 return CrashReason::eInvalidAddress;
   case SEGV_ACCERR:
 return CrashReason::ePrivilegedAddress;
+#ifndef SEGV_BNDERR
+#define SEGV_BNDERR 3
+#endif
+  case SEGV_BNDERR:
+return CrashReason::eBoundViolation;
   }
 
   assert(false && "unexpected si_code for SIGSEGV");
@@ -109,7 +127,7 @@
 }
 }
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr) {
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) {
   std::string str;
 
   switch (reason) {
@@ -119,11 +137,20 @@
 
   case CrashReason::eInvalidAddress:
 str = "signal SIGSEGV: invalid address";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
 break;
   case CrashReason::ePrivilegedAddress:
 str = "signal SIGSEGV: address access protected";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
+break;
+  case CrashReason::eBoundViolation:
+str = "signal SIGSEGV";
+// Make sure that siginfo_t has the bound fields available.
+#if defined(si_lower) && defined(si_upper)
+AppendBounds(str, reinterpret_cast(info.si_lower),
+ reinterpret_cast(info.si_upper),
+ reinterpret_cast(info.si_addr));
+#endif
 break;
   case CrashReason::eIllegalOpcode:
 str = "signal SIGILL: illegal instruction";
@@ -207,6 +234,9 @@
   case CrashReason::ePrivilegedAddress:
 str = "ePrivilegedAddress";
 break;
+  case CrashReason::eBoundViolation:
+str = "eBoundViolation";
+break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:
Index: source/Plugins/Process/Linux/NativeThreadLinux.cpp
===
--- source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -316,8 +316,7 @@
   (info->si_signo == SIGBUS && info->si_code == SI_KERNEL)
   ? CrashReason::eInvalidAddress
   : GetCrashReason(*info);
-  m_stop_description = GetCrashReasonString(
-  reason, reinterpret_cast(info->si_addr));
+  m_stop_description = GetCrashReasonString(reason, *info);
   break;
 }
   }
Index: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
@@ -0,0 +1,40 @@
+//===-- main.cpp --

[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

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

lgtm.

At one point I'd like to change this code to not transfer the "crash reason" as 
string, but in a more structured way (i.e., `qXfer:siginfo:read` packet), but 
that is certainly out of scope of this patch.


https://reviews.llvm.org/D25329



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


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Zachary Turner via lldb-commits
Can you use llvm:raw_string_ostream instead of std::stringstream?

After that this looks fine
On Thu, Oct 6, 2016 at 8:51 AM Pavel Labath  wrote:

> labath accepted this revision.
> labath added a comment.
> This revision is now accepted and ready to land.
>
> lgtm.
>
> At one point I'd like to change this code to not transfer the "crash
> reason" as string, but in a more structured way (i.e., `qXfer:siginfo:read`
> packet), but that is certainly out of scope of this patch.
>
>
> https://reviews.llvm.org/D25329
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283461 - Improve test for Intel(R) MPX registers.

2016-10-06 Thread Valentina Giusti via lldb-commits
Author: valentinagiusti
Date: Thu Oct  6 10:49:10 2016
New Revision: 283461

URL: http://llvm.org/viewvc/llvm-project?rev=283461&view=rev
Log:
Improve test for Intel(R) MPX registers.

Summary:
Let the inferior test code determine if CPU and kernel support Intel(R)
MPX and cleanup test script.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py?rev=283461&r1=283460&r2=283461&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
 Thu Oct  6 10:49:10 2016
@@ -1,5 +1,5 @@
 """
-Test the MPX registers.
+Test the Intel(R) MPX registers.
 """
 
 from __future__ import print_function
@@ -21,23 +21,18 @@ class RegisterCommandsTestCase(TestBase)
 
 def setUp(self):
 TestBase.setUp(self)
-self.has_teardown = False
-
-def tearDown(self):
-self.dbg.GetSelectedTarget().GetProcess().Destroy()
-TestBase.tearDown(self)
 
 @skipIf(compiler="clang")
-@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports MPX.
 @skipIf(oslist=no_match(['linux']))
 @skipIf(archs=no_match(['i386', 'x86_64']))
+@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports Intel(R) MPX.
 def test_mpx_registers_with_example_code(self):
-"""Test MPX registers with example code."""
+"""Test Intel(R) MPX registers with example code."""
 self.build()
 self.mpx_registers_with_example_code()
 
 def mpx_registers_with_example_code(self):
-"""Test MPX registers after running example code."""
+"""Test Intel(R) MPX registers after running example code."""
 self.line = line_number('main.cpp', '// Set a break point here.')
 
 exe = os.path.join(os.getcwd(), "a.out")
@@ -50,7 +45,7 @@ class RegisterCommandsTestCase(TestBase)
 process = target.GetProcess()
 
 if (process.GetState() == lldb.eStateExited):
-self.skipTest("HW doesn't support MPX feature.")
+self.skipTest("Intel(R) MPX is not supported.")
 else:
 self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
 substrs = ["stop reason = breakpoint 1."])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp?rev=283461&r1=283460&r2=283461&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
 Thu Oct  6 10:49:10 2016
@@ -14,23 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
-unsigned int rax, rbx, rcx, rdx;
-
-// Check if XSAVE is enabled.
-if (!__get_cpuid(1, &rax, &rbx, &rcx, &rdx) || (rcx & bit_OSXSAVE) != 
bit_OSXSAVE)
-return -1;
-
-// Check if MPX is enabled.
-if (__get_cpuid_max(0, NULL) > 7)
-{
-__cpuid_count(7, 0, rax, rbx, rcx, rdx);
-if ((rbx & bit_MPX) != bit_MPX)
-return -1;
-}
-else
+// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;
 
-// Run MPX test code.
+// Run Intel(R) MPX test code.
 #if defined(__x86_64__)
 asm("mov $16, %rax\n\t"
 "mov $9, %rdx\n\t"


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


[Lldb-commits] [PATCH] D25328: Improve test for Intel(R) MPX registers.

2016-10-06 Thread Valentina Giusti via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283461: Improve test for Intel(R) MPX registers. (authored 
by valentinagiusti).

Changed prior to commit:
  https://reviews.llvm.org/D25328?vs=73798&id=73804#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25328

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
@@ -14,23 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
-unsigned int rax, rbx, rcx, rdx;
-
-// Check if XSAVE is enabled.
-if (!__get_cpuid(1, &rax, &rbx, &rcx, &rdx) || (rcx & bit_OSXSAVE) != 
bit_OSXSAVE)
-return -1;
-
-// Check if MPX is enabled.
-if (__get_cpuid_max(0, NULL) > 7)
-{
-__cpuid_count(7, 0, rax, rbx, rcx, rdx);
-if ((rbx & bit_MPX) != bit_MPX)
-return -1;
-}
-else
+// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;
 
-// Run MPX test code.
+// Run Intel(R) MPX test code.
 #if defined(__x86_64__)
 asm("mov $16, %rax\n\t"
 "mov $9, %rdx\n\t"
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
@@ -1,5 +1,5 @@
 """
-Test the MPX registers.
+Test the Intel(R) MPX registers.
 """
 
 from __future__ import print_function
@@ -21,23 +21,18 @@
 
 def setUp(self):
 TestBase.setUp(self)
-self.has_teardown = False
-
-def tearDown(self):
-self.dbg.GetSelectedTarget().GetProcess().Destroy()
-TestBase.tearDown(self)
 
 @skipIf(compiler="clang")
-@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports MPX.
 @skipIf(oslist=no_match(['linux']))
 @skipIf(archs=no_match(['i386', 'x86_64']))
+@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports Intel(R) MPX.
 def test_mpx_registers_with_example_code(self):
-"""Test MPX registers with example code."""
+"""Test Intel(R) MPX registers with example code."""
 self.build()
 self.mpx_registers_with_example_code()
 
 def mpx_registers_with_example_code(self):
-"""Test MPX registers after running example code."""
+"""Test Intel(R) MPX registers after running example code."""
 self.line = line_number('main.cpp', '// Set a break point here.')
 
 exe = os.path.join(os.getcwd(), "a.out")
@@ -50,7 +45,7 @@
 process = target.GetProcess()
 
 if (process.GetState() == lldb.eStateExited):
-self.skipTest("HW doesn't support MPX feature.")
+self.skipTest("Intel(R) MPX is not supported.")
 else:
 self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
 substrs = ["stop reason = breakpoint 1."])


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
@@ -14,23 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
-unsigned int rax, rbx, rcx, rdx;
-
-// Check if XSAVE is enabled.
-if (!__get_cpuid(1, &rax, &rbx, &rcx, &rdx) || (rcx & bit_OSXSAVE) != bit_OSXSAVE)
-return -1;
-
-// Check if MPX is enabled.
-if (__get_cpuid_max(0, NULL) > 7)
-{
-__cpuid_count(7, 0, rax, rbx, rcx, rdx);
-if ((rbx & bit_MPX) != bit_MPX)
-return -1;
-}
-else
+// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;
 
-// Run MPX test code.
+// Run Intel(R) MPX test code.
 #if defined(__x86_64__)
 asm("mov $16, %rax\n\t"
 "mov $9, %rdx\n\t"
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPX

[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Valentina Giusti via lldb-commits
valentinagiusti updated this revision to Diff 73811.
valentinagiusti added a comment.

used llvm:raw_string_ostream instead of std::stringstream


https://reviews.llvm.org/D25329

Files:
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  source/Plugins/Process/Linux/NativeThreadLinux.cpp
  source/Plugins/Process/POSIX/CrashReason.cpp
  source/Plugins/Process/POSIX/CrashReason.h

Index: source/Plugins/Process/POSIX/CrashReason.h
===
--- source/Plugins/Process/POSIX/CrashReason.h
+++ source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,7 @@
   // SIGSEGV crash reasons.
   eInvalidAddress,
   ePrivilegedAddress,
+  eBoundViolation,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
@@ -49,7 +50,7 @@
   eFloatSubscriptRange
 };
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr);
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info);
 
 const char *CrashReasonAsString(CrashReason reason);
 
Index: source/Plugins/Process/POSIX/CrashReason.cpp
===
--- source/Plugins/Process/POSIX/CrashReason.cpp
+++ source/Plugins/Process/POSIX/CrashReason.cpp
@@ -9,6 +9,8 @@
 
 #include "CrashReason.h"
 
+#include "llvm/Support/raw_ostream.h"
+
 #include 
 
 namespace {
@@ -19,6 +21,23 @@
   str += ss.str();
 }
 
+void AppendBounds(std::string &str, lldb::addr_t lower_bound,
+  lldb::addr_t upper_bound, lldb::addr_t addr) {
+  llvm::raw_string_ostream stream(str);
+  if ((unsigned long)addr < lower_bound)
+stream << ": lower bound violation ";
+  else
+stream << ": upper bound violation ";
+  stream << "(fault address: 0x";
+  stream.write_hex(addr);
+  stream << ", lower bound: 0x";
+  stream.write_hex(lower_bound);
+  stream << ", upper bound: 0x";
+  stream.write_hex(upper_bound);
+  stream << ")";
+  str += stream.str();
+}
+
 CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   assert(info.si_signo == SIGSEGV);
 
@@ -34,6 +53,11 @@
 return CrashReason::eInvalidAddress;
   case SEGV_ACCERR:
 return CrashReason::ePrivilegedAddress;
+#ifndef SEGV_BNDERR
+#define SEGV_BNDERR 3
+#endif
+  case SEGV_BNDERR:
+return CrashReason::eBoundViolation;
   }
 
   assert(false && "unexpected si_code for SIGSEGV");
@@ -109,7 +133,7 @@
 }
 }
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr) {
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) {
   std::string str;
 
   switch (reason) {
@@ -119,11 +143,20 @@
 
   case CrashReason::eInvalidAddress:
 str = "signal SIGSEGV: invalid address";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
 break;
   case CrashReason::ePrivilegedAddress:
 str = "signal SIGSEGV: address access protected";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
+break;
+  case CrashReason::eBoundViolation:
+str = "signal SIGSEGV";
+// Make sure that siginfo_t has the bound fields available.
+#if defined(si_lower) && defined(si_upper)
+AppendBounds(str, reinterpret_cast(info.si_lower),
+ reinterpret_cast(info.si_upper),
+ reinterpret_cast(info.si_addr));
+#endif
 break;
   case CrashReason::eIllegalOpcode:
 str = "signal SIGILL: illegal instruction";
@@ -207,6 +240,9 @@
   case CrashReason::ePrivilegedAddress:
 str = "ePrivilegedAddress";
 break;
+  case CrashReason::eBoundViolation:
+str = "eBoundViolation";
+break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:
Index: source/Plugins/Process/Linux/NativeThreadLinux.cpp
===
--- source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -316,8 +316,7 @@
   (info->si_signo == SIGBUS && info->si_code == SI_KERNEL)
   ? CrashReason::eInvalidAddress
   : GetCrashReason(*info);
-  m_stop_description = GetCrashReasonString(
-  reason, reinterpret_cast(info->si_addr));
+  m_stop_description = GetCrashReasonString(reason, *info);
   break;
 }
   }
Index: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
@@ -0,0 +1,40 @@
+//===-- main.cpp *

[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Zachary Turner via lldb-commits
zturner added inline comments.


> CrashReason.cpp:38
> +  stream << ")";
> +  str += stream.str();
> +}

Actually I'm not sure this is correct.  Since you initialize the stream with 
`str`, as soon as you call `stream.str()` it will flush everything to the 
underlying string.  Now `str` will contain the full formatted data.  Then you 
will call `str += str` and have a second copy of it.

I think you should just write `stream.flush();`

Can you check whether this works?

https://reviews.llvm.org/D25329



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


[Lldb-commits] [lldb] r283468 - These test cases don't test different debug info formats.

2016-10-06 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Oct  6 12:01:00 2016
New Revision: 283468

URL: http://llvm.org/viewvc/llvm-project?rev=283468&view=rev
Log:
These test cases don't test different debug info formats.

Modified:

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

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py?rev=283468&r1=283467&r2=283468&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
 Thu Oct  6 12:01:00 2016
@@ -17,6 +17,8 @@ class AddressBreakpointTestCase(TestBase
 
 mydir = TestBase.compute_mydir(__file__)
 
+NO_DEBUG_INFO_TESTCASE = True
+
 def test_address_breakpoints(self):
 """Test address breakpoints set with shared library of SBAddress work 
correctly."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py?rev=283468&r1=283467&r2=283468&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
 Thu Oct  6 12:01:00 2016
@@ -17,6 +17,8 @@ class BadAddressBreakpointTestCase(TestB
 
 mydir = TestBase.compute_mydir(__file__)
 
+NO_DEBUG_INFO_TESTCASE = True
+
 def test_bad_address_breakpoints(self):
 """Test that breakpoints set on a bad address say they are bad."""
 self.build()


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


[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Valentina Giusti via lldb-commits
valentinagiusti updated this revision to Diff 73823.
valentinagiusti added a comment.

fixed usage of llvm:raw_string_ostream


https://reviews.llvm.org/D25329

Files:
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  source/Plugins/Process/Linux/NativeThreadLinux.cpp
  source/Plugins/Process/POSIX/CrashReason.cpp
  source/Plugins/Process/POSIX/CrashReason.h

Index: source/Plugins/Process/POSIX/CrashReason.h
===
--- source/Plugins/Process/POSIX/CrashReason.h
+++ source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,7 @@
   // SIGSEGV crash reasons.
   eInvalidAddress,
   ePrivilegedAddress,
+  eBoundViolation,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
@@ -49,7 +50,7 @@
   eFloatSubscriptRange
 };
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr);
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info);
 
 const char *CrashReasonAsString(CrashReason reason);
 
Index: source/Plugins/Process/POSIX/CrashReason.cpp
===
--- source/Plugins/Process/POSIX/CrashReason.cpp
+++ source/Plugins/Process/POSIX/CrashReason.cpp
@@ -9,6 +9,8 @@
 
 #include "CrashReason.h"
 
+#include "llvm/Support/raw_ostream.h"
+
 #include 
 
 namespace {
@@ -19,6 +21,23 @@
   str += ss.str();
 }
 
+void AppendBounds(std::string &str, lldb::addr_t lower_bound,
+  lldb::addr_t upper_bound, lldb::addr_t addr) {
+  llvm::raw_string_ostream stream(str);
+  if ((unsigned long)addr < lower_bound)
+stream << ": lower bound violation ";
+  else
+stream << ": upper bound violation ";
+  stream << "(fault address: 0x";
+  stream.write_hex(addr);
+  stream << ", lower bound: 0x";
+  stream.write_hex(lower_bound);
+  stream << ", upper bound: 0x";
+  stream.write_hex(upper_bound);
+  stream << ")";
+  stream.flush();
+}
+
 CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   assert(info.si_signo == SIGSEGV);
 
@@ -34,6 +53,11 @@
 return CrashReason::eInvalidAddress;
   case SEGV_ACCERR:
 return CrashReason::ePrivilegedAddress;
+#ifndef SEGV_BNDERR
+#define SEGV_BNDERR 3
+#endif
+  case SEGV_BNDERR:
+return CrashReason::eBoundViolation;
   }
 
   assert(false && "unexpected si_code for SIGSEGV");
@@ -109,7 +133,7 @@
 }
 }
 
-std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr) {
+std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) {
   std::string str;
 
   switch (reason) {
@@ -119,11 +143,20 @@
 
   case CrashReason::eInvalidAddress:
 str = "signal SIGSEGV: invalid address";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
 break;
   case CrashReason::ePrivilegedAddress:
 str = "signal SIGSEGV: address access protected";
-AppendFaultAddr(str, fault_addr);
+AppendFaultAddr(str, reinterpret_cast(info.si_addr));
+break;
+  case CrashReason::eBoundViolation:
+str = "signal SIGSEGV";
+// Make sure that siginfo_t has the bound fields available.
+#if defined(si_lower) && defined(si_upper)
+AppendBounds(str, reinterpret_cast(info.si_lower),
+ reinterpret_cast(info.si_upper),
+ reinterpret_cast(info.si_addr));
+#endif
 break;
   case CrashReason::eIllegalOpcode:
 str = "signal SIGILL: illegal instruction";
@@ -207,6 +240,9 @@
   case CrashReason::ePrivilegedAddress:
 str = "ePrivilegedAddress";
 break;
+  case CrashReason::eBoundViolation:
+str = "eBoundViolation";
+break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:
Index: source/Plugins/Process/Linux/NativeThreadLinux.cpp
===
--- source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -316,8 +316,7 @@
   (info->si_signo == SIGBUS && info->si_code == SI_KERNEL)
   ? CrashReason::eInvalidAddress
   : GetCrashReason(*info);
-  m_stop_description = GetCrashReasonString(
-  reason, reinterpret_cast(info->si_addr));
+  m_stop_description = GetCrashReasonString(reason, *info);
   break;
 }
   }
Index: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
@@ -0,0 +1,40 @@
+//===-- main.cpp *- C++ -*-===//
+
+//

[Lldb-commits] [lldb] r283472 - Match printf field width arg and type

2016-10-06 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Oct  6 12:55:22 2016
New Revision: 283472

URL: http://llvm.org/viewvc/llvm-project?rev=283472&view=rev
Log:
Match printf field width arg and type

A '*' as a field width or precision specifies that the field width or
precision is supplied by an int argument.

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

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=283472&r1=283471&r2=283472&view=diff
==
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Thu Oct  6 12:55:22 2016
@@ -213,7 +213,7 @@ void Args::Dump(Stream &s, const char *l
   int i = 0;
   for (auto &entry : m_entries) {
 s.Indent();
-s.Printf("%s[%zi]=\"%*s\"\n", label_name, i++, entry.ref.size(),
+s.Printf("%s[%zi]=\"%*s\"\n", label_name, i++, int(entry.ref.size()),
  entry.ref.data());
   }
   s.Printf("%s[%zi]=NULL\n", label_name, i);


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


[Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Valentina Giusti via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283474: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel… (authored by valentinagiusti).

Changed prior to commit:
  https://reviews.llvm.org/D25329?vs=73823&id=73826#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25329

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h

Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
@@ -0,0 +1,7 @@
+LEVEL = ../../../../make
+
+CXX_SOURCES := main.cpp
+
+CFLAGS_EXTRAS += -mmpx -fcheck-pointer-bounds -fuse-ld=bfd
+
+include $(LEVEL)/Makefile.rules
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
@@ -0,0 +1,40 @@
+//===-- main.cpp *- C++ -*-===//
+
+ The LLVM Compiler Infrastructure
+
+ This file is distributed under the University of Illinois Open Source
+ License. See LICENSE.TXT for details.
+
+===--===//
+//
+
+#include 
+#include 
+
+static void violate_upper_bound(int *ptr, int size)
+{
+  int i;
+  i = *(ptr + size);
+}
+
+static void violate_lower_bound (int *ptr, int size)
+{
+  int i;
+  i = *(ptr - size);
+}
+
+int
+main(int argc, char const *argv[])
+{
+  unsigned int rax, rbx, rcx, rdx;
+  int array[5];
+
+  // This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
+  if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
+return -1;
+
+  violate_upper_bound(array, 5);
+  violate_lower_bound(array, 5);
+
+  return 0;
+}
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
@@ -0,0 +1,57 @@
+"""
+Test the Intel(R) MPX bound violation signal.
+"""
+
+from __future__ import print_function
+
+
+import os
+import sys
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class RegisterCommandsTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIf(compiler="clang")
+@skipIf(oslist=no_match(['linux']))
+@skipIf(archs=no_match(['i386', 'x86_64']))
+@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) #GCC version >= 5 supports Intel(R) MPX.
+def test_mpx_boundary_violation(self):
+"""Test Intel(R) MPX bound violation signal."""
+self.build()
+self.mpx_boundary_violation()
+
+def mpx_boundary_violation(self):
+exe = os.path.join(os.getcwd(), "a.out")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+target = self.dbg.GetSelectedTarget()
+process = target.GetProcess()
+
+if (process.GetState() == lldb.eStateExited):
+self.skipTest("Intel(R) MPX is not supported.")
+
+if (process.GetState() == lldb.eStateStopped):
+self.expect("thread backtrace", STOPPED_DUE_TO_SIGNAL,
+substrs = ['stop reason = signal SIGSEGV: upper bound violation',
+   'fault address:', 'lower bound:', 'upper bound:'])
+
+self.runCmd("continue")
+
+if (process.GetState() == lldb.eStateStopped):
+self.

[Lldb-commits] [lldb] r283474 - Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Valentina Giusti via lldb-commits
Author: valentinagiusti
Date: Thu Oct  6 13:05:12 2016
New Revision: 283474

URL: http://llvm.org/viewvc/llvm-project?rev=283474&view=rev
Log:
Add bound violation handling for Intel(R) Memory Protection Extensions 
(Intel(R) MPX)

Summary:
This patch adds support for handling the SIGSEGV signal with 'si_code ==
SEGV_BNDERR', which is thrown when a bound violation is caught by the
Intel(R) MPX technology.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile?rev=283474&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
 Thu Oct  6 13:05:12 2016
@@ -0,0 +1,7 @@
+LEVEL = ../../../../make
+
+CXX_SOURCES := main.cpp
+
+CFLAGS_EXTRAS += -mmpx -fcheck-pointer-bounds -fuse-ld=bfd
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py?rev=283474&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
 Thu Oct  6 13:05:12 2016
@@ -0,0 +1,57 @@
+"""
+Test the Intel(R) MPX bound violation signal.
+"""
+
+from __future__ import print_function
+
+
+import os
+import sys
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class RegisterCommandsTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIf(compiler="clang")
+@skipIf(oslist=no_match(['linux']))
+@skipIf(archs=no_match(['i386', 'x86_64']))
+@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) 
#GCC version >= 5 supports Intel(R) MPX.
+def test_mpx_boundary_violation(self):
+"""Test Intel(R) MPX bound violation signal."""
+self.build()
+self.mpx_boundary_violation()
+
+def mpx_boundary_violation(self):
+exe = os.path.join(os.getcwd(), "a.out")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+target = self.dbg.GetSelectedTarget()
+process = target.GetProcess()
+
+if (process.GetState() == lldb.eStateExited):
+self.skipTest("Intel(R) MPX is not supported.")
+
+if (process.GetState() == lldb.eStateStopped):
+self.expect("thread backtrace", STOPPED_DUE_TO_SIGNAL,
+substrs = ['stop reason = signal SIGSEGV: upper bound 
violation',
+   'fault address:', 'lower bound:', 'upper 
bound:'])
+
+self.runCmd("continue")
+
+if (process.GetState() == lldb.eStateStopped):
+self.expect("thread backtrace", STOPPED_DUE_TO_SIGNAL,
+substrs = ['stop reason = signal SIGSEGV: lower bound 
violation',
+   'fault address:', 'lower bound:', 'upper 
bound:'])
+
+self.runCmd("continue")
+self.assertTrue(process.GetState() == lldb.eStateExited,
+PROCESS_EXITED)

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_v

[Lldb-commits] [lldb] r283477 - xfail TestDarwinLogBasic.py for i386 macOS

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 13:25:54 2016
New Revision: 283477

URL: http://llvm.org/viewvc/llvm-project?rev=283477&view=rev
Log:
xfail TestDarwinLogBasic.py for i386 macOS

Tracked by:
rdar://28655626

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py?rev=283477&r1=283476&r2=283477&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py
 Thu Oct  6 13:25:54 2016
@@ -21,6 +21,7 @@ class TestDarwinLogBasic(darwin_log.Darw
 
 @decorators.add_test_categories(['pyapi'])
 @decorators.skipUnlessDarwin
+@decorators.expectedFailureAll(archs=["i386"], bugnumber="rdar://28655626")
 def test_SBStructuredData_gets_broadcasted(self):
 """Exercise SBStructuredData API."""
 


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


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Zachary Turner via lldb-commits
Seems like this has caused this buildbot failure:

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/12936/steps/ninja%20build%20local/logs/stdio

On Thu, Oct 6, 2016 at 11:14 AM Valentina Giusti 
wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL283474: Add bound violation handling for Intel(R)
> Memory Protection Extensions (Intel… (authored by valentinagiusti).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D25329?vs=73823&id=73826#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D25329
>
> Files:
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
>   lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>   lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
>   lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Giusti, Valentina via lldb-commits
Ok, I will look into it. Thanks for the link to the logs. I didn’t know that 
there was a FreeBSD builder, why isn’t it linked on the Build page 
(http://lldb.llvm.org/build.html)? Is there another page that lists all 
available builders?

From: Zachary Turner [mailto:ztur...@google.com]
Sent: Thursday, October 6, 2016 8:38 PM
To: reviews+d25329+public+5e5cdf7e302a5...@reviews.llvm.org; Giusti, Valentina 
; lab...@google.com
Cc: lldb-commits@lists.llvm.org; ema...@freebsd.org
Subject: Re: [PATCH] D25329: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel(R) MPX)

Seems like this has caused this buildbot failure:

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/12936/steps/ninja%20build%20local/logs/stdio

On Thu, Oct 6, 2016 at 11:14 AM Valentina Giusti 
mailto:valentina.giu...@intel.com>> wrote:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283474: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel… (authored by valentinagiusti).

Changed prior to commit:
  https://reviews.llvm.org/D25329?vs=73823&id=73826#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25329

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283479 - StringRef::front asserts on empty strings, causing "break modify -c ''" to assert.

2016-10-06 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Oct  6 13:57:30 2016
New Revision: 283479

URL: http://llvm.org/viewvc/llvm-project?rev=283479&view=rev
Log:
StringRef::front asserts on empty strings, causing "break modify -c ''" to 
assert.

Added a check for empty at the point where we were going to crash.



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

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=283479&r1=283478&r2=283479&view=diff
==
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Thu Oct  6 13:57:30 2016
@@ -994,7 +994,7 @@ bool CommandObjectParsed::Execute(const
   }
   if (!handled) {
 for (auto entry : llvm::enumerate(cmd_args.entries())) {
-  if (entry.Value.ref.front() == '`') {
+  if (!entry.Value.ref.empty() && entry.Value.ref.front() == '`') {
 cmd_args.ReplaceArgumentAtIndex(
 entry.Index,
 m_interpreter.ProcessEmbeddedScriptCommands(entry.Value.c_str()));


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


[Lldb-commits] [lldb] r283481 - xfail TestDiagnoseDereferenceFunctionReturn.py on macOS i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 14:04:58 2016
New Revision: 283481

URL: http://llvm.org/viewvc/llvm-project?rev=283481&view=rev
Log:
xfail TestDiagnoseDereferenceFunctionReturn.py on macOS i386

Tracked by:
rdar://28656408

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py?rev=283481&r1=283480&r2=283481&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
 Thu Oct  6 14:04:58 2016
@@ -15,6 +15,7 @@ class TestDiagnoseDereferenceFunctionRet
 mydir = TestBase.compute_mydir(__file__)
 
 @skipUnlessDarwin
+@expectedFailureAll(oslist=['macosx'], archs=['i386'], 
bugnumber="rdar://28656408")
 def test_diagnose_dereference_function_return(self):
 TestBase.setUp(self)
 self.build()


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


[Lldb-commits] [lldb] r283482 - xfail TestExec.py on macOS i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 14:12:05 2016
New Revision: 283482

URL: http://llvm.org/viewvc/llvm-project?rev=283482&view=rev
Log:
xfail TestExec.py on macOS i386

Tracked by:
rdar://28656532

Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=283482&r1=283481&r2=283482&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Thu Oct  6 14:12:05 2016
@@ -27,6 +27,7 @@ class ExecTestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @skipUnlessDarwin
+@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 def test(self):
 if self.getArchitecture() == 'x86_64':
 source = os.path.join(os.getcwd(), "main.cpp")


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


[Lldb-commits] [lldb] r283483 - xfail TestDataFormatterNSIndexPath.py on macOS i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 14:18:48 2016
New Revision: 283483

URL: http://llvm.org/viewvc/llvm-project?rev=283483&view=rev
Log:
xfail TestDataFormatterNSIndexPath.py on macOS i386

Tracked by:
rdar://28656605

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py?rev=283483&r1=283482&r2=283483&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
 Thu Oct  6 14:18:48 2016
@@ -45,6 +45,7 @@ class NSIndexPathDataFormatterTestCase(T
 commands()
 
 @skipUnlessDarwin
+@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656605")
 def test_nsindexpath_with_run_command(self):
 """Test formatters for NSIndexPath."""
 self.appkit_tester_impl(self.nsindexpath_data_formatter_commands)


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


[Lldb-commits] [lldb] r283484 - xfail TestSBTypeTypeClass.py on macOS i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 14:23:29 2016
New Revision: 283484

URL: http://llvm.org/viewvc/llvm-project?rev=283484&view=rev
Log:
xfail TestSBTypeTypeClass.py on macOS i386

Tracked by:
rdar://28656677

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py?rev=283484&r1=283483&r2=283484&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
 Thu Oct  6 14:23:29 2016
@@ -3,4 +3,8 @@ from lldbsuite.test import lldbinline
 
 lldbinline.MakeInlineTest(
 __file__, globals(), [
-decorators.skipIfFreeBSD, decorators.skipIfLinux, 
decorators.skipIfWindows])
+decorators.skipIfFreeBSD, decorators.skipIfLinux,
+decorators.skipIfWindows,
+decorators.expectedFailureAll(
+oslist=['macosx'], archs=['i386'],
+bugnumber='rdar://28656677')])


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


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Zachary Turner via lldb-commits
I'm not sure actually.  I only noticed this because I was in IRC and I saw
the message go by about the failure.

Ed (already CC'ed) maintains the FreeBSD builder, so he might have an
answer for you.

On Thu, Oct 6, 2016 at 12:02 PM Giusti, Valentina <
valentina.giu...@intel.com> wrote:

> Ok, I will look into it. Thanks for the link to the logs. I didn’t know
> that there was a FreeBSD builder, why isn’t it linked on the Build page (
> http://lldb.llvm.org/build.html)? Is there another page that lists all
> available builders?
>
>
>
> *From:* Zachary Turner [mailto:ztur...@google.com]
> *Sent:* Thursday, October 6, 2016 8:38 PM
> *To:* reviews+d25329+public+5e5cdf7e302a5...@reviews.llvm.org; Giusti,
> Valentina ; lab...@google.com
> *Cc:* lldb-commits@lists.llvm.org; ema...@freebsd.org
> *Subject:* Re: [PATCH] D25329: Add bound violation handling for Intel(R)
> Memory Protection Extensions (Intel(R) MPX)
>
>
>
> Seems like this has caused this buildbot failure:
>
>
>
>
> http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/12936/steps/ninja%20build%20local/logs/stdio
>
>
>
> On Thu, Oct 6, 2016 at 11:14 AM Valentina Giusti <
> valentina.giu...@intel.com> wrote:
>
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL283474: Add bound violation handling for Intel(R)
> Memory Protection Extensions (Intel… (authored by valentinagiusti).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D25329?vs=73823&id=73826#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D25329
>
> Files:
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
>   lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>   lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
>   lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Giusti, Valentina via lldb-commits
In the meantime I discovered that the builders and their latest states can be 
seen here: http://lab.llvm.org:8011/builders and I also figured out a fix for 
this issue, but I still can’t compile it on my FreeBSD server. I am afraid I 
will have to continue tomorrow in the office (now it’s late evening and I’m at 
home).

From: Zachary Turner [mailto:ztur...@google.com]
Sent: Thursday, October 6, 2016 10:43 PM
To: Giusti, Valentina ; 
reviews+d25329+public+5e5cdf7e302a5...@reviews.llvm.org; lab...@google.com
Cc: lldb-commits@lists.llvm.org; ema...@freebsd.org
Subject: Re: [PATCH] D25329: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel(R) MPX)

I'm not sure actually.  I only noticed this because I was in IRC and I saw the 
message go by about the failure.

Ed (already CC'ed) maintains the FreeBSD builder, so he might have an answer 
for you.
On Thu, Oct 6, 2016 at 12:02 PM Giusti, Valentina 
mailto:valentina.giu...@intel.com>> wrote:
Ok, I will look into it. Thanks for the link to the logs. I didn’t know that 
there was a FreeBSD builder, why isn’t it linked on the Build page 
(http://lldb.llvm.org/build.html)? Is there another page that lists all 
available builders?

From: Zachary Turner [mailto:ztur...@google.com]
Sent: Thursday, October 6, 2016 8:38 PM
To: 
reviews+d25329+public+5e5cdf7e302a5...@reviews.llvm.org;
 Giusti, Valentina 
mailto:valentina.giu...@intel.com>>; 
lab...@google.com
Cc: lldb-commits@lists.llvm.org; 
ema...@freebsd.org
Subject: Re: [PATCH] D25329: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel(R) MPX)

Seems like this has caused this buildbot failure:

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/12936/steps/ninja%20build%20local/logs/stdio

On Thu, Oct 6, 2016 at 11:14 AM Valentina Giusti 
mailto:valentina.giu...@intel.com>> wrote:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283474: Add bound violation handling for Intel(R) Memory 
Protection Extensions (Intel… (authored by valentinagiusti).

Changed prior to commit:
  https://reviews.llvm.org/D25329?vs=73823&id=73826#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25329

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
  lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283491 - Fix GetDisplayName when only a demangled name is available

2016-10-06 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Thu Oct  6 15:41:11 2016
New Revision: 283491

URL: http://llvm.org/viewvc/llvm-project?rev=283491&view=rev
Log:
Fix GetDisplayName when only a demangled name is available

Summary:
GetDisplayDemangledName will already return a ConstString() when
there is neither a mangled name or a demangled name, so we don't need to special
case here. This will fix GetDisplayName in cases where m_mangled contains
only a demangled name and not a mangled name.

Reviewers: clayborg, granata.enrico, sas

Subscribers: lldb-commits

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

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

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=283491&r1=283490&r2=283491&view=diff
==
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Thu Oct  6 15:41:11 2016
@@ -347,8 +347,6 @@ bool Function::IsTopLevelFunction() {
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=283491&r1=283490&r2=283491&view=diff
==
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Thu Oct  6 15:41:11 2016
@@ -117,8 +117,6 @@ bool Symbol::ValueIsAddress() const {
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 


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


[Lldb-commits] [PATCH] D25201: Fix GetDisplayName when only a demangled name is available

2016-10-06 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283491: Fix GetDisplayName when only a demangled name is 
available (authored by fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D25201?vs=73307&id=73847#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25201

Files:
  lldb/trunk/source/Symbol/Function.cpp
  lldb/trunk/source/Symbol/Symbol.cpp


Index: lldb/trunk/source/Symbol/Function.cpp
===
--- lldb/trunk/source/Symbol/Function.cpp
+++ lldb/trunk/source/Symbol/Function.cpp
@@ -347,8 +347,6 @@
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
Index: lldb/trunk/source/Symbol/Symbol.cpp
===
--- lldb/trunk/source/Symbol/Symbol.cpp
+++ lldb/trunk/source/Symbol/Symbol.cpp
@@ -117,8 +117,6 @@
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 


Index: lldb/trunk/source/Symbol/Function.cpp
===
--- lldb/trunk/source/Symbol/Function.cpp
+++ lldb/trunk/source/Symbol/Function.cpp
@@ -347,8 +347,6 @@
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
Index: lldb/trunk/source/Symbol/Symbol.cpp
===
--- lldb/trunk/source/Symbol/Symbol.cpp
+++ lldb/trunk/source/Symbol/Symbol.cpp
@@ -117,8 +117,6 @@
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283492 - xfail TestQueues on macOS

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 16:07:45 2016
New Revision: 283492

URL: http://llvm.org/viewvc/llvm-project?rev=283492&view=rev
Log:
xfail TestQueues on macOS

This test is failing on CI.  I cannot get it to fail on my
local setup.

Tracked by:
rdar://28658529

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=283492&r1=283491&r2=283492&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Thu 
Oct  6 16:07:45 2016
@@ -18,6 +18,7 @@ class TestQueues(TestBase):
 
 @skipUnlessDarwin
 @add_test_categories(['pyapi'])
+@expectedFailureAll(bugnumber="rdar://28658529")
 def test_with_python_api(self):
 """Test queues inspection SB APIs."""
 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] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Ed Maste via lldb-commits
On 6 October 2016 at 16:42, Zachary Turner  wrote:
> I'm not sure actually.  I only noticed this because I was in IRC and I saw
> the message go by about the failure.
>
> Ed (already CC'ed) maintains the FreeBSD builder, so he might have an answer
> for you.

I'm not sure why it's not on the build.html list - I'll add it soon.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283493 - xfail TestReportData.py on i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 16:16:37 2016
New Revision: 283493

URL: http://llvm.org/viewvc/llvm-project?rev=283493&view=rev
Log:
xfail TestReportData.py on i386

Tracked by:
rdar://28658860

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py?rev=283493&r1=283492&r2=283493&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
 Thu Oct  6 16:16:37 2016
@@ -24,6 +24,7 @@ class AsanTestReportDataCase(TestBase):
 @skipIfFreeBSD  # llvm.org/pr21136 runtimes not yet available by default
 @skipIfRemote
 @skipUnlessCompilerRt
+@expectedFailureAll(archs=['i386'], bugnumber="rdar://28658860")
 def test(self):
 self.build()
 self.asan_tests()


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


[Lldb-commits] [lldb] r283494 - Convert UniqueCStringMap to use StringRef.

2016-10-06 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Oct  6 16:22:44 2016
New Revision: 283494

URL: http://llvm.org/viewvc/llvm-project?rev=283494&view=rev
Log:
Convert UniqueCStringMap to use StringRef.

Modified:
lldb/trunk/include/lldb/Core/Stream.h
lldb/trunk/include/lldb/Core/UniqueCStringMap.h
lldb/trunk/source/Core/Stream.cpp
lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
lldb/trunk/source/Interpreter/OptionValueProperties.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h

lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/GoASTContext.cpp
lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/include/lldb/Core/Stream.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Stream.h?rev=283494&r1=283493&r2=283494&view=diff
==
--- lldb/trunk/include/lldb/Core/Stream.h (original)
+++ lldb/trunk/include/lldb/Core/Stream.h Thu Oct  6 16:22:44 2016
@@ -364,7 +364,7 @@ public:
   /// @param[in] cstr
   /// The string to be output to the stream.
   //--
-  size_t PutCString(const char *cstr);
+  size_t PutCString(llvm::StringRef cstr);
 
   //--
   /// Output and End of Line character to the stream.

Modified: lldb/trunk/include/lldb/Core/UniqueCStringMap.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UniqueCStringMap.h?rev=283494&r1=283493&r2=283494&view=diff
==
--- lldb/trunk/include/lldb/Core/UniqueCStringMap.h (original)
+++ lldb/trunk/include/lldb/Core/UniqueCStringMap.h Thu Oct  6 16:22:44 2016
@@ -33,15 +33,15 @@ namespace lldb_private {
 template  class UniqueCStringMap {
 public:
   struct Entry {
-Entry() : cstring(nullptr), value() {}
+Entry() {}
 
-Entry(const char *cstr) : cstring(cstr), value() {}
+Entry(llvm::StringRef cstr) : cstring(cstr), value() {}
 
-Entry(const char *cstr, const T &v) : cstring(cstr), value(v) {}
+Entry(llvm::StringRef cstr, const T &v) : cstring(cstr), value(v) {}
 
 bool operator<(const Entry &rhs) const { return cstring < rhs.cstring; }
 
-const char *cstring;
+llvm::StringRef cstring;
 T value;
   };
 
@@ -50,7 +50,7 @@ public:
   // this map, then later call UniqueCStringMap::Sort() before doing
   // any searches by name.
   //--
-  void Append(const char *unique_cstr, const T &value) {
+  void Append(llvm::StringRef unique_cstr, const T &value) {
 m_map.push_back(typename UniqueCStringMap::Entry(unique_cstr, value));
   }
 
@@ -62,7 +62,7 @@ public:
   // Call this function to always keep the map sorted when putting
   // entries into the map.
   //--
-  void Insert(const char *unique_cstr, const T &value) {
+  void Insert(llvm::StringRef unique_cstr, const T &value) {
 typename UniqueCStringMap::Entry e(unique_cstr, value);
 m_map.insert(std::upper_bound(m_map.begin(), m_map.end(), e), e);
   }
@@ -85,7 +85,7 @@ public:
 return false;
   }
 
-  const char *GetCStringAtIndexUnchecked(uint32_t idx) const {
+  llvm::StringRef GetCStringAtIndexUnchecked(uint32_t idx) const {
 return m_map[idx].cstring;
   }
 
@@ -99,8 +99,8 @@ public:
 return m_map[idx].value;
   }
 
-  const char *GetCStringAtIndex(uint32_t idx) const {
-return ((idx < m_map.size()) ? m_map[idx].cstring : nullptr);
+  llvm::StringRef GetCStringAtIndex(uint32_t idx) const {
+return ((idx < m_map.size()) ? m_map[idx].cstring : llvm::StringRef());
   }
 
   //--
@@ -111,7 +111,7 @@ public:
   // T values and only if there is a sensible failure value that can
   // be returned and that won't match any existing values.
   //--
-  T Find(const char *unique_cstr, T fail_value) const {
+  T Find(llvm::StringRef unique_cstr, T fail_value) const {
 Entry search_entry(unique_cstr);
 const_iterator end = m_map.end();
 const_iterator pos = std::lower_bound(m_map.begin(), end, search_entry);
@@ -129,12 +129,12 @@ public:
   // The caller is responsible for ensuring that the collection does
   // not change during while using the returned pointer.
   //--

[Lldb-commits] [lldb] r283497 - disable TSAN tests on macOS i386

2016-10-06 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Oct  6 16:30:33 2016
New Revision: 283497

URL: http://llvm.org/viewvc/llvm-project?rev=283497&view=rev
Log:
disable TSAN tests on macOS i386

These are erroring out on macOS i386.

Tracked by:
rdar://28659145

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=283497&r1=283496&r2=283497&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Oct  6 16:30:33 
2016
@@ -5,6 +5,7 @@ from __future__ import print_function
 from distutils.version import LooseVersion, StrictVersion
 from functools import wraps
 import os
+import platform
 import re
 import sys
 import tempfile
@@ -667,6 +668,9 @@ def skipUnlessThreadSanitizer(func):
 compiler = os.path.basename(compiler_path)
 if not compiler.startswith("clang"):
 return "Test requires clang as compiler"
+# rdar://28659145 - TSAN tests don't look like they're supported on 
i386
+if self.getArchitecture() == 'i386' and platform.system() == 'Darwin':
+return "TSAN tests not compatible with i386 targets"
 f = tempfile.NamedTemporaryFile()
 cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
 if os.popen(cmd).close() 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] r283520 - [lit] Don't assume you'll find debugserver

2016-10-06 Thread Hal Finkel via lldb-commits
Author: hfinkel
Date: Thu Oct  6 21:26:41 2016
New Revision: 283520

URL: http://llvm.org/viewvc/llvm-project?rev=283520&view=rev
Log:
[lit] Don't assume you'll find debugserver

On Linux, there is no "debugserver" process, and the RUN-line substitution will
fail if you try to substitute '%debugserver' with None.

Fixes PR30492.

Modified:
lldb/trunk/lit/lit.cfg

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=283520&r1=283519&r2=283520&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Thu Oct  6 21:26:41 2016
@@ -140,7 +140,9 @@ config.substitutions.append(('%cc', conf
 config.substitutions.append(('%cxx', config.cxx))
 
 config.substitutions.append(('%lldb', lldb))
-config.substitutions.append(('%debugserver', debugserver))
+
+if debugserver is not None:
+config.substitutions.append(('%debugserver', debugserver))
 
 for pattern in [r"\bFileCheck\b",
 r"\| \bnot\b"]:


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