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

Bug 237306: Enable --thread-group for all MI commands

This commit is contained in:
Marc Khouzam 2011-01-22 11:31:12 +00:00
parent 2869d6180d
commit c40aa41437
6 changed files with 15 additions and 26 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2009 QNX Software Systems and others.
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -26,5 +26,7 @@ public class CLICommand<V extends MIInfo> extends MICommand<V>
@Override
public boolean supportsThreadAndFrameOptions() { return false; }
@Override
public boolean supportsThreadGroupOption() { return false; }
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -153,14 +153,14 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
StringBuffer command = new StringBuffer(getOperation());
// Add the --thread option
if (supportsThreadAndFrameOptions() && threadId != null) {
if (supportsThreadAndFrameOptions() && threadId != null && threadId.trim().length() > 0) {
command.append(" --thread " + threadId); //$NON-NLS-1$
// Add the --frame option, but only if we are using the --thread option
if (frameId >= 0) {
command.append(" --frame " + frameId); //$NON-NLS-1$
}
} else if (supportsThreadGroupOption() && groupId != null) {
} else if (supportsThreadGroupOption() && groupId != null && groupId.trim().length() > 0) {
// The --thread-group option is only allowed if we are not using the --thread option
command.append(" --thread-group " + groupId); //$NON-NLS-1$
}
@ -257,7 +257,7 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
/**
* @since 4.0
*/
public boolean supportsThreadGroupOption() { return false; }
public boolean supportsThreadGroupOption() { return true; }
/**
* Compare commands based on the MI command string that they generate,

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2010 Ericsson and others.
* Copyright (c) 2008, 2011 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -56,9 +56,4 @@ public class MIFileExecAndSymbols extends MICommand<MIInfo>
public MIFileExecAndSymbols(IMIContainerDMContext dmc, String file) {
super(dmc, "-file-exec-and-symbols", null, file == null ? null : new String[] {file}); //$NON-NLS-1$
}
@Override
public boolean supportsThreadGroupOption() {
return true;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2010 Ericsson and others.
* Copyright (c) 2008, 2011 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -45,9 +45,4 @@ public class MITargetAttach extends MICommand<MIInfo> {
public MITargetAttach(IMIContainerDMContext ctx, String pid) {
super(ctx, "-target-attach", new String[] { pid }); //$NON-NLS-1$
}
@Override
public boolean supportsThreadGroupOption() {
return true;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2010 Ericsson and others.
* Copyright (c) 2008, 2011 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -49,10 +49,4 @@ public class MITargetDetach extends MICommand<MIInfo> {
public MITargetDetach(IMIContainerDMContext ctx) {
super(ctx, "-target-detach"); //$NON-NLS-1$
}
@Override
public boolean supportsThreadGroupOption() {
return true;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2009 QNX Software Systems and others.
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -30,6 +30,9 @@ public class RawCommand extends MICommand<MIInfo> {
@Override
public boolean supportsThreadAndFrameOptions() { return false; }
@Override
public boolean supportsThreadGroupOption() { return false; }
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.command.Command#getMIOutput()
*/