mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 333034 - Select Processes dialog shows command line arguments
This change adds command line arguments to the information listed in the "Select Processes" dialog, seen e.g. when attaching to a C++ application to debug. Change-Id: I18ab685f73cb1c16ed3ea935872f49afa1de9aab Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
This commit is contained in:
parent
74eb81b0bb
commit
094543644b
7 changed files with 76 additions and 7 deletions
|
@ -19,6 +19,7 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
|
||||||
private final String name;
|
private final String name;
|
||||||
private final String[] cores;
|
private final String[] cores;
|
||||||
private final String ownerId;
|
private final String ownerId;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
public ProcessInfo(int pid, String name) {
|
public ProcessInfo(int pid, String name) {
|
||||||
this(pid, name, null, null);
|
this(pid, name, null, null);
|
||||||
|
@ -26,12 +27,21 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
|
||||||
|
|
||||||
/** @since 2.2 */
|
/** @since 2.2 */
|
||||||
public ProcessInfo(int pid, String name, String[] cores, String owner) {
|
public ProcessInfo(int pid, String name, String[] cores, String owner) {
|
||||||
|
this(pid, name, cores, owner, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.6
|
||||||
|
*/
|
||||||
|
public ProcessInfo(int pid, String name, String[] cores, String owner, String description) {
|
||||||
this.pid = pid;
|
this.pid = pid;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.cores = cores;
|
this.cores = cores;
|
||||||
this.ownerId = owner;
|
this.ownerId = owner;
|
||||||
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
@ -52,6 +62,11 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
|
||||||
return ownerId;
|
return ownerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort by name, then by pid.
|
* Sort by name, then by pid.
|
||||||
* No need to sort any further since pids are unique.
|
* No need to sort any further since pids are unique.
|
||||||
|
|
|
@ -52,6 +52,7 @@ import org.eclipse.cdt.dsf.gdb.launching.LaunchMessages;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses;
|
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData;
|
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData;
|
||||||
|
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData2;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext;
|
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||||
|
@ -447,7 +448,11 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
|
||||||
cores = ((IGdbThreadDMData)processData).getCores();
|
cores = ((IGdbThreadDMData)processData).getCores();
|
||||||
owner = ((IGdbThreadDMData)processData).getOwner();
|
owner = ((IGdbThreadDMData)processData).getOwner();
|
||||||
}
|
}
|
||||||
procInfoList.add(new ProcessInfo(pid, processData.getName(), cores, owner));
|
String description = null;
|
||||||
|
if (processData instanceof IGdbThreadDMData2) {
|
||||||
|
description = ((IGdbThreadDMData2)processData).getDescription();
|
||||||
|
}
|
||||||
|
procInfoList.add(new ProcessInfo(pid, processData.getName(), cores, owner, description));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-use the counting monitor and trigger it right away.
|
// Re-use the counting monitor and trigger it right away.
|
||||||
|
@ -484,7 +489,11 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
|
||||||
cores = ((IGdbThreadDMData)processData).getCores();
|
cores = ((IGdbThreadDMData)processData).getCores();
|
||||||
owner = ((IGdbThreadDMData)processData).getOwner();
|
owner = ((IGdbThreadDMData)processData).getOwner();
|
||||||
}
|
}
|
||||||
procInfoList.add(new ProcessInfo(pid, processData.getName(), cores, owner));
|
String description = null;
|
||||||
|
if (processData instanceof IGdbThreadDMData2) {
|
||||||
|
description = ((IGdbThreadDMData2)processData).getDescription();
|
||||||
|
}
|
||||||
|
procInfoList.add(new ProcessInfo(pid, processData.getName(), cores, owner, description));
|
||||||
countingRm.done();
|
countingRm.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -133,6 +133,11 @@ public class ProcessPrompter implements IStatusHandler {
|
||||||
text.replace(text.length()-2, text.length(), "]"); //$NON-NLS-1$
|
text.replace(text.length()-2, text.length(), "]"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String description = info.getDescription();
|
||||||
|
if (description != null) {
|
||||||
|
text.append(" : " + description); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +150,10 @@ public class ProcessPrompter implements IStatusHandler {
|
||||||
@Override
|
@Override
|
||||||
public String getText(Object element) {
|
public String getText(Object element) {
|
||||||
IProcessExtendedInfo info = (IProcessExtendedInfo)element;
|
IProcessExtendedInfo info = (IProcessExtendedInfo)element;
|
||||||
|
String description = info.getDescription();
|
||||||
|
if (description != null) {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
return info.getName();
|
return info.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
|
||||||
Bundle-Version: 5.5.0.qualifier
|
Bundle-Version: 5.6.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
|
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
|
|
@ -44,4 +44,11 @@ public interface IProcessExtendedInfo {
|
||||||
* information is not available.
|
* information is not available.
|
||||||
*/
|
*/
|
||||||
public String getOwner();
|
public String getOwner();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The description of this process, i.e. the program and
|
||||||
|
* its arguments, or null if not available.
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public String getDescription();
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,18 +477,28 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
protected static class MIProcessDMCAndData extends MIProcessDMC implements IGdbThreadDMData {
|
protected static class MIProcessDMCAndData extends MIProcessDMC implements IGdbThreadDMData2 {
|
||||||
final String fName;
|
final String fName;
|
||||||
// Note that cores are only available from GDB 7.1.
|
// Note that cores are only available from GDB 7.1.
|
||||||
final String[] fCores;
|
final String[] fCores;
|
||||||
final String fOwner;
|
final String fOwner;
|
||||||
|
final String fDescription;
|
||||||
|
|
||||||
public MIProcessDMCAndData(String sessionId, ICommandControlDMContext controlDmc,
|
public MIProcessDMCAndData(String sessionId, ICommandControlDMContext controlDmc,
|
||||||
String id, String name, String[] cores, String owner) {
|
String id, String name, String[] cores, String owner) {
|
||||||
|
this(sessionId, controlDmc, id, name, cores, owner, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public MIProcessDMCAndData(String sessionId, ICommandControlDMContext controlDmc,
|
||||||
|
String id, String name, String[] cores, String owner, String description) {
|
||||||
super(sessionId, controlDmc, id);
|
super(sessionId, controlDmc, id);
|
||||||
fName = name;
|
fName = name;
|
||||||
fCores = cores;
|
fCores = cores;
|
||||||
fOwner = owner;
|
fOwner = owner;
|
||||||
|
fDescription = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -497,6 +507,9 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return fName; }
|
public String getName() { return fName; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() { return fDescription; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDebuggerAttached() {
|
public boolean isDebuggerAttached() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1587,7 +1600,8 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
process.getGroupId(),
|
process.getGroupId(),
|
||||||
process.getName(),
|
process.getName(),
|
||||||
process.getCores(),
|
process.getCores(),
|
||||||
process.getUser());
|
process.getUser(),
|
||||||
|
process.getDesciption());
|
||||||
}
|
}
|
||||||
return procDmcs;
|
return procDmcs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,21 @@ public interface IGDBProcesses extends IMIProcesses {
|
||||||
String getOwner();
|
String getOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface extends the {@link IGdbThreadDMData} to provide a description
|
||||||
|
* for a process or thread.
|
||||||
|
*
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public interface IGdbThreadDMData2 extends IGdbThreadDMData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The description for this process or thread. Usually
|
||||||
|
* the program and its arguments.
|
||||||
|
*/
|
||||||
|
String getDescription();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface describes an exited thread/process.
|
* This interface describes an exited thread/process.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue