Re: [Lldb-commits] [lldb] r291198 - Make lldb -Werror clean for -Wstring-conversion

2017-01-05 Thread David Blaikie via lldb-commits
Ah, thanks - r291204 should hopefully do it, otherwise I might need some
help. I'm assuming I'm not actually building this code - think I just ended
up touching it after doing a bunch of manual cleanup then resorting to sed
- so possibly ended up touching code that isn't building in my
configuration.

On Thu, Jan 5, 2017 at 5:02 PM Tim Hammerquist  wrote:

> Green Dragon build <
> http://lab.llvm.org:8080/green/job/lldb_build_test/23854/> failed with
> this commit with the error:
>
> CompileC
> build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.o
> source/DNBDataRef.cpp normal x86_64 c++
> com.apple.compilers.llvm.clang.1_0.compiler cd
> "/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver"
> export LANG=en_US.US-ASCII
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
> -x c++ -arch x86_64 -fmessage-length=0
> -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11
> -stdlib=libc++ -Wno-trigraphs -fpascal-strings -Os -fno-common
> -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code
> -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors
> -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function
> -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value
> -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow
> -Wno-four-char-constants -Wno-conversion -Wconstant-conversion
> -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32
> -Wno-newline-eof -Wno-c++11-extensions -DLLDB_DEBUGSERVER_RELEASE -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
> -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof
> -mmacosx-version-min=10.9 -g -fvisibility=hidden
> -fvisibility-inlines-hidden -Wno-sign-conversion -Wno-infinite-recursion
> -Wno-move 
> -I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/debugserver.hmap
> -Isource -I../../source 
> -I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources
> -I../../include 
> -I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/Release/include
> -I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources/x86_64
> -I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources
> -F/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/Release
> -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
> -Wparentheses -DDT_VARIANT_ -DHAVE_LIBZ=1 -DLLDB_USE_OS_LOG=0 -MMD -MT
> dependencies -MF 
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.d
> --serialize-diagnostics 
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.dia
> -c 
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp
> -o 
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.o
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp:123:5:
> error: use of undeclared identifier 'llvm_unreachable' 
> llvm_unreachable("GetMax32
> unhandled case!"); ^ 
> /Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp:144:5:
> error: use of undeclared identifier 'llvm_unreachable'
> llvm_unreachable("GetMax64 unhandled case!"); ^ 2 errors generated.
>
> On Thu, Jan 5, 2017 at 4:38 PM, David Blaikie via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
> Author: dblaikie
> Date: Thu Jan  5 18:38:06 2017
> New Revision: 291198
>
> URL: http://llvm.org/viewvc/llvm-project?rev=291198&view=rev
> Log:
> Make lldb -Werror clean for -Wstring-conversion
>
> Also found/fixed one bug identified by this warning in
> RenderScriptx86ABIFixups.cpp where a string literal was being used in an
> effort to provide a name for an instruction/register, but was instead
> being passed as the bool 'isVolatile' parameter.
>
> Modified:
> lldb/trunk/include/lldb/Core/MappedHash.h
> lldb/trunk/source/Core/DataEncoder.cpp
> lldb/trunk/source/Core/ValueObjectMemory.cpp
> lldb/trunk/source/Expression/IRInterpreter.cpp
> lldb/trunk/source/Host/windows/EditLineWin.cpp
> lldb/trunk/source/Interpreter/OptionValueProperties.cpp
>
> lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
> lldb

Re: [Lldb-commits] [lldb] r291198 - Make lldb -Werror clean for -Wstring-conversion

2017-01-05 Thread Tim Hammerquist via lldb-commits
Green Dragon build <
http://lab.llvm.org:8080/green/job/lldb_build_test/23854/> failed with this
commit with the error:

CompileC
build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.o
source/DNBDataRef.cpp normal x86_64 c++
com.apple.compilers.llvm.clang.1_0.compiler cd
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver"
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-x c++ -arch x86_64 -fmessage-length=0
-fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11
-stdlib=libc++ -Wno-trigraphs -fpascal-strings -Os -fno-common
-Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code
-Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors
-Wno-missing-braces -Wparentheses -Wswitch -Wunused-function
-Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value
-Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow
-Wno-four-char-constants -Wno-conversion -Wconstant-conversion
-Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32
-Wno-newline-eof -Wno-c++11-extensions -DLLDB_DEBUGSERVER_RELEASE -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof
-mmacosx-version-min=10.9 -g -fvisibility=hidden
-fvisibility-inlines-hidden -Wno-sign-conversion -Wno-infinite-recursion
-Wno-move 
-I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/debugserver.hmap
-Isource -I../../source
-I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources
-I../../include
-I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/Release/include
-I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources/x86_64
-I/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/DerivedSources
-F/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/Release
-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
-Wparentheses -DDT_VARIANT_ -DHAVE_LIBZ=1 -DLLDB_USE_OS_LOG=0 -MMD -MT
dependencies -MF
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.d
--serialize-diagnostics
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.dia
-c 
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp
-o 
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/build/debugserver.build/Release/debugserver.build/Objects-normal/x86_64/DNBDataRef.o
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp:123:5:
error: use of undeclared identifier 'llvm_unreachable'
llvm_unreachable("GetMax32
unhandled case!"); ^
/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/tools/debugserver/source/DNBDataRef.cpp:144:5:
error: use of undeclared identifier 'llvm_unreachable'
llvm_unreachable("GetMax64 unhandled case!"); ^ 2 errors generated.

On Thu, Jan 5, 2017 at 4:38 PM, David Blaikie via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: dblaikie
> Date: Thu Jan  5 18:38:06 2017
> New Revision: 291198
>
> URL: http://llvm.org/viewvc/llvm-project?rev=291198&view=rev
> Log:
> Make lldb -Werror clean for -Wstring-conversion
>
> Also found/fixed one bug identified by this warning in
> RenderScriptx86ABIFixups.cpp where a string literal was being used in an
> effort to provide a name for an instruction/register, but was instead
> being passed as the bool 'isVolatile' parameter.
>
> Modified:
> lldb/trunk/include/lldb/Core/MappedHash.h
> lldb/trunk/source/Core/DataEncoder.cpp
> lldb/trunk/source/Core/ValueObjectMemory.cpp
> lldb/trunk/source/Expression/IRInterpreter.cpp
> lldb/trunk/source/Host/windows/EditLineWin.cpp
> lldb/trunk/source/Interpreter/OptionValueProperties.cpp
> lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/
> RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
> lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
> lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
> lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
> lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
> lldb/trunk/source/Plugins/Process/gdb-remote/
> GDBRemoteCommunicationClient.cpp
> lldb/trunk/source/Plugins/ScriptInterpreter/Python/
> ScriptInterpreterPython.cpp
> lldb/trunk/source

[Lldb-commits] [lldb] r291198 - Make lldb -Werror clean for -Wstring-conversion

2017-01-05 Thread David Blaikie via lldb-commits
Author: dblaikie
Date: Thu Jan  5 18:38:06 2017
New Revision: 291198

URL: http://llvm.org/viewvc/llvm-project?rev=291198&view=rev
Log:
Make lldb -Werror clean for -Wstring-conversion

Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.

Modified:
lldb/trunk/include/lldb/Core/MappedHash.h
lldb/trunk/source/Core/DataEncoder.cpp
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Expression/IRInterpreter.cpp
lldb/trunk/source/Host/windows/EditLineWin.cpp
lldb/trunk/source/Interpreter/OptionValueProperties.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Target/ABI.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/StackFrameList.cpp
lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
lldb/trunk/tools/driver/Platform.cpp
lldb/trunk/tools/lldb-perf/lib/Results.cpp

Modified: lldb/trunk/include/lldb/Core/MappedHash.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=291198&r1=291197&r2=291198&view=diff
==
--- lldb/trunk/include/lldb/Core/MappedHash.h (original)
+++ lldb/trunk/include/lldb/Core/MappedHash.h Thu Jan  5 18:38:06 2017
@@ -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: lldb/trunk/source/Core/DataEncoder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataEncoder.cpp?rev=291198&r1=291197&r2=291198&view=diff
==
--- lldb/trunk/source/Core/DataEncoder.cpp (original)
+++ lldb/trunk/source/Core/DataEncoder.cpp Thu Jan  5 18:38:06 2017
@@ -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: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=291198&r1=291197&r2=291198&view=diff
==
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Thu Jan  5 18:38:06 2017
@@ -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: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=291198&r1=291197&r2=291198&view=diff
==
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Thu Jan  5 18:38:06 2017
@@ -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]);
+  bool Success = execution_unit.GetAllocSize(addr, dataSize);
+  (void)Success;
+  assert(Success &&
+ "unable to locate host data for transfer to device");
+  // Crea