Skip to content

Commit

Permalink
Fixed problem with Live Target and !wmodule, !wmakesource
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyviana committed Nov 11, 2020
1 parent a70b8b1 commit 0f8ac6d
Show file tree
Hide file tree
Showing 28 changed files with 51 additions and 12 deletions.
File renamed without changes.
Binary file added Binaries/NetExt-2.1.59.5000.zip
Binary file not shown.
Binary file modified Binaries/README.md
Binary file not shown.
2 changes: 1 addition & 1 deletion Binaries/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://github.com/rodneyviana/netext
Getting Started:
==================
No matter whether you are a WinDbg debugger already or not, check this out:
http://blogs.msdn.com/b/rodneyviana/archive/2015/03/10/getting-started-with-netext.aspx
https://docs.microsoft.com/en-us/archive/blogs/rodneyviana/getting-started-with-netext

Caution:
=================
Expand Down
Binary file modified Binaries/x64/NetExt.dll
Binary file not shown.
Binary file modified Binaries/x64/NetExt.pdb
Binary file not shown.
Binary file modified Binaries/x64/NetExtShim.dll
Binary file not shown.
Binary file modified Binaries/x64/NetExtShim.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion Binaries/x64/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://github.com/rodneyviana/netext
Getting Started:
==================
No matter whether you are a WinDbg debugger already or not, check this out:
http://blogs.msdn.com/b/rodneyviana/archive/2015/03/10/getting-started-with-netext.aspx
https://docs.microsoft.com/en-us/archive/blogs/rodneyviana/getting-started-with-netext

Caution:
=================
Expand Down
Binary file modified Binaries/x86/NetExt.dll
Binary file not shown.
Binary file modified Binaries/x86/NetExtShim.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Binaries/x86/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://github.com/rodneyviana/netext
Getting Started:
==================
No matter whether you are a WinDbg debugger already or not, check this out:
http://blogs.msdn.com/b/rodneyviana/archive/2015/03/10/getting-started-with-netext.aspx
https://docs.microsoft.com/en-us/archive/blogs/rodneyviana/getting-started-with-netext

Caution:
=================
Expand Down
23 changes: 21 additions & 2 deletions ClrMemDiagExt/DebugApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2742,11 +2742,30 @@ internal static bool CreateBreakpointFromExpression(string Expression, BreakPoin

private static string pFormat = String.Format(":x{0}", Marshal.SizeOf(IntPtr.Zero) * 2);

public static unsafe int QueryVirtual(ulong Offset, out MEMORY_BASIC_INFORMATION64 Info)
{
Info = default(MEMORY_BASIC_INFORMATION64);
// MEMORY_BASIC_INFORMATION64 structure is explicitly declared to be 16-byte aligned [DECLSPEC_ALIGN(16)] when using Live Target
// The lines below is C++ equivalent to this: DECLSPEC_ALIGN(16) MEMORY_BASIC_INFORMATION64 Info
var globalAlloc = Marshal.AllocHGlobal(Marshal.SizeOf(Info) + 15);
var aligned = new IntPtr((globalAlloc.ToInt64() + 0xf) & ~0xf); // Pointer is 16-byte aligned

IDebugDataSpaces2 data = (IDebugDataSpaces2)Client;
var result = data.QueryVirtual(Offset, aligned);
if (result == (int)HRESULT.S_OK)
{
Info = *(MEMORY_BASIC_INFORMATION64*)aligned.ToPointer();
}
Marshal.FreeHGlobal(globalAlloc);
return result;

}

public static MEMORY_BASIC_INFORMATION64 AddressType(ulong Address)
{
IDebugDataSpaces2 data = (IDebugDataSpaces2)Client;
MEMORY_BASIC_INFORMATION64 mbi = new MEMORY_BASIC_INFORMATION64();
int result = data.QueryVirtual(Address,out mbi);
MEMORY_BASIC_INFORMATION64 mbi;
int result = DebugApi.QueryVirtual(Address,out mbi);
if(result == (int)HRESULT.S_OK)
{
return mbi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,6 @@ int FillPhysical(
[PreserveSig]
int QueryVirtual(
[In] UInt64 Offset,
[Out] out MEMORY_BASIC_INFORMATION64 Info);
[Out] IntPtr MEMORY_BASIC_INFORMATION_Info_ALigned);
}
}
4 changes: 2 additions & 2 deletions ClrMemDiagExt/Microsoft.Diagnostics.Runtime/datatarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ public bool VirtualQuery(ulong addr, out VirtualQueryData vq)

SetClientInstance();
MEMORY_BASIC_INFORMATION64 mem;
int hr = _spaces2.QueryVirtual(addr, out mem);
int hr = NetExt.Shim.DebugApi.QueryVirtual(addr, out mem);
vq.BaseAddress = mem.BaseAddress;
vq.Size = mem.RegionSize;

Expand Down Expand Up @@ -1902,7 +1902,7 @@ internal int QueryVirtual(ulong addr, out MEMORY_BASIC_INFORMATION64 mem)
}

SetClientInstance();
return _spaces2.QueryVirtual(addr, out mem);
return NetExt.Shim.DebugApi.QueryVirtual(addr, out mem);
}

internal int GetModuleByModuleName(string image, int start, out uint index, out ulong baseAddress)
Expand Down
2 changes: 1 addition & 1 deletion ClrMemDiagExt/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ public Version VersionInfo
{
try
{
Version ver = new System.Version(ProductVersion);
Version ver = ProductVersion != null ? new System.Version(ProductVersion) : new System.Version();
return ver;
}
catch
Expand Down
4 changes: 2 additions & 2 deletions ClrMemDiagExt/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
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.58.5000")]
[assembly: AssemblyFileVersion("2.1.58.5000")]
[assembly: AssemblyVersion("2.1.59.5000")]
[assembly: AssemblyFileVersion("2.1.59.5000")]
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.
20 changes: 20 additions & 0 deletions NetExt/Release32/NetExt.write.1.tlog
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,23 @@ 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
^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
^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
^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.
2 changes: 1 addition & 1 deletion NetExt/VersionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ver_major
#define ver_major 2
#define ver_minor 1
#define ver_release 58
#define ver_release 59
#define ver_build 5000
#define ver_all(a,b,c,d) a,b,c,d
#define ver_expand(s) #s
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.

0 comments on commit 0f8ac6d

Please sign in to comment.