1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Merge branch 'master' into sd90

This commit is contained in:
Andrew Gvozdev 2012-02-03 16:36:41 -05:00
commit 244d116bd0
4 changed files with 50 additions and 3 deletions

View file

@ -91,7 +91,15 @@ public class ProcessPrompter implements IStatusHandler {
@Override
public String getText(Object element) {
IProcessExtendedInfo info = (IProcessExtendedInfo)element;
IPath path = new Path(info.getName());
// Sometimes, if we are not getting the list of processes from GDB,
// we use CCorePlugin.getDefault().getProcessList(); which returns
// the process and its arguments. If the arguments contain a /
// we will get confused when using path.lastSegment(), so,
// let's only keep the name to be sure
String name = info.getName();
name = name.split("\\s", 2)[0]; //$NON-NLS-1$
IPath path = new Path(name);
StringBuffer text = new StringBuffer(path.lastSegment());
String owner = info.getOwner();

View file

@ -505,6 +505,13 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
* @since 4.0
*/
protected void createConsole(final IContainerDMContext containerDmc, final boolean restart, final RequestMonitor rm) {
if (fBackend.getSessionType() == SessionType.REMOTE || fBackend.getIsAttachSession()) {
// Remote or attach sessions shouldn't have a console, since the inferior is not started
// by eclipse but by gdbserver
rm.done();
return;
}
initializeInputOutput(containerDmc, new ImmediateRequestMonitor(rm) {
@Override
protected void handleSuccess() {

View file

@ -295,6 +295,15 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
*/
@Execute
public void stepCreateConsole(final RequestMonitor rm) {
if (fBackend.getSessionType() == SessionType.REMOTE && !fBackend.getIsAttachSession()) {
// Remote non-attach sessions don't support multi-process and therefore will not
// start new processes. Those sessions will only start the one process, which should
// not have a console, because it's output is handled by GDB server. Therefore,
// no need to create an inferior process and add it to the launch
rm.done();
return;
}
Process inferiorProcess;
if (fPty == null) {
inferiorProcess = new MIInferiorProcess(fContainerDmc, fBackend.getMIOutputStream());

View file

@ -232,8 +232,31 @@ public class MIListThreadGroupsInfo extends MIInfo {
name = matcher.group(1);
} else {
// If we didn't get the form "name: " then we expect to have the form
// "/usr/sbin/dhcdbd --system"
name = desc.split("\\s", 2)[0]; //$NON-NLS-1$
// "/usr/sbin/dhcdbd --system"
// or (starting with GDB 7.4)
// "[migration/0]" where the integer represents the core, if the process
// has an instance of many cores
// "[kacpid]" when the process only runs on one core
// "[async/mgr]"
// "[jbd2/dm-1-8]"
// The brackets indicate that the startup parameters are not available
// We handle this case by removing the brackets and the core indicator
// since GDB already tells us the core separately.
if (desc.length() > 0 && desc.charAt(0) == '[') {
// Remove brackets
name = desc.substring(1, desc.length()-1);
// Look for [name/coreNum] pattern to remove /coreNum
pattern = Pattern.compile("(.+?)(/\\d+)", Pattern.MULTILINE); //$NON-NLS-1$
matcher = pattern.matcher(name);
if (matcher.find()) {
// Found a pattern /coreNum, so ignore it
name = matcher.group(1);
}
// else, no /coreNum pattern, so the name is correct already
} else {
name = desc.split("\\s", 2)[0]; //$NON-NLS-1$
}
}
return name;