summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index 4edb8dec6082a..dd9312234d8bd 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -1,4 +1,4 @@
-//===-- RenderScriptRuntime.cpp ---------------------------------*- C++ -*-===//
+//===-- RenderScriptRuntime.cpp -------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -46,6 +46,8 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_renderscript;
+LLDB_PLUGIN_DEFINE(RenderScriptRuntime)
+
#define FMT_COORD "(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")"
char RenderScriptRuntime::ID = 0;
@@ -791,6 +793,9 @@ RenderScriptRuntime::CreateInstance(Process *process,
Searcher::CallbackReturn
RSBreakpointResolver::SearchCallback(SearchFilter &filter,
SymbolContext &context, Address *) {
+ BreakpointSP breakpoint_sp = GetBreakpoint();
+ assert(breakpoint_sp);
+
ModuleSP module = context.module_sp;
if (!module || !IsRenderScriptScriptModule(module))
@@ -811,7 +816,7 @@ RSBreakpointResolver::SearchCallback(SearchFilter &filter,
if (kernel_sym) {
Address bp_addr = kernel_sym->GetAddress();
if (filter.AddressPasses(bp_addr))
- m_breakpoint->AddLocation(bp_addr);
+ breakpoint_sp->AddLocation(bp_addr);
}
return Searcher::eCallbackReturnContinue;
@@ -821,6 +826,9 @@ Searcher::CallbackReturn
RSReduceBreakpointResolver::SearchCallback(lldb_private::SearchFilter &filter,
lldb_private::SymbolContext &context,
Address *) {
+ BreakpointSP breakpoint_sp = GetBreakpoint();
+ assert(breakpoint_sp);
+
// We need to have access to the list of reductions currently parsed, as
// reduce names don't actually exist as symbols in a module. They are only
// identifiable by parsing the .rs.info packet, or finding the expand symbol.
@@ -867,7 +875,7 @@ RSReduceBreakpointResolver::SearchCallback(lldb_private::SearchFilter &filter,
if (!SkipPrologue(module, address)) {
LLDB_LOGF(log, "%s: Error trying to skip prologue", __FUNCTION__);
}
- m_breakpoint->AddLocation(address, &new_bp);
+ breakpoint_sp->AddLocation(address, &new_bp);
LLDB_LOGF(log, "%s: %s reduction breakpoint on %s in %s",
__FUNCTION__, new_bp ? "new" : "existing",
kernel_name.GetCString(),
@@ -882,7 +890,8 @@ RSReduceBreakpointResolver::SearchCallback(lldb_private::SearchFilter &filter,
Searcher::CallbackReturn RSScriptGroupBreakpointResolver::SearchCallback(
SearchFilter &filter, SymbolContext &context, Address *addr) {
- if (!m_breakpoint)
+ BreakpointSP breakpoint_sp = GetBreakpoint();
+ if (!breakpoint_sp)
return eCallbackReturnContinue;
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
@@ -892,7 +901,8 @@ Searcher::CallbackReturn RSScriptGroupBreakpointResolver::SearchCallback(
return Searcher::eCallbackReturnContinue;
std::vector<std::string> names;
- m_breakpoint->GetNames(names);
+ Breakpoint& breakpoint = *breakpoint_sp;
+ breakpoint.GetNames(names);
if (names.empty())
return eCallbackReturnContinue;
@@ -932,7 +942,7 @@ Searcher::CallbackReturn RSScriptGroupBreakpointResolver::SearchCallback(
}
bool new_bp;
- m_breakpoint->AddLocation(address, &new_bp);
+ breakpoint.AddLocation(address, &new_bp);
LLDB_LOGF(log, "%s: Placed %sbreakpoint on %s", __FUNCTION__,
new_bp ? "new " : "", k.m_name.AsCString());
@@ -1029,8 +1039,8 @@ bool RenderScriptRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
}
lldb::BreakpointResolverSP
-RenderScriptRuntime::CreateExceptionResolver(Breakpoint *bp, bool catch_bp,
- bool throw_bp) {
+RenderScriptRuntime::CreateExceptionResolver(const lldb::BreakpointSP &bp,
+ bool catch_bp, bool throw_bp) {
BreakpointResolverSP resolver_sp;
return resolver_sp;
}
@@ -1513,7 +1523,7 @@ void RenderScriptRuntime::CaptureScriptInit(RuntimeHook *hook,
script->type = ScriptDetails::eScriptC;
script->cache_dir = cache_dir;
script->res_name = res_name;
- script->shared_lib = strm.GetString();
+ script->shared_lib = std::string(strm.GetString());
script->context = addr_t(args[eRsContext]);
}
@@ -3129,7 +3139,7 @@ void RenderScriptRuntime::DumpKernels(Stream &strm) const {
strm.Printf("Resource '%s':", module->m_resname.c_str());
strm.EOL();
for (const auto &kernel : module->m_kernels) {
- strm.Indent(kernel.m_name.AsCString());
+ strm.Indent(kernel.m_name.GetStringRef());
strm.EOL();
}
}
@@ -3939,9 +3949,10 @@ void RSModuleDescriptor::Dump(Stream &strm) const {
}
void RSGlobalDescriptor::Dump(Stream &strm) const {
- strm.Indent(m_name.AsCString());
+ strm.Indent(m_name.GetStringRef());
VariableList var_list;
- m_module->m_module->FindGlobalVariables(m_name, nullptr, 1U, var_list);
+ m_module->m_module->FindGlobalVariables(m_name, CompilerDeclContext(), 1U,
+ var_list);
if (var_list.GetSize() == 1) {
auto var = var_list.GetVariableAtIndex(0);
auto type = var->GetType();
@@ -3964,12 +3975,12 @@ void RSGlobalDescriptor::Dump(Stream &strm) const {
}
void RSKernelDescriptor::Dump(Stream &strm) const {
- strm.Indent(m_name.AsCString());
+ strm.Indent(m_name.GetStringRef());
strm.EOL();
}
void RSReductionDescriptor::Dump(lldb_private::Stream &stream) const {
- stream.Indent(m_reduce_name.AsCString());
+ stream.Indent(m_reduce_name.GetStringRef());
stream.IndentMore();
stream.EOL();
stream.Indent();