summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangwook Kim <swift.kim@samsung.com>2020-02-18 06:48:15 (GMT)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>2020-03-23 00:43:33 (GMT)
commita11d29b4d38663421fb5d6914cb1a7b2e6bc92f8 (patch)
treea67596a70bdaef1ee9ed5f385f4ba9da9fcca84a
parent96426f220e8965eea7b402f0635e054b68ed40b6 (diff)
downloadcoreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.zip
coreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.tar.gz
coreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.tar.bz2
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.
-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 36235d6..6ef769d 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -6426,6 +6426,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;