ブレークポイントを付けられるようにした

This commit is contained in:
otya128 committed 2016-09-02 22:47:21 +09:00
1 parent 820009bfb5
commit 0fd1c75b3d
2 files changed
+32 -3

No files matched your search

+21 -3
View File
@@ -6,25 +6,43 @@ import otya.smilebasic.type;
import otya.smilebasic.error;
import otya.smilebasic.systemvariable;
import std.stdio;
struct DebugData
{
SourceLocation location;
bool isBreakPoint;
}
class DebugInfo
{
sizediff_t old;
std.container.Array!SourceLocation location;
std.container.Array!DebugData location;
std.container.Array!int line;
this()
{
}
void addLocation(SourceLocation loc, Code[] code)
{
while (line.length < loc.line)
{
line ~= location.length;
}
for(int i = 0; i < code.length - old; i++)
{
location ~= loc;
location ~= DebugData (loc, false);
}
old = location.length;
}
SourceLocation getLocationByAddress(int addr)
{
if(location.length <= addr) return SourceLocation(0, 0, 0);
return location[addr];
return location[addr].location;
}
void setBreakPoint(int line)
{
location[this.line[line - 1]].isBreakPoint = true;
}
bool isBreakPoint(int line)
{
return location[this.line[line - 1]].isBreakPoint;
}
}
class Scope