mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Bug 196885, cache the "is the exe a binary" value.
This commit is contained in:
parent
16c0c77295
commit
4f7831b525
1 changed files with 12 additions and 2 deletions
|
@ -13,8 +13,10 @@
|
||||||
package org.eclipse.cdt.launch.ui;
|
package org.eclipse.cdt.launch.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.ICDescriptor;
|
import org.eclipse.cdt.core.ICDescriptor;
|
||||||
|
@ -128,6 +130,8 @@ public class CMainTab extends CLaunchConfigurationTab {
|
||||||
/** @since 6.0 */
|
/** @since 6.0 */
|
||||||
public static final int SPECIFY_CORE_FILE = 4;
|
public static final int SPECIFY_CORE_FILE = 4;
|
||||||
|
|
||||||
|
private final Map<IPath, Boolean> fBinaryExeCache = new HashMap<IPath, Boolean>();
|
||||||
|
|
||||||
|
|
||||||
public CMainTab() {
|
public CMainTab() {
|
||||||
this(WANTS_TERMINAL);
|
this(WANTS_TERMINAL);
|
||||||
|
@ -790,8 +794,14 @@ public class CMainTab extends CLaunchConfigurationTab {
|
||||||
*/
|
*/
|
||||||
protected boolean isBinary(IProject project, IPath exePath) throws CoreException {
|
protected boolean isBinary(IProject project, IPath exePath) throws CoreException {
|
||||||
try {
|
try {
|
||||||
IBinaryObject exe = LaunchUtils.getBinary(project, exePath);
|
Boolean binValue = fBinaryExeCache.get(exePath);
|
||||||
return exe != null;
|
if (binValue == null)
|
||||||
|
{
|
||||||
|
IBinaryObject exe = LaunchUtils.getBinary(project, exePath);
|
||||||
|
binValue = exe != null;
|
||||||
|
fBinaryExeCache.put(exePath, binValue);
|
||||||
|
}
|
||||||
|
return binValue;
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue