1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
David Inglis 2003-01-16 19:25:42 +00:00
parent 1ab7121260
commit ad047ecf89
5 changed files with 46 additions and 19 deletions

View file

@ -1,3 +1,12 @@
2003-01-16 David Inglis
* src/.../launch/AbstractCLaunchDelegate.java
add check for program existance on disk before launch
* src/.../launch/internal/ui/AbstractCDebuggerTab.java
* src/.../launch/ui/CDebuggerTab.java
* src/.../launch/ui/CorefileDebuggerTab.java
Fixed http://bugs.eclipse.org/bugs/show_bug.cgi?id=29532
2003-01-06 Alain Magloire 2003-01-06 Alain Magloire
* build.properties: Patch from Judy Green. * build.properties: Patch from Judy Green.

View file

@ -396,7 +396,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
} }
IFile projectPath = ((IProject) cproject.getResource()).getFile(fileName); IFile projectPath = ((IProject) cproject.getResource()).getFile(fileName);
if (projectPath == null || !projectPath.exists()) { if (projectPath == null || !projectPath.exists() || !projectPath.getLocation().toFile().exists()) {
abort("Program file does not exist", null, ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); abort("Program file does not exist", null, ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
} }
return projectPath.getLocation(); return projectPath.getLocation();
@ -510,7 +510,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
private String parseToken() { private String parseToken() {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
while (ch > 0 && !Character.isWhitespace((char) ch)) { while (ch > 0 && !Character.isWhitespace((char) ch)) {
if (ch == '\\') { if (ch == '\\') {
ch = getNext(); ch = getNext();

View file

@ -26,6 +26,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
// Dynamic Debugger UI widgets // Dynamic Debugger UI widgets
protected ILaunchConfigurationTab fDynamicTab; protected ILaunchConfigurationTab fDynamicTab;
protected Composite fDynamicTabHolder; protected Composite fDynamicTabHolder;
private boolean fInitDefaults;
protected void setDebugConfig(ICDebugConfiguration config) { protected void setDebugConfig(ICDebugConfiguration config) {
fCurrentDebugConfig = config; fCurrentDebugConfig = config;
@ -76,8 +77,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
ILaunchConfigurationTab tab = getDynamicTab(); ILaunchConfigurationTab tab = getDynamicTab();
if ((super.getErrorMessage() != null) || (tab == null)) { if ((super.getErrorMessage() != null) || (tab == null)) {
return super.getErrorMessage(); return super.getErrorMessage();
} } else {
else {
return tab.getErrorMessage(); return tab.getErrorMessage();
} }
} }
@ -100,23 +100,24 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
if (wc != null) { if (wc != null) {
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null); wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null);
} }
} } else {
else {
if (wc == null) { if (wc == null) {
try { try {
if (getLaunchConfiguration().isWorkingCopy()) { if (getLaunchConfiguration().isWorkingCopy()) {
// get a fresh copy to work on setLaunchConfigurationWorkingCopy((ILaunchConfigurationWorkingCopy)getLaunchConfiguration());
wc = ((ILaunchConfigurationWorkingCopy) getLaunchConfiguration()).getOriginal().getWorkingCopy(); } else {
setLaunchConfigurationWorkingCopy(getLaunchConfiguration().getWorkingCopy());
} }
else { wc = getLaunchConfigurationWorkingCopy();
wc = getLaunchConfiguration().getWorkingCopy();
} } catch (CoreException e) {
}
catch (CoreException e) {
return; return;
} }
} }
getDynamicTab().setDefaults(wc); if (initDefaults()) {
getDynamicTab().setDefaults(wc);
}
setInitializeDefault(false);
getDynamicTab().initializeFrom(wc); getDynamicTab().initializeFrom(wc);
} }
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -137,9 +138,12 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
ICDebugConfiguration debugConfig = getConfigForCurrentDebugger(); ICDebugConfiguration debugConfig = getConfigForCurrentDebugger();
if (debugConfig == null) { if (debugConfig == null) {
setDynamicTab(null); setDynamicTab(null);
} } else {
else {
setDynamicTab(CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID())); setDynamicTab(CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()));
ICDebugConfiguration oldConfig = getDebugConfig();
if ( oldConfig != null && oldConfig != debugConfig ) {
setInitializeDefault(true);
}
} }
setDebugConfig(debugConfig); setDebugConfig(debugConfig);
if (getDynamicTab() == null) { if (getDynamicTab() == null) {
@ -165,13 +169,12 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
} }
public void performApply(ILaunchConfigurationWorkingCopy config) { public void performApply(ILaunchConfigurationWorkingCopy config) {
if ( getDebugConfig() != null ) { if (getDebugConfig() != null) {
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID()); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID());
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ILaunchConfigurationTab dynamicTab = getDynamicTab();
if (dynamicTab == null) { if (dynamicTab == null) {
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null);
} } else {
else {
dynamicTab.performApply(config); dynamicTab.performApply(config);
} }
} }
@ -182,6 +185,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ILaunchConfigurationTab dynamicTab = getDynamicTab();
if (dynamicTab != null) { if (dynamicTab != null) {
dynamicTab.setDefaults(config); dynamicTab.setDefaults(config);
setInitializeDefault(false);
} }
} }
@ -200,4 +204,12 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
return true; return true;
} }
protected void setInitializeDefault(boolean init) {
fInitDefaults = init;
}
protected boolean initDefaults() {
return fInitDefaults;
}
} }

View file

@ -132,6 +132,9 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
} }
} }
} }
// if no selection meaning nothing in config the force initdefault on tab
setInitializeDefault(selection.equals("") ? true : false);
fDCombo.select(selndx == -1 ? 0 : selndx); fDCombo.select(selndx == -1 ? 0 : selndx);
//The behaviour is undefined for if the callbacks should be triggered for this, //The behaviour is undefined for if the callbacks should be triggered for this,
//so to avoid unnecessary confusion, we force an update. //so to avoid unnecessary confusion, we force an update.

View file

@ -99,6 +99,9 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
} }
} }
} }
// if no selection meaning nothing in config the force initdefault on tab
setInitializeDefault(selection.equals("") ? true : false);
fDCombo.select(selndx == -1 ? 0 : selndx); fDCombo.select(selndx == -1 ? 0 : selndx);
//The behaviour is undefined for if the callbacks should be triggered for this, //The behaviour is undefined for if the callbacks should be triggered for this,
//so to avoid unnecessary confusion, we force an update. //so to avoid unnecessary confusion, we force an update.