Skip to content

Commit

Permalink
Merge pull request #191 from simplitech/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Relfos authored Jun 17, 2019
2 parents 0e802b2 + d5eae5c commit 8c16d79
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ deploy:
api_key:
secure: jBINz3B7eTUpUxDCDk26+NySv3h5+cGhM0tF0Z27B3OTeSLH7nnz/F65JmSSJx28IlhtX0n6bJ6SyAn9JARWNz4pH1XhEm7KZT8Bh5o+ef1VnP8P4Yd5iHOmSPzJz0M2ZAQRciK6GEjCH+bOFGXTD3l4JiosMHy0B2kfcppb9cLwelNampHO+qIGhdTyuxaRP+5zI6YXHQdQgqTHiddlJLjwnPKNZ62lAeB06righ9vy27W80N3q84N15iVjlVamU6iV3ZAMcMy1AoBse7yi98/2VTb9xHvQth7nKignrZrC+PuFKqgbzFM8p05OlRZN9DYsJQPTf+QNyF7eFyYSCj6e89cSRMREhmE7mvVpmjkVoEtDW2ioIXG6PxUPV1q/sS7Nd91WBi5Xjqwc41QW2C+xUQBVH4UaMsniyrVG63hkmOXPaPDfmxEv2qgllxCH84mpaQbYUowKC/x+gLQ/sEtHFksXGJTpMl3J4FZDHbzgelliHNKHhTZW16Nn0n22WcG0kXH4DwTZNl+kXfztW454ThfUbMqhskaoYWjdUs6X+iYS79ce4Bv5APIoHskJyA4GlIHqb1/XIE+9o33WKFV5ppAPGJi2EkTl+HpAC1JAULrrcfQajoCHD3mWTELvTXKeg2FA2VBXWZqEzFUnLhgBzVJZZaZ99V5gZxS5lx4=
file:
- osx-x64.zip
- win-x64.zip
- linux-x64.zip

- "neo-debugger-osx-x64.zip"
- "neo-debugger-win-x64.zip"
- "neo-debugger-linux-x64.zip"
overwrite: true
skip_cleanup: true
on:
Expand Down
10 changes: 5 additions & 5 deletions NEO-Debugger-Core/Shell/DebugCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class ShellRunner
{
public static void UpdateState(DebuggerShell Shell, Action<ShellMessageType, string> output)
{
var state = Shell.Debugger.Info;
var state = Shell.Debugger.State;

output(ShellMessageType.Default, $"VM state: {state.state}");
output(ShellMessageType.Default, $"Instruction pointer: {state.offset}");
Expand Down Expand Up @@ -65,7 +65,7 @@ public class RunCommand : Command

public override void Execute(string[] args, Action<ShellMessageType, string> output)
{
if (Shell.Debugger.Info.state == DebuggerState.State.Running || Shell.Debugger.Info.state == DebuggerState.State.Break)
if (Shell.Debugger.State.state == DebuggerState.State.Running || Shell.Debugger.State.state == DebuggerState.State.Break)
{
output(ShellMessageType.Default, "Resuming invoke.");
Shell.Debugger.Run();
Expand All @@ -85,19 +85,19 @@ public class StepCommand : Command

public override void Execute(string[] args, Action<ShellMessageType, string> output)
{
if (Shell.Debugger.Info.state == DebuggerState.State.Running || Shell.Debugger.Info.state == DebuggerState.State.Break)
if (Shell.Debugger.State.state == DebuggerState.State.Running || Shell.Debugger.State.state == DebuggerState.State.Break)
{
output(ShellMessageType.Default, "Stepping invoke.");

string startFile;
var startLine = Shell.Debugger.ResolveLine(Shell.Debugger.Info.offset, true, out startFile);
var startLine = Shell.Debugger.ResolveLine(Shell.Debugger.State.offset, true, out startFile);

string currentFile;
int currentLine;
do
{
Shell.Debugger.Step();
currentLine = Shell.Debugger.ResolveLine(Shell.Debugger.Info.offset, true, out currentFile);
currentLine = Shell.Debugger.ResolveLine(Shell.Debugger.State.offset, true, out currentFile);
} while (currentFile == startFile && currentLine == startLine);

ShellRunner.UpdateState(Shell, output);
Expand Down
2 changes: 1 addition & 1 deletion NEO-Debugger-Core/Utils/DebugManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public bool ResetFlag
return _resetFlag;
}
}
public DebuggerState Info
public DebuggerState State
{
get
{
Expand Down
8 changes: 4 additions & 4 deletions NEO-Debugger-WebServices/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ public Backend(ServerSettings serverSettings)
}
string filePath;
var curLine = _shell.Debugger.ResolveLine(_shell.Debugger.Info.offset, true, out filePath);
var curLine = _shell.Debugger.ResolveLine(_shell.Debugger.State.offset, true, out filePath);
output.AddField("state", _shell.Debugger.Info.state);
output.AddField("offset", _shell.Debugger.Info.offset);
output.AddField("state", _shell.Debugger.State.state);
output.AddField("offset", _shell.Debugger.State.offset);
output.AddField("line", curLine);
output.AddField("path", filePath);
if (_shell.Debugger.Info.state == Emulation.DebuggerState.State.Finished)
if (_shell.Debugger.State.state == Emulation.DebuggerState.State.Finished)
{
var val = _debugger.Emulator.GetOutput();
Expand Down
9 changes: 8 additions & 1 deletion NEO-Emulator/Emulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,14 @@ public DebuggerState Step()
return lastState;
}

lastState = new DebuggerState(DebuggerState.State.Running, lastOffset);
if (lastState.state == DebuggerState.State.Break) {
lastState = new DebuggerState(DebuggerState.State.Break, lastOffset);
}
else
{
lastState = new DebuggerState(DebuggerState.State.Running, lastOffset);
}

return lastState;
}

Expand Down
2 changes: 1 addition & 1 deletion NEO-Emulator/VM/InteropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static bool GetEntryScriptHash(ExecutionEngine engine)

public bool Invoke(byte[] method, ExecutionEngine engine)
{
return Invoke(method.ToString(), engine);
return Invoke(System.Text.Encoding.ASCII.GetString(method), engine);
}
}
}

0 comments on commit 8c16d79

Please sign in to comment.