Enable gdbjit while NI file exist 62/164262/1 accepted/tizen/4.0/unified/20180102.065619 submit/tizen_4.0/20171229.060354
authorchunseok lee <chunseok.lee@samsung.com>
Mon, 18 Dec 2017 05:23:08 +0000 (14:23 +0900)
committerchunseok lee <chunseok.lee@samsung.com>
Mon, 18 Dec 2017 08:00:33 +0000 (17:00 +0900)
upstream cherry pick(https://github.com/dotnet/coreclr/pull/15501)

Change-Id: Id65783c9af70e2ff907a83f923d00123fee96fd8
Signed-off-by: chunseok lee <chunseok.lee@samsung.com>
packaging/0001-Enable-gdbjit-while-NI-file-exist.patch [new file with mode: 0644]
packaging/coreclr.spec

diff --git a/packaging/0001-Enable-gdbjit-while-NI-file-exist.patch b/packaging/0001-Enable-gdbjit-while-NI-file-exist.patch
new file mode 100644 (file)
index 0000000..9668464
--- /dev/null
@@ -0,0 +1,36 @@
+From 7702a18197fa51dfbb19c352a0371d95d6030156 Mon Sep 17 00:00:00 2001
+From: chunseok lee <chunseok.lee@samsung.com>
+Date: Thu, 14 Dec 2017 10:04:03 +0900
+Subject: [PATCH] Enable gdbjit while NI file exist
+
+Signed-off-by: chunseok lee <chunseok.lee@samsung.com>
+---
+ src/vm/gdbjit.cpp | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/vm/gdbjit.cpp b/src/vm/gdbjit.cpp
+index 50f1bb2..5bf0524 100644
+--- a/src/vm/gdbjit.cpp
++++ b/src/vm/gdbjit.cpp
+@@ -2477,6 +2477,18 @@ void NotifyGdb::OnMethodCompiled(MethodDesc* methodDescPtr)
+     }
+ #endif
++    // remove '.ni.dll' or '.ni.exe' suffix from wszModuleFile
++    LPWSTR pNIExt = const_cast<LPWSTR>(wcsstr(wszModuleFile, W(".ni.exe"))); // where '.ni.exe' start at 
++    if (!pNIExt)
++    {
++      pNIExt = const_cast<LPWSTR>(wcsstr(wszModuleFile, W(".ni.dll"))); // where '.ni.dll' start at 
++    }
++
++    if (pNIExt)
++    {
++      wcscpy(pNIExt, W(".dll"));
++    }
++
+     if (isListedModule(wszModuleFile))
+     {
+         bool bEmitted = EmitDebugInfo(elfBuilder, methodDescPtr, pCode, codeSize, szModuleFile);
+-- 
+2.7.4
+
index 1af5bba..5ae7c2b 100644 (file)
@@ -23,7 +23,7 @@ Source1000: downloaded_files.tar.gz
 Source1001: %{name}.manifest
 Source1002: libicu.tar.gz
 Source1003: dep_libs.tar.gz
-# Gbp-Ignore-Patches: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
+# Gbp-Ignore-Patches: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
 Patch0:     0001-Add-project.assets.json-files.patch
 Patch1:     0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch
 Patch2:     0002-x86-Linux-Thread-safe-UMThunkMarshInfo-RunTimeInit-1.patch
@@ -63,6 +63,7 @@ Patch35:     0001-Fix-clrstack-command-of-lldb-sosplugin-on-x86-13973.patch
 Patch36:     0001-Fix-typo-in-SetDebuggerREGDISPLAYFromREGDISPLAY-1422.patch
 Patch37:     0001-Use-addresses-without-sign-extension-in-lldb-plugin-.patch
 Patch38:     0001-Fix-uaf-in-DestroyThread-function.patch
+Patch39:     0001-Enable-gdbjit-while-NI-file-exist.patch
 
 ExcludeArch: aarch64
 
@@ -200,6 +201,7 @@ cp %{SOURCE1001} .
 %patch36 -p1
 %patch37 -p1
 %patch38 -p1
+%patch39 -p1
 
 %if 0%{skipmscorlib}
 %else