private void setSharedlibrarySearchPath(ILaunchConfiguration config) throws CoreException {
// Attach debugging should add the "Debug" directory to its [Shared Libraries] path.
- List<String> values = config.getAttribute(
+ List<String> soLibPath = config.getAttribute(
IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, new ArrayList(1));
+ List<String> soLibList = config.getAttribute(
+ IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB_LIST, new ArrayList(1));
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
IProject proj = ProjectUtil.getProject(config);
- String appPath = config
+ String appPath = "";
+ String binaryPath = config
.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
- if (!appPath.isEmpty()) {
- appPath = new Path(appPath).removeLastSegments(1).toOSString();
+ if (!binaryPath.isEmpty()) {
+ appPath = new Path(binaryPath).removeLastSegments(1).toOSString();
} else {
newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
}
+ appPath);
if (canAddLibrarySearchPath(config, debugProjPath)) {
- values.add(debugProjPath.toOSString());
+ soLibPath.add(debugProjPath.toOSString());
+ }
+
+ IPath programPath = new Path(rootstrapPath + File.separatorChar + "usr"
+ + File.separatorChar + "lib" + File.separatorChar + "debug" + File.separatorChar
+ + binaryPath + ".debug");
+
+ if (canAddLibraryPath(config, programPath)) {
+ soLibList.add(programPath.toOSString());
}
+ List<String> aa = new ArrayList<String>();
+ aa.add(debugProjPath.append("taskmgr.debug").toOSString());
IPath debugBinPath = new Path(rootstrapPath + File.separatorChar + "usr"
+ File.separatorChar + "lib" + File.separatorChar + "debug" + File.separatorChar
+ "usr" + File.separatorChar + "bin");
if (canAddLibrarySearchPath(config, debugBinPath)) {
- values.add(debugBinPath.toOSString());
+ soLibPath.add(debugBinPath.toOSString());
}
IPath debugLibPath = new Path(rootstrapPath + File.separatorChar + "usr"
+ "usr" + File.separatorChar + "lib");
if (canAddLibrarySearchPath(config, debugLibPath)) {
- values.add(debugLibPath.toOSString());
+ soLibPath.add(debugLibPath.toOSString());
}
// set shared library search path
- if (values.size() > 0) {
- wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, values);
+ if (soLibPath.size() > 0) {
+ wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, soLibPath);
}
+ wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB_LIST, soLibList);
wc.doSave();
}
return ret;
}
+ protected boolean canAddLibraryPath(ILaunchConfiguration config, IPath searchPath)
+ throws CoreException {
+ List<String> values = config.getAttribute(
+ IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB_LIST,
+ Collections.EMPTY_LIST);
+ Iterator it = values.iterator();
+ boolean ret = true;
+
+ while (it.hasNext()) {
+ IPath oldPath = new Path((String) it.next());
+ if (PathUtil.equalPath(oldPath, searchPath)) {
+ ret = false;
+ break;
+ }
+ }
+ return ret;
+ }
+
protected void checkChangedConfiguration(ILaunchConfiguration config) throws CoreException {
setAttachProcess(config);
}