diff options
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/daccess/nidump.cpp | 43 | ||||
-rw-r--r-- | src/debug/daccess/nidump.h | 9 |
2 files changed, 38 insertions, 14 deletions
diff --git a/src/debug/daccess/nidump.cpp b/src/debug/daccess/nidump.cpp index e948687c0e..b6d7da7090 100644 --- a/src/debug/daccess/nidump.cpp +++ b/src/debug/daccess/nidump.cpp @@ -5907,7 +5907,9 @@ void NativeImageDumper::DumpTypes(PTR_Module module) for (COUNT_T i = 0; i < slotChunkCount; ++i) { - DumpMethodTableSlotChunk(m_discoveredSlotChunks[i].addr, m_discoveredSlotChunks[i].nSlots); + DumpMethodTableSlotChunk(m_discoveredSlotChunks[i].addr, + m_discoveredSlotChunks[i].nSlots, + m_discoveredSlotChunks[i].isRelative); } } DisplayEndArray( "Total MethodTableSlotChunks", METHODTABLES ); @@ -7172,8 +7174,9 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name, while (itIndirect.Next()) { SlotChunk sc; - sc.addr = itIndirect.GetIndirectionSlot(); + sc.addr = dac_cast<TADDR>(itIndirect.GetIndirectionSlot()); sc.nSlots = (WORD)itIndirect.GetNumSlots(); + sc.isRelative = MethodTable::VTableIndir2_t::isRelative; m_discoveredSlotChunks.AppendEx(sc); } @@ -7185,7 +7188,7 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name, DisplayStartElement( "Slot", ALWAYS ); DisplayWriteElementInt( "Index", i, ALWAYS ); TADDR base = dac_cast<TADDR>(&(mt->GetVtableIndirections()[i])); - PTR_PCODE tgt = MethodTable::VTableIndir_t::GetValueMaybeNullAtPtr(base); + DPTR(MethodTable::VTableIndir2_t) tgt = MethodTable::VTableIndir_t::GetValueMaybeNullAtPtr(base); DisplayWriteElementPointer( "Pointer", DataPtrToDisplay(dac_cast<TADDR>(tgt)), ALWAYS ); @@ -7207,8 +7210,9 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name, DisplayEndElement( ALWAYS ); //Slot SlotChunk sc; - sc.addr = tgt; + sc.addr = dac_cast<TADDR>(tgt); sc.nSlots = (mt->GetNumVtableSlots() - mt->GetNumVirtuals()); + sc.isRelative = false; m_discoveredSlotChunks.AppendEx(sc); } else if (mt->HasSingleNonVirtualSlot()) @@ -7344,25 +7348,42 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name, #endif void -NativeImageDumper::DumpMethodTableSlotChunk( PTR_PCODE slotChunk, COUNT_T numSlots ) +NativeImageDumper::DumpMethodTableSlotChunk( TADDR slotChunk, COUNT_T numSlots, bool isRelative ) { IF_OPT( METHODTABLES ) { - DisplayStartStructure( "MethodTableSlotChunk", DPtrToPreferredAddr(slotChunk), numSlots * sizeof(PCODE), - METHODTABLES ); + COUNT_T slotsSize; + if (isRelative) + { + slotsSize = numSlots * sizeof(RelativePointer<PCODE>); + } + else + { + slotsSize = numSlots * sizeof(PCODE); + } + DisplayStartStructure( "MethodTableSlotChunk", DataPtrToDisplay(slotChunk), slotsSize, METHODTABLES ); IF_OPT(VERBOSE_TYPES) { DisplayStartList( W("[%-4s]: %s (%s)"), ALWAYS ); for( unsigned i = 0; i < numSlots; ++i ) { - DumpSlot(i, slotChunk[i]); + PCODE target; + if (isRelative) + { + target = RelativePointer<PCODE>::GetValueMaybeNullAtPtr(slotChunk + i * sizeof(RelativePointer<PCODE>)); + } + else + { + target = dac_cast<PTR_PCODE>(slotChunk)[i]; + } + + DumpSlot(i, target); } DisplayEndList( ALWAYS ); //Slot list } else - CoverageRead( PTR_TO_TADDR(slotChunk), - numSlots * sizeof(PCODE) ); + CoverageRead( slotChunk, slotsSize ); DisplayEndStructure(ALWAYS); //Slot chunk } } @@ -7735,7 +7756,7 @@ void NativeImageDumper::DumpMethodDesc( PTR_MethodDesc md, PTR_Module module ) } if ( md->HasNonVtableSlot() ) { - DisplayWriteElementInt( "Slot", (DWORD)(PTR_TO_TADDR(md->GetAddrOfSlot()) - PTR_TO_TADDR(md)), ALWAYS); + DisplayWriteElementInt( "Slot", (DWORD)(md->GetAddrOfSlot() - PTR_TO_TADDR(md)), ALWAYS); } if (md->HasNativeCodeSlot()) { diff --git a/src/debug/daccess/nidump.h b/src/debug/daccess/nidump.h index fc57e4bf7f..ac1c093f6a 100644 --- a/src/debug/daccess/nidump.h +++ b/src/debug/daccess/nidump.h @@ -194,7 +194,7 @@ public: PTR_Module module ); #ifndef STUB_DISPATCH_ALL - void DumpMethodTableSlotChunk( PTR_PCODE slotChunk, COUNT_T size ); + void DumpMethodTableSlotChunk( TADDR slotChunk, COUNT_T size, bool ); #endif void DumpSlot( unsigned index, PCODE tgt ); @@ -478,6 +478,8 @@ private: template<typename T> TADDR DPtrToPreferredAddr( T ptr ); + TADDR DPtrToPreferredAddr( TADDR tptr ); + void DumpAssemblySignature(CORCOMPILE_ASSEMBLY_SIGNATURE & assemblySignature); SIZE_T CountFields( PTR_MethodTable mt ); @@ -500,12 +502,13 @@ private: struct SlotChunk { - PTR_PCODE addr; + TADDR addr; WORD nSlots; + bool isRelative; inline bool operator==(const SlotChunk& sc) const { - return (addr == sc.addr) && (nSlots == sc.nSlots); + return (addr == sc.addr) && (nSlots == sc.nSlots) && (isRelative == sc.isRelative); } inline bool operator<(const SlotChunk& sc) const |