ide: fix active bith depth dropbox is not updated with value from workspace file.
[sdk] / ide / src / ide.ec
old mode 100644 (file)
new mode 100755 (executable)
index c9aa31d..ceea56c
@@ -439,12 +439,16 @@ class IDEWorkSpace : Window
 
       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)
@@ -1634,6 +1638,8 @@ class IDEWorkSpace : Window
    };
 
    bool noParsing;
+   bool debugStart;
+   bool debugHideIDE;
 
 #ifdef GDB_DEBUG_GUI
    GDBDialog gdbDialog
@@ -1888,6 +1894,7 @@ class IDEWorkSpace : Window
       }
       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)
@@ -2662,13 +2669,13 @@ class IDEWorkSpace : Window
       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);
    }
 
-   FileAttribs GoToCodeSelectFile(const char * filePath, const char * dir, Project prj, ProjectNode * node, char * selectedPath)
+   FileAttribs GoToCodeSelectFile(const char * filePath, const char * dir, Project prj, ProjectNode * node, char * selectedPath, const char * objectFileExt)
    {
       FileAttribs result { };
       FileAttribs fileAttribs;
@@ -2715,7 +2722,7 @@ class IDEWorkSpace : Window
                      }
                   }
                }
-               if(!n && (n = workspace.GetObjectFileNode(filePath, &project, selectedPath)) && project &&
+               if(!n && (n = workspace.GetObjectFileNode(filePath, &project, selectedPath, objectFileExt)) && project &&
                      (fileAttribs = FileExists(selectedPath)).isFile)
                {
                   if(node) *node = n;
@@ -2727,7 +2734,7 @@ class IDEWorkSpace : Window
       return result;
    }
 
-   void CodeLocationParseAndGoTo(const char * text, Project project, const char * dir)
+   void CodeLocationParseAndGoTo(const char * text, Project project, const char * dir, const char * objectFileExt)
    {
       char *s = null;
       const char *path = text;
@@ -2822,7 +2829,7 @@ class IDEWorkSpace : Window
          strcpy(filePath, path);
       }
 
-      if((fileAttribs = GoToCodeSelectFile(filePath, dir, prj, null, completePath)))
+      if((fileAttribs = GoToCodeSelectFile(filePath, dir, prj, null, completePath, objectFileExt)))
          CodeLocationGoTo(completePath, fileAttribs, line, col);
    }
 
@@ -2835,7 +2842,8 @@ class IDEWorkSpace : Window
          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);
@@ -3065,7 +3073,7 @@ class IDEWorkSpace : Window
                               {
                                  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;
                               }
                            }
@@ -3106,7 +3114,6 @@ class IDEWorkSpace : Window
    {
       int c;
       bool passThrough = false;
-      bool debugStart = false;
       bool debugWorkDir = false;
       char * passDebugWorkDir = null;
       bool openAsText = false;
@@ -3136,7 +3143,9 @@ class IDEWorkSpace : Window
          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], "-@"))
@@ -3154,7 +3163,7 @@ class IDEWorkSpace : Window
             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)
@@ -3207,8 +3216,6 @@ class IDEWorkSpace : Window
          workspace.debugDir = passDebugWorkDir;
          delete passDebugWorkDir;
       }
-      if(debugStart)
-         ;//MenuDebugStart(debugStartResumeItem, 0); // <-- how TODO this without getting into the app.Wait lock
 
       UpdateToolBarActiveConfigs(false);
       UpdateToolBarActiveCompilers();
@@ -3303,17 +3310,21 @@ class IDEWorkSpace : Window
 
       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);
@@ -3720,6 +3731,7 @@ class IDEApp : GuiApplication
             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], "-@"))