From 52ecc62130f166a92927747cf98a06b9575cded4 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 18 Nov 2003 17:07:18 +0000 Subject: [PATCH] Fix for PR 46850: Unable to report problems from the methods of 'ICDIRuntimeOptions'. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 4 ++++ .../debug/core/cdi/ICDIRuntimeOptions.java | 6 +++--- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 5 +++++ .../cdt/debug/mi/core/cdi/RuntimeOptions.java | 19 ++++++++++--------- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 85ed6eb4f31..e59780c043e 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -3,6 +3,10 @@ 'setCurrentThread': check if the old current thread is not null. * CDebugTarget.java +2003-10-07 Mikhail Khodjaiants + All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure. + * ICDIRuntimeOptions.java + 2003-09-30 Mikhail Khodjaiants Use the new 'equals' method of ICDIVaraiableObject to compare variables. * CVariable.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java index 7ee1313d2ea..30471b5e3e3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java @@ -20,19 +20,19 @@ public interface ICDIRuntimeOptions { * * @param args the string representing the arguments. */ - void setArguments(String[] args); + void setArguments(String[] args) throws CDIException; /** * Program/Inferior environment settings. * * @param props the new environment variable to add. */ - void setEnvironment(Properties props); + void setEnvironment(Properties props) throws CDIException; /** * Program/Inferior working directory. * * @param wd the working directory to start the program. */ - void setWorkingDirectory(String wd); + void setWorkingDirectory(String wd) throws CDIException; } diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index db14ecac9c3..8a22c707a6f 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,8 @@ +2003-10-07 Mikhail Khodjaiants + + All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure. + * src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java + 2003-09-30 Alain Magloire ICDIVariableObject.equals(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java index c7ff0449358..38419382c57 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java @@ -8,6 +8,7 @@ package org.eclipse.cdt.debug.mi.core.cdi; import java.util.Iterator; import java.util.Properties; +import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MISession; @@ -30,7 +31,7 @@ public class RuntimeOptions implements ICDIRuntimeOptions { /** * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setArguments(String) */ - public void setArguments(String[] args) { + public void setArguments(String[] args) throws CDIException { if (args == null || args.length == 0) { return; } @@ -41,17 +42,17 @@ public class RuntimeOptions implements ICDIRuntimeOptions { mi.postCommand(arguments); MIInfo info = arguments.getMIInfo(); if (info == null) { - //throw new CDIException("No answer"); + throw new CDIException("Unable to set arguments: target is not responding"); } } catch (MIException e) { - //throw new CDIException(e.getMessage()); + throw new CDIException("Unable to set arguments: " + e.getMessage()); } } /** * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setEnvironment(Properties) */ - public void setEnvironment(Properties props) { + public void setEnvironment(Properties props) throws CDIException { if (props == null) { return; } @@ -73,10 +74,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions { mi.postCommand(set); MIInfo info = set.getMIInfo(); if (info == null) { - //throw new CDIException("No answer"); + throw new CDIException("Unable to set environment: target is not responding"); } } catch (MIException e) { - //throw new CDIException(e.getMessage()); + throw new CDIException("Unable to set environment: " + e.getMessage()); } } } @@ -84,7 +85,7 @@ public class RuntimeOptions implements ICDIRuntimeOptions { /** * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setWorkingDirectory(String) */ - public void setWorkingDirectory(String wd) { + public void setWorkingDirectory(String wd) throws CDIException { if (wd == null || wd.length() == 0) { return; } @@ -95,10 +96,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions { mi.postCommand(cd); MIInfo info = cd.getMIInfo(); if (info == null) { - //throw new CDIException("No answer"); + throw new CDIException("Unable to set working directory: target is not responding"); } } catch (MIException e) { - //throw new CDIException(e.getMessage()); + throw new CDIException("Unable to set working directory: " + e.getMessage()); } }