Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions 2018-12-local.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="cdt-rse" sequenceNumber="79">
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<launcherArgs>
<vmArgs>-Xms40m&#13;
-Xmx512M&#13;
-ea</vmArgs>
<programArgs>-consolelog</programArgs>
</launcherArgs>
<locations>
<location path="/Applications/Eclipse 2018-12.app/Contents/Eclipse" type="Profile"/>
</locations>
</target>
79 changes: 79 additions & 0 deletions 2018-12.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="cdt-rse-2018-12" sequenceNumber="79">
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<launcherArgs>
<vmArgs>-Xms40m&#13;
-Xmx512M&#13;
-ea</vmArgs>
<programArgs>-consolelog</programArgs>
</launcherArgs>
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="http://download.eclipse.org/eclipse/updates/4.10"/>
<unit id="org.eclipse.platform.ide" version="4.10.0.I20181206-0815"/>
<unit id="org.eclipse.platform.sdk" version="4.10.0.I20181206-0815"/>
<unit id="org.eclipse.sdk.ide" version="4.10.0.I20181206-0815"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="http://download.eclipse.org/releases/2018-12"/>
<unit id="org.eclipse.rse.feature.group" version="4.5.1.201811011802"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="http://download.eclipse.org/tools/cdt/releases/9.6"/>
<unit id="org.eclipse.cdt.arduino.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.arduino.source.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.autotools.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.autotools.source.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.build.crossgcc.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.build.crossgcc.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.bupc.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.bupc.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.cmake.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.cmake.source.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.core.autotools.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.autotools.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.lrparser.feature.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.lrparser.feature.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.lrparser.sdk.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.parser.upc.feature.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.parser.upc.feature.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.core.parser.upc.sdk.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.gdbjtag.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.gdbjtag.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.standalone.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.standalone.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.ui.memory.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.debug.ui.memory.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.docker.launcher.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.docker.launcher.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.examples.dsf.feature.group" version="9.6.0.201811241122"/>
<unit id="org.eclipse.cdt.examples.dsf.source.feature.group" version="9.6.0.201811241122"/>
<unit id="org.eclipse.cdt.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.gnu.multicorevisualizer.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.gnu.multicorevisualizer.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.launch.remote.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.launch.remote.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.launch.serial.feature.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.launch.serial.feature.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.llvm.dsf.lldb.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.llvm.dsf.lldb.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.managedbuilder.llvm.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.managedbuilder.llvm.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.meson.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.meson.source.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.msw.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.msw.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.qt.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.qt.source.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.sdk.feature.group" version="9.6.0.201812111211"/>
<unit id="org.eclipse.cdt.testsrunner.feature.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.testsrunner.feature.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.visualizer.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.visualizer.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.xlc.feature.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.xlc.feature.source.feature.group" version="9.6.0.201811241055"/>
<unit id="org.eclipse.cdt.xlc.sdk.feature.group" version="9.6.0.201811241055"/>
</location>
</locations>
</target>
14 changes: 14 additions & 0 deletions 2020-06-local.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="2020-06-local" sequenceNumber="79">
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<launcherArgs>
<vmArgs>-Xms40m&#13;
-Xmx512M&#13;
-ea</vmArgs>
<programArgs>-consolelog</programArgs>
</launcherArgs>
<locations>
<location path="/Applications/Eclipse.app/Contents/Eclipse" type="Profile"/>
</locations>
</target>
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# DirectRemoteDebug


## Development

### Setup
* Download/install "Eclipse IDE for eclipse committers"
* Download/install "Eclipse CDT 2018-12"
* Set up the target platform to point to the installation above.

Older version is needed because:

* org.eclipse.cdt.dsf.gdb.internal.ui.launching.CArgumentsTab;
* org.eclipse.cdt.dsf.gdb.internal.ui.launching.WorkingDirectoryBlock;

are gone in newer versions. An update is required to get this code working This throws an exception in the newer versions, but the UI is able to recover, so this can still run on newer versions even missing the above
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package org.eclipse.cdt.launch.remote.direct;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.concurrent.RejectedExecutionException;

import org.eclipse.cdt.core.model.ICProject;
Expand All @@ -21,7 +25,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ISourceLocator;
Expand Down Expand Up @@ -94,7 +97,7 @@ public void launch(ILaunchConfiguration config, String mode,
final GdbLaunch l = (GdbLaunch)launch;
try {
remoteShell = RSEHelper.execCmdInRemoteShell(config, prelaunchCmd, gdbCommmand.toOSString(), "-version", //$NON-NLS-1$
new SubProgressMonitor(monitor, 5));
EclipseCompat.getSubMonitor(monitor, 5));
} catch(Exception el) {
RSEHelper.abort(el.getMessage(), el, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
Expand All @@ -107,6 +110,7 @@ public void launch(ILaunchConfiguration config, String mode,
gdbReady[0] = false;
final Object lock = new Object();
if (remoteShell != null) {
/*
remoteShell.addOutputListener(new IHostShellOutputListener() {
boolean working = true;
@Override
Expand All @@ -131,13 +135,15 @@ public void shellOutputChanged(IHostShellChangeEvent event) {
}
}
});
*/
try {
remoteProcess = new HostShellProcessAdapter(remoteShell);
}
catch(Exception e) {
RSEHelper.abort(Messages.DirectRemoteDebugLaunchDelegate_5, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
synchronized(lock) {
BufferedReader br = new BufferedReader(new InputStreamReader(remoteProcess.getInputStream()));
while (gdbReady[0] == false) {
if (monitor.isCanceled() || !remoteShell.isActive()) {
if (remoteProcess != null) {
Expand All @@ -164,7 +170,21 @@ public void run() {
}
catch(InterruptedException e) {

}
}
try {
String lineString = br.readLine();
if(lineString.contains("GNU gdb")) { //$NON-NLS-1$
String versionString = br.readLine();
version = LaunchUtils.getGDBVersionFromText(versionString);
}
if (lineString.contains("This GDB was configured as")) { //$NON-NLS-1$
gdbReady[0] = true;
}
} catch (IOException e) {

}


}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.eclipse.cdt.launch.remote.direct;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
//import org.eclipse.core.runtime.SubProgressMonitor;


public class EclipseCompat {
/**
* Get the "SubProgressMonitor"
* @param monitor
* @param ticks
* @return
*/
public static IProgressMonitor getSubMonitor(IProgressMonitor monitor, int work) {
// One could use reflection here to choose between the newer
// and older versions if needed and backwards compat. is desired.
return SubMonitor.convert(monitor, work);
//return new SubProgressMonitor(monitor, ticks);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.core.RSECorePlugin;
Expand All @@ -34,6 +33,8 @@ public class RSEHelper {
* @param code
* error code
*/


public static void abort(String message, Throwable exception, int code) throws CoreException {
IStatus status;
if (exception != null) {
Expand Down Expand Up @@ -145,15 +146,15 @@ public static IHostShell execCmdInRemoteShell(ILaunchConfiguration config,

IShellService shellService = null;
shellService = (IShellService) getConnectedRemoteShellService(getCurrentConnection(config),
new SubProgressMonitor(monitor, 7));
EclipseCompat.getSubMonitor(monitor, 7));

// This is necessary because runCommand does not actually run the
// command right now.
String env[] = new String[0];
IHostShell hostShell = null;
if (shellService != null) {
hostShell = shellService.launchShell(
"", env, new SubProgressMonitor(monitor, 3)); //$NON-NLS-1$
"", env, EclipseCompat.getSubMonitor(monitor, 3)); //$NON-NLS-1$
hostShell.writeToShell(remoteCommand);

}
Expand Down