1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure.

This commit is contained in:
Mikhail Khodjaiants 2003-10-07 18:30:31 +00:00
parent 05ec3d8a5c
commit 3804b80669
4 changed files with 22 additions and 12 deletions

View file

@ -1,3 +1,7 @@
2003-10-07 Mikhail Khodjaiants
All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure.
* ICDIRuntimeOptions.java
2003-10-06 Mikhail Khodjaiants 2003-10-06 Mikhail Khodjaiants
Added the "isArgument" method to ICVariable. This method is used to distinguish Added the "isArgument" method to ICVariable. This method is used to distinguish
the arguments in the Variables View. the arguments in the Variables View.

View file

@ -20,19 +20,19 @@ public interface ICDIRuntimeOptions {
* *
* @param args the string representing the arguments. * @param args the string representing the arguments.
*/ */
void setArguments(String[] args); void setArguments(String[] args) throws CDIException;
/** /**
* Program/Inferior environment settings. * Program/Inferior environment settings.
* *
* @param props the new environment variable to add. * @param props the new environment variable to add.
*/ */
void setEnvironment(Properties props); void setEnvironment(Properties props) throws CDIException;
/** /**
* Program/Inferior working directory. * Program/Inferior working directory.
* *
* @param wd the working directory to start the program. * @param wd the working directory to start the program.
*/ */
void setWorkingDirectory(String wd); void setWorkingDirectory(String wd) throws CDIException;
} }

View file

@ -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 2003-09-30 Alain Magloire
ICDIVariableObject.equals(); ICDIVariableObject.equals();

View file

@ -8,6 +8,7 @@ package org.eclipse.cdt.debug.mi.core.cdi;
import java.util.Iterator; import java.util.Iterator;
import java.util.Properties; 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.core.cdi.ICDIRuntimeOptions;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; 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) * @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) { if (args == null || args.length == 0) {
return; return;
} }
@ -41,17 +42,17 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(arguments); mi.postCommand(arguments);
MIInfo info = arguments.getMIInfo(); MIInfo info = arguments.getMIInfo();
if (info == null) { if (info == null) {
//throw new CDIException("No answer"); throw new CDIException("Unable to set arguments: target is not responding");
} }
} catch (MIException e) { } 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) * @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) { if (props == null) {
return; return;
} }
@ -73,10 +74,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(set); mi.postCommand(set);
MIInfo info = set.getMIInfo(); MIInfo info = set.getMIInfo();
if (info == null) { if (info == null) {
//throw new CDIException("No answer"); throw new CDIException("Unable to set environment: target is not responding");
} }
} catch (MIException e) { } 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) * @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) { if (wd == null || wd.length() == 0) {
return; return;
} }
@ -95,10 +96,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(cd); mi.postCommand(cd);
MIInfo info = cd.getMIInfo(); MIInfo info = cd.getMIInfo();
if (info == null) { if (info == null) {
//throw new CDIException("No answer"); throw new CDIException("Unable to set working directory: target is not responding");
} }
} catch (MIException e) { } catch (MIException e) {
//throw new CDIException(e.getMessage()); throw new CDIException("Unable to set working directory: " + e.getMessage());
} }
} }