aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp4
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h1
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp141
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp5
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp48
5 files changed, 107 insertions, 92 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
index c990c733d24c..7078c059adc7 100644
--- a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -22,6 +22,7 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "RenderScriptExpressionOpts.h"
@@ -77,8 +78,7 @@ static bool registerRSDefaultTargetOpts(clang::TargetOptions &proto,
bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
bool changed_module = false;
- Log *log(
- GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_EXPRESSIONS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Expressions);
std::string err;
llvm::StringRef real_triple =
diff --git a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
index e0b4f388dcc5..61af4dc1d764 100644
--- a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
+++ b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
@@ -11,6 +11,7 @@
#include "llvm/IR/Module.h"
#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
diff --git a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index d6de65809c18..bc8e43764af6 100644
--- a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -32,6 +32,7 @@
#include "lldb/Target/Thread.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/RegularExpression.h"
@@ -120,7 +121,7 @@ struct GetArgsCtx {
};
bool GetArgsX86(const GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
Status err;
@@ -148,7 +149,7 @@ bool GetArgsX86(const GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
}
bool GetArgsX86_64(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
// number of arguments passed in registers
static const uint32_t args_in_reg = 6;
@@ -224,7 +225,7 @@ bool GetArgsArm(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
// number of arguments passed in registers
static const uint32_t args_in_reg = 4;
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
Status err;
@@ -268,7 +269,7 @@ bool GetArgsAarch64(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
// number of arguments passed in registers
static const uint32_t args_in_reg = 8;
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
for (size_t i = 0; i < num_args; ++i) {
bool success = false;
@@ -301,7 +302,7 @@ bool GetArgsMipsel(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
// register file offset to first argument
static const uint32_t reg_offset = 4;
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
Status err;
@@ -346,7 +347,7 @@ bool GetArgsMips64el(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
// register file offset to first argument
static const uint32_t reg_offset = 4;
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
Status err;
@@ -388,7 +389,7 @@ bool GetArgsMips64el(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
}
bool GetArgs(ExecutionContext &exe_ctx, ArgItem *arg_list, size_t num_args) {
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
// verify that we have a target
if (!exe_ctx.GetTargetPtr()) {
@@ -465,7 +466,7 @@ bool ParseCoordinate(llvm::StringRef coord_s, RSCoordinate &coord) {
}
bool SkipPrologue(lldb::ModuleSP &module, Address &addr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
SymbolContext sc;
uint32_t resolved_flags =
module->ResolveSymbolContextForAddress(addr, eSymbolContextFunction, sc);
@@ -833,7 +834,7 @@ RSReduceBreakpointResolver::SearchCallback(lldb_private::SearchFilter &filter,
// identifiable by parsing the .rs.info packet, or finding the expand symbol.
// We therefore need access to the list of parsed rs modules to properly
// resolve reduction names.
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Breakpoints);
ModuleSP module = context.module_sp;
if (!module || !IsRenderScriptScriptModule(module))
@@ -893,7 +894,7 @@ Searcher::CallbackReturn RSScriptGroupBreakpointResolver::SearchCallback(
if (!breakpoint_sp)
return eCallbackReturnContinue;
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Breakpoints);
ModuleSP &module = context.module_sp;
if (!module || !IsRenderScriptScriptModule(module))
@@ -1105,7 +1106,7 @@ bool RenderScriptRuntime::HookCallback(void *baton,
void RenderScriptRuntime::HookCallback(RuntimeHook *hook,
ExecutionContext &exe_ctx) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
LLDB_LOGF(log, "%s - '%s'", __FUNCTION__, hook->defn->name);
@@ -1116,7 +1117,7 @@ void RenderScriptRuntime::HookCallback(RuntimeHook *hook,
void RenderScriptRuntime::CaptureDebugHintScriptGroup2(
RuntimeHook *hook_info, ExecutionContext &context) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
enum {
eGroupName = 0,
@@ -1254,7 +1255,7 @@ void RenderScriptRuntime::CaptureDebugHintScriptGroup2(
void RenderScriptRuntime::CaptureScriptInvokeForEachMulti(
RuntimeHook *hook, ExecutionContext &exe_ctx) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
enum {
eRsContext = 0,
@@ -1354,7 +1355,7 @@ void RenderScriptRuntime::CaptureScriptInvokeForEachMulti(
void RenderScriptRuntime::CaptureSetGlobalVar(RuntimeHook *hook,
ExecutionContext &context) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
enum {
eRsContext,
@@ -1401,7 +1402,7 @@ void RenderScriptRuntime::CaptureSetGlobalVar(RuntimeHook *hook,
void RenderScriptRuntime::CaptureAllocationInit(RuntimeHook *hook,
ExecutionContext &exe_ctx) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
enum { eRsContext, eRsAlloc, eRsForceZero };
@@ -1429,7 +1430,7 @@ void RenderScriptRuntime::CaptureAllocationInit(RuntimeHook *hook,
void RenderScriptRuntime::CaptureAllocationDestroy(RuntimeHook *hook,
ExecutionContext &exe_ctx) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
enum {
eRsContext,
@@ -1466,7 +1467,7 @@ void RenderScriptRuntime::CaptureAllocationDestroy(RuntimeHook *hook,
void RenderScriptRuntime::CaptureScriptInit(RuntimeHook *hook,
ExecutionContext &exe_ctx) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
Status err;
Process *process = exe_ctx.GetProcessPtr();
@@ -1527,7 +1528,7 @@ void RenderScriptRuntime::CaptureScriptInit(RuntimeHook *hook,
void RenderScriptRuntime::LoadRuntimeHooks(lldb::ModuleSP module,
ModuleKind kind) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!module) {
return;
@@ -1619,7 +1620,7 @@ void RenderScriptRuntime::FixupScriptDetails(RSModuleDescriptorSP rsmodule_sp) {
if (!rsmodule_sp)
return;
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
const ModuleSP module = rsmodule_sp->m_module;
const FileSpec &file = module->GetPlatformFileSpec();
@@ -1675,7 +1676,7 @@ void RenderScriptRuntime::FixupScriptDetails(RSModuleDescriptorSP rsmodule_sp) {
bool RenderScriptRuntime::EvalRSExpression(const char *expr,
StackFrame *frame_ptr,
uint64_t *result) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
LLDB_LOGF(log, "%s(%s)", __FUNCTION__, expr);
ValueObjectSP expr_result;
@@ -1822,7 +1823,7 @@ const char *JITTemplate(ExpressionStrings e) {
bool RenderScriptRuntime::JITDataPointer(AllocationDetails *alloc,
StackFrame *frame_ptr, uint32_t x,
uint32_t y, uint32_t z) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!alloc->address.isValid()) {
LLDB_LOGF(log, "%s - failed to find allocation details.", __FUNCTION__);
@@ -1857,7 +1858,7 @@ bool RenderScriptRuntime::JITDataPointer(AllocationDetails *alloc,
// success, false otherwise
bool RenderScriptRuntime::JITTypePointer(AllocationDetails *alloc,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!alloc->address.isValid() || !alloc->context.isValid()) {
LLDB_LOGF(log, "%s - failed to find allocation details.", __FUNCTION__);
@@ -1892,7 +1893,7 @@ bool RenderScriptRuntime::JITTypePointer(AllocationDetails *alloc,
// the result. Returns true on success, false otherwise
bool RenderScriptRuntime::JITTypePacked(AllocationDetails *alloc,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!alloc->type_ptr.isValid() || !alloc->context.isValid()) {
LLDB_LOGF(log, "%s - Failed to find allocation details.", __FUNCTION__);
@@ -1953,7 +1954,7 @@ bool RenderScriptRuntime::JITTypePacked(AllocationDetails *alloc,
bool RenderScriptRuntime::JITElementPacked(Element &elem,
const lldb::addr_t context,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!elem.element_ptr.isValid()) {
LLDB_LOGF(log, "%s - failed to find allocation details.", __FUNCTION__);
@@ -2010,7 +2011,7 @@ bool RenderScriptRuntime::JITElementPacked(Element &elem,
bool RenderScriptRuntime::JITSubelements(Element &elem,
const lldb::addr_t context,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!elem.element_ptr.isValid() || !elem.field_count.isValid()) {
LLDB_LOGF(log, "%s - failed to find allocation details.", __FUNCTION__);
@@ -2093,7 +2094,7 @@ bool RenderScriptRuntime::JITSubelements(Element &elem,
// allocation. Returns true on success, false otherwise
bool RenderScriptRuntime::JITAllocationSize(AllocationDetails *alloc,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!alloc->address.isValid() || !alloc->dimension.isValid() ||
!alloc->data_ptr.isValid() || !alloc->element.datum_size.isValid()) {
@@ -2159,7 +2160,7 @@ bool RenderScriptRuntime::JITAllocationSize(AllocationDetails *alloc,
// 16-byte aligned. Returns true on success, false otherwise
bool RenderScriptRuntime::JITAllocationStride(AllocationDetails *alloc,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!alloc->address.isValid() || !alloc->data_ptr.isValid()) {
LLDB_LOGF(log, "%s - failed to find allocation details.", __FUNCTION__);
@@ -2220,7 +2221,7 @@ bool RenderScriptRuntime::RefreshAllocation(AllocationDetails *alloc,
// represents. We need this string for pretty printing the Element to users.
void RenderScriptRuntime::FindStructTypeName(Element &elem,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!elem.type_name.IsEmpty()) // Name already set
return;
@@ -2304,7 +2305,7 @@ void RenderScriptRuntime::FindStructTypeName(Element &elem,
// single instance including padding. Assumes the relevant allocation
// information has already been jitted.
void RenderScriptRuntime::SetElementSize(Element &elem) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
const Element::DataType type = *elem.type.get();
assert(type >= Element::RS_TYPE_NONE && type <= Element::RS_TYPE_FONT &&
"Invalid allocation type");
@@ -2348,7 +2349,7 @@ void RenderScriptRuntime::SetElementSize(Element &elem) {
std::shared_ptr<uint8_t>
RenderScriptRuntime::GetAllocationData(AllocationDetails *alloc,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
// JIT all the allocation details
if (alloc->ShouldRefresh()) {
@@ -2396,7 +2397,7 @@ RenderScriptRuntime::GetAllocationData(AllocationDetails *alloc,
bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
const char *path,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
// Find allocation with the given id
AllocationDetails *alloc = FindAllocByID(strm, alloc_id);
@@ -2441,7 +2442,7 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
auto data_sp = FileSystem::Instance().CreateDataBuffer(file.GetPath());
// Cast start of buffer to FileHeader and use pointer to read metadata
- void *file_buf = data_sp->GetBytes();
+ const void *file_buf = data_sp->GetBytes();
if (file_buf == nullptr ||
data_sp->GetByteSize() < (sizeof(AllocationDetails::FileHeader) +
sizeof(AllocationDetails::ElementHeader))) {
@@ -2450,7 +2451,7 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
return false;
}
const AllocationDetails::FileHeader *file_header =
- static_cast<AllocationDetails::FileHeader *>(file_buf);
+ static_cast<const AllocationDetails::FileHeader *>(file_buf);
// Check file starts with ascii characters "RSAD"
if (memcmp(file_header->ident, "RSAD", 4)) {
@@ -2462,8 +2463,9 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
// Look at the type of the root element in the header
AllocationDetails::ElementHeader root_el_hdr;
- memcpy(&root_el_hdr, static_cast<uint8_t *>(file_buf) +
- sizeof(AllocationDetails::FileHeader),
+ memcpy(&root_el_hdr,
+ static_cast<const uint8_t *>(file_buf) +
+ sizeof(AllocationDetails::FileHeader),
sizeof(AllocationDetails::ElementHeader));
LLDB_LOGF(log, "%s - header type %" PRIu32 ", element size %" PRIu32,
@@ -2514,7 +2516,7 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
}
// Advance buffer past header
- file_buf = static_cast<uint8_t *>(file_buf) + file_header->hdr_size;
+ file_buf = static_cast<const uint8_t *>(file_buf) + file_header->hdr_size;
// Calculate size of allocation data in file
size_t size = data_sp->GetByteSize() - file_header->hdr_size;
@@ -2616,7 +2618,7 @@ size_t RenderScriptRuntime::CalculateElementHeaderSize(const Element &elem) {
bool RenderScriptRuntime::SaveAllocation(Stream &strm, const uint32_t alloc_id,
const char *path,
StackFrame *frame_ptr) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
// Find allocation with the given id
AllocationDetails *alloc = FindAllocByID(strm, alloc_id);
@@ -2735,7 +2737,7 @@ bool RenderScriptRuntime::SaveAllocation(Stream &strm, const uint32_t alloc_id,
}
bool RenderScriptRuntime::LoadModule(const lldb::ModuleSP &module_sp) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (module_sp) {
for (const auto &rs_module : m_rsmodules) {
@@ -2867,7 +2869,7 @@ bool RSModuleDescriptor::ParseExportReduceCount(llvm::StringRef *lines,
// a function is not explicitly named by the user, or is not generated by the
// compiler, it is named "." so the dash separated list should always be 8
// items long
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
// Skip the exportReduceCount line
++lines;
for (; n_lines--; ++lines) {
@@ -2958,7 +2960,7 @@ bool RSModuleDescriptor::ParseExportVarCount(llvm::StringRef *lines,
// be parsed. The string is basic and is parsed on a line by line basis.
bool RSModuleDescriptor::ParseRSInfo() {
assert(m_module);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
const Symbol *info_sym = m_module->FindFirstSymbolWithNameAndType(
ConstString(".rs.info"), eSymbolTypeData);
if (!info_sym)
@@ -3165,7 +3167,7 @@ RenderScriptRuntime::FindAllocByID(Stream &strm, const uint32_t alloc_id) {
// file
bool RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame *frame_ptr,
const uint32_t id) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
// Check we can find the desired allocation
AllocationDetails *alloc = FindAllocByID(strm, id);
@@ -3453,8 +3455,7 @@ void RenderScriptRuntime::BreakOnModuleKernels(
// or disable breaking on all kernels. When do_break is true we want to enable
// this functionality. When do_break is false we want to disable it.
void RenderScriptRuntime::SetBreakAllKernels(bool do_break, TargetSP target) {
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Breakpoints);
InitSearchFilter(target);
@@ -3482,8 +3483,7 @@ void RenderScriptRuntime::SetBreakAllKernels(bool do_break, TargetSP target) {
// breakpoint resolver, and returns the Breakpoint shared pointer.
BreakpointSP
RenderScriptRuntime::CreateKernelBreakpoint(ConstString name) {
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Breakpoints);
if (!m_filtersp) {
LLDB_LOGF(log, "%s - error, no breakpoint search filter set.",
@@ -3510,8 +3510,7 @@ RenderScriptRuntime::CreateKernelBreakpoint(ConstString name) {
BreakpointSP
RenderScriptRuntime::CreateReductionBreakpoint(ConstString name,
int kernel_types) {
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Breakpoints);
if (!m_filtersp) {
LLDB_LOGF(log, "%s - error, no breakpoint search filter set.",
@@ -3542,7 +3541,7 @@ RenderScriptRuntime::CreateReductionBreakpoint(ConstString name,
bool RenderScriptRuntime::GetFrameVarAsUnsigned(const StackFrameSP frame_sp,
const char *var_name,
uint64_t &val) {
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
Status err;
VariableSP var_sp;
@@ -3580,7 +3579,7 @@ bool RenderScriptRuntime::GetKernelCoordinate(RSCoordinate &coord,
static const char *const y_expr = "p->current.y";
static const char *const z_expr = "p->current.z";
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+ Log *log = GetLog(LLDBLog::Language);
if (!thread_ptr) {
LLDB_LOGF(log, "%s - Error, No thread pointer", __FUNCTION__);
@@ -3646,8 +3645,7 @@ bool RenderScriptRuntime::KernelBreakpointHit(void *baton,
StoppointCallbackContext *ctx,
user_id_t break_id,
user_id_t break_loc_id) {
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Breakpoints);
assert(baton &&
"Error: null baton in conditional kernel breakpoint callback");
@@ -3742,8 +3740,7 @@ bool RenderScriptRuntime::PlaceBreakpointOnKernel(TargetSP target,
BreakpointSP
RenderScriptRuntime::CreateScriptGroupBreakpoint(ConstString name,
bool stop_on_all) {
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Breakpoints);
if (!m_filtersp) {
LLDB_LOGF(log, "%s - error, no breakpoint search filter set.",
@@ -3839,7 +3836,7 @@ RenderScriptRuntime::LookUpAllocation(addr_t address) {
RenderScriptRuntime::AllocationDetails *
RenderScriptRuntime::CreateAllocation(addr_t address) {
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Log *log = GetLog(LLDBLog::Language);
// Remove any previous allocation which contains the same address
auto it = m_allocations.begin();
@@ -3862,7 +3859,7 @@ RenderScriptRuntime::CreateAllocation(addr_t address) {
bool RenderScriptRuntime::ResolveKernelName(lldb::addr_t kernel_addr,
ConstString &name) {
- Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS);
+ Log *log = GetLog(LLDBLog::Symbols);
Target &target = GetProcess()->GetTarget();
Address resolved;
@@ -4070,7 +4067,10 @@ public:
"<reduction_kernel_type,...>]",
eCommandRequiresProcess | eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused),
- m_options(){};
+ m_options() {
+ CommandArgumentData name_arg{eArgTypeName, eArgRepeatPlain};
+ m_arguments.push_back({name_arg});
+ };
class CommandOptions : public Options {
public:
@@ -4219,7 +4219,10 @@ public:
"renderscript kernel breakpoint set <kernel_name> [-c x,y,z]",
eCommandRequiresProcess | eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused),
- m_options() {}
+ m_options() {
+ CommandArgumentData name_arg{eArgTypeName, eArgRepeatPlain};
+ m_arguments.push_back({name_arg});
+ }
~CommandObjectRenderScriptRuntimeKernelBreakpointSet() override = default;
@@ -4314,7 +4317,10 @@ public:
"but does not remove currently set breakpoints.",
"renderscript kernel breakpoint all <enable/disable>",
eCommandRequiresProcess | eCommandProcessMustBeLaunched |
- eCommandProcessMustBePaused) {}
+ eCommandProcessMustBePaused) {
+ CommandArgumentData enable_arg{eArgTypeNone, eArgRepeatPlain};
+ m_arguments.push_back({enable_arg});
+ }
~CommandObjectRenderScriptRuntimeKernelBreakpointAll() override = default;
@@ -4496,7 +4502,10 @@ public:
"renderscript allocation dump <ID>",
eCommandRequiresProcess |
eCommandProcessMustBeLaunched),
- m_options() {}
+ m_options() {
+ CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain};
+ m_arguments.push_back({id_arg});
+ }
~CommandObjectRenderScriptRuntimeAllocationDump() override = default;
@@ -4682,7 +4691,12 @@ public:
interpreter, "renderscript allocation load",
"Loads renderscript allocation contents from a file.",
"renderscript allocation load <ID> <filename>",
- eCommandRequiresProcess | eCommandProcessMustBeLaunched) {}
+ eCommandRequiresProcess | eCommandProcessMustBeLaunched) {
+ CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain};
+ CommandArgumentData name_arg{eArgTypeFilename, eArgRepeatPlain};
+ m_arguments.push_back({id_arg});
+ m_arguments.push_back({name_arg});
+ }
~CommandObjectRenderScriptRuntimeAllocationLoad() override = default;
@@ -4729,7 +4743,12 @@ public:
"Write renderscript allocation contents to a file.",
"renderscript allocation save <ID> <filename>",
eCommandRequiresProcess |
- eCommandProcessMustBeLaunched) {}
+ eCommandProcessMustBeLaunched) {
+ CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain};
+ CommandArgumentData name_arg{eArgTypeFilename, eArgRepeatPlain};
+ m_arguments.push_back({id_arg});
+ m_arguments.push_back({name_arg});
+ }
~CommandObjectRenderScriptRuntimeAllocationSave() override = default;
diff --git a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
index b6f8b20c90c3..3eb2519dda9e 100644
--- a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
@@ -39,7 +39,10 @@ public:
interpreter, "renderscript scriptgroup breakpoint set",
"Place a breakpoint on all kernels forming a script group.",
"renderscript scriptgroup breakpoint set <group_name>",
- eCommandRequiresProcess | eCommandProcessMustBeLaunched) {}
+ eCommandRequiresProcess | eCommandProcessMustBeLaunched) {
+ CommandArgumentData name_arg{eArgTypeName, eArgRepeatPlus};
+ m_arguments.push_back({name_arg});
+ }
~CommandObjectRenderScriptScriptGroupBreakpointSet() override = default;
diff --git a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
index f3b7c9dd3edc..ec8f8d83c4b3 100644
--- a/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
@@ -19,14 +19,14 @@
#include "llvm/Pass.h"
#include "lldb/Target/Process.h"
+#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
using namespace lldb_private;
-static bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) {
+static bool isRSAPICall(llvm::CallInst *call_inst) {
// TODO get the list of renderscript modules from lldb and check if
// this llvm::Module calls into any of them.
- (void)module;
const auto func_name = call_inst->getCalledFunction()->getName();
if (func_name.startswith("llvm") || func_name.startswith("lldb"))
return false;
@@ -37,8 +37,7 @@ static bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) {
return true;
}
-static bool isRSLargeReturnCall(llvm::Module &module,
- llvm::CallInst *call_inst) {
+static bool isRSLargeReturnCall(llvm::CallInst *call_inst) {
// i686 and x86_64 returns for large vectors in the RenderScript API are not
// handled as normal register pairs, but as a hidden sret type. This is not
// reflected in the debug info or mangled symbol name, and the android ABI
@@ -49,7 +48,6 @@ static bool isRSLargeReturnCall(llvm::Module &module,
// It is perhaps an unreliable heuristic, and relies on bcc not generating
// AVX code, so if the android ABI one day provides for AVX, this function
// may go out of fashion.
- (void)module;
if (!call_inst || !call_inst->getCalledFunction())
return false;
@@ -58,23 +56,19 @@ static bool isRSLargeReturnCall(llvm::Module &module,
->getPrimitiveSizeInBits() > 128;
}
-static bool isRSAllocationPtrTy(const llvm::Type *type) {
- if (!type->isPointerTy())
- return false;
- auto ptr_type = type->getPointerElementType();
-
- return ptr_type->isStructTy() &&
- ptr_type->getStructName().startswith("struct.rs_allocation");
+static bool isRSAllocationTy(const llvm::Type *type) {
+ return type->isStructTy() &&
+ type->getStructName().startswith("struct.rs_allocation");
}
-static bool isRSAllocationTyCallSite(llvm::Module &module,
- llvm::CallInst *call_inst) {
- (void)module;
+static bool isRSAllocationTyCallSite(llvm::CallInst *call_inst) {
if (!call_inst->hasByValArgument())
return false;
- for (const auto *param : call_inst->operand_values())
- if (isRSAllocationPtrTy(param->getType()))
- return true;
+ for (unsigned i = 0; i < call_inst->arg_size(); ++i) {
+ if (llvm::Type *ByValTy = call_inst->getParamByValType(i))
+ if (isRSAllocationTy(ByValTy))
+ return true;
+ }
return false;
}
@@ -85,8 +79,7 @@ static llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) {
// create a return type by getting the pointer type of the old return type,
// and inserting a new initial argument of pointer type of the original
// return type.
- Log *log(
- GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_EXPRESSIONS));
+ Log *log = GetLog(LLDBLog::Language | LLDBLog::Expressions);
assert(call_inst && "no CallInst");
llvm::Function *orig = call_inst->getCalledFunction();
@@ -125,7 +118,7 @@ static llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) {
static bool
findRSCallSites(llvm::Module &module, std::set<llvm::CallInst *> &rs_callsites,
- bool (*predicate)(llvm::Module &, llvm::CallInst *)) {
+ bool (*predicate)(llvm::CallInst *)) {
bool found = false;
for (auto &func : module.getFunctionList())
@@ -136,7 +129,7 @@ findRSCallSites(llvm::Module &module, std::set<llvm::CallInst *> &rs_callsites,
if (!call_inst || !call_inst->getCalledFunction())
// This is not the call-site you are looking for...
continue;
- if (isRSAPICall(module, call_inst) && predicate(module, call_inst)) {
+ if (isRSAPICall(call_inst) && predicate(call_inst)) {
rs_callsites.insert(call_inst);
found = true;
}
@@ -187,18 +180,17 @@ static bool fixupX86StructRetCalls(llvm::Module &module) {
(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->getType()->getPointerElementType(),
- new_func_ptr, "load_func_pointer", call_inst);
+ llvm::LoadInst *new_func_addr_load = new llvm::LoadInst(
+ new_func_ptr_type, new_func_ptr, "load_func_pointer", call_inst);
// and create a callinstruction from it
llvm::CallInst *new_call_inst =
llvm::CallInst::Create(new_func_type, new_func_addr_load, new_call_args,
"new_func_call", call_inst);
new_call_inst->setCallingConv(call_inst->getCallingConv());
new_call_inst->setTailCall(call_inst->isTailCall());
- llvm::LoadInst *lldb_save_result_address = new llvm::LoadInst(
- return_value_alloc->getType()->getPointerElementType(),
- return_value_alloc, "save_return_val", call_inst);
+ llvm::LoadInst *lldb_save_result_address =
+ new llvm::LoadInst(func->getReturnType(), return_value_alloc,
+ "save_return_val", call_inst);
// Now remove the old broken call
call_inst->replaceAllUsesWith(lldb_save_result_address);