Browse Source

Fix memory exception.

pull/21/head
Eusebiu Marcu 14 years ago
parent
commit
396ae2f0d9
  1. 2
      src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/MemoryPadCommands.cs
  2. 4
      src/AddIns/Debugger/Debugger.AddIn/Pads/MemoryPad.cs
  3. 4
      src/AddIns/Debugger/Debugger.Core/Interop/NativeMethods.cs

2
src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/MemoryPadCommands.cs

@ -119,7 +119,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{ {
if (this.pad != null && this.comboBox != null) { if (this.pad != null && this.comboBox != null) {
pad.DisplayByteSize = Convert.ToByte(this.comboBox.SelectedValue); pad.DisplayByteSize = Convert.ToByte(this.comboBox.SelectedValue);
pad.ChangeByteDisplay(); pad.DisplayMemory();
} }
base.Run(); base.Run();
} }

4
src/AddIns/Debugger/Debugger.AddIn/Pads/MemoryPad.cs

@ -188,10 +188,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
return; return;
} }
ChangeByteDisplay(); DisplayMemory();
} }
public void ChangeByteDisplay() public void DisplayMemory()
{ {
if (memory == null || memory.Length == 0) if (memory == null || memory.Length == 0)
return; return;

4
src/AddIns/Debugger/Debugger.Core/Interop/NativeMethods.cs

@ -169,9 +169,9 @@ namespace Debugger.Interop
public static byte[] ReadProcessMemory(this Process process, long startAddress, long size) public static byte[] ReadProcessMemory(this Process process, long startAddress, long size)
{ {
IntPtr openedProcess = IntPtr.Zero; IntPtr openedProcess = IntPtr.Zero;
byte[] temp = new byte[size]; byte[] temp = null;
try { try {
temp = new byte[size];
openedProcess = OpenProcess(ProcessAccessFlags.All, false, (int)process.Id); openedProcess = OpenProcess(ProcessAccessFlags.All, false, (int)process.Id);
int outSize; int outSize;

Loading…
Cancel
Save