mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 05:52:11 +00:00
Added better handling for incomplete data received when debugging
This commit is contained in:
parent
25639bc279
commit
2cd0d32184
3 changed files with 18 additions and 7 deletions
|
|
@ -90,6 +90,11 @@ namespace Cosmos.TestRunner.Core
|
||||||
|
|
||||||
aDebugConnector.CmdCoreDump = dump =>
|
aDebugConnector.CmdCoreDump = dump =>
|
||||||
{
|
{
|
||||||
|
if(dump is null)
|
||||||
|
{
|
||||||
|
OutputHandler.LogMessage("Attempted to dump core but didnt get enough data;");
|
||||||
|
return;
|
||||||
|
}
|
||||||
OutputHandler.LogMessage("Core dump:");
|
OutputHandler.LogMessage("Core dump:");
|
||||||
|
|
||||||
string eax = "EAX = 0x" + dump.EAX.ToString("X8");
|
string eax = "EAX = 0x" + dump.EAX.ToString("X8");
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Cosmos.TestRunner.Core
|
||||||
|
|
||||||
protected override void OnUnhandledException(Exception exception)
|
protected override void OnUnhandledException(Exception exception)
|
||||||
{
|
{
|
||||||
Log("Unhandled exception: " + exception.ToString());
|
Log("Unhandled exception: " + exception?.ToString() ?? "Unable to get exception: Exception was null!");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnExecutionEnd()
|
protected override void OnExecutionEnd()
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,18 @@ namespace Cosmos.Debug.DebugConnectors
|
||||||
{
|
{
|
||||||
stack.Push(BitConverter.ToUInt32(stackBytes, i));
|
stack.Push(BitConverter.ToUInt32(stackBytes, i));
|
||||||
}
|
}
|
||||||
|
if(stack.Count != 9)
|
||||||
return new CoreDump(
|
{
|
||||||
stack.Pop(), stack.Pop(), stack.Pop(), stack.Pop(),
|
return null;
|
||||||
stack.Pop(), stack.Pop(),
|
}
|
||||||
stack.Pop(), stack.Pop(), stack.Pop(),
|
else
|
||||||
stack);
|
{
|
||||||
|
return new CoreDump(
|
||||||
|
stack.Pop(), stack.Pop(), stack.Pop(), stack.Pop(),
|
||||||
|
stack.Pop(), stack.Pop(),
|
||||||
|
stack.Pop(), stack.Pop(), stack.Pop(),
|
||||||
|
stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue