ide; (#968) fixed toggling a breakpoint in wrong file with same file name in differen...
authorRejean Loyer <rejean.loyer@gmail.com>
Wed, 28 Aug 2013 18:40:22 +0000 (14:40 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 29 Aug 2013 09:03:49 +0000 (05:03 -0400)
ide/src/debugger/Debugger.ec
ide/src/designer/CodeEditor.ec
ide/src/panels/BreakpointsView.ec
ide/src/project/Workspace.ec

index 940f79e..1f495a3 100644 (file)
@@ -4470,6 +4470,29 @@ class Breakpoint : struct
       return location;
    }
 
+   char * CopyUserLocationString()
+   {
+      char * location;
+      char * loc = CopyLocationString(false);
+      Project prj = null;
+      for(p : ide.workspace.projects)
+      {
+         if(p.topNode.FindByFullPath(absoluteFilePath, false))
+         {
+            prj = p;
+            break;
+         }
+      }
+      if(prj)
+      {
+         location = PrintString("(", prj.name, ")", loc);
+         delete loc;
+      }
+      else
+         location = loc;
+      return location;
+   }
+
    void Save(File f)
    {
       if(relativeFilePath && relativeFilePath[0])
index 9041091..e4ff770 100644 (file)
@@ -1988,15 +1988,12 @@ class CodeEditor : Window
          if(projectView && fileName)
          {
             int line = editBox.lineNumber + 1;
-            char name[MAX_LOCATION];
             Project prj = null;
-            // TOFIX: This only looks at the filename...
-            GetLastDirectory(fileName, name);
             if(ide && ide.workspace)
             {
                for(p : ide.workspace.projects)
                {
-                  if(p.topNode.Find(name, false))
+                  if(p.topNode.FindByFullPath(fileName, false))
                   {
                      prj = p;
                      break;
index 33ff2b4..afc497d 100644 (file)
@@ -217,7 +217,7 @@ class BreakpointsView : Window
          char string[32];
          char * location;
          Breakpoint bp = (Breakpoint)row.tag;
-         location = bp.CopyLocationString(false);
+         location = bp.CopyUserLocationString();
 #if defined(__WIN32__)
          ChangeCh(location, '/', '\\');
 #endif
index 521545f..c0ff9ff 100644 (file)
@@ -513,7 +513,7 @@ public:
       Breakpoint bp = (Breakpoint)row.tag;
       if(bp)
       {
-         char * currentLoc = bp.CopyLocationString(false);
+         char * currentLoc = bp.CopyUserLocationString();
          if(strcmp(location, currentLoc))
          {
             // todo, parse location