ecere/sys/JSON: Fixed broken TimeStamp text serialization
[sdk] / ide / src / debugger / Debugger.ec
index ffb67e7..6d19835 100644 (file)
@@ -821,7 +821,7 @@ class Debugger
             if(frame.absoluteFile)
                editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, false, true, null, no, normal, false);
             if(!editor && frame.file)
-               frame.absoluteFile = ide.workspace.GetAbsolutePathFromRelative(frame.file);
+               frame.absoluteFile = ide.workspace.CopyAbsolutePathFromRelative(frame.file);
             if(!frame.absoluteFile && askForLocation && frame.file)
             {
                char * s = null;
@@ -832,7 +832,7 @@ class Debugger
                if(SourceDirDialog(title, ide.workspace.projectDir, frame.file, sourceDir))
                {
                   AddSourceDir(sourceDir);
-                  frame.absoluteFile = ide.workspace.GetAbsolutePathFromRelative(frame.file);
+                  frame.absoluteFile = ide.workspace.CopyAbsolutePathFromRelative(frame.file);
                }
             }
             if(!editor && frame.absoluteFile)
@@ -1061,9 +1061,10 @@ class Debugger
    void RunToCursor(CompilerConfig compiler, ProjectConfig config, int bitDepth, bool useValgrind, const char * absoluteFilePath, int lineNumber, bool ignoreBreakpoints, bool atSameLevel, bool oldImplementation)
    {
       char relativeFilePath[MAX_LOCATION];
+      const char * objectFileExt = compiler ? compiler.objectFileExt : objectDefaultFileExt;
       _dpcl(_dpct, dplchan::debuggerCall, 0, "Debugger::RunToCursor()");
       _ChangeUserAction(runToCursor);
-      ide.workspace.GetRelativePath(absoluteFilePath, relativeFilePath, null);
+      ide.workspace.GetRelativePath(absoluteFilePath, relativeFilePath, null, objectFileExt);
 
       if(bpRunToCursor && bpRunToCursor.inserted && symbols)
       {
@@ -1339,8 +1340,9 @@ class Debugger
       {
          Project owner;
          char relativePath[MAX_LOCATION];
+         const char * objectFileExt = currentCompiler ? currentCompiler.objectFileExt : objectDefaultFileExt;
 
-         ide.workspace.GetRelativePath(absolutePath, relativePath, &owner);
+         ide.workspace.GetRelativePath(absolutePath, relativePath, &owner, objectFileExt);
 
          if(!owner && !FileExists(absolutePath))
          {
@@ -1508,7 +1510,7 @@ class Debugger
                Workspace ws = ide.workspace;
                if(ws)
                {
-                  String path = ide.workspace.GetPathWorkspaceRelativeOrAbsolute(item.value);
+                  String path = ide.workspace.CopyUnixPathWorkspaceRelativeOrAbsolute(item.value);
                   if(strcmp(frame.file, path))
                      frame.file = path;
                   delete path;
@@ -2100,7 +2102,8 @@ class Debugger
       GdbExecCommon();
       if(absoluteFilePath)
       {
-         ide.workspace.GetRelativePath(absoluteFilePath, relativeFilePath, null);
+         const char * objectFileExt = currentCompiler ? currentCompiler.objectFileExt : objectDefaultFileExt;
+         ide.workspace.GetRelativePath(absoluteFilePath, relativeFilePath, null, objectFileExt);
          if(!GdbCommand(0.1, true, "-exec-until %s:%d", relativeFilePath, lineNumber))
          {
             GetLastDirectory(relativeFilePath, relativeFilePath);
@@ -2126,7 +2129,8 @@ class Debugger
       GdbExecCommon();
       if(lineNumber)
       {
-         ide.workspace.GetRelativePath(absoluteFilePathOrLocation, relativeFilePath, null);
+         const char * objectFileExt = currentCompiler ? currentCompiler.objectFileExt : objectDefaultFileExt;
+         ide.workspace.GetRelativePath(absoluteFilePathOrLocation, relativeFilePath, null, objectFileExt);
          if(!GdbCommand(0.1, true, "advance %s:%d", relativeFilePath, lineNumber)) // should use -exec-advance -- GDB/MI implementation missing
          {
             GetLastDirectory(relativeFilePath, relativeFilePath);
@@ -2908,7 +2912,7 @@ class Debugger
                   {
                      Expression memberExp = exp.member.exp;
                      Identifier memberID = exp.member.member;
-                     Type type = memberExp.expType;
+                     Type type = memberExp ? memberExp.expType : null;
                      Class _class = (type && memberID) ? (memberID && memberID.classSym) ? memberID.classSym.registered : ((type.kind == classType && type._class) ? type._class.registered : null) : null;
                      if(_class && memberID && memberID.string)
                         snprintf(watchmsg, sizeof(watchmsg), $"Missing property evaluation for \"%s\" in class \"%s\"", memberID.string, _class.name);
@@ -4822,7 +4826,7 @@ class Breakpoint : struct
          {
             if(!strcmp(prjName, prj.name))
             {
-               if(prj.GetAbsoluteFromRelativePath(filePath, fullPath))
+               if(prj.GetAbsoluteFromRelativePath(filePath, fullPath, null))
                {
                   property::absoluteFilePath = fullPath;
                   project = prj;
@@ -4836,7 +4840,7 @@ class Breakpoint : struct
       else
       {
          Project prj = ide.project;
-         if(prj.GetAbsoluteFromRelativePath(filePath, fullPath))
+         if(prj.GetAbsoluteFromRelativePath(filePath, fullPath, null))
          {
             property::absoluteFilePath = fullPath;
             project = prj;
@@ -5014,7 +5018,7 @@ class CodeLocation : struct
                {
                   CodeLocation codloc { line = line };
                   codloc.file = CopyString(loc);
-                  codloc.absoluteFile = ide.workspace.GetAbsolutePathFromRelative(loc);
+                  codloc.absoluteFile = ide.workspace.CopyAbsolutePathFromRelative(loc);
                   return codloc;
                }
             }