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"
32namespace 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 =
".")
264 strm->
Printf(
"RenderScript ScriptGroup breakpoint for '%s'",
276 lldb::BreakpointResolverSP
319 static lldb::CommandObjectSP
326 bool isA(
const void *ClassID)
const override {
331 return runtime->
isA(&
ID);
352 lldb::BreakpointResolverSP
354 bool catch_bp,
bool throw_bp)
override;
356 bool LoadModule(
const lldb::ModuleSP &module_sp);
372 lldb::TargetSP target,
Stream &messages,
const char *name,
376 lldb::TargetSP target,
Stream &messages,
const char *reduce_name,
378 int kernel_types = ~(0));
405 for (
const auto &kernel : module->m_kernels)
406 if (kernel.m_name == name)
422 struct ScriptDetails;
423 struct AllocationDetails;
431 std::make_shared<SearchFilterForUnconstrainedSearches>(target);
484 std::map<lldb::addr_t, lldb_renderscript::RSModuleDescriptorSP>
487 std::map<lldb::user_id_t, std::unique_ptr<lldb_renderscript::RSCoordinate>>
537 const char *var_name, uint64_t &val);
542 size_t offset,
const Element &elem);
A section + offset based address class.
General Outline: The BreakpointResolver is a Searcher.
bool isA(const void *ClassID) const override
A uniqued constant string class.
static int Compare(ConstString lhs, ConstString rhs, const bool case_sensitive=true)
Compare two string objects.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual bool isA(const void *ClassID) const
A collection class for Module objects.
A plug-in interface definition class for debugging a process.
static lldb::CommandObjectSP GetCommandObject(CommandInterpreter &interpreter)
bool JITDataPointer(AllocationDetails *alloc, StackFrame *frame_ptr, uint32_t x=0, uint32_t y=0, uint32_t z=0)
static bool HookCallback(void *baton, StoppointCallbackContext *ctx, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
static void ModulesDidLoad(const lldb::ProcessSP &process_sp, const ModuleList &module_list)
static bool GetKernelCoordinate(lldb_renderscript::RSCoordinate &coord, Thread *thread_ptr)
void CaptureSetGlobalVar(RuntimeHook *hook_info, ExecutionContext &context)
bool JITAllocationSize(AllocationDetails *alloc, StackFrame *frame_ptr)
void FixupScriptDetails(lldb_renderscript::RSModuleDescriptorSP rsmodule_sp)
bool GetOverrideExprOptions(clang::TargetOptions &prototype)
void FindStructTypeName(Element &elem, StackFrame *frame_ptr)
static const size_t s_runtimeHookCount
static bool KernelBreakpointHit(void *baton, StoppointCallbackContext *ctx, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
llvm::StringRef GetPluginName() override
size_t CalculateElementHeaderSize(const Element &elem)
std::vector< std::unique_ptr< ScriptDetails > > m_scripts
bool LoadModule(const lldb::ModuleSP &module_sp)
void CaptureScriptInvokeForEachMulti(RuntimeHook *hook_info, ExecutionContext &context)
AllocationDetails * FindAllocByID(Stream &strm, const uint32_t alloc_id)
void CaptureAllocationInit(RuntimeHook *hook_info, ExecutionContext &context)
const lldb_renderscript::RSScriptGroupList & GetScriptGroups() const
bool DumpAllocation(Stream &strm, StackFrame *frame_ptr, const uint32_t id)
static bool classof(const LanguageRuntime *runtime)
bool JITElementPacked(Element &elem, const lldb::addr_t context, StackFrame *frame_ptr)
void SetConditional(lldb::BreakpointSP bp, lldb_private::Stream &messages, const lldb_renderscript::RSCoordinate &coord)
lldb::BreakpointSP CreateReductionBreakpoint(ConstString name, int kernel_types)
void DumpKernels(Stream &strm) const
bool JITTypePacked(AllocationDetails *alloc, StackFrame *frame_ptr)
std::map< lldb::addr_t, RuntimeHookSP > m_runtimeHooks
static const HookDefn s_runtimeHookDefns[]
bool PlaceBreakpointOnScriptGroup(lldb::TargetSP target, Stream &strm, ConstString name, bool stop_on_all)
ScriptDetails * LookUpScript(lldb::addr_t address, bool create)
void CaptureScriptInit(RuntimeHook *hook_info, ExecutionContext &context)
LLVMUserExpression::IRPasses * m_ir_passes
lldb::BreakpointSP CreateKernelBreakpoint(ConstString name)
std::vector< std::unique_ptr< AllocationDetails > > m_allocations
bool GetIRPasses(LLVMUserExpression::IRPasses &passes) override
void ListAllocations(Stream &strm, StackFrame *frame_ptr, const uint32_t index)
bool RefreshAllocation(AllocationDetails *alloc, StackFrame *frame_ptr)
static bool GetFrameVarAsUnsigned(const lldb::StackFrameSP, const char *var_name, uint64_t &val)
lldb::ModuleSP m_libRSDriver
lldb::SearchFilterSP m_filtersp
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type) override
static ModuleKind GetModuleKind(const lldb::ModuleSP &module_sp)
bool isA(const void *ClassID) const override
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
bool RecomputeAllAllocations(Stream &strm, StackFrame *frame_ptr)
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bp, bool catch_bp, bool throw_bp) override
bool JITTypePointer(AllocationDetails *alloc, StackFrame *frame_ptr)
size_t PopulateElementHeaders(const std::shared_ptr< uint8_t > header_buffer, size_t offset, const Element &elem)
bool m_debuggerPresentFlagged
void DumpContexts(Stream &strm) const
bool JITAllocationStride(AllocationDetails *alloc, StackFrame *frame_ptr)
bool CouldHaveDynamicValue(ValueObject &in_value) override
std::map< lldb::user_id_t, std::unique_ptr< lldb_renderscript::RSCoordinate > > m_conditional_breaks
AllocationDetails * CreateAllocation(lldb::addr_t address)
void InitSearchFilter(lldb::TargetSP target)
bool JITSubelements(Element &elem, const lldb::addr_t context, StackFrame *frame_ptr)
std::shared_ptr< uint8_t > GetAllocationData(AllocationDetails *alloc, StackFrame *frame_ptr)
lldb_renderscript::RSScriptGroupList m_scriptGroups
void SetBreakAllKernels(bool do_break, lldb::TargetSP target)
bool IsKnownKernel(ConstString name)
std::vector< lldb_renderscript::RSModuleDescriptorSP > m_rsmodules
AllocationDetails * LookUpAllocation(lldb::addr_t address)
void DumpModules(Stream &strm) const
bool PlaceBreakpointOnReduction(lldb::TargetSP target, Stream &messages, const char *reduce_name, const lldb_renderscript::RSCoordinate *coords=nullptr, int kernel_types=~(0))
std::shared_ptr< RuntimeHook > RuntimeHookSP
void DumpStatus(Stream &strm) const
lldb::BreakpointSP CreateScriptGroupBreakpoint(ConstString name, bool multi)
void SetElementSize(Element &elem)
void CaptureAllocationDestroy(RuntimeHook *hook_info, ExecutionContext &context)
void CaptureDebugHintScriptGroup2(RuntimeHook *hook_info, ExecutionContext &context)
~RenderScriptRuntime() override
bool ResolveKernelName(lldb::addr_t kernel_address, ConstString &name)
std::map< lldb::addr_t, lldb_renderscript::RSModuleDescriptorSP > m_scriptMappings
bool LoadAllocation(Stream &strm, const uint32_t alloc_id, const char *filename, StackFrame *frame_ptr)
bool EvalRSExpression(const char *expression, StackFrame *frame_ptr, uint64_t *result)
bool PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name, const lldb_renderscript::RSCoordinate *coords=nullptr)
lldb::ModuleSP m_libRSCpuRef
static llvm::StringRef GetPluginNameStatic()
static bool IsRenderScriptModule(const lldb::ModuleSP &module_sp)
bool SaveAllocation(Stream &strm, const uint32_t alloc_id, const char *filename, StackFrame *frame_ptr)
void(RenderScriptRuntime::* CaptureStateFn)(RuntimeHook *hook_info, ExecutionContext &context)
void LoadRuntimeHooks(lldb::ModuleSP module, ModuleKind kind)
void BreakOnModuleKernels(const lldb_renderscript::RSModuleDescriptorSP rsmodule_sp)
General Outline: Provides the callback and search depth for the SearchFilter search.
This base class provides an interface to stack frames.
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Defines a symbol context baton that can be handed other debug core functions.
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
ValueType
Type that describes Value::m_value.
void GetDescription(Stream *strm) override
Prints a canonical description for the breakpoint to the stream s.
ConstString m_kernel_name
RSBreakpointResolver(const lldb::BreakpointSP &bp, ConstString name)
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
lldb::SearchDepth GetDepth() override
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
const lldb::ModuleSP m_module
bool ParseExportReduceCount(llvm::StringRef *, size_t n_lines)
RSModuleDescriptor(const lldb::ModuleSP &module)
bool ParseExportForeachCount(llvm::StringRef *, size_t n_lines)
~RSModuleDescriptor()=default
bool ParseExportVarCount(llvm::StringRef *, size_t n_lines)
bool ParseVersionInfo(llvm::StringRef *, size_t n_lines)
std::string m_bcc_version
std::vector< RSGlobalDescriptor > m_globals
bool ParseBuildChecksum(llvm::StringRef *, size_t n_lines)
std::vector< RSReductionDescriptor > m_reductions
std::map< std::string, std::string > m_pragmas
void WarnIfVersionMismatch(Stream *s) const
std::vector< RSKernelDescriptor > m_kernels
std::string m_slang_version
bool ParsePragmaCount(llvm::StringRef *, size_t n_lines)
void Dump(Stream &strm) const
std::vector< lldb_renderscript::RSModuleDescriptorSP > * m_rsmodules
lldb::SearchDepth GetDepth() override
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
ConstString m_reduce_name
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
void GetDescription(Stream *strm) override
Prints a canonical description for the breakpoint to the stream s.
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
RSReduceBreakpointResolver(const lldb::BreakpointSP &breakpoint, ConstString reduce_name, std::vector< lldb_renderscript::RSModuleDescriptorSP > *rs_modules, int kernel_types=eKernelTypeAll)
std::shared_ptr< RSKernelDescriptor > RSKernelDescriptorSP
std::shared_ptr< RSScriptGroupDescriptor > RSScriptGroupDescriptorSP
std::shared_ptr< RSModuleDescriptor > RSModuleDescriptorSP
std::vector< RSScriptGroupDescriptorSP > RSScriptGroupList
std::shared_ptr< RSGlobalDescriptor > RSGlobalDescriptorSP
A class that represents a running process on the host machine.
LanguageType
Programming language type.
const char * symbol_name_m32
const char * symbol_name_m64
bool operator==(const lldb_renderscript::RSCoordinate &rhs)
void Dump(Stream &strm) const
RSGlobalDescriptor(const RSModuleDescriptor *module, llvm::StringRef name)
const RSModuleDescriptor * m_module
const RSModuleDescriptor * m_module
void Dump(Stream &strm) const
RSKernelDescriptor(const RSModuleDescriptor *module, llvm::StringRef name, uint32_t slot)
uint32_t m_accum_data_size
ConstString m_halter_name
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=".")
ConstString m_reduce_name
bool m_comb_name_generated
const RSModuleDescriptor * m_module
void Dump(Stream &strm) const