Do not treat access violation addresses as pointers
This commit is contained in:
parent
02e2f6c5c9
commit
9ea851c14d
|
@ -37,7 +37,7 @@ namespace CxbxDebugger
|
||||||
|
|
||||||
public interface IDebuggerExceptionEvents
|
public interface IDebuggerExceptionEvents
|
||||||
{
|
{
|
||||||
bool OnAccessViolation(DebuggerThread Thread, uint Code, IntPtr Address);
|
bool OnAccessViolation(DebuggerThread Thread, uint Code, uint Address);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDebuggerFileEvents
|
public interface IDebuggerFileEvents
|
||||||
|
|
|
@ -163,7 +163,7 @@ namespace CxbxDebugger
|
||||||
public class ExceptionHandledQuery
|
public class ExceptionHandledQuery
|
||||||
{
|
{
|
||||||
public IntPtr ReponseAddr { get; set; }
|
public IntPtr ReponseAddr { get; set; }
|
||||||
public IntPtr ExceptionAddress { get; set; }
|
public uint ExceptionAddress { get; set; }
|
||||||
public uint ExceptionCode { get; set; }
|
public uint ExceptionCode { get; set; }
|
||||||
public uint ParameterCount { get; set; }
|
public uint ParameterCount { get; set; }
|
||||||
public IntPtr ParameterBase { get; set; }
|
public IntPtr ParameterBase { get; set; }
|
||||||
|
@ -174,7 +174,7 @@ namespace CxbxDebugger
|
||||||
ExceptionHandledQuery Query = new ExceptionHandledQuery();
|
ExceptionHandledQuery Query = new ExceptionHandledQuery();
|
||||||
|
|
||||||
Query.ReponseAddr = new IntPtr(Data[0]);
|
Query.ReponseAddr = new IntPtr(Data[0]);
|
||||||
Query.ExceptionAddress = new IntPtr(Data[1]);
|
Query.ExceptionAddress = Data[1];
|
||||||
Query.ExceptionCode = Data[2];
|
Query.ExceptionCode = Data[2];
|
||||||
Query.ParameterCount = Data[3];
|
Query.ParameterCount = Data[3];
|
||||||
Query.ParameterBase = new IntPtr(Data[4]);
|
Query.ParameterBase = new IntPtr(Data[4]);
|
||||||
|
|
|
@ -371,7 +371,7 @@ namespace CxbxDebugger
|
||||||
|
|
||||||
public void OnThreadExit(DebuggerThread Thread, uint ExitCode)
|
public void OnThreadExit(DebuggerThread Thread, uint ExitCode)
|
||||||
{
|
{
|
||||||
frm.DebugLog(string.Format("Thread exited {0} ({1})", Thread.ThreadID, PrettyExitCode(ExitCode)));
|
frm.DebugLog(string.Format("Thread exited {0} ({1})", Thread.ThreadID, NtStatus.PrettyPrint(ExitCode)));
|
||||||
frm.DebugThreads.Remove(Thread);
|
frm.DebugThreads.Remove(Thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,18 +397,18 @@ namespace CxbxDebugger
|
||||||
frm.OutputString(Message);
|
frm.OutputString(Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnAccessViolation(DebuggerThread Thread, uint Code, IntPtr Address)
|
public bool OnAccessViolation(DebuggerThread Thread, uint Code, uint Address)
|
||||||
{
|
{
|
||||||
string ProcessName = "??";
|
string ProcessName = "??";
|
||||||
|
|
||||||
var Module = frm.DebuggerInst.ResolveModule((uint)Address);
|
var Module = frm.DebuggerInst.ResolveModule(Address);
|
||||||
if (Module != null)
|
if (Module != null)
|
||||||
{
|
{
|
||||||
ProcessName = Path.GetFileName(Module.Path);
|
ProcessName = Path.GetFileName(Module.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Include GetLastError string
|
// TODO Include GetLastError string
|
||||||
string ExceptionMessage = string.Format("Access violation thrown at 0x{0:X8} ({1})", (uint)Address, ProcessName);
|
string ExceptionMessage = string.Format("Access violation thrown at 0x{0:X8} ({1})", Address, ProcessName);
|
||||||
|
|
||||||
ExceptionMessage += string.Format("\n\nException code {0:X8}", Code);
|
ExceptionMessage += string.Format("\n\nException code {0:X8}", Code);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue