Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
481 changes: 310 additions & 171 deletions src/SOS/Strike/eeheap.cpp

Large diffs are not rendered by default.

356 changes: 178 additions & 178 deletions src/SOS/Strike/gcroot.cpp

Large diffs are not rendered by default.

157 changes: 95 additions & 62 deletions src/SOS/Strike/sos.cpp

Large diffs are not rendered by default.

61 changes: 31 additions & 30 deletions src/SOS/Strike/sos.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace sos
* mt - The address of the MethodTable to test for.
*/
static bool IsZombie(TADDR mt);

/* Returns the method table for arrays.
*/
inline static TADDR GetArrayMT()
Expand Down Expand Up @@ -164,7 +164,7 @@ namespace sos
{
return GetFreeMT() == mt;
}

/* Returns true if the given method table is that of an Array.
*/
inline static bool IsArrayMT(TADDR mt)
Expand All @@ -178,7 +178,7 @@ namespace sos
{
return GetStringMT() == mt;
}

inline static bool IsValid(TADDR mt)
{
DacpMethodTableData data;
Expand All @@ -190,15 +190,15 @@ namespace sos
: mMT(mt), mName(0)
{
}

MethodTable(const MethodTable &mt)
: mMT(mt.mMT), mName(mt.mName)
{
// Acquire the calculated mName field. Since we are making a copy, we will likely use
// the copy instead of the original.
mt.mName = NULL;
}

const MethodTable &operator=(const MethodTable &mt)
{
Clear();
Expand All @@ -208,10 +208,10 @@ namespace sos
mMT = mt.mMT;
mName = mt.mName;
mt.mName = NULL;

return *this;
}

~MethodTable()
{
Clear();
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace sos
* true will make IsValid return less false positives.
*/
static bool IsValid(TADDR address, bool verifyFields=false);

static int GetStringDataOffset()
{
#ifndef _TARGET_WIN64_
Expand All @@ -279,14 +279,14 @@ namespace sos
* Exception - if addr is misaligned.
*/
Object(TADDR addr, TADDR mt);

Object(const Object &rhs);

inline ~Object()
{
if (mMTData)
delete mMTData;

if (mTypeName)
delete mTypeName;
}
Expand Down Expand Up @@ -320,15 +320,15 @@ namespace sos
* DataRead - we failed to read the object header.
*/
ULONG GetHeader() const;

/* Gets the header for the current object, does not throw any exception.
* Params:
* outHeader - filled with the header if this function was successful.
* Returns:
* True if we successfully read the object header, false otherwise.
*/
bool TryGetHeader(ULONG &outHeader) const;

/* Returns the method table of the object this represents.
* Throws:
* DataRead - If we failed to read the method table from the address.
Expand All @@ -338,7 +338,7 @@ namespace sos
* verification here.)
*/
TADDR GetMT() const;

/* Returns the component method table of the object. For example, if
* this object is an array, the method table will be the general array
* MT. Calling this function tells you what type of objects can be
Expand Down Expand Up @@ -453,19 +453,19 @@ namespace sos
RefIterator(TADDR obj, LinearReadCache *cache = NULL);
RefIterator(TADDR obj, CGCDesc *desc, bool arrayOfVC, LinearReadCache *cache = NULL);
~RefIterator();

/* Moves to the next reference in the object.
*/
const RefIterator &operator++();

/* Returns the address of the current reference.
*/
TADDR operator*() const;

/* Gets the offset into the object where the current reference comes from.
*/
TADDR GetOffset() const;

/* Returns true if there are more objects in the iteration, false otherwise.
* Used as:
* if (itr)
Expand All @@ -480,7 +480,7 @@ namespace sos
{
return mLoaderAllocatorObjectHandle == mCurr;
}

private:
void Init();
inline TADDR ReadPointer(TADDR addr) const
Expand All @@ -494,22 +494,22 @@ namespace sos
{
MOVE(addr, addr);
}

return addr;
}

private:
LinearReadCache *mCache;
CGCDesc *mGCDesc;
bool mArrayOfVC, mDone;

TADDR *mBuffer;
CGCDescSeries *mCurrSeries;

TADDR mLoaderAllocatorObjectHandle;

int i, mCount;

TADDR mCurr, mStop, mObject;
size_t mObjSize;
};
Expand Down Expand Up @@ -612,7 +612,7 @@ namespace sos
void MoveToNextObjectCarefully();

private:
ObjectIterator(const DacpGcHeapDetails *heap, int numHeaps, TADDR start, TADDR stop);
ObjectIterator(const GCHeapDetails *heap, int numHeaps, TADDR start, TADDR stop);

bool VerifyObjectMembers(__out_ecount(size) char *buffer, size_t size) const;
void BuildError(__out_ecount(count) char *out, size_t count, const char *format, ...) const;
Expand All @@ -625,10 +625,11 @@ namespace sos
private:
DacpHeapSegmentData mSegment;
bool bLarge;
bool bPinned;
Object mCurrObj;
TADDR mLastObj, mStart, mEnd, mSegmentEnd;
AllocInfo mAllocInfo;
const DacpGcHeapDetails *mHeaps;
const GCHeapDetails *mHeaps;
int mNumHeaps;
int mCurrHeap;
};
Expand All @@ -649,7 +650,7 @@ namespace sos
* DataRead - if we could not read the syncblk entry for the given index.
*/
explicit SyncBlk(int index);

/* Returns whether or not the current entry is a "Free" SyncBlk table entry
* or not. This should be called *before* any other function here.
*/
Expand Down Expand Up @@ -736,7 +737,7 @@ namespace sos
int mCurr, mTotal;
SyncBlk mSyncBlk;
};

/* An class which contains information about the GCHeap.
*/
class GCHeap
Expand Down Expand Up @@ -779,7 +780,7 @@ namespace sos
bool AreGCStructuresValid() const;

private:
DacpGcHeapDetails *mHeaps;
GCHeapDetails *mHeaps;
DacpGcHeapData mHeapData;
int mNumHeaps;
};
Expand All @@ -795,7 +796,7 @@ namespace sos
{
return Object::IsValid(TO_TADDR(addr), verifyFields);
}


void BuildTypeWithExtraInfo(TADDR addr, unsigned int size, __inout_ecount(size) WCHAR *buffer);
}
Loading