}*/
enum OpenedFileState { unknown, opened, closed };
+enum ValgrindLeakCheck
+{
+ no, summary, yes, full;
+
+ property char *
+ {
+ get { return OnGetString(null, null, null); }
+ }
+
+ char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+ {
+ if(this >= no && this <= full)
+ {
+ if(tempString)
+ strcpy(tempString, valgrindLeakCheckNames[this]);
+ return valgrindLeakCheckNames[this];
+ }
+ if(tempString && tempString[0])
+ tempString[0] = '\0';
+ return null;
+ }
+};
+static const char * valgrindLeakCheckNames[ValgrindLeakCheck] = { "no", "summary", "yes", "full" };
class OpenedFileInfo
{
private:
String compiler;
int bitDepth;
+ // TODO: save these new settings when json format is ready
bool useValgrind;
- bool vgFullLeakCheck;
+ ValgrindLeakCheck vgLeakCheck;
+ bool vgTrackOrigins;
+ int vgRedzoneSize;
+
+ vgRedzoneSize = -1;
+ vgLeakCheck = summary;
public:
void Save()
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);
delete project;
}
+ void SelectActiveConfig(char * configName)
+ {
+ bool change = false;
+ for(prj : ide.workspace.projects)
+ {
+ for(cfg : prj.configurations)
+ {
+ if(cfg.name && !strcmp(cfg.name, configName))
+ {
+ prj.config = cfg;
+ change = true;
+ break;
+ }
+ }
+ }
+ if(change)
+ {
+ modified = true;
+ ide.UpdateToolBarActiveConfigs(true);
+ ide.projectView.Update(null);
+ Save();
+ }
+ }
+
bool FindPath(ProjectNode node, char * path)
{
if(node.type == file)
Breakpoint bp = (Breakpoint)row.tag;
if(bp)
{
- char * currentLoc = bp.LocationToString();
+ 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))
+ if(bp.project == removedProject)
{
- 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;
- }
+ 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);
+ }
}
}
}
}
ide.breakpointsView.Update(null);
}
-
+
void Free()
{
delete workspaceFile;
bp = { type = user, enabled = enabled, ignore = ignore, level = level, line = line };
workspace.breakpoints.Add(bp);
- bp.relativeFilePath = CopyString(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 = CopyString(relPath);
- bp.absoluteFilePath = workspace.GetAbsolutePathFromRelative(relPath);
- if(!bp.absoluteFilePath)
- bp.absoluteFilePath = CopyString("");
+ bp.location = relPath;
}
}
}