1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

show error when failure to create debugger page

This commit is contained in:
David Inglis 2004-07-15 02:38:03 +00:00
parent 540b9dc9f1
commit 52f7290c19
4 changed files with 18 additions and 10 deletions

View file

@ -143,19 +143,14 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, message, null ) ); log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, message, null ) );
} }
public ILaunchConfigurationTab getDebuggerPage( String debuggerID ) { public ILaunchConfigurationTab getDebuggerPage( String debuggerID ) throws CoreException {
if ( fDebuggerPageMap == null ) { if ( fDebuggerPageMap == null ) {
initializeDebuggerPageMap(); initializeDebuggerPageMap();
} }
IConfigurationElement configElement = (IConfigurationElement)fDebuggerPageMap.get( debuggerID ); IConfigurationElement configElement = (IConfigurationElement)fDebuggerPageMap.get( debuggerID );
ILaunchConfigurationTab tab = null; ILaunchConfigurationTab tab = null;
if ( configElement != null ) { if ( configElement != null ) {
try { tab = (ILaunchConfigurationTab)configElement.createExecutableExtension( "class" ); //$NON-NLS-1$
tab = (ILaunchConfigurationTab)configElement.createExecutableExtension( "class" ); //$NON-NLS-1$
}
catch( CoreException ce ) {
log( new Status( IStatus.ERROR, getUniqueIdentifier(), 100, "An error occurred retrieving a C Debugger page", ce ) ); //$NON-NLS-1$
}
} }
return tab; return tab;
} }

View file

@ -145,7 +145,13 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
if (debugConfig == null) { if (debugConfig == null) {
setDynamicTab(null); setDynamicTab(null);
} else { } else {
setDynamicTab(CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID())); ILaunchConfigurationTab tab = null;
try {
tab = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID());
} catch (CoreException e) {
LaunchUIPlugin.errorDialog(LaunchUIPlugin.getResourceString("AbstractCDebuggerTab.ErrorLoadingDebuggerPage"), e.getStatus()); //$NON-NLS-1$
}
setDynamicTab(tab);
ICDebugConfiguration oldConfig = getDebugConfig(); ICDebugConfiguration oldConfig = getDebugConfig();
if ( oldConfig != null && oldConfig != debugConfig ) { if ( oldConfig != null && oldConfig != debugConfig ) {
setInitializeDefault(true); setInitializeDefault(true);

View file

@ -58,6 +58,7 @@ CApplicationLaunchShortcut.Launch_failed_no_project_selected=Launch failed no pr
AbstractCDebuggerTab.No_debugger_available=No debugger available AbstractCDebuggerTab.No_debugger_available=No debugger available
AbstractCDebuggerTab.Debugger=Debugger AbstractCDebuggerTab.Debugger=Debugger
AbstractCDebuggerTab.ErrorLoadingDebuggerPage=Error Loading Debugger UI Component.
LaunchUIPlugin.Error=Error LaunchUIPlugin.Error=Error

View file

@ -46,6 +46,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
protected Button fVarBookKeeping; protected Button fVarBookKeeping;
private final boolean DEFAULT_STOP_AT_MAIN = true; private final boolean DEFAULT_STOP_AT_MAIN = true;
private boolean pageUpdated;
public void createControl(Composite parent) { public void createControl(Composite parent) {
GridData gd; GridData gd;
@ -177,14 +178,19 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
// if no selection meaning nothing in config the force initdefault on tab // if no selection meaning nothing in config the force initdefault on tab
setInitializeDefault(selection.equals("") ? true : false); //$NON-NLS-1$ setInitializeDefault(selection.equals("") ? true : false); //$NON-NLS-1$
pageUpdated = 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 force page update if needed.
updateComboFromSelection(); if (!pageUpdated) {
updateComboFromSelection();
}
pageUpdated = false;
getControl().getParent().layout(true); getControl().getParent().layout(true);
} }
protected void updateComboFromSelection() { protected void updateComboFromSelection() {
pageUpdated = true;
handleDebuggerChanged(); handleDebuggerChanged();
ICDebugConfiguration debugConfig = getConfigForCurrentDebugger(); ICDebugConfiguration debugConfig = getConfigForCurrentDebugger();
if (debugConfig != null) { if (debugConfig != null) {