From dec6fb5e70ad14eb9dad507e81616329c89180bf Mon Sep 17 00:00:00 2001 From: Rejean Loyer Date: Wed, 28 Aug 2013 14:40:22 -0400 Subject: [PATCH] ide; (#968) fixed toggling a breakpoint in wrong file with same file name in different added projects. --- ide/src/debugger/Debugger.ec | 23 +++++++++++++++++++++++ ide/src/designer/CodeEditor.ec | 5 +---- ide/src/panels/BreakpointsView.ec | 2 +- ide/src/project/Workspace.ec | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ide/src/debugger/Debugger.ec b/ide/src/debugger/Debugger.ec index 940f79e..1f495a3 100644 --- a/ide/src/debugger/Debugger.ec +++ b/ide/src/debugger/Debugger.ec @@ -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]) diff --git a/ide/src/designer/CodeEditor.ec b/ide/src/designer/CodeEditor.ec index 9041091..e4ff770 100644 --- a/ide/src/designer/CodeEditor.ec +++ b/ide/src/designer/CodeEditor.ec @@ -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; diff --git a/ide/src/panels/BreakpointsView.ec b/ide/src/panels/BreakpointsView.ec index 33ff2b4..afc497d 100644 --- a/ide/src/panels/BreakpointsView.ec +++ b/ide/src/panels/BreakpointsView.ec @@ -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 diff --git a/ide/src/project/Workspace.ec b/ide/src/project/Workspace.ec index 521545f..c0ff9ff 100644 --- a/ide/src/project/Workspace.ec +++ b/ide/src/project/Workspace.ec @@ -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 -- 1.8.3.1