aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-04 19:20:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:02:26 +0000
commit81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch)
tree311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
parent5fff09660e06a66bed6482da9c70df328e16bbb6 (diff)
parent145449b1e420787bb99721a429341fa6be3adfb6 (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp141
1 files changed, 80 insertions, 61 deletions
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;