MS decided not to show ILOffset info as default in exception info.
To enable that feature, "Switch.System.Diagnostics.StackTrace.ShowILOffsets" switch should be set true.
An internal API for setting app context switch in dotnet-launcher has been added.
And, "Switch.System.Diagnostics.StackTrace.ShowILOffsets" is enabled defaultly.
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Runtime
+{
+ public class AppSetting
+ {
+ private static void SetSwitch(string name, bool value)
+ {
+ Console.WriteLine($"Set {name} switch to {value}");
+ AppContext.SetSwitch(name, value);
+ }
+ }
+}
const char* entryPointMethodName,
void** delegate);
- typedef bool (*set_environment_variable_ptr)(const char* name,
- const char* value);
-
- typedef bool (*stop_profile_after_delay_ptr)(int sec);
-
- typedef int (*multi_byte_to_wide_char_ptr)(
- unsigned int CodePage,
- unsigned int dwFlags,
- const char * lpMultiByteStr,
- int cbMultiByte,
- char16_t * lpWideCharStr,
- int cchWideChar);
-
typedef int (*coreclr_preload_assembly_ptr)(
const char* assemblyPath);
}
static coreclr_create_delegate_ptr createDelegate = nullptr;
static set_environment_variable_ptr setEnvironmentVariable = nullptr;
static stop_profile_after_delay_ptr stopProfileAfterDelay = nullptr;
+static set_switch_ptr setSwitch = nullptr;
static void* __coreclrLib = nullptr;
static void* __hostHandle = nullptr;
static unsigned int __domainId = -1;
return -1;
}
+ st = createDelegate(__hostHandle, __domainId, "Tizen.Runtime", "Tizen.Runtime.AppSetting", "SetSwitch", (void**)&setSwitch);
+ if (st < 0 || setSwitch == nullptr) {
+ _ERR("Create delegate for Tizen.Runtime.dll -> Tizen.Runtime.AppSetting -> SetSwitch failed (0x%08x)", st);
+ return -1;
+ }
+
if (launchMode == LaunchMode::loader) {
// terminate candidate process if language is changed.
// CurrentCulture created for preloaded dlls should be updated.
free(localDataPath);
}
+ setSwitch("Switch.System.Diagnostics.StackTrace.ShowILOffsets", true);
+
vconf_ignore_key_changed(VCONFKEY_LANGSET, langChangedCB);
pluginBeforeExecute();
namespace runtime {
namespace dotnetcore {
+typedef bool (*set_environment_variable_ptr)(const char* name, const char* value);
+typedef bool (*stop_profile_after_delay_ptr)(int sec);
+typedef bool (*set_switch_ptr)(const char* name, bool value);
+
class CoreRuntime
{
public: