}
void AppExecutor::CheckAndPrepareDebugging() {
+ auto& debug = Debug::GetInst();
auto& b = app_info_->GetBundle();
if (b.GetType(kAulSdk) != BUNDLE_TYPE_NONE)
- Debug::GetInst().Prepare(b);
+ debug.Prepare(b);
- Debug::GetInst().CheckWebAppDebugging(b);
+ debug.CheckAndSetAsanActivation(app_info_->GetAppId());
+ debug.CheckWebAppDebugging(b);
}
LauncherInfoPtr AppExecutor::FindLauncherInfo(const std::string& app_type) {
debugger_info_->GetExtraEnvList());
}
- auto appid = b.GetString(kAulAppId);
- if (CheckAsanApp(appid))
- const_cast<tizen_base::Bundle&>(b).Add(kAulTizenAsanActivation, "true");
-
debug_argv_ = debugger_info_->GetDefaultOptList();
if (!debugger_info_->GetExe().empty())
debug_argv_.insert(debug_argv_.begin(), debugger_info_->GetExe());
return asan_app_map_.find(appid) != asan_app_map_.end();
}
+void Debug::CheckAndSetAsanActivation(const std::string& appid) {
+ if (CheckAsanApp(appid)) {
+ _W("Set TIZEN_ASAN_ACTIVATION. appid: %s", appid.c_str());
+ setenv(kTizenAsanActivation, "1", 1);
+ }
+}
+
std::vector<std::string> Debug::GetExtraArgv() const { return extra_argv_; }
std::vector<std::string> Debug::GetArgv() const { return debug_argv_; }
auto debugger = request.GetString(kAulSdk);
if (debugger.empty()) return;
- if (debugger == "ASAN" ||
- request.GetString(kAulTizenAsanActivation) == "true")
+ if (debugger == "ASAN")
setenv(kTizenAsanActivation, "1", 1);
ParseAndRedirectStandardFds(request);
std::vector<std::string> GetArgv() const;
bool ShouldAttach() const;
bool CheckAsanApp(const std::string& appid);
+ void CheckAndSetAsanActivation(const std::string& appid);
void Prepare(const tizen_base::Bundle& request);
void ChangeMountNamespace();
void CheckWebAppDebugging(const tizen_base::Bundle& request);