diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 05ebe73af1f..ae2f82255d6 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,13 @@ +2004-10-29 Alain Magloire + Remove of ICDISharedLibraryManager + * cdi/org/eclipse/cdt/debug/core/cdi/Session.java + * cdi/org/eclipse/cdt/debug/core/cdi/SharedLibraryManager.java + * cdi/org/eclipse/cdt/debug/core/cdi/model/Target.java + * cdi/org/eclipse/cdt/debug/core/cdi/model/SharedLibraryManagement.java + + * src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java + * src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger.java + 2004-10-28 Alain Magloire Add ICDIValue.getType() and ICDIExpression.geType() new methods. diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index 2d2128f113d..12a452d8811 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -21,7 +21,6 @@ import java.util.Map; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; @@ -532,19 +531,16 @@ public class BreakpointManager extends Manager { throw e; } Session session = (Session)target.getSession(); - ICDISharedLibraryManager sharedMgr = session.getSharedLibraryManager(); - if (sharedMgr instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager)sharedMgr; - if (mgr.isDeferredBreakpoint()) { - List dList = (List)deferredMap.get(target); - if (dList == null) { - dList = Collections.synchronizedList(new ArrayList()); - deferredMap.put(target, dList); - } - dList.add(bkpt); - } else { - throw e; + SharedLibraryManager sharedMgr = session.getSharedLibraryManager(); + if (sharedMgr.isDeferredBreakpoint()) { + List dList = (List)deferredMap.get(target); + if (dList == null) { + dList = Collections.synchronizedList(new ArrayList()); + deferredMap.put(target, dList); } + dList.add(bkpt); + } else { + throw e; } } return bkpt; diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java index 622a0b7cb0e..2f017c6ade9 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java @@ -19,7 +19,6 @@ import java.util.Observer; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; @@ -350,14 +349,9 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs MISession miSession = stopped.getMISession(); Target currentTarget = session.getTarget(miSession); - ICDISharedLibraryManager libMgr = session.getSharedLibraryManager(); - SharedLibraryManager mgr = null; + SharedLibraryManager mgr = session.getSharedLibraryManager(); - if (libMgr instanceof SharedLibraryManager) { - mgr = (SharedLibraryManager)libMgr; - } - - if (mgr !=null && mgr.isDeferredBreakpoint()) { + if (mgr.isDeferredBreakpoint()) { if (stopped instanceof MISharedLibEvent) { // Check if we have a new library loaded List eventList = null; diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java index 801f78a7715..e1f922da10c 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java @@ -19,7 +19,6 @@ import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; @@ -155,10 +154,7 @@ public class Session implements ICDISession, ICDISessionObject { return registerManager; } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSharedLibraryManager() - */ - public ICDISharedLibraryManager getSharedLibraryManager() { + public SharedLibraryManager getSharedLibraryManager() { return sharedLibraryManager; } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java index efefcbf36d8..fed1b6552b8 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java @@ -19,7 +19,6 @@ import java.util.Map; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIFormat; @@ -47,7 +46,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIShared; /** * Manager of the CDI shared libraries. */ -public class SharedLibraryManager extends Manager implements ICDISharedLibraryManager { +public class SharedLibraryManager extends Manager { ICDISharedLibrary[] EMPTY_SHAREDLIB = {}; Map sharedMap; @@ -180,14 +179,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return isDeferred; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) - */ - public void setAutoLoadSymbols(boolean set) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - setAutoLoadSymbols(target, set); - } public void setAutoLoadSymbols(Target target, boolean set) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -200,13 +191,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } } - /** - * @deprecated - */ - public boolean isAutoLoadSymbols() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return isAutoLoadSymbols(target); - } public boolean isAutoLoadSymbols(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -224,15 +208,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return false; } - /** - * @deprecated - * @param set - * @throws CDIException - */ - public void setStopOnSolibEvents(boolean set) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - setStopOnSolibEvents(target, set); - } public void setStopOnSolibEvents(Target target, boolean set) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -245,15 +220,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } } - /** - * @deprecated - * @return - * @throws CDIException - */ - public boolean isStopOnSolibEvents() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return isStopOnSolibEvents(target); - } public boolean isStopOnSolibEvents(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -271,14 +237,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return false; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) - */ - public void setSharedLibraryPaths(String[] libPaths) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - setSharedLibraryPaths(target, libPaths); - } public void setSharedLibraryPaths(Target target, String[] libPaths) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -291,14 +249,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraryPaths() - */ - public String[] getSharedLibraryPaths() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return getSharedLibraryPaths(target); - } public String[] getSharedLibraryPaths(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -312,14 +262,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraries() - */ - public ICDISharedLibrary[] getSharedLibraries() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return getSharedLibraries(target); - } public ICDISharedLibrary[] getSharedLibraries(Target target) throws CDIException { List sharedList = (List)sharedMap.get(target); if (sharedList != null) { @@ -328,14 +270,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return EMPTY_SHAREDLIB; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols() - */ - public void loadSymbols() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - loadSymbols(target); - } public void loadSymbols(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -352,14 +286,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa update(target); } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols(ICDISharedLibrary[]) - */ - public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - loadSymbols(target, libs); - } public void loadSymbols(Target target, ICDISharedLibrary[] libs) throws CDIException { MISession miSession = target.getMISession(); CommandFactory factory = miSession.getCommandFactory(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index 4de01229614..795ea2f74ac 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java @@ -25,6 +25,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIRuntimeOptions; +import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; @@ -40,6 +41,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager; import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; import org.eclipse.cdt.debug.mi.core.cdi.Session; +import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; import org.eclipse.cdt.debug.mi.core.cdi.SignalManager; import org.eclipse.cdt.debug.mi.core.cdi.SourceManager; import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; @@ -923,4 +925,12 @@ public class Target implements ICDITarget { return memMgr.getMemoryBlocks(this); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibraryManagement#getSharedLibraries() + */ + public ICDISharedLibrary[] getSharedLibraries() throws CDIException { + SharedLibraryManager sharedMgr = ((Session)getSession()).getSharedLibraryManager(); + return sharedMgr.getSharedLibraries(this); + } + } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java index 95793b36fe5..28e57b8aa2a 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java @@ -23,10 +23,10 @@ import org.eclipse.cdt.debug.core.ICDIDebugger; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; +import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; @@ -183,14 +183,16 @@ public class GDBCDIDebugger implements ICDIDebugger { protected void initializeLibraries(ILaunchConfiguration config, Session session) throws CoreException { try { - ICDISharedLibraryManager manager = session.getSharedLibraryManager(); - if (manager instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager)manager; - boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); - boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); + SharedLibraryManager sharedMgr = session.getSharedLibraryManager(); + boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); + boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); + List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); + ICDITarget[] dtargets = session.getTargets(); + for (int i = 0; i < dtargets.length; ++i) { + Target target = (Target)dtargets[i]; try { - mgr.setAutoLoadSymbols(autolib); - mgr.setStopOnSolibEvents(stopOnSolibEvents); + sharedMgr.setAutoLoadSymbols(target, autolib); + sharedMgr.setStopOnSolibEvents(target, stopOnSolibEvents); // The idea is that if the user set autolib, by default // we provide with the capability of deferred breakpoints // And we set setStopOnSolib events for them(but they should not see those things. @@ -198,21 +200,20 @@ public class GDBCDIDebugger implements ICDIDebugger { // If the user explicitly set stopOnSolibEvents well it probably // means that they wanted to see those events so do no do deferred breakpoints. if (autolib && !stopOnSolibEvents) { - mgr.setDeferredBreakpoint(true); - mgr.setStopOnSolibEvents(true); + sharedMgr.setDeferredBreakpoint(true); + sharedMgr.setStopOnSolibEvents(target, true); } } catch (CDIException e) { // Ignore this error // it seems to be a real problem on many gdb platform } - } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); - if (p.size() > 0) { - String[] oldPaths = manager.getSharedLibraryPaths(); - String[] paths = new String[oldPaths.length + p.size()]; - System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); - System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); - manager.setSharedLibraryPaths(paths); + if (p.size() > 0) { + String[] oldPaths = sharedMgr.getSharedLibraryPaths(target); + String[] paths = new String[oldPaths.length + p.size()]; + System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); + System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); + sharedMgr.setSharedLibraryPaths(target, paths); + } } } catch (CDIException e) { throw newCoreException(MIPlugin.getResourceString("src.GDBDebugger.Error_initializing_shared_lib_options") + e.getMessage(), e); //$NON-NLS-1$ diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java index 19fb3e25512..8680fc192a5 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java @@ -18,27 +18,29 @@ import java.util.List; import org.eclipse.cdt.debug.core.ICDebugger; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; +import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; +import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.debug.core.ILaunchConfiguration; public class GDBDebugger implements ICDebugger { protected void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException { try { - ICDISharedLibraryManager manager = session.getSharedLibraryManager(); - if (manager instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager)manager; - boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); - boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); + SharedLibraryManager mgr = session.getSharedLibraryManager(); + boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); + boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); + List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); + ICDITarget[] dtargets = session.getTargets(); + for (int i = 0; i < dtargets.length; ++i) { + Target target = (Target)dtargets[i]; try { - mgr.setAutoLoadSymbols(autolib); - mgr.setStopOnSolibEvents(stopOnSolibEvents); + mgr.setAutoLoadSymbols(target, autolib); + mgr.setStopOnSolibEvents(target, stopOnSolibEvents); // The idea is that if the user set autolib, by default // we provide with the capability of deferred breakpoints // And we set setStopOnSolib events for them(but they should not see those things. @@ -47,20 +49,19 @@ public class GDBDebugger implements ICDebugger { // means that they wanted to see those events so do no do deferred breakpoints. if (autolib && !stopOnSolibEvents) { mgr.setDeferredBreakpoint(true); - mgr.setStopOnSolibEvents(true); + mgr.setStopOnSolibEvents(target, true); } } catch (CDIException e) { // Ignore this error // it seems to be a real problem on many gdb platform } - } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); - if (p.size() > 0) { - String[] oldPaths = manager.getSharedLibraryPaths(); - String[] paths = new String[oldPaths.length + p.size()]; - System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); - System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); - manager.setSharedLibraryPaths(paths); + if (p.size() > 0) { + String[] oldPaths = mgr.getSharedLibraryPaths(target); + String[] paths = new String[oldPaths.length + p.size()]; + System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); + System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); + mgr.setSharedLibraryPaths(target, paths); + } } } catch (CoreException e) { throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_initializing_shared_lib_options") + e.getMessage()); //$NON-NLS-1$ diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java index 149a09cd88c..e92b45e3f77 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java @@ -19,7 +19,6 @@ import java.util.List; import org.eclipse.cdt.debug.core.ICDebugger; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; @@ -38,20 +37,22 @@ public class GDBServerDebugger implements ICDebugger { void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException { try { - ICDISharedLibraryManager mgr = session.getSharedLibraryManager(); - if (mgr instanceof SharedLibraryManager) { - boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); + SharedLibraryManager mgr = session.getSharedLibraryManager(); + boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); + List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, new ArrayList(1)); + ICDITarget[] dtargets = session.getTargets(); + for (int i = 0; i < dtargets.length; ++i) { + Target target = (Target)dtargets[i]; try { - ((SharedLibraryManager)mgr).setAutoLoadSymbols(autolib); + mgr.setAutoLoadSymbols(target, autolib); } catch (CDIException e) { // ignore this one, cause problems for many gdb. } + if (p.size() > 0) { + String[] paths = (String[])p.toArray(new String[0]); + mgr.setSharedLibraryPaths(target, paths); + } } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, new ArrayList(1)); - if (p.size() > 0) { - String[] paths = (String[])p.toArray(new String[0]); - mgr.setSharedLibraryPaths(paths); - } } catch (CoreException e) { throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$ }