Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2017 20:14:12 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r311542 - in vendor/lldb/dist: include/lldb/Core include/lldb/Host packages/Python/lldbsuite/test/tools/lldb-mi packages/Python/lldbsuite/test/tools/lldb-mi/control packages/Python/lldb...
Message-ID:  <201701062014.v06KECJi068856@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Jan  6 20:14:12 2017
New Revision: 311542
URL: https://svnweb.freebsd.org/changeset/base/311542

Log:
  Vendor import of lldb trunk r291274:
  https://llvm.org/svn/llvm-project/lldb/trunk@291274

Added:
  vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py   (contents, props changed)
Modified:
  vendor/lldb/dist/include/lldb/Core/MappedHash.h
  vendor/lldb/dist/include/lldb/Host/Editline.h
  vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
  vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
  vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
  vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
  vendor/lldb/dist/source/Core/DataEncoder.cpp
  vendor/lldb/dist/source/Core/ValueObjectMemory.cpp
  vendor/lldb/dist/source/Expression/IRInterpreter.cpp
  vendor/lldb/dist/source/Expression/IRMemoryMap.cpp
  vendor/lldb/dist/source/Host/common/Editline.cpp
  vendor/lldb/dist/source/Host/windows/EditLineWin.cpp
  vendor/lldb/dist/source/Interpreter/OptionValueProperties.cpp
  vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
  vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
  vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
  vendor/lldb/dist/source/Plugins/Process/POSIX/CrashReason.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
  vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
  vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
  vendor/lldb/dist/source/Symbol/ClangASTContext.cpp
  vendor/lldb/dist/source/Symbol/Type.cpp
  vendor/lldb/dist/source/Target/ABI.cpp
  vendor/lldb/dist/source/Target/Platform.cpp
  vendor/lldb/dist/source/Target/StackFrameList.cpp
  vendor/lldb/dist/tools/driver/Platform.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdEnviro.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.h
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.h
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdMiscellanous.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmdCmdTarget.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
  vendor/lldb/dist/tools/lldb-mi/MICmnMIOutOfBandRecord.h
  vendor/lldb/dist/tools/lldb-perf/lib/Results.cpp
  vendor/lldb/dist/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Modified: vendor/lldb/dist/include/lldb/Core/MappedHash.h
==============================================================================
--- vendor/lldb/dist/include/lldb/Core/MappedHash.h	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/include/lldb/Core/MappedHash.h	Fri Jan  6 20:14:12 2017	(r311542)
@@ -52,8 +52,7 @@ public:
     default:
       break;
     }
-    assert(!"Invalid hash function index");
-    return 0;
+    llvm_unreachable("Invalid hash function index");
   }
 
   static const uint32_t HASH_MAGIC = 0x48415348u;

Modified: vendor/lldb/dist/include/lldb/Host/Editline.h
==============================================================================
--- vendor/lldb/dist/include/lldb/Host/Editline.h	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/include/lldb/Host/Editline.h	Fri Jan  6 20:14:12 2017	(r311542)
@@ -322,6 +322,8 @@ private:
   /// single or multi-line editing.
   void ConfigureEditor(bool multiline);
 
+  bool CompleteCharacter(char ch, EditLineCharType &out);
+
 private:
 #if LLDB_EDITLINE_USE_WCHAR
   std::wstring_convert<std::codecvt_utf8<wchar_t>> m_utf8conv;

Added: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py	Fri Jan  6 20:14:12 2017	(r311542)
@@ -0,0 +1,37 @@
+"""
+Test lldb-mi -environment-cd command.
+"""
+
+from __future__ import print_function
+
+
+import lldbmi_testcase
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class MiEnvironmentCdTestCase(lldbmi_testcase.MiTestCaseBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+
+    @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
+    @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races
+    @skipIfDarwin   # Disabled while I investigate the failure on buildbot.
+    def test_lldbmi_environment_cd(self):
+        """Test that 'lldb-mi --interpreter' changes working directory for inferior."""
+
+        self.spawnLldbMi(args=None)
+
+        # Load executable
+        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+        self.expect("\^done")
+
+        # cd to a different directory
+        self.runCmd("-environment-cd /tmp")
+        self.expect("\^done")
+
+        # Run to the end
+        self.runCmd("-exec-run")
+        self.expect("\^running")
+        self.expect("@\"cwd: /tmp\\r\\n\"", exactly=True)

Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py	Fri Jan  6 20:14:12 2017	(r311542)
@@ -208,3 +208,44 @@ class MiGdbSetShowTestCase(lldbmi_testca
         self.expect("\^done")
         self.runCmd("-var-evaluate-expression var_a")
         self.expect("\^done,value=\"10\"")
+
+    @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
+    @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races
+    @expectedFailureAll(
+        bugnumber="llvm.org/pr31485: data-disassemble doesn't follow flavor settings")
+    def test_lldbmi_gdb_set_disassembly_flavor(self):
+        """Test that 'lldb-mi --interpreter' works for -gdb-set disassembly-flavor."""
+
+        self.spawnLldbMi(args=None)
+
+        # Load executable
+        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+        self.expect("\^done")
+
+        # Run to BP_printf
+        line = line_number('main.cpp', '// BP_printf')
+        self.runCmd("-break-insert main.cpp:%d" % line)
+        self.expect("\^done,bkpt={number=\"1\"")
+        self.runCmd("-exec-run")
+        self.expect("\^running")
+        self.expect("\*stopped,reason=\"breakpoint-hit\".+addr=\"(0x[0-9a-f]+)\"")
+
+        # Get starting and ending address from $pc
+        pc = int(self.child.match.group(1), base=16)
+        s_addr, e_addr = pc, pc + 1
+
+        # Test default output (att)
+        self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
+        self.expect("movl ")
+
+        # Test intel style
+        self.runCmd("-gdb-set disassembly-flavor intel")
+        self.expect("\^done")
+        self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
+        self.expect("mov ")
+
+        # Test AT&T style
+        self.runCmd("-gdb-set disassembly-flavor intel")
+        self.expect("\^done")
+        self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
+        self.expect("movl ")

Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py	Fri Jan  6 20:14:12 2017	(r311542)
@@ -111,24 +111,25 @@ class MiExecTestCase(lldbmi_testcase.MiT
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
 
         # Check argc and argv to see if arg passed
+        # Note that exactly=True is needed to avoid extra escaping for re
         self.runCmd("-data-evaluate-expression argc")
         self.expect("\^done,value=\"5\"")
         #self.runCmd("-data-evaluate-expression argv[1]")
         # self.expect("\^done,value=\"--arg1\"")
         self.runCmd("-interpreter-exec command \"print argv[1]\"")
-        self.expect("\"--arg1\"")
+        self.expect("\\\"--arg1\\\"", exactly=True)
         #self.runCmd("-data-evaluate-expression argv[2]")
         #self.expect("\^done,value=\"2nd arg\"")
         self.runCmd("-interpreter-exec command \"print argv[2]\"")
-        self.expect("\"2nd arg\"")
+        self.expect("\\\"2nd arg\\\"", exactly=True)
         #self.runCmd("-data-evaluate-expression argv[3]")
         # self.expect("\^done,value=\"third_arg\"")
         self.runCmd("-interpreter-exec command \"print argv[3]\"")
-        self.expect("\"third_arg\"")
+        self.expect("\\\"third_arg\\\"", exactly=True)
         #self.runCmd("-data-evaluate-expression argv[4]")
         #self.expect("\^done,value=\"fourth=\\\\\\\"4th arg\\\\\\\"\"")
         self.runCmd("-interpreter-exec command \"print argv[4]\"")
-        self.expect("\"fourth=\\\\\\\"4th arg\\\\\\\"\"")
+        self.expect("\\\"fourth=\\\\\\\"4th arg\\\\\\\"\\\"", exactly=True)
 
     @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
     @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races

Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -9,11 +9,25 @@
 
 #include <cstdio>
 
+#ifdef _WIN32
+    #include <direct.h>
+    #define getcwd _getcwd // suppress "deprecation" warning
+#else
+    #include <unistd.h>
+#endif
+
 int
 main(int argc, char const *argv[])
 {
-    int a  = 10;
+    int a = 10;
+
+    char buf[512];
+    char *ans = getcwd(buf, sizeof(buf));
+    if (ans) {
+        printf("cwd: %s\n", ans);
+    }
 
     printf("argc=%d\n", argc); // BP_printf
+
     return 0;
 }

Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py	Fri Jan  6 20:14:12 2017	(r311542)
@@ -97,6 +97,7 @@ class MiSyntaxTestCase(lldbmi_testcase.M
 
         # Run all commands simultaneously
         self.runCmd("-unknown-command")
+        self.runCmd("-interpreter-exec command help")
         self.runCmd("-file-exec-and-symbols %s" % self.myexe)
         self.runCmd("-break-insert -f main")
         self.runCmd("-gdb-set target-async off")

Modified: vendor/lldb/dist/source/Core/DataEncoder.cpp
==============================================================================
--- vendor/lldb/dist/source/Core/DataEncoder.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Core/DataEncoder.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -258,8 +258,7 @@ uint32_t DataEncoder::PutMaxU64(uint32_t
   case 8:
     return PutU64(offset, value);
   default:
-    assert(!"GetMax64 unhandled case!");
-    break;
+    llvm_unreachable("GetMax64 unhandled case!");
   }
   return UINT32_MAX;
 }

Modified: vendor/lldb/dist/source/Core/ValueObjectMemory.cpp
==============================================================================
--- vendor/lldb/dist/source/Core/ValueObjectMemory.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Core/ValueObjectMemory.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -165,8 +165,7 @@ bool ValueObjectMemory::UpdateValue() {
 
     switch (value_type) {
     default:
-      assert(!"Unhandled expression result value kind...");
-      break;
+      llvm_unreachable("Unhandled expression result value kind...");
 
     case Value::eValueTypeScalar:
       // The variable value is in the Scalar value inside the m_value.

Modified: vendor/lldb/dist/source/Expression/IRInterpreter.cpp
==============================================================================
--- vendor/lldb/dist/source/Expression/IRInterpreter.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Expression/IRInterpreter.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -1602,25 +1602,23 @@ bool IRInterpreter::Interpret(llvm::Modu
           lldb::addr_t addr = tmp_op.ULongLong();
           size_t dataSize = 0;
 
-          if (execution_unit.GetAllocSize(addr, dataSize)) {
-            // Create the required buffer
-            rawArgs[i].size = dataSize;
-            rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
-
-            // Read string from host memory
-            execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
-                                      error);
-            if (error.Fail()) {
-              assert(!"we have failed to read the string from memory");
-              return false;
-            }
-            // Add null terminator
-            rawArgs[i].data_ap[dataSize] = '\0';
-            rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
-          } else {
-            assert(!"unable to locate host data for transfer to device");
-            return false;
-          }
+          bool Success = execution_unit.GetAllocSize(addr, dataSize);
+          (void)Success;
+          assert(Success &&
+                 "unable to locate host data for transfer to device");
+          // Create the required buffer
+          rawArgs[i].size = dataSize;
+          rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
+
+          // Read string from host memory
+          execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
+                                    error);
+          assert(!error.Fail() &&
+                 "we have failed to read the string from memory");
+
+          // Add null terminator
+          rawArgs[i].data_ap[dataSize] = '\0';
+          rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
         } else /* if ( arg_ty->isPointerTy() ) */
         {
           rawArgs[i].type = lldb_private::ABI::CallArgument::TargetValue;

Modified: vendor/lldb/dist/source/Expression/IRMemoryMap.cpp
==============================================================================
--- vendor/lldb/dist/source/Expression/IRMemoryMap.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Expression/IRMemoryMap.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -126,7 +126,7 @@ lldb::addr_t IRMemoryMap::FindSpace(size
         err = process_sp->GetMemoryRegionInfo(
             region_info.GetRange().GetRangeEnd(), region_info);
         if (err.Fail()) {
-          lldbassert(!"GetMemoryRegionInfo() succeeded, then failed");
+          lldbassert(0 && "GetMemoryRegionInfo() succeeded, then failed");
           ret = LLDB_INVALID_ADDRESS;
           break;
         }

Modified: vendor/lldb/dist/source/Host/common/Editline.cpp
==============================================================================
--- vendor/lldb/dist/source/Host/common/Editline.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Host/common/Editline.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -526,17 +526,8 @@ int Editline::GetCharacter(EditLineCharT
     }
 
     if (read_count) {
-#if LLDB_EDITLINE_USE_WCHAR
-      // After the initial interruptible read, this is guaranteed not to block
-      ungetc(ch, m_input_file);
-      *c = fgetwc(m_input_file);
-      if (*c != WEOF)
-        return 1;
-#else
-      *c = ch;
-      if (ch != (char)EOF)
+      if (CompleteCharacter(ch, *c))
         return 1;
-#endif
     } else {
       switch (status) {
       case lldb::eConnectionStatusSuccess: // Success
@@ -1367,3 +1358,39 @@ void Editline::PrintAsync(Stream *stream
     MoveCursor(CursorLocation::BlockEnd, CursorLocation::EditingCursor);
   }
 }
+
+bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
+#if !LLDB_EDITLINE_USE_WCHAR
+  if (ch == (char)EOF)
+    return false;
+
+  out = ch;
+  return true;
+#else
+  std::codecvt_utf8<wchar_t> cvt;
+  llvm::SmallString<4> input;
+  for (;;) {
+    const char *from_next;
+    wchar_t *to_next;
+    std::mbstate_t state = std::mbstate_t();
+    input.push_back(ch);
+    switch (cvt.in(state, input.begin(), input.end(), from_next, &out, &out + 1,
+                   to_next)) {
+    case std::codecvt_base::ok:
+      return out != WEOF;
+
+    case std::codecvt_base::error:
+    case std::codecvt_base::noconv:
+      return false;
+
+    case std::codecvt_base::partial:
+      lldb::ConnectionStatus status;
+      size_t read_count = m_input_connection.Read(
+          &ch, 1, std::chrono::seconds(0), status, nullptr);
+      if (read_count == 0)
+        return false;
+      break;
+    }
+  }
+#endif
+}

Modified: vendor/lldb/dist/source/Host/windows/EditLineWin.cpp
==============================================================================
--- vendor/lldb/dist/source/Host/windows/EditLineWin.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Host/windows/EditLineWin.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -13,6 +13,7 @@
 #include "lldb/Host/windows/windows.h"
 
 #include "lldb/Host/windows/editlinewin.h"
+#include "llvm/Support/ErrorHandling.h"
 #include <assert.h>
 #include <vector>
 
@@ -285,11 +286,10 @@ void el_end(EditLine *el) {
   // assert( !"Not implemented!" );
 }
 
-void el_reset(EditLine *) { assert(!"Not implemented!"); }
+void el_reset(EditLine *) { llvm_unreachable("Not implemented!"); }
 
 int el_getc(EditLine *, char *) {
-  assert(!"Not implemented!");
-  return 0;
+  llvm_unreachable("Not implemented!");
 }
 
 void el_push(EditLine *, const char *) {}
@@ -297,8 +297,7 @@ void el_push(EditLine *, const char *) {
 void el_beep(EditLine *) { Beep(1000, 500); }
 
 int el_parse(EditLine *, int, const char **) {
-  assert(!"Not implemented!");
-  return 0;
+  llvm_unreachable("Not implemented!");
 }
 
 int el_get(EditLine *el, int code, ...) {
@@ -311,7 +310,7 @@ int el_get(EditLine *el, int code, ...) 
     *dout = clientData;
   } break;
   default:
-    assert(!"Not implemented!");
+    llvm_unreachable("Not implemented!");
   }
   return 0;
 }
@@ -322,7 +321,7 @@ int el_source(EditLine *el, const char *
   return 0;
 }
 
-void el_resize(EditLine *) { assert(!"Not implemented!"); }
+void el_resize(EditLine *) { llvm_unreachable("Not implemented!"); }
 
 const LineInfo *el_line(EditLine *el) { return 0; }
 
@@ -331,7 +330,7 @@ int el_insertstr(EditLine *, const char 
   return 0;
 }
 
-void el_deletestr(EditLine *, int) { assert(!"Not implemented!"); }
+void el_deletestr(EditLine *, int) { llvm_unreachable("Not implemented!"); }
 
 History *history_init(void) {
   // return dummy handle

Modified: vendor/lldb/dist/source/Interpreter/OptionValueProperties.cpp
==============================================================================
--- vendor/lldb/dist/source/Interpreter/OptionValueProperties.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Interpreter/OptionValueProperties.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -584,8 +584,7 @@ Error OptionValueProperties::DumpPropert
 }
 
 lldb::OptionValueSP OptionValueProperties::DeepCopy() const {
-  assert(!"this shouldn't happen");
-  return lldb::OptionValueSP();
+  llvm_unreachable("this shouldn't happen");
 }
 
 const Property *OptionValueProperties::GetPropertyAtPath(

Modified: vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -64,10 +64,10 @@ private:
 class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {
 public:
   ClangModulesDeclVendorImpl(
-      llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> &diagnostics_engine,
-      llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> &compiler_invocation,
-      std::unique_ptr<clang::CompilerInstance> &&compiler_instance,
-      std::unique_ptr<clang::Parser> &&parser);
+      llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine,
+      std::shared_ptr<clang::CompilerInvocation> compiler_invocation,
+      std::unique_ptr<clang::CompilerInstance> compiler_instance,
+      std::unique_ptr<clang::Parser> parser);
 
   ~ClangModulesDeclVendorImpl() override = default;
 
@@ -96,7 +96,7 @@ private:
   bool m_enabled = false;
 
   llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> m_diagnostics_engine;
-  llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> m_compiler_invocation;
+  std::shared_ptr<clang::CompilerInvocation> m_compiler_invocation;
   std::unique_ptr<clang::CompilerInstance> m_compiler_instance;
   std::unique_ptr<clang::Parser> m_parser;
   size_t m_source_location_index =
@@ -157,14 +157,14 @@ ClangModulesDeclVendor::ClangModulesDecl
 ClangModulesDeclVendor::~ClangModulesDeclVendor() {}
 
 ClangModulesDeclVendorImpl::ClangModulesDeclVendorImpl(
-    llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> &diagnostics_engine,
-    llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> &compiler_invocation,
-    std::unique_ptr<clang::CompilerInstance> &&compiler_instance,
-    std::unique_ptr<clang::Parser> &&parser)
-    : ClangModulesDeclVendor(), m_diagnostics_engine(diagnostics_engine),
-      m_compiler_invocation(compiler_invocation),
+    llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine,
+    std::shared_ptr<clang::CompilerInvocation> compiler_invocation,
+    std::unique_ptr<clang::CompilerInstance> compiler_instance,
+    std::unique_ptr<clang::Parser> parser)
+    : m_diagnostics_engine(std::move(diagnostics_engine)),
+      m_compiler_invocation(std::move(compiler_invocation)),
       m_compiler_instance(std::move(compiler_instance)),
-      m_parser(std::move(parser)), m_imported_modules() {}
+      m_parser(std::move(parser)) {}
 
 void ClangModulesDeclVendorImpl::ReportModuleExportsHelper(
     std::set<ClangModulesDeclVendor::ModuleID> &exports,
@@ -498,7 +498,7 @@ void ClangModulesDeclVendorImpl::ForEach
                       ti->getLocation(), &invalid);
 
               if (invalid) {
-                lldbassert(!"Unhandled token kind");
+                lldbassert(0 && "Unhandled token kind");
                 macro_expansion.append("<unknown literal value>");
               } else {
                 macro_expansion.append(
@@ -621,9 +621,9 @@ ClangModulesDeclVendor::Create(Target &t
     compiler_invocation_argument_cstrs.push_back(arg.c_str());
   }
 
-  llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> invocation(
+  std::shared_ptr<clang::CompilerInvocation> invocation =
       clang::createInvocationFromCommandLine(compiler_invocation_argument_cstrs,
-                                             diagnostics_engine));
+                                             diagnostics_engine);
 
   if (!invocation)
     return nullptr;
@@ -640,7 +640,7 @@ ClangModulesDeclVendor::Create(Target &t
       new clang::CompilerInstance);
 
   instance->setDiagnostics(diagnostics_engine.get());
-  instance->setInvocation(invocation.get());
+  instance->setInvocation(invocation);
 
   std::unique_ptr<clang::FrontendAction> action(new clang::SyntaxOnlyAction);
 
@@ -674,6 +674,7 @@ ClangModulesDeclVendor::Create(Target &t
   while (!parser->ParseTopLevelDecl(parsed))
     ;
 
-  return new ClangModulesDeclVendorImpl(diagnostics_engine, invocation,
+  return new ClangModulesDeclVendorImpl(std::move(diagnostics_engine),
+                                        std::move(invocation),
                                         std::move(instance), std::move(parser));
 }

Modified: vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -196,8 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module
     llvm::AllocaInst *new_func_ptr =
         new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst);
     // store the new_func_cast to the newly allocated space
-    (void)new llvm::StoreInst(new_func_cast, new_func_ptr,
-                              "new_func_ptr_load_cast", call_inst);
+    (new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst))
+        ->setName("new_func_ptr_load_cast");
     // load the new function address ready for a jump
     llvm::LoadInst *new_func_addr_load =
         new llvm::LoadInst(new_func_ptr, "load_func_pointer", call_inst);

Modified: vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -480,8 +480,7 @@ Error ProcessKDP::DoResume() {
 
     default:
       // The only valid thread resume states are listed above
-      assert(!"invalid thread resume state");
-      break;
+      llvm_unreachable("invalid thread resume state");
     }
   }
 

Modified: vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -116,8 +116,7 @@ ThreadKDP::CreateRegisterContextForFrame
             new RegisterContextKDP_x86_64(*this, concrete_frame_idx));
         break;
       default:
-        assert(!"Add CPU type support in KDP");
-        break;
+        llvm_unreachable("Add CPU type support in KDP");
       }
     }
   } else {

Modified: vendor/lldb/dist/source/Plugins/Process/POSIX/CrashReason.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/POSIX/CrashReason.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/POSIX/CrashReason.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -21,6 +21,7 @@ void AppendFaultAddr(std::string &str, l
   str += ss.str();
 }
 
+#if defined(si_lower) && defined(si_upper)
 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);
@@ -37,6 +38,7 @@ void AppendBounds(std::string &str, lldb
   stream << ")";
   stream.flush();
 }
+#endif
 
 CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   assert(info.si_signo == SIGSEGV);

Modified: vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -167,7 +167,7 @@ DynamicRegisterInfo::SetRegisterInfo(con
                       reg_info.byte_offset =
                           containing_reg_info->byte_offset + msbyte;
                     } else {
-                      assert(!"Invalid byte order");
+                      llvm_unreachable("Invalid byte order");
                     }
                   } else {
                     if (msbit > max_bit)

Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -1053,8 +1053,7 @@ bool RegisterContextLLDB::ReadRegisterVa
   case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
     break;
   case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
-    assert("FIXME debugger inferior function call unwind");
-    break;
+    llvm_unreachable("FIXME debugger inferior function call unwind");
   case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
     Error error(ReadRegisterValueFromMemory(
         reg_info, regloc.location.target_memory_location, reg_info->byte_size,
@@ -1062,8 +1061,7 @@ bool RegisterContextLLDB::ReadRegisterVa
     success = error.Success();
   } break;
   default:
-    assert("Unknown RegisterLocation type.");
-    break;
+    llvm_unreachable("Unknown RegisterLocation type.");
   }
   return success;
 }
@@ -1097,8 +1095,7 @@ bool RegisterContextLLDB::WriteRegisterV
   case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
     break;
   case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
-    assert("FIXME debugger inferior function call unwind");
-    break;
+    llvm_unreachable("FIXME debugger inferior function call unwind");
   case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
     Error error(WriteRegisterValueToMemory(
         reg_info, regloc.location.target_memory_location, reg_info->byte_size,
@@ -1106,8 +1103,7 @@ bool RegisterContextLLDB::WriteRegisterV
     success = error.Success();
   } break;
   default:
-    assert("Unknown RegisterLocation type.");
-    break;
+    llvm_unreachable("Unknown RegisterLocation type.");
   }
   return success;
 }

Modified: vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -2599,10 +2599,7 @@ size_t GDBRemoteCommunicationClient::Get
       thread_ids.push_back(1);
     }
   } else {
-#if defined(LLDB_CONFIGURATION_DEBUG)
-// assert(!"ProcessGDBRemote::UpdateThreadList() failed due to not getting the
-// sequence mutex");
-#else
+#if !defined(LLDB_CONFIGURATION_DEBUG)
     Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS |
                                                            GDBR_LOG_PACKETS));
     if (log)
@@ -3246,7 +3243,7 @@ GDBRemoteCommunicationClient::GetModules
     JSONObject::SP module_sp = std::make_shared<JSONObject>();
     module_array_sp->AppendObject(module_sp);
     module_sp->SetObject(
-        "file", std::make_shared<JSONString>(module_file_spec.GetPath()));
+        "file", std::make_shared<JSONString>(module_file_spec.GetPath(false)));
     module_sp->SetObject("triple",
                          std::make_shared<JSONString>(triple.getTriple()));
   }

Modified: vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -1599,12 +1599,7 @@ StructuredData::ArraySP ScriptInterprete
 // as the underlying typedef for uint* types, size_t, off_t and other values
 // change.
 
-template <typename T> const char *GetPythonValueFormatString(T t) {
-  assert(!"Unhandled type passed to GetPythonValueFormatString(T), make a "
-          "specialization of GetPythonValueFormatString() to support this "
-          "type.");
-  return nullptr;
-}
+template <typename T> const char *GetPythonValueFormatString(T t);
 template <> const char *GetPythonValueFormatString(char *) { return "s"; }
 template <> const char *GetPythonValueFormatString(char) { return "b"; }
 template <> const char *GetPythonValueFormatString(unsigned char) {

Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -65,8 +65,7 @@ bool DWARFDebugRanges::Extract(SymbolFil
       break;
 
     default:
-      assert(!"DWARFRangeList::Extract() unsupported address size.");
-      break;
+      llvm_unreachable("DWARFRangeList::Extract() unsupported address size.");
     }
 
     // Filter out empty ranges

Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -734,12 +734,11 @@ int DWARFFormValue::Compare(const DWARFF
   }
 
   case DW_FORM_indirect:
-    assert(!"This shouldn't happen after the form has been extracted...");
-    break;
+    llvm_unreachable(
+        "This shouldn't happen after the form has been extracted...");
 
   default:
-    assert(!"Unhandled DW_FORM");
-    break;
+    llvm_unreachable("Unhandled DW_FORM");
   }
   return -1;
 }

Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -167,8 +167,7 @@ void DWARFMappedHash::Prologue::AppendAt
   case DW_FORM_exprloc:
   case DW_FORM_flag_present:
   case DW_FORM_ref_sig8:
-    assert(!"Unhandled atom form");
-    break;
+    llvm_unreachable("Unhandled atom form");
 
   case DW_FORM_string:
   case DW_FORM_block:

Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -1253,8 +1253,7 @@ SymbolFileDWARFDebugMap::GetCompileUnit(
       }
     }
   }
-  assert(!"this shouldn't happen");
-  return lldb::CompUnitSP();
+  llvm_unreachable("this shouldn't happen");
 }
 
 SymbolFileDWARFDebugMap::CompileUnitInfo *

Modified: vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
==============================================================================
--- vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -442,15 +442,14 @@ size_t UnwindAssemblyInstEmulation::Writ
   case EmulateInstruction::eContextPushRegisterOnStack: {
     uint32_t reg_num = LLDB_INVALID_REGNUM;
     uint32_t generic_regnum = LLDB_INVALID_REGNUM;
-    if (context.info_type ==
-        EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset) {
-      const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
-      reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
-                    .kinds[unwind_reg_kind];
-      generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
-                           .kinds[eRegisterKindGeneric];
-    } else
-      assert(!"unhandled case, add code to handle this!");
+    assert(context.info_type ==
+               EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset &&
+           "unhandled case, add code to handle this!");
+    const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
+    reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
+                  .kinds[unwind_reg_kind];
+    generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
+                         .kinds[eRegisterKindGeneric];
 
     if (reg_num != LLDB_INVALID_REGNUM &&
         generic_regnum != LLDB_REGNUM_GENERIC_SP) {

Modified: vendor/lldb/dist/source/Symbol/ClangASTContext.cpp
==============================================================================
--- vendor/lldb/dist/source/Symbol/ClangASTContext.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Symbol/ClangASTContext.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -390,7 +390,7 @@ static void ParseLangArgs(LangOptions &O
     case IK_AST:
     case IK_LLVM_IR:
     case IK_RenderScript:
-      assert(!"Invalid input kind!");
+      llvm_unreachable("Invalid input kind!");
     case IK_OpenCL:
       LangStd = LangStandard::lang_opencl;
       break;
@@ -2119,7 +2119,7 @@ CompilerType ClangASTContext::CreateStru
   if (!type_name.IsEmpty() &&
       (type = GetTypeForIdentifier<clang::CXXRecordDecl>(type_name))
           .IsValid()) {
-    lldbassert("Trying to create a type for an existing name");
+    lldbassert(0 && "Trying to create a type for an existing name");
     return type;
   }
 
@@ -7568,8 +7568,7 @@ ClangASTContext::GetTemplateArgument(lld
             return CompilerType();
 
           default:
-            assert(!"Unhandled clang::TemplateArgument::ArgKind");
-            break;
+            llvm_unreachable("Unhandled clang::TemplateArgument::ArgKind");
           }
         }
       }

Modified: vendor/lldb/dist/source/Symbol/Type.cpp
==============================================================================
--- vendor/lldb/dist/source/Symbol/Type.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Symbol/Type.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -484,8 +484,7 @@ bool Type::ResolveClangType(ResolveState
         break;
 
       default:
-        assert(!"Unhandled encoding_data_type.");
-        break;
+        llvm_unreachable("Unhandled encoding_data_type.");
       }
     } else {
       // We have no encoding type, return void?
@@ -529,8 +528,7 @@ bool Type::ResolveClangType(ResolveState
         break;
 
       default:
-        assert(!"Unhandled encoding_data_type.");
-        break;
+        llvm_unreachable("Unhandled encoding_data_type.");
       }
     }
 

Modified: vendor/lldb/dist/source/Target/ABI.cpp
==============================================================================
--- vendor/lldb/dist/source/Target/ABI.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Target/ABI.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -189,8 +189,7 @@ bool ABI::PrepareTrivialCall(Thread &thr
                              lldb::addr_t returnAddress, llvm::Type &returntype,
                              llvm::ArrayRef<ABI::CallArgument> args) const {
   // dummy prepare trivial call
-  assert(!"Should never get here!");
-  return false;
+  llvm_unreachable("Should never get here!");
 }
 
 bool ABI::GetFallbackRegisterLocation(

Modified: vendor/lldb/dist/source/Target/Platform.cpp
==============================================================================
--- vendor/lldb/dist/source/Target/Platform.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Target/Platform.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -1876,9 +1876,8 @@ size_t Platform::GetSoftwareBreakpointTr
   } break;
 
   default:
-    assert(
-        !"Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
-    break;
+    llvm_unreachable(
+        "Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
   }
 
   assert(bp_site);

Modified: vendor/lldb/dist/source/Target/StackFrameList.cpp
==============================================================================
--- vendor/lldb/dist/source/Target/StackFrameList.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/source/Target/StackFrameList.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -541,8 +541,7 @@ StackFrameSP StackFrameList::GetFrameAtI
     if (m_frames.empty()) {
       // Why do we have a thread with zero frames, that should not ever
       // happen...
-      if (m_thread.IsValid())
-        assert("A valid thread has no frames.");
+      assert(!m_thread.IsValid() && "A valid thread has no frames.");
     } else {
       ResetCurrentInlinedDepth();
       frame_sp = m_frames[original_idx];

Modified: vendor/lldb/dist/tools/driver/Platform.cpp
==============================================================================
--- vendor/lldb/dist/tools/driver/Platform.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/driver/Platform.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include "Platform.h"
+#include "llvm/Support/ErrorHandling.h"
 
 int ioctl(int d, int request, ...) {
   switch (request) {
@@ -34,9 +35,8 @@ int ioctl(int d, int request, ...) {
     return 0;
   } break;
   default:
-    assert(!"Not implemented!");
+    llvm_unreachable("Not implemented!");
   }
-  return -1;
 }
 
 int kill(pid_t pid, int sig) {
@@ -44,13 +44,11 @@ int kill(pid_t pid, int sig) {
   if (pid == getpid())
     exit(sig);
   //
-  assert(!"Not implemented!");
-  return -1;
+  llvm_unreachable("Not implemented!");
 }
 
 int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
-  assert(!"Not implemented!");
-  return -1;
+  llvm_unreachable("Not implemented!");
 }
 
 int tcgetattr(int fildes, struct termios *termios_p) {

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdEnviro.cpp
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdEnviro.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdEnviro.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -94,6 +94,13 @@ bool CMICmdCmdEnvironmentCd::Execute() {
                                    m_cmdData.strMiCmd.c_str(),
                                    "SetCurrentPlatformSDKRoot()"));
 
+  lldb::SBTarget sbTarget = m_rLLDBDebugSessionInfo.GetTarget();
+  if (sbTarget.IsValid()) {
+    lldb::SBLaunchInfo sbLaunchInfo = sbTarget.GetLaunchInfo();
+    sbLaunchInfo.SetWorkingDirectory(strWkDir.c_str());
+    sbTarget.SetLaunchInfo(sbLaunchInfo);
+  }
+
   return bOk;
 }
 

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.cpp
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -27,6 +27,7 @@ const CMICmdCmdGdbSet::MapGdbOptionNameT
         // Example code if need to implement GDB set other options
         {"output-radix", &CMICmdCmdGdbSet::OptionFnOutputRadix},
         {"solib-search-path", &CMICmdCmdGdbSet::OptionFnSolibSearchPath},
+        {"disassembly-flavor", &CMICmdCmdGdbSet::OptionFnDisassemblyFlavor},
         {"fallback", &CMICmdCmdGdbSet::OptionFnFallback}};
 
 //++
@@ -399,6 +400,39 @@ bool CMICmdCmdGdbSet::OptionFnOutputRadi
 
 //++
 //------------------------------------------------------------------------------------
+// Details: Carry out work to complete the GDB set option 'disassembly-flavor'
+// to prepare
+//          and send back information asked for.
+// Type:    Method.
+// Args:    vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbSet::OptionFnDisassemblyFlavor(
+    const CMIUtilString::VecString_t &vrWords) {
+  // Check we have at least one argument
+  if (vrWords.size() < 1) {
+    m_bGbbOptionFnHasError = true;
+    // m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH);
+    return MIstatus::failure;
+  }
+  const CMIUtilString &rStrValDisasmFlavor(vrWords[0]);
+
+  lldb::SBDebugger &rDbgr = m_rLLDBDebugSessionInfo.GetDebugger();
+  lldb::SBError error = lldb::SBDebugger::SetInternalVariable(
+      "target.x86-disassembly-flavor", rStrValDisasmFlavor.c_str(),
+      rDbgr.GetInstanceName());
+  if (error.Fail()) {
+    m_strGdbOptionFnError = error.GetCString();
+    return MIstatus::failure;
+  }
+
+  return MIstatus::success;
+}
+
+//++
+//------------------------------------------------------------------------------------
 // Details: Carry out work to complete the GDB set option to prepare and send
 // back the
 //          requested information.

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.h
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.h	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbSet.h	Fri Jan  6 20:14:12 2017	(r311542)
@@ -79,6 +79,7 @@ private:
   bool OptionFnPrint(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnSolibSearchPath(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnOutputRadix(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.cpp
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -13,6 +13,7 @@
 #include "lldb/API/SBCompileUnit.h"
 #include "lldb/API/SBFrame.h"
 #include "lldb/API/SBLanguageRuntime.h"
+#include "lldb/API/SBStringList.h"
 #include "lldb/API/SBThread.h"
 
 // In-house headers:
@@ -30,6 +31,7 @@ const CMICmdCmdGdbShow::MapGdbOptionName
         {"target-async", &CMICmdCmdGdbShow::OptionFnTargetAsync},
         {"print", &CMICmdCmdGdbShow::OptionFnPrint},
         {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
+        {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
         {"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
 
 //++
@@ -327,6 +329,26 @@ bool CMICmdCmdGdbShow::OptionFnLanguage(
 
 //++
 //------------------------------------------------------------------------------------
+// Details: Carry out work to complete the GDB show option 'disassembly-flavor' to prepare
+//          and send back the requested information.
+// Type:    Method.
+// Args:    vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//          MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords) {
+  MIunused(vrWords);
+
+  // Get current disassembly flavor
+  lldb::SBDebugger &rDbgr = m_rLLDBDebugSessionInfo.GetDebugger();
+  m_strValue = lldb::SBDebugger::GetInternalVariableValue("target.x86-disassembly-flavor",
+                                                          rDbgr.GetInstanceName()).GetStringAtIndex(0);
+  return MIstatus::success;
+}
+
+//++
+//------------------------------------------------------------------------------------
 // Details: Carry out work to complete the GDB show option to prepare and send
 // back the
 //          requested information.

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.h
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.h	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdGdbShow.h	Fri Jan  6 20:14:12 2017	(r311542)
@@ -78,6 +78,7 @@ private:
   bool OptionFnTargetAsync(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnPrint(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdMiscellanous.cpp
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdMiscellanous.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdMiscellanous.cpp	Fri Jan  6 20:14:12 2017	(r311542)
@@ -496,14 +496,22 @@ bool CMICmdCmdInterpreterExec::Execute()
 //--
 bool CMICmdCmdInterpreterExec::Acknowledge() {
   if (m_lldbResult.GetOutputSize() > 0) {
-    CMIUtilString strMsg(m_lldbResult.GetOutput());
-    strMsg = strMsg.StripCREndOfLine();
-    CMICmnStreamStdout::TextToStdout(strMsg);
+    const CMIUtilString line(m_lldbResult.GetOutput());
+    const bool bEscapeQuotes(true);
+    CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput, miValueConst);
+    const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
+    if (!bOk)
+      return MIstatus::failure;
   }
   if (m_lldbResult.GetErrorSize() > 0) {
-    CMIUtilString strMsg(m_lldbResult.GetError());
-    strMsg = strMsg.StripCREndOfLine();
-    CMICmnStreamStderr::LLDBMsgToConsole(strMsg);
+    const CMIUtilString line(m_lldbResult.GetError());
+    const bool bEscapeQuotes(true);
+    CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput, miValueConst);
+    const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
+    if (!bOk)
+      return MIstatus::failure;
   }
 
   const CMICmnMIResultRecord miRecordResult(

Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdTarget.cpp
==============================================================================
--- vendor/lldb/dist/tools/lldb-mi/MICmdCmdTarget.cpp	Fri Jan  6 20:14:09 2017	(r311541)
+++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdTarget.cpp	Fri Jan  6 20:14:12 2017	(r311542)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701062014.v06KECJi068856>