From 6d73f9322cc7a51a6f959f74e87f7aca609d981b Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 17 Jan 2003 21:33:03 +0000 Subject: [PATCH] new method loadSymbols(). --- .../core/cdi/ICDISharedLibraryManager.java | 17 ++++++ .../mi/core/cdi/SharedLibraryManager.java | 61 +++++++++++++------ 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java index ad39e8f8499..e8ff62ce367 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java @@ -22,4 +22,21 @@ public interface ICDISharedLibraryManager extends ICDISessionObject * @throws CDIException on failure. Reasons include: */ ICDISharedLibrary[] getSharedLibraries() throws CDIException; + + /** + * load symbols for the specified shared libraries. + * + * @return the array of loaded shared libraries + * @throws CDIException on failure. Reasons include: + */ + void loadSymbols(ICDISharedLibrary[] libs) throws CDIException; + + /** + * load symbols of all the shared libs. + * + * @return the array of loaded shared libraries + * @throws CDIException on failure. Reasons include: + */ + void loadSymbols() throws CDIException; + } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java index 599707cfbe6..609c46e29cb 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java @@ -40,25 +40,6 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib delList = new ArrayList(1); } - public void loadSymbols(ICDISharedLibrary slib) throws CDIException { - // FIXME: use the command factory for this so we can overload. - if (slib.areSymbolsLoaded()) { - return; - } - CSession s = getCSession(); - CLICommand cmd = new CLICommand("shared " + slib.getFileName()); - try { - s.getMISession().postCommand(cmd); - MIInfo info = cmd.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - update(); - } - public void update() throws CDIException { MIShared[] miLibs = new MIShared[0]; CSession s = getCSession(); @@ -151,4 +132,46 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib return (ICDISharedLibrary[])sharedList.toArray(new ICDISharedLibrary[0]); } + /** + * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols() + */ + public void loadSymbols() throws CDIException { + CSession s = getCSession(); + CLICommand cmd = new CLICommand("shared"); + try { + s.getMISession().postCommand(cmd); + MIInfo info = cmd.getMIInfo(); + if (info == null) { + throw new CDIException("No answer"); + } + } catch (MIException e) { + throw new MI2CDIException(e); + } + update(); + } + + /** + * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols(ICDISharedLibrary[]) + */ + public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException { + // FIXME: use the command factory for this so we can overload. + for (int i = 0; i < libs.length; i++) { + if (libs[i].areSymbolsLoaded()) { + continue; + } + CSession s = getCSession(); + CLICommand cmd = new CLICommand("shared " + libs[i].getFileName()); + try { + s.getMISession().postCommand(cmd); + MIInfo info = cmd.getMIInfo(); + if (info == null) { + throw new CDIException("No answer"); + } + } catch (MIException e) { + throw new MI2CDIException(e); + } + } + update(); + } + }