diff options
Diffstat (limited to 'source/Plugins/LanguageRuntime')
18 files changed, 143 insertions, 91 deletions
diff --git a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt index d25215d0a613..14d1f46caebb 100644 --- a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt +++ b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt @@ -1,3 +1,10 @@ -add_lldb_library(lldbPluginCXXItaniumABI +add_lldb_library(lldbPluginCXXItaniumABI PLUGIN ItaniumABILanguageRuntime.cpp + + LINK_LIBS + lldbBreakpoint + lldbCore + lldbInterpreter + lldbSymbol + lldbTarget ) diff --git a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index ddfbd864e92c..e308747378d3 100644 --- a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -11,9 +11,6 @@ #include "ItaniumABILanguageRuntime.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Mangled.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +30,9 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" #include <vector> diff --git a/source/Plugins/LanguageRuntime/Go/CMakeLists.txt b/source/Plugins/LanguageRuntime/Go/CMakeLists.txt index 7c9166a94cbe..16756d5c985a 100644 --- a/source/Plugins/LanguageRuntime/Go/CMakeLists.txt +++ b/source/Plugins/LanguageRuntime/Go/CMakeLists.txt @@ -1,5 +1,13 @@ set(LLVM_NO_RTTI 1) -add_lldb_library(lldbPluginLanguageRuntimeGo +add_lldb_library(lldbPluginLanguageRuntimeGo PLUGIN GoLanguageRuntime.cpp + + LINK_LIBS + lldbBreakpoint + lldbCore + lldbSymbol + lldbTarget + LINK_COMPONENTS + Support ) diff --git a/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp b/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp index 1450835298e6..c52fc1e121d8 100644 --- a/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp +++ b/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp @@ -11,9 +11,6 @@ #include "GoLanguageRuntime.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" @@ -29,6 +26,9 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" #include "llvm/ADT/Twine.h" #include <vector> diff --git a/source/Plugins/LanguageRuntime/Java/CMakeLists.txt b/source/Plugins/LanguageRuntime/Java/CMakeLists.txt index 4cfd71c2e242..ec87718752e7 100644 --- a/source/Plugins/LanguageRuntime/Java/CMakeLists.txt +++ b/source/Plugins/LanguageRuntime/Java/CMakeLists.txt @@ -1,3 +1,10 @@ -add_lldb_library(lldbPluginLanguageRuntimeJava +add_lldb_library(lldbPluginLanguageRuntimeJava PLUGIN JavaLanguageRuntime.cpp + + LINK_LIBS + lldbCore + lldbSymbol + lldbTarget + LINK_COMPONENTS + Support ) diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp index 131f31f69a9f..6b5e6b1eb764 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp @@ -10,8 +10,8 @@ #include "AppleObjCClassDescriptorV2.h" -#include "lldb/Core/Log.h" #include "lldb/Expression/FunctionCaller.h" +#include "lldb/Utility/Log.h" using namespace lldb; using namespace lldb_private; @@ -501,10 +501,8 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, if (m_filled) return; std::lock_guard<std::recursive_mutex> guard(m_mutex); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES | LIBLLDB_LOG_VERBOSE)); - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] class_name = %s", - descriptor.GetClassName().AsCString("<unknown")); + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES)); + LLDB_LOGV(log, "class_name = {0}", descriptor.GetClassName()); m_filled = true; ObjCLanguageRuntime::EncodingToTypeSP encoding_to_type_sp( runtime.GetEncodingToType()); @@ -519,19 +517,15 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, uint64_t size) -> bool { const bool for_expression = false; const bool stop_loop = false; - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, encoding " - "= %s, offset_ptr = %" PRIx64 ", size = %" PRIu64, - name, type, offset_ptr, size); + LLDB_LOGV(log, "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = {3}", + name, type, offset_ptr, size); CompilerType ivar_type = encoding_to_type_sp->RealizeType(type, for_expression); if (ivar_type) { - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, " - "encoding = %s, offset_ptr = %" PRIx64 ", size = %" PRIu64 - " , type_size = %" PRIu64, - name, type, offset_ptr, size, - ivar_type.GetByteSize(nullptr)); + LLDB_LOGV(log, + "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = " + "{3}, type_size = {4}", + name, type, offset_ptr, size, ivar_type.GetByteSize(nullptr)); Scalar offset_scalar; Error error; const int offset_ptr_size = 4; @@ -539,18 +533,13 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, size_t read = process->ReadScalarIntegerFromMemory( offset_ptr, offset_ptr_size, is_signed, offset_scalar, error); if (error.Success() && 4 == read) { - if (log) - log->Printf( - "[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 - " --> %" PRIu32, - offset_ptr, offset_scalar.SInt()); + LLDB_LOGV(log, "offset_ptr = {0:x} --> {1}", offset_ptr, + offset_scalar.SInt()); m_ivars.push_back( {ConstString(name), ivar_type, size, offset_scalar.SInt()}); - } else if (log) - log->Printf( - "[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 - " --> read fail, read = %zu", - offset_ptr, read); + } else + LLDB_LOGV(log, "offset_ptr = {0:x} --> read fail, read = %{1}", + offset_ptr, read); } return stop_loop; }); diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp index 922d192c333c..07b4ae5e0add 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp @@ -10,13 +10,13 @@ #include "AppleObjCDeclVendor.h" #include "Plugins/ExpressionParser/Clang/ASTDumper.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/ClangExternalASTSourceCommon.h" #include "lldb/Symbol/ClangUtil.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Log.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 4a90f5c16633..6b27009a0727 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -14,15 +14,11 @@ #include "clang/AST/Type.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -34,6 +30,10 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/StreamString.h" #include <vector> diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 13bd245a33b4..2c92b922b9df 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -15,13 +15,9 @@ #include "clang/AST/Type.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Expression/FunctionCaller.h" #include "lldb/Expression/UtilityFunction.h" #include "lldb/Symbol/ClangASTContext.h" @@ -31,6 +27,10 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/StreamString.h" #include <vector> @@ -127,7 +127,7 @@ struct BufStruct { UtilityFunction *AppleObjCRuntimeV1::CreateObjectChecker(const char *name) { std::unique_ptr<BufStruct> buf(new BufStruct); - assert(snprintf(&buf->contents[0], sizeof(buf->contents), + int strformatsize = snprintf(&buf->contents[0], sizeof(buf->contents), "struct __objc_class " " \n" "{ " @@ -169,7 +169,8 @@ UtilityFunction *AppleObjCRuntimeV1::CreateObjectChecker(const char *name) { " \n" "} " " \n", - name) < (int)sizeof(buf->contents)); + name); + assert(strformatsize < (int)sizeof(buf->contents)); Error error; return GetTargetRef().GetUtilityFunctionForLanguage( diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index e9958a5ef759..42c5fe9248f6 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -20,26 +20,21 @@ // Project includes #include "lldb/Core/ClangForward.h" +#include "lldb/Host/OptionParser.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/lldb-enumerations.h" #include "lldb/Core/ClangForward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" #include "lldb/Expression/UtilityFunction.h" -#include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -55,6 +50,11 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "AppleObjCClassDescriptorV2.h" #include "AppleObjCDeclVendor.h" @@ -600,14 +600,12 @@ protected: } iterator->second->Describe( nullptr, - [objc_runtime, &std_out](const char *name, - const char *type) -> bool { + [&std_out](const char *name, const char *type) -> bool { std_out.Printf(" instance method name = %s type = %s\n", name, type); return false; }, - [objc_runtime, &std_out](const char *name, - const char *type) -> bool { + [&std_out](const char *name, const char *type) -> bool { std_out.Printf(" class method name = %s type = %s\n", name, type); return false; @@ -895,6 +893,7 @@ UtilityFunction *AppleObjCRuntimeV2::CreateObjectChecker(const char *name) { } assert(len < (int)sizeof(check_function_code)); + UNUSED_IF_ASSERT_DISABLED(len); Error error; return GetTargetRef().GetUtilityFunctionForLanguage( @@ -1396,8 +1395,13 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic( arguments.GetValueAtIndex(0)->GetScalar() = hash_table.GetTableLoadAddress(); arguments.GetValueAtIndex(1)->GetScalar() = class_infos_addr; arguments.GetValueAtIndex(2)->GetScalar() = class_infos_byte_size; - arguments.GetValueAtIndex(3)->GetScalar() = - (GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES) == nullptr ? 0 : 1); + + // Only dump the runtime classes from the expression evaluation if the + // log is verbose: + Log *type_log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES); + bool dump_log = type_log && type_log->GetVerbose(); + + arguments.GetValueAtIndex(3)->GetScalar() = dump_log ? 1 : 0; bool success = false; @@ -1640,8 +1644,12 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { arguments.GetValueAtIndex(0)->GetScalar() = objc_opt_ptr; arguments.GetValueAtIndex(1)->GetScalar() = class_infos_addr; arguments.GetValueAtIndex(2)->GetScalar() = class_infos_byte_size; - arguments.GetValueAtIndex(3)->GetScalar() = - (GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES) == nullptr ? 0 : 1); + // Only dump the runtime classes from the expression evaluation if the + // log is verbose: + Log *type_log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES); + bool dump_log = type_log && type_log->GetVerbose(); + + arguments.GetValueAtIndex(3)->GetScalar() = dump_log ? 1 : 0; bool success = false; diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 1dc20c11567e..8ce65b07684f 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -17,9 +17,7 @@ #include "AppleThreadPlanStepThroughObjCTrampoline.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Value.h" @@ -27,7 +25,6 @@ #include "lldb/Expression/FunctionCaller.h" #include "lldb/Expression/UserExpression.h" #include "lldb/Expression/UtilityFunction.h" -#include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/ABI.h" @@ -38,6 +35,9 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/Log.h" #include "llvm/ADT/STLExtras.h" diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp index e49269532329..a295d1b4ce76 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -14,7 +14,6 @@ // Project includes #include "AppleThreadPlanStepThroughObjCTrampoline.h" #include "AppleObjCTrampolineHandler.h" -#include "lldb/Core/Log.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" #include "lldb/Expression/UtilityFunction.h" @@ -24,6 +23,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" #include "lldb/Target/ThreadPlanStepOut.h" +#include "lldb/Utility/Log.h" using namespace lldb; using namespace lldb_private; diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt index 13fde3d181fa..18f3ae1c5b1e 100644 --- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt +++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt @@ -1,4 +1,4 @@ -add_lldb_library(lldbPluginAppleObjCRuntime +add_lldb_library(lldbPluginAppleObjCRuntime PLUGIN AppleObjCRuntime.cpp AppleObjCRuntimeV1.cpp AppleObjCRuntimeV2.cpp @@ -7,4 +7,18 @@ add_lldb_library(lldbPluginAppleObjCRuntime AppleThreadPlanStepThroughObjCTrampoline.cpp AppleObjCClassDescriptorV2.cpp AppleObjCTypeEncodingParser.cpp + + LINK_LIBS + clangAST + lldbBreakpoint + lldbCore + lldbExpression + lldbHost + lldbInterpreter + lldbSymbol + lldbTarget + lldbUtility + lldbPluginExpressionParserClang + LINK_COMPONENTS + Support ) diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt index cd08f14137dc..1a6c49946134 100644 --- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt +++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT LLDB_BUILT_STANDALONE) endif() -add_lldb_library(lldbPluginRenderScriptRuntime +add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN RenderScriptRuntime.cpp RenderScriptExpressionOpts.cpp RenderScriptx86ABIFixups.cpp @@ -11,4 +11,20 @@ add_lldb_library(lldbPluginRenderScriptRuntime DEPENDS ${tablegen_deps} + + LINK_LIBS + clangBasic + lldbBreakpoint + lldbCore + lldbDataFormatters + lldbExpression + lldbHost + lldbInterpreter + lldbSymbol + lldbTarget + LINK_COMPONENTS + Core + IRReader + Support + Target ) diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp index b05618634868..654ac9abfcab 100644 --- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp +++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp @@ -25,9 +25,9 @@ #include "clang/Basic/TargetOptions.h" // Project includes -#include "lldb/Core/Log.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Log.h" #include "RenderScriptExpressionOpts.h" #include "RenderScriptRuntime.h" diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index ae907ac8dfbb..638112b9ebde 100644 --- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -17,15 +17,14 @@ #include "RenderScriptScriptGroup.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" +#include "lldb/Core/DumpDataExtractor.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" +#include "lldb/Core/RegisterValue.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/DataFormatters/DumpValueObjectOptions.h" #include "lldb/Expression/UserExpression.h" +#include "lldb/Host/OptionParser.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -41,6 +40,11 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/DataBufferLLVM.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; @@ -2535,7 +2539,7 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id, } // Read file into data buffer - DataBufferSP data_sp(file.ReadFileContents()); + auto data_sp = DataBufferLLVM::CreateFromPath(file.GetPath()); // Cast start of buffer to FileHeader and use pointer to read metadata void *file_buf = data_sp->GetBytes(); @@ -3073,7 +3077,7 @@ bool RSModuleDescriptor::ParseRSInfo() { const addr_t size = info_sym->GetByteSize(); const FileSpec fs = m_module->GetFileSpec(); - const DataBufferSP buffer = fs.ReadFileContents(addr, size); + auto buffer = DataBufferLLVM::CreateSliceFromPath(fs.GetPath(), size, addr); if (!buffer) return false; @@ -3128,9 +3132,8 @@ bool RSModuleDescriptor::ParseRSInfo() { // in numeric fields at the moment uint64_t n_lines; if (val.getAsInteger(10, n_lines)) { - if (log) - log->Debug("Failed to parse non-numeric '.rs.info' section %s", - line->str().c_str()); + LLDB_LOGV(log, "Failed to parse non-numeric '.rs.info' section {0}", + line->str()); continue; } if (info_lines.end() - (line + 1) < (ptrdiff_t)n_lines) @@ -3410,8 +3413,9 @@ bool RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame *frame_ptr, // Print the results to our stream. expr_result->Dump(strm, expr_options); } else { - alloc_data.Dump(&strm, offset, format, data_size - padding, 1, 1, - LLDB_INVALID_ADDRESS, 0, 0); + DumpDataExtractor(alloc_data, &strm, offset, format, + data_size - padding, 1, 1, LLDB_INVALID_ADDRESS, 0, + 0); } offset += data_size; } diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp index a8202dd08814..9ca8fb4444c0 100644 --- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp +++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp @@ -8,12 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObjectMultiword.h" @@ -24,6 +20,9 @@ #include "lldb/Symbol/VariableList.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Log.h" #include "RenderScriptRuntime.h" #include "RenderScriptScriptGroup.h" diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp index aaca04582676..3ceda5ff67e9 100644 --- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp +++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp @@ -24,8 +24,8 @@ #include "llvm/Pass.h" // Project includes -#include "lldb/Core/Log.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Log.h" using namespace lldb_private; namespace { @@ -182,8 +182,10 @@ bool fixupX86StructRetCalls(llvm::Module &module) { // we pass a pointer to this allocation as the StructRet param, and then // copy its // value into the lldb return value + const llvm::DataLayout &DL = module.getDataLayout(); llvm::AllocaInst *return_value_alloc = new llvm::AllocaInst( - func->getReturnType(), "var_vector_return_alloc", call_inst); + func->getReturnType(), DL.getAllocaAddrSpace(), "var_vector_return_alloc", + call_inst); // use the new allocation as the new first argument new_call_args.emplace(new_call_args.begin(), llvm::cast<llvm::Value>(return_value_alloc)); @@ -194,7 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module &module) { llvm::Instruction::BitCast, func, new_func_ptr_type); // create an allocation for a new function pointer llvm::AllocaInst *new_func_ptr = - new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst); + new llvm::AllocaInst(new_func_ptr_type, DL.getAllocaAddrSpace(), + "new_func_ptr", call_inst); // store the new_func_cast to the newly allocated space (new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst)) ->setName("new_func_ptr_load_cast"); @@ -248,7 +251,7 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) { rs_functions.insert(call_inst->getCalledFunction()); // get the function attributes - llvm::AttributeSet call_attribs = call_inst->getAttributes(); + llvm::AttributeList call_attribs = call_inst->getAttributes(); // iterate over the argument attributes for (size_t i = 1; i <= call_attribs.getNumSlots(); ++i) { @@ -261,16 +264,12 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) { } } - llvm::AttributeSet attr_byval = - llvm::AttributeSet::get(module.getContext(), 1u, llvm::Attribute::ByVal); - // for all called function decls for (auto func : rs_functions) { // inspect all of the arguments in the call - llvm::SymbolTableList<llvm::Argument> &arg_list = func->getArgumentList(); - for (auto &arg : arg_list) { + for (auto &arg : func->args()) { if (arg.hasByValAttr()) { - arg.removeAttr(attr_byval); + arg.removeAttr(llvm::Attribute::ByVal); changed = true; } } |
