Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added full support for .NET Core
  • Loading branch information
Rodney Viana committed Aug 30, 2018
1 parent 8982987 commit 79e7774
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 19 deletions.
File renamed without changes.
Binary file added Binaries/NetExt-2.1.38.5000.zip
Binary file not shown.
Binary file modified Binaries/README.md
Binary file not shown.
Binary file modified Binaries/x86/NetExt.dll
Binary file not shown.
Binary file modified Binaries/x86/NetExtShim.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions ClrMemDiagExt/Properties/AssemblyInfo.cs
Expand Up @@ -22,5 +22,5 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f12c38b7-0893-4208-ab3d-54c3f8d1c01e")]

[assembly: AssemblyVersion("2.1.37.5000")]
[assembly: AssemblyFileVersion("2.1.37.5000")]
[assembly: AssemblyVersion("2.1.38.5000")]
[assembly: AssemblyFileVersion("2.1.38.5000")]
9 changes: 5 additions & 4 deletions NetExt/CLRHelper.cpp
Expand Up @@ -266,7 +266,7 @@ std::wstring EEClass::GetEnumString(CLRDATA_ADDRESS& Address)
{
enumStr = enumName;
}
return enumName;
return enumStr;
}

void EEClass::Request(CLRDATA_ADDRESS MTOfType)
Expand Down Expand Up @@ -315,8 +315,8 @@ void EEClass::EnsureFields()
{
if(fields.empty())
{

if(IsCacheHit = fieldsCache.Exists(eeClassData.EEClass))
IsCacheHit = fieldsCache.Exists(eeClassData.EEClass);
if(IsCacheHit)
{
fields = *fieldsCache.Get(eeClassData.EEClass);
return;
Expand Down Expand Up @@ -1390,7 +1390,8 @@ MD_TypeData DumpHeapCache::GetObj(CLRDATA_ADDRESS Address)
// Fix a counting bug for string in .NET 4.0 and beyond
if(obj.MethodTable == commonMTs.StringMethodTable() && (!NET2))
{
obj.arraySize++;
obj.arraySize++;

}
return obj;
};
Expand Down
2 changes: 1 addition & 1 deletion NetExt/CLRHelper.h
Expand Up @@ -995,7 +995,7 @@ class Heap
Heap()
{
heapPtrs = NULL;
currentHeap = -1;
currentHeap = 0;
valid = AreStructuresValid();


Expand Down
8 changes: 7 additions & 1 deletion NetExt/NetExt.cpp
Expand Up @@ -25,7 +25,7 @@ bool isCLRInit = false;

bool NET2 = false;


bool coreCLR = false;

#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
Expand Down Expand Up @@ -392,6 +392,12 @@ HRESULT INIT_API()
{
string clr = EXT_CLASS::Execute("lmv mclr");
NET2 = clr.find("Microsoft") == string::npos;
clr = EXT_CLASS::Execute("lmv mcoreclr");
if(clr.find("Microsoft") != string::npos)
{
coreCLR = true;
NET2 = false;
}
HRESULT hr = S_OK;

if(pTarget != NULL) hr = E_APPLICATION_ACTIVATION_EXEC_FAILURE;
Expand Down
1 change: 1 addition & 0 deletions NetExt/NetExt.h
Expand Up @@ -231,6 +231,7 @@ void CallOutputDml(wchar_t* Text);
long IsManagedInterrupt();

extern bool NET2;
extern bool coreCLR;
HRESULT INIT_API();


Expand Down
Binary file modified NetExt/Release32/CL.read.1.tlog
Binary file not shown.
Binary file modified NetExt/Release32/CL.write.1.tlog
Binary file not shown.
Binary file modified NetExt/Release32/NetExt.res
Binary file not shown.
5 changes: 5 additions & 0 deletions NetExt/Release32/NetExt.write.1.tlog
Expand Up @@ -3,3 +3,8 @@ C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.lib
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.lib
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.exp
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.exp
^C:\Users\rviana\OneDrive\Projects\netext\NetExt\NetExt.vcxproj
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.lib
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.lib
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.exp
C:\Users\rviana\OneDrive\Projects\netext\Release32\NetExt.exp
Binary file modified NetExt/Release32/cl.command.1.tlog
Binary file not shown.
24 changes: 16 additions & 8 deletions NetExt/SpecialCases.cpp
Expand Up @@ -659,7 +659,7 @@ std::string SpecialCases::GetHexArray(CLRDATA_ADDRESS Obj, bool Padded, int Limi
}
if(className == L"System.Char[]" || className == L"System.Int16[]" || className == L"System.UInt16[]" )
{
for(int i=0;i<limit;i++)
for(unsigned int i=0;i<limit;i++)
{
ExtRemoteData ptr(obj.DataPtr()+i*obj.InnerComponentSize(), sizeof(unsigned short));
if(!IsValidMemory(ptr.m_Offset))
Expand Down Expand Up @@ -749,7 +749,10 @@ std::string SpecialCases::PrettyPrint(CLRDATA_ADDRESS Address, CLRDATA_ADDRESS M
{
SVAL v = GetBoxedValue(Address);
if(v.IsValid && v.strValue.size() != 0)
return CW2A(v.strValue.c_str());
{
string ret = CW2A(v.strValue.c_str());
return ret;
}
obj.Request(Address);
}
if(!obj.IsValid())
Expand All @@ -762,13 +765,17 @@ std::string SpecialCases::PrettyPrint(CLRDATA_ADDRESS Address, CLRDATA_ADDRESS M
}

if(obj.IsString())
return CW2A(obj.String().c_str());
{
string ret = CW2A(obj.String().c_str());
return ret;
}

if(methName == L"System.DateTime")
{
ExtRemoteData dt(Address + (MethodTable ? 0 : sizeof(void*)) , sizeof(UINT64));
UINT64 ticks = dt.GetUlong64();
return CW2A(tickstodatetime(ticks).c_str());
string ret = CW2A(tickstodatetime(ticks).c_str());
return ret;
}
if(methName == L"System.TimeSpan")
{
Expand All @@ -786,13 +793,14 @@ std::string SpecialCases::PrettyPrint(CLRDATA_ADDRESS Address, CLRDATA_ADDRESS M
fields.push_back("m_String");
varMap fieldV;
DumpFields(Address,fields,0,&fieldV);

return CW2A(fieldV["m_String"].strValue.c_str());
string ret = CW2A(fieldV["m_String"].strValue.c_str());
return ret;
}

if(methName == L"System.Net.IPEndPoint" || methName == L"System.Net.IPAddress")
{
return CW2A(SpecialCases::IPAddress(Address).c_str());
string ret = CW2A(SpecialCases::IPAddress(Address).c_str());
return ret;
}

if(methName == L"System.DBNull")
Expand Down Expand Up @@ -1584,7 +1592,7 @@ SVAL GetValue(CLRDATA_ADDRESS offset, CorElementType CorType, CLRDATA_ADDRESS Me
{
g_ExtInstancePtr->Out("%S", NameBuffer);
}
response.Value.b=static_cast<bool>(u);
response.Value.b=(u != 0);
response.strValue.assign(NameBuffer);
response.DoubleValue = (double)u;

Expand Down
2 changes: 1 addition & 1 deletion NetExt/VersionInfo.h
Expand Up @@ -8,7 +8,7 @@
#ifndef ver_major
#define ver_major 2
#define ver_minor 1
#define ver_release 37
#define ver_release 38
#define ver_build 5000
#define ver_all(a,b,c,d) a,b,c,d
#define ver_expand(s) #s
Expand Down
2 changes: 1 addition & 1 deletion NetExt/regmatch.cpp
Expand Up @@ -161,6 +161,6 @@ EXT_COMMAND(regmatch,


string cmd(Execute(command));
Out(regexmatch(cmd, pattern, lowcase != 0, flavor, run, format).str().c_str());
Out(regexmatch(cmd, pattern, lowcase != 0, flavor, run != 0, format).str().c_str());

}
2 changes: 1 addition & 1 deletion NetExt/regsearch.cpp
Expand Up @@ -92,7 +92,7 @@ EXT_COMMAND(regsearch,


string cmd(Execute(command));
Out(regexsearch(cmd, pattern, not, lowcase != 0, flavor).str().c_str());
Out(regexsearch(cmd, pattern, not != 0, lowcase != 0, flavor).str().c_str());

}

Expand Down
Binary file modified README.md
Binary file not shown.
Binary file modified Release32/NetExt.exp
Binary file not shown.
Binary file modified Release32/NetExt.lib
Binary file not shown.
Binary file modified x86/Release32/NetExt.dll
Binary file not shown.
Binary file modified x86/Release32/NetExtShim.dll
Binary file not shown.
Binary file modified x86/Release32/NetExtShim.exp
Binary file not shown.
Binary file modified x86/Release32/NetExtShim.lib
Binary file not shown.

0 comments on commit 79e7774

Please sign in to comment.