aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime/RenderScript
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:59 +0000
commitcce7c2b0d24e364b1907670cf6f843531e5fe052 (patch)
treedc8d10317720644d161fe86b0933b71e87ed0842 /source/Plugins/LanguageRuntime/RenderScript
parent14f1b3e8826ce43b978db93a62d1166055db5394 (diff)
downloadsrc-cce7c2b0d24e364b1907670cf6f843531e5fe052.tar.gz
src-cce7c2b0d24e364b1907670cf6f843531e5fe052.zip
Notes
Notes: svn path=/vendor/lldb/dist/; revision=311325 svn path=/vendor/lldb/lldb-trunk-r291012/dist/; revision=311335; tag=vendor/lldb/lldb-trunk-r291015
Diffstat (limited to 'source/Plugins/LanguageRuntime/RenderScript')
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp47
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h7
2 files changed, 53 insertions, 1 deletions
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index 82473fba065b..ae907ac8dfbb 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -2854,6 +2854,11 @@ bool RenderScriptRuntime::LoadModule(const lldb::ModuleSP &module_sp) {
module_desc.reset(new RSModuleDescriptor(module_sp));
if (module_desc->ParseRSInfo()) {
m_rsmodules.push_back(module_desc);
+ module_desc->WarnIfVersionMismatch(GetProcess()
+ ->GetTarget()
+ .GetDebugger()
+ .GetAsyncOutputStream()
+ .get());
module_loaded = true;
}
if (module_loaded) {
@@ -2923,6 +2928,25 @@ void RenderScriptRuntime::Update() {
}
}
+void RSModuleDescriptor::WarnIfVersionMismatch(lldb_private::Stream *s) const {
+ if (!s)
+ return;
+
+ if (m_slang_version.empty() || m_bcc_version.empty()) {
+ s->PutCString("WARNING: Unknown bcc or slang (llvm-rs-cc) version; debug "
+ "experience may be unreliable");
+ s->EOL();
+ } else if (m_slang_version != m_bcc_version) {
+ s->Printf("WARNING: The debug info emitted by the slang frontend "
+ "(llvm-rs-cc) used to build this module (%s) does not match the "
+ "version of bcc used to generate the debug information (%s). "
+ "This is an unsupported configuration and may result in a poor "
+ "debugging experience; proceed with caution",
+ m_slang_version.c_str(), m_bcc_version.c_str());
+ s->EOL();
+ }
+}
+
bool RSModuleDescriptor::ParsePragmaCount(llvm::StringRef *lines,
size_t n_lines) {
// Skip the pragma prototype line
@@ -2990,6 +3014,22 @@ bool RSModuleDescriptor::ParseExportReduceCount(llvm::StringRef *lines,
return true;
}
+bool RSModuleDescriptor::ParseVersionInfo(llvm::StringRef *lines,
+ size_t n_lines) {
+ // Skip the versionInfo line
+ ++lines;
+ for (; n_lines--; ++lines) {
+ // We're only interested in bcc and slang versions, and ignore all other
+ // versionInfo lines
+ const auto kv_pair = lines->split(" - ");
+ if (kv_pair.first == "slang")
+ m_slang_version = kv_pair.second.str();
+ else if (kv_pair.first == "bcc")
+ m_bcc_version = kv_pair.second.str();
+ }
+ return true;
+}
+
bool RSModuleDescriptor::ParseExportForeachCount(llvm::StringRef *lines,
size_t n_lines) {
// Skip the exportForeachCount line
@@ -3054,7 +3094,8 @@ bool RSModuleDescriptor::ParseRSInfo() {
eExportReduce,
ePragma,
eBuildChecksum,
- eObjectSlot
+ eObjectSlot,
+ eVersionInfo,
};
const auto rs_info_handler = [](llvm::StringRef name) -> int {
@@ -3070,6 +3111,7 @@ bool RSModuleDescriptor::ParseRSInfo() {
// script
.Case("pragmaCount", ePragma)
.Case("objectSlotCount", eObjectSlot)
+ .Case("versionInfo", eVersionInfo)
.Default(-1);
};
@@ -3108,6 +3150,9 @@ bool RSModuleDescriptor::ParseRSInfo() {
case ePragma:
success = ParsePragmaCount(line, n_lines);
break;
+ case eVersionInfo:
+ success = ParseVersionInfo(line, n_lines);
+ break;
default: {
if (log)
log->Printf("%s - skipping .rs.info field '%s'", __FUNCTION__,
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
index a1211a2814b7..5b2bb57ac8c8 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
@@ -203,6 +203,11 @@ struct RSReductionDescriptor {
};
class RSModuleDescriptor {
+ std::string m_slang_version;
+ std::string m_bcc_version;
+
+ bool ParseVersionInfo(llvm::StringRef *, size_t n_lines);
+
bool ParseExportForeachCount(llvm::StringRef *, size_t n_lines);
bool ParseExportVarCount(llvm::StringRef *, size_t n_lines);
@@ -222,6 +227,8 @@ public:
void Dump(Stream &strm) const;
+ void WarnIfVersionMismatch(Stream *s) const;
+
const lldb::ModuleSP m_module;
std::vector<RSKernelDescriptor> m_kernels;
std::vector<RSGlobalDescriptor> m_globals;