// use =0 to disable printing of specific channels
#ifdef _DEBUG_INST
-static enum dplchan { none, gdbProtoIgnored=0/*1*/, gdbProtoUnknown=2, gdbOutput=0/*3*/, gdbCommand=0/*4*/, debuggerCall=0/*5*/, debuggerProblem=6,
+static enum dplchan { none, gdbProtoIgnored=0/*1*/, gdbProtoUnknown=2, gdbOutput=3/*3*/, gdbCommand=4/*4*/, debuggerCall=0/*5*/, debuggerProblem=6,
debuggerUserAction=7,debuggerState=8, debuggerBreakpoints=9, debuggerWatches=0/*10*/, debuggerTemp=0 };
#else
static enum dplchan { none, gdbProtoIgnored=0, gdbProtoUnknown=0, gdbOutput=0, gdbCommand=0, debuggerCall=0, debuggerProblem=0,
else
_dpl2(_dpct, dplchan::debuggerProblem, 0, "Invalid stopItem!");
if(bpUser && strcmp(stopItem.frame.addr, bpUser.bp.addr))
- bpUser = null;
+ _dpl2(_dpct, dplchan::debuggerProblem, 0, "Breakpoint bkptno(", stopItem.bkptno, ") address missmatch!");
}
else
_dpl2(_dpct, dplchan::debuggerProblem, 0, "Breakpoint bkptno(", stopItem.bkptno, ") invalid or not found!");
char relativeFilePath[MAX_LOCATION];
_dpl2(_dpct, dplchan::debuggerCall, 0, "Debugger::RunToCursor()");
_ChangeUserAction(runToCursor);
- if(!ide.projectView.project.GetRelativePath(absoluteFilePath, relativeFilePath))
- strcpy(relativeFilePath, absoluteFilePath);
+ WorkspaceGetRelativePath(absoluteFilePath, relativeFilePath, null);
if(bpRunToCursor && bpRunToCursor.inserted && symbols)
{
}
}
- void ToggleBreakpoint(char * fileName, int lineNumber, Project prj)
+ void ToggleBreakpoint(char * fileName, int lineNumber)
{
- char winFilePath[MAX_LOCATION];
- char * absoluteFilePath = GetSlashPathBuffer(winFilePath, fileName);
char absolutePath[MAX_LOCATION];
- char relativePath[MAX_LOCATION];
- char sourceDir[MAX_LOCATION];
Breakpoint bp = null;
_dpl2(_dpct, dplchan::debuggerBreakpoints, 0, "Debugger::ToggleBreakpoint(", fileName, ":", lineNumber, ")");
- strcpy(absolutePath, absoluteFilePath);
+
+ GetSlashPathBuffer(absolutePath, fileName);
for(i : ide.workspace.breakpoints; i.type == user && i.absoluteFilePath && !fstrcmp(i.absoluteFilePath, absolutePath) && i.line == lineNumber)
{
bp = i;
}
else
{
- // FIXED: This is how it should have been... Source locations are only for files not in project
- // if(IsPathInsideOf(absolutePath, ide.workspace.projectDir))
- // MakePathRelative(absolutePath, ide.workspace.projectDir, relativePath);
- bool result = false;
- if(prj)
- result = prj.GetRelativePath(absolutePath, relativePath);
- else
- result = ide.projectView.project.GetRelativePath(absolutePath, relativePath);
- //if(ide.projectView.project.GetRelativePath(absolutePath, relativePath));
- //else
- if(!result)
+ Project owner;
+ char relativePath[MAX_LOCATION];
+
+ WorkspaceGetRelativePath(absolutePath, relativePath, &owner);
+
+ if(!owner)
{
char title[MAX_LOCATION];
char directory[MAX_LOCATION];
+ char sourceDir[MAX_LOCATION];
StripLastDirectory(absolutePath, directory);
snprintf(title, sizeof(title), $"Provide source files location directory for %s", absolutePath);
title[sizeof(title)-1] = 0;
{
if(IsPathInsideOf(absolutePath, dir))
{
- MakePathRelative(absoluteFilePath, dir, relativePath);
+ MakePathRelative(absolutePath, dir, relativePath);
srcDir = dir;
break;
}
if(IsPathInsideOf(absolutePath, sourceDir))
{
AddSourceDir(sourceDir);
- MakePathRelative(absoluteFilePath, sourceDir, relativePath);
+ MakePathRelative(absolutePath, sourceDir, relativePath);
break;
}
else if(MessageBox { type = yesNo, master = ide,
text = $"Invalid Source Directory" }.Modal() == no)
return;
}
- else if(MessageBox { type = yesNo, master = ide,
- contents = $"You must provide a source directory in order to place a breakpoint in this file.\nWould you like to try again?",
- text = $"No Source Directory Provided" }.Modal() == no)
+ else
return;
}
}
ide.workspace.bpCount++;
- bp = { line = lineNumber, type = user, enabled = true, level = -1, project = prj };
+ bp = { line = lineNumber, type = user, enabled = true, level = -1, project = owner };
ide.workspace.breakpoints.Add(bp);
bp.absoluteFilePath = absolutePath;
bp.relativeFilePath = relativePath;
breakpointError = false;
if(symbols && bp.enabled && (!bp.project || bp.project == ide.project || projectsLibraryLoaded[bp.project.name]))
{
- char * location = bp.CopyLocationString(removePath);
sentBreakInsert = true;
- GdbCommand(false, "-break-insert %s", location);
- delete location;
+ if(bp.address)
+ GdbCommand(false, "-break-insert *%s", bp.address);
+ else
+ {
+ char * location = bp.CopyLocationString(removePath);
+ GdbCommand(false, "-break-insert %s", location);
+ delete location;
+ }
if(!breakpointError)
{
+ char * address = null;
if(bpItem && bpItem.multipleBPs && bpItem.multipleBPs.count)
{
int count = 0;
GdbDataBreakpoint first = null;
for(n : bpItem.multipleBPs)
{
- if(!fstrcmp(n.fullname, bp.absoluteFilePath))
+ if(!fstrcmp(n.fullname, bp.absoluteFilePath) && !first)
{
count++;
- if(!first)
- first = n;
+ first = n;
+ break;
}
- else
+ /*else
{
if(n.enabled)
{
}
else
_dpl2(_dpct, dplchan::debuggerProblem, 0, "Debugger::SetBreakpoint -- error breakpoint already disabled.");
- }
+ }*/
}
if(first)
{
+ address = CopyString(first.addr);
bpItem.addr = first.addr;
bpItem.func = first.func;
bpItem.file = first.file;
bpItem.fullname = first.fullname;
bpItem.line = first.line;
- //bpItem.thread-groups = first.thread-groups;
- bpItem.multipleBPs.Free();
- delete bpItem.multipleBPs;
+ //bpItem.thread-groups = first.thread-groups;*/
}
else if(count == 0)
_dpl2(_dpct, dplchan::debuggerProblem, 0, "Debugger::SetBreakpoint -- error multiple breakpoints all disabled.");
else
_dpl2(_dpct, dplchan::debuggerProblem, 0, "Debugger::SetBreakpoint -- error multiple breakpoints in exact same file not supported.");
+ bpItem.multipleBPs.Free();
+ delete bpItem.multipleBPs;
}
bp.bp = bpItem;
bpItem = null;
bp.inserted = (bp.bp && bp.bp.number && strcmp(bp.bp.number, "0"));
if(bp.inserted)
ValidateBreakpoint(bp);
+
+ if(address)
+ {
+ UnsetBreakpoint(bp);
+ bp.address = address;
+ delete address;
+ SetBreakpoint(bp, removePath);
+ }
}
}
return !breakpointError;
GdbExecCommon();
if(absoluteFilePath)
{
- if(!ide.projectView.project.GetRelativePath(absoluteFilePath, relativeFilePath))
- strcpy(relativeFilePath, absoluteFilePath);
+ WorkspaceGetRelativePath(absoluteFilePath, relativeFilePath, null);
GdbCommand(true, "-exec-until %s:%d", relativeFilePath, lineNumber);
}
else
GdbExecCommon();
if(lineNumber)
{
- if(!ide.projectView.project.GetRelativePath(absoluteFilePathOrLocation, relativeFilePath))
- strcpy(relativeFilePath, absoluteFilePathOrLocation);
+ WorkspaceGetRelativePath(absoluteFilePathOrLocation, relativeFilePath, null);
GdbCommand(true, "advance %s:%d", relativeFilePath, lineNumber); // should use -exec-advance -- GDB/MI implementation missing
}
else
if(ide.workspace)
{
for(bp : ide.workspace.breakpoints)
- {
- bp.inserted = false;
- delete bp.bp;
- }
+ bp.Reset();
}
for(bp : sysBPs)
- {
- bp.inserted = false;
- delete bp.bp;
- }
+ bp.Reset();
if(bpRunToCursor)
- {
- bpRunToCursor.inserted = false;
- delete bpRunToCursor.bp;
- }
+ bpRunToCursor.Reset();
ide.outputView.debugBox.Logf($"Debugging stopped\n");
ClearBreakDisplay();
DataRow row;
GdbDataBreakpoint bp;
Project project;
+ char * address;
+ property char * address { set { delete address; if(value) address = CopyString(value); } }
void ParseLocation()
{
char * file;
char * line;
char fullPath[MAX_LOCATION];
- ProjectNode node;
if(location[0] == '\(' && location[1] && (file = strchr(location+2, '\)')) && file[1])
{
prjName = new char[file-location];
{
if(!strcmp(prjName, prj.name))
{
- node = prj.topNode.FindWithPath(filePath, false);
- if(node)
+ if(ProjectGetAbsoluteFromRelativePath(prj, filePath, fullPath))
{
- node.GetFullFilePath(fullPath);
property::absoluteFilePath = fullPath;
project = prj;
break;
}
else
{
- node = ide.projectView.project.topNode.Find(filePath, false);
- if(node)
+ Project prj = ide.project;
+ if(ProjectGetAbsoluteFromRelativePath(prj, filePath, fullPath))
{
- node.GetFullFilePath(fullPath);
property::absoluteFilePath = fullPath;
+ project = prj;
}
- project = ide.project;
}
if(!absoluteFilePath)
property::absoluteFilePath = "";
char * location;
char * loc = CopyLocationString(false);
Project prj = null;
- for(p : ide.workspace.projects; p != ide.workspace.projects.firstIterator.data)
+ if(absoluteFilePath)
{
- if(p.topNode.FindByFullPath(absoluteFilePath, false))
+ for(p : ide.workspace.projects; p != ide.workspace.projects.firstIterator.data)
{
- prj = p;
- break;
+ if(p.topNode.FindByFullPath(absoluteFilePath, false))
+ {
+ prj = p;
+ break;
+ }
}
}
if(prj)
void Free()
{
- if(bp)
- bp.Free();
- delete bp;
+ Reset();
delete function;
delete relativeFilePath;
delete absoluteFilePath;
delete location;
}
+ void Reset()
+ {
+ inserted = false;
+ delete address;
+ if(bp)
+ bp.Free();
+ delete bp;
+ }
+
~Breakpoint()
{
Free();
exp.type = constantExp;
}
}
+
+static Project WorkspaceGetFileOwner(char * absolutePath)
+{
+ Project owner = null;
+ for(prj : ide.workspace.projects)
+ {
+ if(prj.topNode.FindByFullPath(absolutePath, false))
+ {
+ owner = prj;
+ break;
+ }
+ }
+ if(!owner)
+ WorkspaceGetObjectFileNode(absolutePath, &owner);
+ return owner;
+}
+
+static ProjectNode WorkspaceGetObjectFileNode(char * filePath, Project * project)
+{
+ ProjectNode node = null;
+ char ext[MAX_EXTENSION];
+ GetExtension(filePath, ext);
+ if(ext[0])
+ {
+ IntermediateFileType type = IntermediateFileType::FromExtension(ext);
+ if(type)
+ {
+ char fileName[MAX_FILENAME];
+ GetLastDirectory(filePath, fileName);
+ if(fileName[0])
+ {
+ DotMain dotMain = DotMain::FromFileName(fileName);
+ for(prj : ide.workspace.projects)
+ {
+ if((node = prj.FindNodeByObjectFileName(fileName, type, dotMain, null)))
+ {
+ if(project)
+ *project = prj;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return node;
+}
+
+static ProjectNode ProjectGetObjectFileNode(Project project, char * filePath)
+{
+ ProjectNode node = null;
+ char ext[MAX_EXTENSION];
+ GetExtension(filePath, ext);
+ if(ext[0])
+ {
+ IntermediateFileType type = IntermediateFileType::FromExtension(ext);
+ if(type)
+ {
+ char fileName[MAX_FILENAME];
+ GetLastDirectory(filePath, fileName);
+ if(fileName[0])
+ {
+ DotMain dotMain = DotMain::FromFileName(fileName);
+ node = project.FindNodeByObjectFileName(fileName, type, dotMain, null);
+ }
+ }
+ }
+ return node;
+}
+
+static void WorkspaceGetRelativePath(char * absolutePath, char * relativePath, Project * owner)
+{
+ Project prj = WorkspaceGetFileOwner(absolutePath);
+ if(owner)
+ *owner = prj;
+ if(!prj)
+ prj = ide.workspace.projects.firstIterator.data;
+ if(prj)
+ {
+ MakePathRelative(absolutePath, prj.topNode.path, relativePath);
+ MakeSlashPath(relativePath);
+ }
+ else
+ relativePath[0] = '\0';
+}
+
+static bool ProjectGetAbsoluteFromRelativePath(Project project, char * relativePath, char * absolutePath)
+{
+ ProjectNode node = project.topNode.FindWithPath(relativePath, false);
+ if(!node)
+ node = ProjectGetObjectFileNode(project, relativePath);
+ if(node)
+ {
+ strcpy(absolutePath, node.project.topNode.path);
+ PathCat(absolutePath, relativePath);
+ MakeSlashPath(absolutePath);
+ }
+ return node != null;
+}
if(projectView && fileName)
{
int line = editBox.lineNumber + 1;
- Project prj = null;
- if(ide && ide.workspace)
- {
- for(p : ide.workspace.projects)
- {
- if(p.topNode.FindByFullPath(fileName, false))
- {
- prj = p;
- break;
- }
- }
- if(!prj)
- {
- for(p : ide.workspace.projects)
- {
- if(IsPathInsideOf(fileName, p.topNode.path))
- {
- prj = p;
- break;
- }
- }
- }
- }
- ide.debugger.ToggleBreakpoint(fileName, line, prj);
+ ide.debugger.ToggleBreakpoint(fileName, line);
Update(null);
}
return true;
if(debugger.activeFrame && debugger.activeFrame.absoluteFile)
{
int line = debugger.activeFrame.line;
- char name[MAX_LOCATION];
- Project prj = null;
- // TOFIX: Improve on this, don't use only filename, make a function
- GetLastDirectory(debugger.activeFrame.absoluteFile, name);
- if(ide && ide.workspace)
- {
- for(p : ide.workspace.projects)
- {
- if(p.topNode.Find(name, false))
- {
- prj = p;
- break;
- }
- }
- if(!prj)
- {
- for(p : ide.workspace.projects)
- {
- if(IsPathInsideOf(debugger.activeFrame.absoluteFile, p.topNode.path))
- {
- prj = p;
- break;
- }
- }
- }
- }
- debugger.ToggleBreakpoint(debugger.activeFrame.absoluteFile, line, prj);
+ debugger.ToggleBreakpoint(debugger.activeFrame.absoluteFile, line);
Update(null);
{
CodeEditor codeEditor = (CodeEditor)ide.FindWindow(debugger.activeFrame.absoluteFile);
String lastBuildConfigName;
String lastBuildCompilerName;
- Map<String, NameCollisionInfo> lastBuildNamesInfo;
+ Map<String, Map<String, NameCollisionInfo>> configsNameCollisions { };
#ifndef MAKEFILE_GENERATOR
FileMonitor fileMonitor
delete name;
delete lastBuildConfigName;
delete lastBuildCompilerName;
- if(lastBuildNamesInfo) { lastBuildNamesInfo.Free(); delete lastBuildNamesInfo; }
+ for(map : configsNameCollisions)
+ map.Free();
+ configsNameCollisions.Free();
}
~Project()
ProjectNode FindNodeByObjectFileName(char * fileName, IntermediateFileType type, bool dotMain, ProjectConfig config)
{
ProjectNode result;
- if(!lastBuildNamesInfo)
+ char * cfgName;
+ if(!config)
+ config = this.config;
+ cfgName = config ? config.name : "";
+ if(!configsNameCollisions[cfgName])
ProjectLoadLastBuildNamesInfo(this, config);
- result = topNode.FindByObjectFileName(fileName, type, dotMain, lastBuildNamesInfo);
+ result = topNode.FindByObjectFileName(fileName, type, dotMain, configsNameCollisions[cfgName]);
return result;
}
}
#endif
- // This method is only called from Debugger, should be moved to Debugger class?
-#ifndef MAKEFILE_GENERATOR
- bool GetRelativePath(char * filePath, char * relativePath)
- {
- ProjectNode node;
- char moduleName[MAX_FILENAME];
- GetLastDirectory(filePath, moduleName);
- // try with workspace dir first?
- if((node = topNode.Find(moduleName, false)))
- {
- strcpy(relativePath, strcmp(node.path, ".") ? node.path : "");
- PathCatSlash(relativePath, node.name);
- return true;
- }
- else
- {
- // Tweak for automatically resolving symbol loader modules
- char * sl = strstr(moduleName, ".main.ec");
- if(sl && (*sl = 0, !strcmpi(moduleName, name)))
- {
- char objDir[MAX_LOCATION];
- DirExpression objDirExp;
- CompilerConfig compiler = ide.debugger.currentCompiler;
- ProjectConfig config = ide.debugger.prjConfig;
- int bitDepth = ide.debugger.bitDepth;
- // This is not perfect, as multiple source files exist for the symbol loader module...
- // We try to set it in the debug config object directory.
- if(!compiler || !config)
- {
- // If we're not currently debugging, set a breakpoint in the active compiler/config
- compiler = GetCompilerConfig();
- config = this.config;
- // If the current config is not debuggable, set it in the first debuggable config found
- if(config && !config.options.debug)
- {
- for(c : configurations; c.options.debug)
- {
- config = c;
- break;
- }
- }
- }
- objDirExp = GetObjDir(compiler, config, bitDepth);
- strcpy(objDir, objDirExp.dir);
- delete objDirExp;
- ChangeCh(objDir, '\\', '/'); // TODO: this is a hack, paths should never include win32 path seperators - fix this in ProjectSettings and ProjectLoad instead
- ReplaceSpaces(relativePath, objDir);
- *sl = '.';
- PathCatSlash(relativePath, moduleName);
- return true;
- }
- }
- // WARNING: On failure, relative path is uninitialized
- return false;
- }
-#endif
-
void CatTargetFileName(char * string, CompilerConfig compiler, ProjectConfig config)
{
TargetTypes targetType = GetTargetType(config);
void ModifiedAllConfigs(bool making, bool compiling, bool linking, bool symbolGen)
{
+ Map<String, NameCollisionInfo> cfgNameCollision = configsNameCollisions[""];
+ if(cfgNameCollision)
+ {
+ cfgNameCollision.Free();
+ delete cfgNameCollision;
+ configsNameCollisions[""] = null;
+ }
for(cfg : configurations)
{
if(making)
+ {
cfg.makingModified = true;
+ cfgNameCollision = configsNameCollisions[cfg.name];
+ if(cfgNameCollision)
+ {
+ cfgNameCollision.Free();
+ delete cfgNameCollision;
+ configsNameCollisions[cfg.name] = null;
+ }
+ }
if(compiling)
cfg.compilingModified = true;
if(linking)
int numJobs = compiler.numJobs;
char command[MAX_F_STRING*4];
char * compilerName = CopyString(compiler.name);
+ Map<String, NameCollisionInfo> cfgNameCollisions;
delete lastBuildConfigName;
lastBuildConfigName = CopyString(config ? config.name : "Common");
delete lastBuildCompilerName;
lastBuildCompilerName = CopyString(compiler.name);
ProjectLoadLastBuildNamesInfo(this, config);
+ cfgNameCollisions = configsNameCollisions[config ? config.name : ""];
CamelCase(compilerName);
else
{
if(!eC_Debug)
- node.DeleteIntermediateFiles(compiler, config, bitDepth, lastBuildNamesInfo, mode == cObject ? true : false);
- node.GetTargets(config, lastBuildNamesInfo, objDirExp.dir, makeTargets);
+ node.DeleteIntermediateFiles(compiler, config, bitDepth, cfgNameCollisions, mode == cObject ? true : false);
+ node.GetTargets(config, cfgNameCollisions, objDirExp.dir, makeTargets);
}
}
}
static inline void ProjectLoadLastBuildNamesInfo(Project prj, ProjectConfig cfg)
{
- if(prj.lastBuildNamesInfo)
+ char * cfgName = cfg ? cfg.name : "";
+ Map<String, NameCollisionInfo> cfgNameCollisions = prj.configsNameCollisions[cfgName];
+ if(cfgNameCollisions)
{
- prj.lastBuildNamesInfo.Free();
- delete prj.lastBuildNamesInfo;
+ cfgNameCollisions.Free();
+ delete cfgNameCollisions;
}
- prj.lastBuildNamesInfo = { };
- prj.topNode.GenMakefileGetNameCollisionInfo(prj.lastBuildNamesInfo, cfg);
+ prj.configsNameCollisions[cfgName] = cfgNameCollisions = { };
+ prj.topNode.GenMakefileGetNameCollisionInfo(cfgNameCollisions, cfg);
}
Project LegacyBinaryLoadProject(File f, char * filePath)
}
}
-enum IntermediateFileType { none, ec, c, sym, imp, bowl, o };
+class DotMain : bool
+{
+ //property char * { set { } }
+ DotMain ::FromFileName(char * fileName)
+ {
+ DotMain dotMain = false;
+ if(fileName && fileName[0])
+ {
+ char ext[MAX_EXTENSION];
+ GetExtension(fileName, ext);
+ if(!strcmp(ext, "c") || !strcmp(ext, "ec"))
+ {
+ char stripExt[MAX_LOCATION];
+ strcpy(stripExt, fileName);
+ StripExtension(stripExt);
+ GetExtension(stripExt, ext);
+ if(!strcmp(ext, "main"))
+ dotMain = true;
+ }
+ }
+ return dotMain;
+ }
+}
+
+enum IntermediateFileType
+{
+ none, ec, c, sym, imp, bowl, o;
+
+ //property char * { set { } }
+ IntermediateFileType ::FromExtension(char * extension)
+ {
+ IntermediateFileType type = none;
+ if(extension && extension[0])
+ {
+ if(!fstrcmp(extension, "ec"))
+ type = ec;
+ else if(!fstrcmp(extension, "c"))
+ type = c;
+ else if(!fstrcmp(extension, "sym"))
+ type = sym;
+ else if(!fstrcmp(extension, "imp"))
+ type = imp;
+ else if(!fstrcmp(extension, "bowl"))
+ type = bowl;
+ else if(!fstrcmp(extension, "o"))
+ type = o;
+ }
+ return type;
+ }
+};
class ProjectNode : ListItem
{
if(dotMain)
{
- ReplaceSpaces(buffer, project.moduleName);
+ Project prj = property::project;
+ ReplaceSpaces(buffer, prj.moduleName);
StripExtension(buffer);
strcat(buffer, ".main.ec");
}
{
if(child.type != file)
result = child.InternalFindByFullPath(path, includeResources, lastDirName);
- else if(child.name && !strcmpi(lastDirName, child.name))
+ else if(child.name && !fstrcmp(lastDirName, child.name))
{
char p[MAX_LOCATION];
child.GetFullFilePath(p);
- if(!strcmpi(p, path))
+ if(!fstrcmp(p, path))
{
result = child;
break;
if(dotMain == true && this.type == project)
{
GetObjectFileName(p, namesInfo, type, dotMain);
- if(!strcmpi(p, fileName))
+ if(!fstrcmp(p, fileName))
result = this;
}
else if(files)
else if(child.type == file && child.name)
{
child.GetObjectFileName(p, namesInfo, type, dotMain);
- if(!strcmpi(p, fileName))
+ if(!fstrcmp(p, fileName))
{
result = child;
break;
if(!colon && !filePath[0])
{
- bool dotMain = false;
// Check if it's one of our modules
node = project.topNode.Find(moduleName, false);
if(node)
}
else
{
- IntermediateFileType type = none;
- ProjectConfig config;
- if(ext[0])
+ char ext[MAX_EXTENSION];
+ GetExtension(fileName, ext);
{
- char ext2[MAX_EXTENSION];
- char stripExt[MAX_LOCATION];
- strcpy(stripExt, moduleName);
- StripExtension(stripExt);
- GetExtension(stripExt, ext2);
- if(ext2[0] && !strcmp(ext2, "main"))
- dotMain = true;
- if(!strcmp(ext, "ec"))
- type = ec;
- else if(!strcmp(ext, "c"))
- type = c;
- else if(!strcmp(ext, "sym"))
- type = sym;
- else if(!strcmp(ext, "imp"))
- type = imp;
- else if(!strcmp(ext, "bowl"))
- type = bowl;
- else if(!strcmp(ext, "o"))
- type = o;
-
+ DotMain dotMain = DotMain::FromFileName(moduleName);
+ IntermediateFileType type = IntermediateFileType::FromExtension(ext);
+ ProjectConfig config = null;
if(type)
{
for(prj : ide.workspace.projects; prj.lastBuildConfigName)
break;
}
}
- }
- if(node)
- {
- char name[MAX_FILENAME];
- Project project = node.project;
- CompilerConfig compiler = ideSettings.GetCompilerConfig(project.lastBuildCompilerName);
- if(compiler)
+ if(node)
{
- int bitDepth = ide.workspace.bitDepth;
- DirExpression objDir = project.GetObjDir(compiler, config, bitDepth);
- strcpy(filePath, project.topNode.path);
- PathCatSlash(filePath, objDir.dir);
- node.GetObjectFileName(name, project.lastBuildNamesInfo, type, dotMain);
- PathCatSlash(filePath, name);
- delete objDir;
+ char name[MAX_FILENAME];
+ Project project = node.project;
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(project.lastBuildCompilerName);
+ if(compiler)
+ {
+ int bitDepth = ide.workspace.bitDepth;
+ DirExpression objDir = project.GetObjDir(compiler, config, bitDepth);
+ strcpy(filePath, project.topNode.path);
+ PathCatSlash(filePath, objDir.dir);
+ node.GetObjectFileName(name, project.configsNameCollisions[config ? config.name : ""], type, dotMain);
+ PathCatSlash(filePath, name);
+ delete objDir;
+ }
+ delete compiler;
}
- delete compiler;
}
}
if(!node)
}
ide.breakpointsView.Update(null);
}
-
+
void Free()
{
delete workspaceFile;