diff options
author | Sangwook Kim <swift.kim@samsung.com> | 2020-02-18 15:48:15 +0900 |
---|---|---|
committer | 이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com> | 2020-03-23 09:43:33 +0900 |
commit | a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8 (patch) | |
tree | a67596a70bdaef1ee9ed5f385f4ba9da9fcca84a | |
parent | 96426f220e8965eea7b402f0635e054b68ed40b6 (diff) | |
download | coreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.tar.gz coreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.tar.bz2 coreclr-a11d29b4d38663421fb5d6914cb1a7b2e6bc92f8.zip |
[Tizen] Add FEATURE_LARGEADDRESS_SUPPORTsubmit/tizen_5.5/20200323.035211submit/tizen/20200323.035150accepted/tizen/unified/20200323.172942accepted/tizen/5.5/unified/20200323.072150
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.txt | 4 | ||||
-rw-r--r-- | src/vm/eventpipeblock.cpp | 6 | ||||
-rw-r--r-- | src/vm/eventtrace.cpp | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt index c90c955003..10f8d340aa 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 fb9d6c721e..d510ec8adf 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 36235d605b..6ef769dc94 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; |