[Tizen] Add a config knob for importing ibc files
authorSwift Kim <swift.kim@samsung.com>
Thu, 1 Aug 2019 06:10:49 +0000 (15:10 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Wed, 22 Apr 2020 10:19:59 +0000 (19:19 +0900)
Documentation/project-docs/clr-configuration-knobs.md
src/inc/clrconfigvalues.h
src/zap/zapimage.cpp

index 9786bc4..4e9a772 100644 (file)
@@ -283,6 +283,7 @@ Name | Description | Type | Class | Default Value | Flags
 `DisableHotCold` | Master hot/cold splitting switch in Jit64 | `DWORD` | `UNSUPPORTED` | |
 `DisableIBC` | Disables the use of IBC data | `DWORD` | `UNSUPPORTED` | `0` | REGUTIL_default
 `UseIBCFile` |  | `DWORD` | `EXTERNAL` | `0` | REGUTIL_default
+`IBCFileDir` | Directory to search for IBC files | `STRING` | `EXTERNAL` | |
 
 #### Interop Configuration Knobs
 
index 2cb127c..98e03e0 100644 (file)
@@ -325,7 +325,7 @@ RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1,
 RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_DisableHotCold, W("DisableHotCold"), "Master hot/cold splitting switch in Jit64")
 RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data", CLRConfig::REGUTIL_default)
 RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "", CLRConfig::REGUTIL_default)
-
+RETAIL_CONFIG_STRING_INFO(EXTERNAL_IBCFileDir, W("IBCFileDir"), "Directory to search for IBC files")
 
 ///
 /// JIT
index 4a11405..228ef2a 100644 (file)
@@ -2475,7 +2475,20 @@ HRESULT ZapImage::LocateProfileData()
     // Couldn't find profile resource--let's see if there's an ibc file to use instead
     //
 
-    SString path(m_pModuleFileName);
+    SString path;
+
+    LPWSTR ibcDir = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_IBCFileDir);
+    if (ibcDir != NULL)
+    {
+        LPCWSTR moduleFileName = wcsrchr(m_pModuleFileName, DIRECTORY_SEPARATOR_CHAR_W);
+        path.Set(ibcDir);
+        path.Append(DIRECTORY_SEPARATOR_CHAR_W);
+        path.Append(moduleFileName);
+    }
+    else
+    {
+        path.Set(m_pModuleFileName); // the same directory as the IL dll
+    }
 
     SString::Iterator dot = path.End();
     if (path.FindBack(dot, '.'))