void OnGotoError(const char * line, bool noParsing)
{
- ide.GoToError(line, noParsing);
+ CompilerConfig compiler = ide.workspace ? ideSettings.GetCompilerConfig(ide.workspace.compiler) : null;
+ const char * objectFileExt = compiler ? compiler.objectFileExt : objectDefaultFileExt;
+ ide.GoToError(line, noParsing, objectFileExt);
}
void OnCodeLocationParseAndGoTo(const char * line)
{
- ide.CodeLocationParseAndGoTo(line, ide.findInFilesDialog.findProject, ide.findInFilesDialog.findDir);
+ CompilerConfig compiler = ide.workspace ? ideSettings.GetCompilerConfig(ide.workspace.compiler) : null;
+ const char * objectFileExt = compiler ? compiler.objectFileExt : objectDefaultFileExt;
+ ide.CodeLocationParseAndGoTo(line, ide.findInFilesDialog.findProject, ide.findInFilesDialog.findDir, objectFileExt);
}
bool OnKeyDown(Key key, unichar ch)
};
bool noParsing;
+ bool debugStart;
+ bool debugHideIDE;
#ifdef GDB_DEBUG_GUI
GDBDialog gdbDialog
}
if(!toolBar.activeCompiler.currentRow && toolBar.activeCompiler.firstRow)
toolBar.activeCompiler.SelectRow(toolBar.activeCompiler.firstRow);
+ toolBar.activeBitDepth.SelectRow(toolBar.activeBitDepth.FindRow(workspace ? workspace.bitDepth : 0));
}
void UpdateToolBarActiveConfigs(bool selectionOnly)
return true;
}
- void GoToError(const char * line, bool noParsing)
+ void GoToError(const char * line, bool noParsing, const char * objectFileExt)
{
if(projectView)
- projectView.GoToError(line, noParsing);
+ projectView.GoToError(line, noParsing, objectFileExt);
}
- void CodeLocationParseAndGoTo(const char * text, Project project, const char * dir)
+ FileAttribs GoToCodeSelectFile(const char * filePath, const char * dir, Project prj, ProjectNode * node, char * selectedPath, const char * objectFileExt)
+ {
+ FileAttribs result { };
+ FileAttribs fileAttribs;
+ if(filePath[0])
+ {
+ if(prj)
+ strcpy(selectedPath, prj.topNode.path);
+ else if(dir && dir[0])
+ strcpy(selectedPath, dir);
+ else
+ selectedPath[0] = '\0';
+ PathCat(selectedPath, filePath);
+
+ if((fileAttribs = FileExists(selectedPath)).isFile)
+ result = fileAttribs;
+ else if(workspace)
+ {
+ bool done = false;
+ for(p : workspace.projects)
+ {
+ strcpy(selectedPath, p.topNode.path);
+ PathCat(selectedPath, filePath);
+ if((fileAttribs = FileExists(selectedPath)).isFile)
+ {
+ done = true;
+ result = fileAttribs;
+ break;
+ }
+ }
+ if(!done)
+ {
+ Project project;
+ ProjectNode n = null;
+ for(p : workspace.projects)
+ {
+ if((n = p.topNode.Find(filePath, false)))
+ {
+ n.GetFullFilePath(selectedPath);
+ if((fileAttribs = FileExists(selectedPath)).isFile)
+ {
+ if(node) *node = n;
+ result = fileAttribs;
+ break;
+ }
+ }
+ }
+ if(!n && (n = workspace.GetObjectFileNode(filePath, &project, selectedPath, objectFileExt)) && project &&
+ (fileAttribs = FileExists(selectedPath)).isFile)
+ {
+ if(node) *node = n;
+ result = fileAttribs;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ void CodeLocationParseAndGoTo(const char * text, Project project, const char * dir, const char * objectFileExt)
{
char *s = null;
const char *path = text;
FileAttribs fileAttribs;
// support for valgrind output
- if((s = strstr(text, "==")) && (s = strstr(s+2, "==")) && (s = strstr(s+2, ":")) && (s = strstr(s+1, ":")))
+ if((s = strstr(text, "==")) && s == text && (s = strstr(s+2, "==")) && (s = strstr(s+2, ":")) && (s = strstr(s+1, ":")))
{
colon = s;
for(; s>text; s--)
strcpy(filePath, path);
}
- if(filePath[0])
- {
- if(prj)
- strcpy(completePath, prj.topNode.path);
- else if(dir && dir[0])
- strcpy(completePath, dir);
- else
- completePath[0] = '\0';
- PathCat(completePath, filePath);
-
- if((fileAttribs = FileExists(completePath)))
- CodeLocationGoTo(completePath, fileAttribs, line, col);
- else if(ide.workspace)
- {
- bool done = false;
- for(p : ide.workspace.projects)
- {
- strcpy(completePath, p.topNode.path);
- PathCat(completePath, filePath);
- if((fileAttribs = FileExists(completePath)).isFile)
- {
- CodeLocationGoTo(completePath, fileAttribs, line, col);
- done = true;
- break;
- }
- }
- if(!done)
- {
- for(p : ide.workspace.projects)
- {
- ProjectNode node = p.topNode.Find(filePath, false);
- if(node)
- {
- node.GetFullFilePath(completePath);
- if((fileAttribs = FileExists(completePath)).isFile)
- {
- CodeLocationGoTo(completePath, fileAttribs, line, col);
- break;
- }
- }
- }
- }
- }
- }
+ if((fileAttribs = GoToCodeSelectFile(filePath, dir, prj, null, completePath, objectFileExt)))
+ CodeLocationGoTo(completePath, fileAttribs, line, col);
}
void CodeLocationGoTo(const char * path, const FileAttribs fileAttribs, int line, int col)
strlwr(ext);
if(binaryDocExt.Find(ext))
ShellOpen(path);
- else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe"))
+ else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "bc") ||
+ !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe"))
{
char dirPath[MAX_LOCATION];
StripLastDirectory(path, dirPath);
}
else
{
- CodeEditor codeEditor = (CodeEditor)OpenFile(path, false, true, ext, no, normal, false);
- if(codeEditor && line)
+ CodeEditor codeEditor = (CodeEditor)OpenFile(path, false, true, !strcmpi(ext, "epj") ? "txt" : ext, no, normal, false);
+ if(codeEditor && codeEditor._class == class(CodeEditor) && line)
{
EditBox editBox = codeEditor.editBox;
editBox.GoToLineNum(line - 1);
{
List<ProjectNode> nodes { };
nodes.Add(node);
- projectView.Compile(node.project, nodes, mods.ctrl && mods.shift, isCObject ? cObject : normal);
+ projectView.Compile(node.project, nodes, false, false, isCObject ? cObject : normal);
delete nodes;
}
}
{
int c;
bool passThrough = false;
- bool debugStart = false;
bool debugWorkDir = false;
char * passDebugWorkDir = null;
bool openAsText = false;
else if(!strcmp(app.argv[c], "-no-parsing"))
ide.noParsing = true;
else if(!strcmp(app.argv[c], "-debug-start"))
- debugStart = true;
+ ide.debugStart = true;
+ else if(!strcmp(app.argv[c], "-debug-hide-ide"))
+ ide.debugHideIDE = true;
else if(!strcmp(app.argv[c], "-debug-work-dir"))
debugWorkDir = true;
else if(!strcmp(app.argv[c], "-@"))
GetExtension(app.argv[c], ext);
isProject = !openAsText && !strcmpi(ext, "epj");
- if(isProject && c > (debugStart ? 2 : 1)) continue;
+ if(isProject && c > 1 + (ide.debugStart ? 1 : 0) + (ide.debugHideIDE ? 1 : 0)) continue;
// Create directory for projects (only)
if(((dirAttribs = FileExists(parentPath)) && dirAttribs.isDirectory) || isProject)
workspace.debugDir = passDebugWorkDir;
delete passDebugWorkDir;
}
- if(debugStart)
- ;//MenuDebugStart(debugStartResumeItem, 0); // <-- how TODO this without getting into the app.Wait lock
UpdateToolBarActiveConfigs(false);
UpdateToolBarActiveCompilers();
for(item : compiler.executableDirs)
{
+ DirExpression dirExpr { };
+ dirExpr.Evaluate(item, null, compiler, null, 0);
found = false;
+
for(p : newExePaths)
{
- if(!fstrcmp(p, item))
+ if(!fstrcmp(p, dirExpr.dir))
{
found = true;
break;
}
}
if(!found)
- newExePaths.Add(CopySystemPath(item));
+ newExePaths.Add(CopySystemPath(dirExpr.dir));
+ delete dirExpr;
}
GetEnvironment("PATH", oldList, maxPathLen);
else if(!strcmp(app.argv[c], "-t"));
else if(!strcmp(app.argv[c], "-no-parsing"));
else if(!strcmp(app.argv[c], "-debug-start"));
+ else if(!strcmp(app.argv[c], "-debug-hide-ide"));
else if(!strcmp(app.argv[c], "-debug-work-dir"))
debugWorkDir = true;
else if(!strcmp(app.argv[c], "-@"))