summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Chen <jochen@microsoft.com>2016-04-18 16:38:39 -0700
committerJohn Chen <jochen@microsoft.com>2016-04-18 16:38:39 -0700
commitcd998ae421bb8fb68f170de8f016940084cf19e6 (patch)
tree2f1aaacfe64974b0e2062e22584a68aad8d7ccef
parent83e52facfec1ae6002ed9d0a474c300ab3dbe2fe (diff)
downloadcoreclr-cd998ae421bb8fb68f170de8f016940084cf19e6.tar.gz
coreclr-cd998ae421bb8fb68f170de8f016940084cf19e6.tar.bz2
coreclr-cd998ae421bb8fb68f170de8f016940084cf19e6.zip
Fix nidump to avoid crashing while working with Ready to Run images
[tfs-changeset: 1597064]
-rw-r--r--src/debug/daccess/nidump.cpp2
-rw-r--r--src/vm/nativeformatreader.h6
-rw-r--r--src/vm/readytoruninfo.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/debug/daccess/nidump.cpp b/src/debug/daccess/nidump.cpp
index 9b4fe1c176..29c326debe 100644
--- a/src/debug/daccess/nidump.cpp
+++ b/src/debug/daccess/nidump.cpp
@@ -9324,7 +9324,7 @@ void NativeImageDumper::DumpReadyToRun()
IMAGE_DATA_DIRECTORY * pEntryPointsDir = FindReadyToRunSection(READYTORUN_SECTION_METHODDEF_ENTRYPOINTS);
if (pEntryPointsDir != NULL)
- m_methodDefEntryPoints = NativeFormat::NativeArray(&m_nativeReader, pEntryPointsDir->VirtualAddress);
+ m_methodDefEntryPoints = NativeFormat::NativeArray((TADDR)&m_nativeReader, pEntryPointsDir->VirtualAddress);
DisplayStartCategory("NativeInfo", NATIVE_INFO);
diff --git a/src/vm/nativeformatreader.h b/src/vm/nativeformatreader.h
index a410884626..fc5391ca05 100644
--- a/src/vm/nativeformatreader.h
+++ b/src/vm/nativeformatreader.h
@@ -240,9 +240,9 @@ namespace NativeFormat
{
}
- NativeParser(NativeReader * pReader, uint offset)
+ NativeParser(PTR_NativeReader pReader, uint offset)
{
- _pReader = dac_cast<PTR_NativeReader>(pReader);
+ _pReader = pReader;
_offset = offset;
}
@@ -313,7 +313,7 @@ namespace NativeFormat
{
}
- NativeArray(NativeReader * pReader, uint offset)
+ NativeArray(PTR_NativeReader pReader, uint offset)
: _pReader(pReader)
{
uint val;
diff --git a/src/vm/readytoruninfo.cpp b/src/vm/readytoruninfo.cpp
index 158a23370f..56dc506b1b 100644
--- a/src/vm/readytoruninfo.cpp
+++ b/src/vm/readytoruninfo.cpp
@@ -342,7 +342,7 @@ PTR_BYTE ReadyToRunInfo::GetDebugInfo(PTR_RUNTIME_FUNCTION pRuntimeFunction)
SIZE_T methodIndex = pRuntimeFunction - m_pRuntimeFunctions;
_ASSERTE(methodIndex < m_nRuntimeFunctions);
- NativeArray debugInfoIndex(&m_nativeReader, pDebugInfoDir->VirtualAddress);
+ NativeArray debugInfoIndex(dac_cast<PTR_NativeReader>(PTR_HOST_INT_TO_TADDR(&m_nativeReader)), pDebugInfoDir->VirtualAddress);
uint offset;
if (!debugInfoIndex.TryGetAt((DWORD)methodIndex, &offset))