summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAmy Yu <amycmyu@gmail.com>2018-06-15 11:46:49 -0700
committerAmy Yu <amycmyu@gmail.com>2018-06-15 17:14:40 -0700
commit1df3d7978e69166fa366c5788d114acf1c743d70 (patch)
tree7fbe541994dd25629fa49a6bcf5bb3091570216e /src/tools
parent30a7daa5d0fd4102ef053d1291775140be610495 (diff)
downloadcoreclr-1df3d7978e69166fa366c5788d114acf1c743d70.tar.gz
coreclr-1df3d7978e69166fa366c5788d114acf1c743d70.tar.bz2
coreclr-1df3d7978e69166fa366c5788d114acf1c743d70.zip
Use DumpInstruction instead of code block
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/r2rdump/CoreDisTools.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/r2rdump/CoreDisTools.cs b/src/tools/r2rdump/CoreDisTools.cs
index a3739c0e5e..16fef7e848 100644
--- a/src/tools/r2rdump/CoreDisTools.cs
+++ b/src/tools/r2rdump/CoreDisTools.cs
@@ -26,6 +26,10 @@ namespace R2RDump
public static extern void DumpCodeBlock(IntPtr Disasm, ulong Address, IntPtr Bytes, int Size);
[DllImport("coredistools.dll")]
+ [return: MarshalAs(UnmanagedType.I4)]
+ public static extern int DumpInstruction(IntPtr Disasm, ulong Address, IntPtr Bytes, int Size);
+
+ [DllImport("coredistools.dll")]
public static extern IntPtr GetOutputBuffer();
[DllImport("coredistools.dll")]
@@ -36,10 +40,11 @@ namespace R2RDump
public unsafe static string GetCodeBlock(IntPtr Disasm, int Address, int Offset, byte[] image, int Size)
{
+ int len;
fixed (byte* p = image)
{
IntPtr ptr = (IntPtr)(p + Offset);
- DumpCodeBlock(Disasm, (ulong)Address, ptr, Size);
+ len = DumpInstruction(Disasm, (ulong)Address, ptr, Size); //DumpCodeBlock(Disasm, (ulong)Address, ptr, Size);
}
IntPtr pBuffer = GetOutputBuffer();
string buffer = Marshal.PtrToStringAnsi(pBuffer);