summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSangwook Kim <swift.kim@samsung.com>2020-02-18 06:48:15 (GMT)
committerGleb Balykov <g.balykov@samsung.com>2020-03-25 12:29:41 (GMT)
commit0a3525c6541f6151df57debcbefe829d6e017045 (patch)
tree115c45d04655536e7d2104a2cd323e9a46f4eb5e /src
parentb2841b4cad8cd96d2de6f8bf5f35f59a819d7410 (diff)
downloadcoreclr-0a3525c6541f6151df57debcbefe829d6e017045.zip
coreclr-0a3525c6541f6151df57debcbefe829d6e017045.tar.gz
coreclr-0a3525c6541f6151df57debcbefe829d6e017045.tar.bz2
[Tizen] Add FEATURE_LARGEADDRESS_SUPPORT
Many diagnostic tools are unaware of 32-bit applications which have large address spaces (> 2GB). Such tools include the TraceEvent library (required by PerfView and dotnet-trace), and Visual Studio. They assume the address range 0x80000000 through 0xFFFFFFFF as the system space and thus often fail to read symbols from event traces generated by CoreCLR. This workaround is to support such scenarios by simply discarding MSBs of 32-bit instruction pointer values in the trace output. Only a minimal set of values required for symbol resolution are affected by this change. Beware that you will have to manually restore the original values when you inspect them in lldb or etc.
Diffstat (limited to 'src')
-rw-r--r--src/vm/CMakeLists.txt4
-rw-r--r--src/vm/eventpipeblock.cpp6
-rw-r--r--src/vm/eventtrace.cpp3
3 files changed, 13 insertions, 0 deletions
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt
index c90c955..10f8d34 100644
--- a/src/vm/CMakeLists.txt
+++ b/src/vm/CMakeLists.txt
@@ -38,6 +38,10 @@ if(FEATURE_JIT_PITCHING)
add_definitions(-DFEATURE_JIT_PITCHING)
endif(FEATURE_JIT_PITCHING)
+if(FEATURE_EVENT_TRACE AND NOT _TARGET_64BIT_)
+ add_definitions(-DFEATURE_LARGEADDRESS_SUPPORT)
+endif()
+
set(VM_SOURCES_DAC_AND_WKS_COMMON
appdomain.cpp
array.cpp
diff --git a/src/vm/eventpipeblock.cpp b/src/vm/eventpipeblock.cpp
index fb9d6c7..d510ec8 100644
--- a/src/vm/eventpipeblock.cpp
+++ b/src/vm/eventpipeblock.cpp
@@ -457,6 +457,12 @@ bool EventPipeStackBlock::WriteStack(DWORD stackId, StackContents* pStack)
if (stackSize > 0)
{
memcpy(m_pWritePointer, pStack->GetPointer(), stackSize);
+#ifdef FEATURE_LARGEADDRESS_SUPPORT
+ for (int i = 0; i < stackSize / sizeof(UINT_PTR); i++)
+ {
+ ((UINT_PTR*)m_pWritePointer)[i] &= INT_MAX;
+ }
+#endif // FEATURE_LARGEADDRESS_SUPPORT
m_pWritePointer += stackSize;
}
diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp
index ec09400..651cac7 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -6428,6 +6428,9 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio
codeInfo.GetMethodRegionInfo(&methodRegionInfo);
ullMethodStartAddress = (ULONGLONG)methodRegionInfo.hotStartAddress;
+#ifdef FEATURE_LARGEADDRESS_SUPPORT
+ ullMethodStartAddress &= INT_MAX;
+#endif
ulMethodSize = (ULONG)methodRegionInfo.hotSize;
ullModuleID = (ULONGLONG)(TADDR) pModule;