This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 255888
Collapse All | Expand All

(-)a/cnd.debugger.common2/nbproject/project.properties (-1 / +1 lines)
Lines 4-10 Link Here
4
build.compiler.deprecation=false
4
build.compiler.deprecation=false
5
javac.source=1.6
5
javac.source=1.6
6
javac.compilerargs=-Xlint -Xlint:-serial
6
javac.compilerargs=-Xlint -Xlint:-serial
7
spec.version.base=3.28.6
7
spec.version.base=3.28.7
8
extra.module.files=bin/GdbKillProc.exe
8
extra.module.files=bin/GdbKillProc.exe
9
9
10
# added by hand:
10
# added by hand:
(-)a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/NativeDebuggerImpl.java (+41 lines)
Lines 58-68 Link Here
58
58
59
import java.awt.event.ActionEvent;
59
import java.awt.event.ActionEvent;
60
import java.awt.event.ActionListener;
60
import java.awt.event.ActionListener;
61
import java.io.IOException;
61
import java.util.Collection;
62
import java.util.Collection;
62
import java.util.Collections;
63
import java.util.Collections;
63
import java.util.Set;
64
import java.util.Set;
64
import java.util.concurrent.CopyOnWriteArrayList;
65
import java.util.concurrent.CopyOnWriteArrayList;
65
import java.util.concurrent.locks.ReentrantReadWriteLock;
66
import java.util.concurrent.locks.ReentrantReadWriteLock;
67
import java.util.logging.Level;
66
import javax.swing.SwingUtilities;
68
import javax.swing.SwingUtilities;
67
import org.netbeans.modules.cnd.spi.remote.RemoteSyncFactory;
69
import org.netbeans.modules.cnd.spi.remote.RemoteSyncFactory;
68
70
Lines 81-86 Link Here
81
import org.netbeans.modules.cnd.api.toolchain.ui.BuildToolsAction;
83
import org.netbeans.modules.cnd.api.toolchain.ui.BuildToolsAction;
82
import org.netbeans.modules.cnd.api.toolchain.ui.LocalToolsPanelModel;
84
import org.netbeans.modules.cnd.api.toolchain.ui.LocalToolsPanelModel;
83
import org.netbeans.modules.cnd.api.toolchain.ui.ToolsPanelModel;
85
import org.netbeans.modules.cnd.api.toolchain.ui.ToolsPanelModel;
86
import org.netbeans.modules.cnd.debugger.common2.DbgGuiModule;
84
import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
87
import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
85
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
88
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
86
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
89
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
Lines 118-127 Link Here
118
import org.netbeans.modules.cnd.debugger.common2.debugger.spi.DebuggerToolRecognizer;
121
import org.netbeans.modules.cnd.debugger.common2.debugger.spi.DebuggerToolRecognizer;
119
import org.netbeans.modules.cnd.debugger.common2.utils.Executor;
122
import org.netbeans.modules.cnd.debugger.common2.utils.Executor;
120
import org.netbeans.modules.cnd.makeproject.api.configurations.CompilerSet2Configuration;
123
import org.netbeans.modules.cnd.makeproject.api.configurations.CompilerSet2Configuration;
124
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
121
import org.netbeans.modules.cnd.spi.toolchain.CompilerSetFactory;
125
import org.netbeans.modules.cnd.spi.toolchain.CompilerSetFactory;
126
import org.netbeans.modules.remote.spi.FileSystemProvider;
122
import org.netbeans.spi.viewmodel.ModelListener;
127
import org.netbeans.spi.viewmodel.ModelListener;
123
import org.openide.cookies.EditorCookie;
128
import org.openide.cookies.EditorCookie;
124
import org.openide.util.Lookup;
129
import org.openide.util.Lookup;
130
import org.openide.util.Pair;
125
import org.openide.util.actions.SystemAction;
131
import org.openide.util.actions.SystemAction;
126
132
127
/**
133
/**
Lines 302-307 Link Here
302
	return cachedPathMap;
308
	return cachedPathMap;
303
    }
309
    }
304
    
310
    
311
    // It maps source roots to their canonical representations
312
    private volatile LinkedList<Pair<String, String>> pathMap;
313
    private final Object lock = new Object();
314
    
315
    private String expandCanonicalPath(String potentiallyCanonicalPath) {
316
        String ret = potentiallyCanonicalPath;
317
        
318
        synchronized (lock) {
319
            if (pathMap == null) {
320
                pathMap = new LinkedList();
321
                for (String absoluteSourceRoot : MakeConfigurationDescriptor.getMakeConfigurationDescriptor(getNDI().getProject()).getAbsoluteSourceRoots()) {
322
                    try {
323
                        String canonicalSourceRoot = FileSystemProvider.getCanonicalPath(getExecutionEnvironment(), absoluteSourceRoot);
324
                        if (!absoluteSourceRoot.equals(canonicalSourceRoot)) {
325
                            pathMap.add(Pair.of(absoluteSourceRoot, canonicalSourceRoot));
326
                        }
327
                    } catch (IOException ex) {
328
                        DbgGuiModule.logger.log(Level.INFO, ex.getMessage(), ex);
329
                    }
330
                }
331
            }
332
        }
333
334
        if (pathMap.size() > 0) {
335
            for (Pair<String, String> paths : pathMap) {
336
                ret = ret.replace(paths.second(), paths.first());
337
            }
338
        }
339
        
340
        return ret;
341
    }
342
    
305
    public static PathMap getPathMapFromConfig(Configuration conf) {
343
    public static PathMap getPathMapFromConfig(Configuration conf) {
306
        MakeConfiguration mc = (MakeConfiguration) conf;
344
        MakeConfiguration mc = (MakeConfiguration) conf;
307
        ExecutionEnvironment ee = mc.getDevelopmentHost().getExecutionEnvironment();                
345
        ExecutionEnvironment ee = mc.getDevelopmentHost().getExecutionEnvironment();                
Lines 360-365 Link Here
360
	    System.out.printf("    from: %s\n", path); // NOI18N
398
	    System.out.printf("    from: %s\n", path); // NOI18N
361
	    System.out.printf("      to: %s\n", mapped); // NOI18N
399
	    System.out.printf("      to: %s\n", mapped); // NOI18N
362
	}
400
	}
401
        
402
        mapped = expandCanonicalPath(mapped);
403
        
363
	return mapped;
404
	return mapped;
364
    }
405
    }
365
406
(-)a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/NativeDebuggerInfo.java (+21 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.modules.cnd.debugger.common2.debugger;
45
package org.netbeans.modules.cnd.debugger.common2.debugger;
46
46
47
import org.netbeans.api.project.Project;
48
import org.netbeans.api.project.ui.OpenProjects;
47
import org.netbeans.modules.cnd.debugger.common2.DbgActionHandler;
49
import org.netbeans.modules.cnd.debugger.common2.DbgActionHandler;
48
import org.netbeans.modules.cnd.makeproject.api.configurations.*;
50
import org.netbeans.modules.cnd.makeproject.api.configurations.*;
49
import org.netbeans.modules.cnd.makeproject.api.runprofiles.RunProfile;
51
import org.netbeans.modules.cnd.makeproject.api.runprofiles.RunProfile;
Lines 56-61 Link Here
56
import org.netbeans.modules.cnd.debugger.common2.debugger.api.EngineDescriptor;
58
import org.netbeans.modules.cnd.debugger.common2.debugger.api.EngineDescriptor;
57
import org.netbeans.modules.cnd.debugger.common2.debugger.remote.Host;
59
import org.netbeans.modules.cnd.debugger.common2.debugger.remote.Host;
58
import org.netbeans.modules.cnd.debugger.common2.utils.Executor;
60
import org.netbeans.modules.cnd.debugger.common2.utils.Executor;
61
import org.openide.filesystems.FileObject;
59
import org.openide.windows.InputOutput;
62
import org.openide.windows.InputOutput;
60
63
61
64
Lines 154-159 Link Here
154
    public final void setConfiguration(Configuration configuration) {
157
    public final void setConfiguration(Configuration configuration) {
155
	this.configuration = configuration;
158
	this.configuration = configuration;
156
    }
159
    }
160
    
161
    private final Object lock = new Object();
162
    private volatile Project project;
163
    
164
    public final Project getProject() {
165
        synchronized (lock) {
166
            if (project == null) {
167
                FileObject projectDir = getConfiguration().getBaseFSPath().getFileObject();
168
                for (Project openProject : OpenProjects.getDefault().getOpenProjects()) {
169
                    if (openProject.getProjectDirectory().equals(projectDir)) {
170
                        project = openProject;
171
                    }
172
                }
173
            }
174
        }
175
        
176
        return project;
177
    }
157
178
158
    private DebugTarget debugtarget;
179
    private DebugTarget debugtarget;
159
    public final void setDebugTarget(DebugTarget dt) {
180
    public final void setDebugTarget(DebugTarget dt) {

Return to bug 255888