for(s : dirs)
sourceDirs.Add(CopyString(s));
- DropInvalidBreakpoints();
+ DropInvalidBreakpoints(null);
delete dirs;
}
if(it.Find(project))
it.Remove();
- DropInvalidBreakpoints();
+ for(bp : breakpoints)
+ DropInvalidBreakpoints(project);
modified = true;
ide.findInFilesDialog.RemoveProjectItem(project);
ide.UpdateToolBarActiveConfigs(false);
char * currentLoc = bp.CopyUserLocationString();
if(strcmp(location, currentLoc))
{
- // todo, parse location
- // if good, make changes to breakpoint, according to execution state delete and place breakpoint
- ide.breakpointsView.UpdateBreakpoint(row); // this is the else
- //Save();
+ char * newLoc;
+ bp.location = location;
+ bp.ParseLocation();
+ newLoc = bp.CopyUserLocationString();
+ if(strcmp(newLoc, currentLoc))
+ {
+ ide.breakpointsView.UpdateBreakpoint(row);
+ Save();
+ }
}
delete currentLoc;
}
delete bp;
}
- void DropInvalidBreakpoints()
+ void ParseLoadedBreakpoints()
+ {
+ for(bp : breakpoints; bp.location)
+ {
+ bp.ParseLocation();
+ ide.breakpointsView.UpdateBreakpoint(bp.row);
+ }
+ }
+
+ void DropInvalidBreakpoints(Project removedProject)
{
Link bpLink, next;
for(bpLink = breakpoints.first; bpLink; bpLink = next)
if(bp.type == user)
{
- Project project = null;
- for(p : projects)
+ if(removedProject)
{
- if(FindPath(p.topNode, bp.absoluteFilePath))
- {
- project = p;
- break;
- }
- // Handle symbol loader modules:
+ if(bp.project == removedProject)
{
- char moduleName[MAX_FILENAME];
- char * sl;
- GetLastDirectory(bp.absoluteFilePath, moduleName);
- // Tweak for automatically resolving symbol loader modules
- sl = strstr(moduleName, ".main.ec");
- if(sl && (*sl = 0, !strcmpi(moduleName, p.name)))
- {
- project = p;
- break;
- }
+ ide.breakpointsView.RemoveBreakpoint(bp);
+ RemoveBreakpoint(bp);
}
}
- if(!project)
+ else
{
- bool found = false;
- for(dir : sourceDirs)
+ Project project = bp.project;
+ if(!project)
{
- if(IsPathInsideOf(bp.absoluteFilePath, dir))
+ for(p : projects)
{
- found = true;
- break;
+ if(FindPath(p.topNode, bp.absoluteFilePath))
+ {
+ project = p;
+ break;
+ }
+ // Handle symbol loader modules:
+ {
+ char moduleName[MAX_FILENAME];
+ char * sl;
+ GetLastDirectory(bp.absoluteFilePath, moduleName);
+ // Tweak for automatically resolving symbol loader modules
+ sl = strstr(moduleName, ".main.ec");
+ if(sl && (*sl = 0, !strcmpi(moduleName, p.name)))
+ {
+ project = p;
+ break;
+ }
+ }
}
}
- if(!found)
+ if(!project)
{
- ide.breakpointsView.RemoveBreakpoint(bp);
- RemoveBreakpoint(bp);
+ bool found = false;
+ for(dir : sourceDirs)
+ {
+ if(IsPathInsideOf(bp.absoluteFilePath, dir))
+ {
+ found = true;
+ break;
+ }
+ }
+ if(!found)
+ {
+ ide.breakpointsView.RemoveBreakpoint(bp);
+ RemoveBreakpoint(bp);
+ }
}
}
}
bp = { type = user, enabled = enabled, ignore = ignore, level = level, line = line };
workspace.breakpoints.Add(bp);
- bp.relativeFilePath = strFile;
- bp.absoluteFilePath = workspace.GetAbsolutePathFromRelative(strFile);
- if(!bp.absoluteFilePath)
- bp.absoluteFilePath = CopyString("");
+ bp.location = strFile;
}
}
}
bp = { type = user, enabled = enabled, level = -1 };
workspace.breakpoints.Add(bp);
bp.line = atoi(lineNum);
- bp.relativeFilePath = relPath;
- bp.absoluteFilePath = workspace.GetAbsolutePathFromRelative(relPath);
- if(!bp.absoluteFilePath)
- bp.absoluteFilePath = "";
+ bp.location = relPath;
}
}
}