1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Use MISharedLibrary.

This commit is contained in:
Alain Magloire 2003-01-28 03:45:40 +00:00
parent 419c4372a6
commit 1a00ad8f8f

View file

@ -16,9 +16,9 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
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;
import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary; import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary;
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIInfoSharedLibrary; import org.eclipse.cdt.debug.mi.core.command.MIInfoSharedLibrary;
import org.eclipse.cdt.debug.mi.core.command.MISharedLibrary;
import org.eclipse.cdt.debug.mi.core.event.MIEvent; import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent; import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent;
import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent; import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent;
@ -167,10 +167,12 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
*/ */
public void loadSymbols() throws CDIException { public void loadSymbols() throws CDIException {
Session session = (Session)getSession(); Session session = (Session)getSession();
CLICommand cmd = new CLICommand("shared"); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
MISharedLibrary sharedlibrary = factory.createMISharedLibrary();
try { try {
session.getMISession().postCommand(cmd); mi.postCommand(sharedlibrary);
MIInfo info = cmd.getMIInfo(); MIInfo info = sharedlibrary.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException("No answer");
} }
@ -185,15 +187,17 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
*/ */
public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException { public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException {
// FIXME: use the command factory for this so we can overload. // FIXME: use the command factory for this so we can overload.
Session session = (Session)getSession();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
for (int i = 0; i < libs.length; i++) { for (int i = 0; i < libs.length; i++) {
if (libs[i].areSymbolsLoaded()) { if (libs[i].areSymbolsLoaded()) {
continue; continue;
} }
Session session = (Session)getSession(); MISharedLibrary sharedlibrary = factory.createMISharedLibrary(libs[i].getFileName());
CLICommand cmd = new CLICommand("shared " + libs[i].getFileName());
try { try {
session.getMISession().postCommand(cmd); session.getMISession().postCommand(sharedlibrary);
MIInfo info = cmd.getMIInfo(); MIInfo info = sharedlibrary.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException("No answer");
} }