mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +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 =>
|
||||
{
|
||||
if(dump is null)
|
||||
{
|
||||
OutputHandler.LogMessage("Attempted to dump core but didnt get enough data;");
|
||||
return;
|
||||
}
|
||||
OutputHandler.LogMessage("Core dump:");
|
||||
|
||||
string eax = "EAX = 0x" + dump.EAX.ToString("X8");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Cosmos.TestRunner.Core
|
|||
|
||||
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()
|
||||
|
|
|
|||
|
|
@ -48,12 +48,18 @@ namespace Cosmos.Debug.DebugConnectors
|
|||
{
|
||||
stack.Push(BitConverter.ToUInt32(stackBytes, i));
|
||||
}
|
||||
|
||||
return new CoreDump(
|
||||
stack.Pop(), stack.Pop(), stack.Pop(), stack.Pop(),
|
||||
stack.Pop(), stack.Pop(),
|
||||
stack.Pop(), stack.Pop(), stack.Pop(),
|
||||
stack);
|
||||
if(stack.Count != 9)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
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