1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +02:00

Allow to set search source paths

This commit is contained in:
Alain Magloire 2002-09-04 20:14:39 +00:00
parent 73bf2abf5a
commit 46e1e64e85
4 changed files with 29 additions and 4 deletions

View file

@ -109,4 +109,10 @@ public interface ICDISession {
* @exception CDIException on failure. Reasons include: * @exception CDIException on failure. Reasons include:
*/ */
void terminate() throws CDIException; void terminate() throws CDIException;
/**
* Add directories to the begining of the search path
* for source files.
*/
void addSearchPaths(String[] dirs) throws CDIException;
} }

View file

@ -20,7 +20,12 @@ import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.ICDISignalManager; import org.eclipse.cdt.debug.core.cdi.ICDISignalManager;
import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; import org.eclipse.cdt.debug.core.cdi.ICDISourceManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import sun.security.krb5.internal.crypto.e;
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession * @see org.eclipse.cdt.debug.core.cdi.ICDISession
@ -182,4 +187,18 @@ public class CSession implements ICDISession, ICDISessionObject {
return this; return this;
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[])
*/
public void addSearchPaths(String[] dirs) throws CDIException {
CommandFactory factory = session.getCommandFactory();
MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs);
try {
session.postCommand(dir);
MIInfo info = dir.getMIInfo();
} catch (MIException e) {
throw new CDIException(e.getMessage());
}
}
} }

View file

@ -87,8 +87,8 @@ public class CommandFactory {
return new MIEnvironmentCD(pathdir); return new MIEnvironmentCD(pathdir);
} }
public MIEnvironmentDirectory createMIEnvironmentDirectory(String pathdir) { public MIEnvironmentDirectory createMIEnvironmentDirectory(String[] pathdirs) {
return new MIEnvironmentDirectory(pathdir); return new MIEnvironmentDirectory(pathdirs);
} }
public MIEnvironmentPath createMIEnvironmentPath(String[] paths) { public MIEnvironmentPath createMIEnvironmentPath(String[] paths) {

View file

@ -15,7 +15,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/ */
public class MIEnvironmentDirectory extends MICommand public class MIEnvironmentDirectory extends MICommand
{ {
public MIEnvironmentDirectory(String path) { public MIEnvironmentDirectory(String[] paths) {
super("-environment-directory", new String[]{path}); super("-environment-directory", paths);
} }
} }