mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
new method loadSymbols().
This commit is contained in:
parent
d266ca5299
commit
6d73f9322c
2 changed files with 59 additions and 19 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue