Go to the documentation of this file.
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_RENDERSCRIPT_RENDERSCRIPTRUNTIME_RENDERSCRIPTRUNTIME_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_RENDERSCRIPT_RENDERSCRIPTRUNTIME_RENDERSCRIPTRUNTIME_H
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/ADT/StringRef.h"
32 namespace lldb_renderscript {
52 return x == rhs.
x &&
y == rhs.
y &&
z == rhs.
z;
67 strm->
Printf(
"RenderScript kernel breakpoint for '%s'",
79 lldb::BreakpointResolverSP
81 lldb::BreakpointResolverSP ret_sp(
103 const lldb::BreakpointSP &breakpoint,
ConstString reduce_name,
104 std::vector<lldb_renderscript::RSModuleDescriptorSP> *rs_modules,
117 strm->
Printf(
"RenderScript reduce breakpoint for '%s'",
129 lldb::BreakpointResolverSP
138 std::vector<lldb_renderscript::RSModuleDescriptorSP> *
m_rsmodules;
168 uint32_t accum_data_size, llvm::StringRef name,
169 llvm::StringRef init_name, llvm::StringRef accum_name,
170 llvm::StringRef comb_name, llvm::StringRef outc_name,
171 llvm::StringRef halter_name =
".")
263 strm->
Printf(
"RenderScript ScriptGroup breakpoint for '%s'",
275 lldb::BreakpointResolverSP
318 static lldb::CommandObjectSP
325 bool isA(
const void *ClassID)
const override {
330 return runtime->
isA(&
ID);
351 lldb::BreakpointResolverSP
353 bool catch_bp,
bool throw_bp)
override;
355 bool LoadModule(
const lldb::ModuleSP &module_sp);
371 lldb::TargetSP target,
Stream &messages,
const char *name,
375 lldb::TargetSP target,
Stream &messages,
const char *reduce_name,
377 int kernel_types = ~(0));
404 for (
const auto &kernel : module->m_kernels)
405 if (kernel.m_name == name)
421 struct ScriptDetails;
422 struct AllocationDetails;
430 std::make_shared<SearchFilterForUnconstrainedSearches>(target);
483 std::map<lldb::addr_t, lldb_renderscript::RSModuleDescriptorSP>
486 std::map<lldb::user_id_t, std::unique_ptr<lldb_renderscript::RSCoordinate>>
536 const char *var_name, uint64_t &val);
541 size_t offset,
const Element &elem);
591 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_RENDERSCRIPT_RENDERSCRIPTRUNTIME_RENDERSCRIPTRUNTIME_H
LLVMUserExpression::IRPasses * m_ir_passes
RSReduceBreakpointResolver(const lldb::BreakpointSP &breakpoint, ConstString reduce_name, std::vector< lldb_renderscript::RSModuleDescriptorSP > *rs_modules, int kernel_types=eKernelTypeAll)
bool JITTypePacked(AllocationDetails *alloc, StackFrame *frame_ptr)
bool IsKnownKernel(ConstString name)
static bool HookCallback(void *baton, StoppointCallbackContext *ctx, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
std::vector< RSReductionDescriptor > m_reductions
std::shared_ptr< uint8_t > GetAllocationData(AllocationDetails *alloc, StackFrame *frame_ptr)
const RSModuleDescriptor * m_module
bool isA(const void *ClassID) const override
static int Compare(ConstString lhs, ConstString rhs, const bool case_sensitive=true)
Compare two string objects.
const lldb::ModuleSP m_module
bool EvalRSExpression(const char *expression, StackFrame *frame_ptr, uint64_t *result)
RenderScriptRuntime(Process *process)
void Dump(Stream &strm) const
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
ConstString m_halter_name
static bool IsRenderScriptModule(const lldb::ModuleSP &module_sp)
ConstString m_reduce_name
RSBreakpointResolver(const lldb::BreakpointSP &bp, ConstString name)
ConstString m_reduce_name
size_t PopulateElementHeaders(const std::shared_ptr< uint8_t > header_buffer, size_t offset, const Element &elem)
void LoadRuntimeHooks(lldb::ModuleSP module, ModuleKind kind)
bool PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name, const lldb_renderscript::RSCoordinate *coords=nullptr)
bool RecomputeAllAllocations(Stream &strm, StackFrame *frame_ptr)
void Dump(Stream &strm) const
LanguageType
Programming language type.
std::map< lldb::addr_t, lldb_renderscript::RSModuleDescriptorSP > m_scriptMappings
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
bool isA(const void *ClassID) const override
const char * symbol_name_m64
std::vector< RSKernelDescriptor > m_kernels
RSReductionDescriptor(const RSModuleDescriptor *module, uint32_t sig, uint32_t accum_data_size, llvm::StringRef name, llvm::StringRef init_name, llvm::StringRef accum_name, llvm::StringRef comb_name, llvm::StringRef outc_name, llvm::StringRef halter_name=".")
lldb::SearchDepth GetDepth() override
virtual bool isA(const void *ClassID) const
bool ParseExportReduceCount(llvm::StringRef *, size_t n_lines)
llvm::StringRef GetPluginName() override
AllocationDetails * LookUpAllocation(lldb::addr_t address)
RSKernelDescriptor(const RSModuleDescriptor *module, llvm::StringRef name, uint32_t slot)
void Dump(Stream &strm) const
bool LoadAllocation(Stream &strm, const uint32_t alloc_id, const char *filename, StackFrame *frame_ptr)
bool JITSubelements(Element &elem, const lldb::addr_t context, StackFrame *frame_ptr)
std::map< lldb::user_id_t, std::unique_ptr< lldb_renderscript::RSCoordinate > > m_conditional_breaks
std::vector< RSGlobalDescriptor > m_globals
std::shared_ptr< RSKernelDescriptor > RSKernelDescriptorSP
void ListAllocations(Stream &strm, StackFrame *frame_ptr, const uint32_t index)
void GetDescription(Stream *strm) override
Prints a canonical description for the breakpoint to the stream s.
std::vector< lldb_renderscript::RSModuleDescriptorSP > * m_rsmodules
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
void DumpModules(Stream &strm) const
void CaptureAllocationDestroy(RuntimeHook *hook_info, ExecutionContext &context)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
const char * symbol_name_m32
void CaptureScriptInit(RuntimeHook *hook_info, ExecutionContext &context)
bool operator==(const lldb_renderscript::RSCoordinate &rhs)
lldb::ModuleSP m_libRSDriver
static const HookDefn s_runtimeHookDefns[]
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
bool DumpAllocation(Stream &strm, StackFrame *frame_ptr, const uint32_t id)
General Outline: Provides the callback and search depth for the SearchFilter search.
lldb::SearchDepth GetDepth() override
void CaptureDebugHintScriptGroup2(RuntimeHook *hook_info, ExecutionContext &context)
void DumpContexts(Stream &strm) const
const lldb_renderscript::RSScriptGroupList & GetScriptGroups() const
static void ModulesDidLoad(const lldb::ProcessSP &process_sp, const ModuleList &module_list)
const RSModuleDescriptor * m_module
void FindStructTypeName(Element &elem, StackFrame *frame_ptr)
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type) override
void CaptureAllocationInit(RuntimeHook *hook_info, ExecutionContext &context)
ScriptDetails * LookUpScript(lldb::addr_t address, bool create)
lldb::BreakpointSP CreateKernelBreakpoint(ConstString name)
bool GetOverrideExprOptions(clang::TargetOptions &prototype)
bool ParseExportForeachCount(llvm::StringRef *, size_t n_lines)
lldb::BreakpointSP CreateScriptGroupBreakpoint(ConstString name, bool multi)
bool CouldHaveDynamicValue(ValueObject &in_value) override
bool JITElementPacked(Element &elem, const lldb::addr_t context, StackFrame *frame_ptr)
std::shared_ptr< RuntimeHook > RuntimeHookSP
static lldb::CommandObjectSP GetCommandObject(CommandInterpreter &interpreter)
void BreakOnModuleKernels(const lldb_renderscript::RSModuleDescriptorSP rsmodule_sp)
void(RenderScriptRuntime::* CaptureStateFn)(RuntimeHook *hook_info, ExecutionContext &context)
std::map< lldb::addr_t, RuntimeHookSP > m_runtimeHooks
ValueType
Type that describes Value::m_value.
static bool GetKernelCoordinate(lldb_renderscript::RSCoordinate &coord, Thread *thread_ptr)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
bool ParsePragmaCount(llvm::StringRef *, size_t n_lines)
void FixupScriptDetails(lldb_renderscript::RSModuleDescriptorSP rsmodule_sp)
size_t CalculateElementHeaderSize(const Element &elem)
bool ResolveKernelName(lldb::addr_t kernel_address, ConstString &name)
void DumpKernels(Stream &strm) const
string(SUBSTRING ${p} 10 -1 pStripped) if($
AllocationDetails * CreateAllocation(lldb::addr_t address)
AllocationDetails * FindAllocByID(Stream &strm, const uint32_t alloc_id)
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
std::shared_ptr< RSGlobalDescriptor > RSGlobalDescriptorSP
bool RefreshAllocation(AllocationDetails *alloc, StackFrame *frame_ptr)
bool PlaceBreakpointOnScriptGroup(lldb::TargetSP target, Stream &strm, ConstString name, bool stop_on_all)
std::vector< lldb_renderscript::RSModuleDescriptorSP > m_rsmodules
bool GetIRPasses(LLVMUserExpression::IRPasses &passes) override
bool JITAllocationStride(AllocationDetails *alloc, StackFrame *frame_ptr)
static const size_t s_runtimeHookCount
bool LoadModule(const lldb::ModuleSP &module_sp)
General Outline: The BreakpointResolver is a Searcher.
std::vector< RSScriptGroupDescriptorSP > RSScriptGroupList
void GetDescription(Stream *strm) override
Prints a canonical description for the breakpoint to the stream s.
std::vector< std::unique_ptr< ScriptDetails > > m_scripts
static bool classof(const LanguageRuntime *runtime)
std::vector< std::unique_ptr< AllocationDetails > > m_allocations
std::string m_slang_version
RSGlobalDescriptor(const RSModuleDescriptor *module, llvm::StringRef name)
void SetConditional(lldb::BreakpointSP bp, lldb_private::Stream &messages, const lldb_renderscript::RSCoordinate &coord)
static bool GetFrameVarAsUnsigned(const lldb::StackFrameSP, const char *var_name, uint64_t &val)
std::map< std::string, std::string > m_pragmas
lldb_renderscript::RSScriptGroupList m_scriptGroups
static bool KernelBreakpointHit(void *baton, StoppointCallbackContext *ctx, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
std::shared_ptr< RSModuleDescriptor > RSModuleDescriptorSP
lldb::SearchFilterSP m_filtersp
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
void SetElementSize(Element &elem)
uint32_t m_accum_data_size
bool m_debuggerPresentFlagged
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
bool PlaceBreakpointOnReduction(lldb::TargetSP target, Stream &messages, const char *reduce_name, const lldb_renderscript::RSCoordinate *coords=nullptr, int kernel_types=~(0))
bool ParseVersionInfo(llvm::StringRef *, size_t n_lines)
bool ParseExportVarCount(llvm::StringRef *, size_t n_lines)
A class that represents a running process on the host machine.
~RSModuleDescriptor()=default
const RSModuleDescriptor * m_module
void InitSearchFilter(lldb::TargetSP target)
RSModuleDescriptor(const lldb::ModuleSP &module)
void WarnIfVersionMismatch(Stream *s) const
void DumpStatus(Stream &strm) const
bool JITAllocationSize(AllocationDetails *alloc, StackFrame *frame_ptr)
static llvm::StringRef GetPluginNameStatic()
ConstString m_kernel_name
std::shared_ptr< RSScriptGroupDescriptor > RSScriptGroupDescriptorSP
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
bool JITDataPointer(AllocationDetails *alloc, StackFrame *frame_ptr, uint32_t x=0, uint32_t y=0, uint32_t z=0)
bool SaveAllocation(Stream &strm, const uint32_t alloc_id, const char *filename, StackFrame *frame_ptr)
lldb::BreakpointSP CreateReductionBreakpoint(ConstString name, int kernel_types)
static ModuleKind GetModuleKind(const lldb::ModuleSP &module_sp)
void CaptureScriptInvokeForEachMulti(RuntimeHook *hook_info, ExecutionContext &context)
bool m_comb_name_generated
void Dump(Stream &strm) const
bool JITTypePointer(AllocationDetails *alloc, StackFrame *frame_ptr)
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
bool ParseBuildChecksum(llvm::StringRef *, size_t n_lines)
lldb::ModuleSP m_libRSCpuRef
~RenderScriptRuntime() override
void SetBreakAllKernels(bool do_break, lldb::TargetSP target)
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bp, bool catch_bp, bool throw_bp) override
void CaptureSetGlobalVar(RuntimeHook *hook_info, ExecutionContext &context)
std::string m_bcc_version