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

Added the 'stop-on-solib-events' option.

Changed the initialization of the hared library search path.
Changed the messages of the thrown exceptions.
This commit is contained in:
Mikhail Khodjaiants 2003-09-08 21:27:56 +00:00
parent 233b7ca8d5
commit 3da46e561e
2 changed files with 26 additions and 14 deletions

View file

@ -1,3 +1,9 @@
2003-09-09 Mikhail Khodjaiants
Added the 'stop-on-solib-events' option.
Changed the initialization of the hared library search path.
Changed the messages of the thrown exceptions.
* GDBDebugger.java
2003-09-09 Mikhail Khodjaiants 2003-09-09 Mikhail Khodjaiants
CoreFileConfiguration supports shared libraries. CoreFileConfiguration supports shared libraries.

View file

@ -6,9 +6,10 @@ package org.eclipse.cdt.debug.mi.core;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.Collections;
import java.util.List; import java.util.List;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugger; import org.eclipse.cdt.debug.core.ICDebugger;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
@ -26,21 +27,26 @@ public class GDBDebugger implements ICDebugger {
try { try {
ICDISharedLibraryManager mgr = session.getSharedLibraryManager(); ICDISharedLibraryManager mgr = session.getSharedLibraryManager();
if (mgr instanceof SharedLibraryManager) { if (mgr instanceof SharedLibraryManager) {
boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_AUTO_SOLIB, false); boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, false);
boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false);
try { try {
((SharedLibraryManager)mgr).setAutoLoadSymbols(autolib); ((SharedLibraryManager)mgr).setAutoLoadSymbols(autolib);
((SharedLibraryManager)mgr).setStopOnSolibEvents(stopOnSolibEvents);
} catch (CDIException e) { } catch (CDIException e) {
// Ignore this error // Ignore this error
// it seems to be a real problem on many gdb platform // it seems to be a real problem on many gdb platform
} }
} }
List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_SOLIB_PATH, new ArrayList(1)); List p = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST);
if (p.size() > 0) { if (p.size() > 0) {
String[] paths = (String[])p.toArray(new String[0]); String[] oldPaths = mgr.getSharedLibraryPaths();
String[] paths = new String[oldPaths.length + p.size()];
System.arraycopy((String[])p.toArray(new String[p.size()]), 0, paths, 0, p.size());
System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length);
mgr.setSharedLibraryPaths(paths); mgr.setSharedLibraryPaths(paths);
} }
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error initializing shared library options: " + e.getMessage());
} }
} }
@ -53,11 +59,11 @@ public class GDBDebugger implements ICDebugger {
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} }
} }
@ -70,11 +76,11 @@ public class GDBDebugger implements ICDebugger {
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} }
} }
@ -88,11 +94,11 @@ public class GDBDebugger implements ICDebugger {
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException("Error creating session: " + e.getMessage());
} }
} }