summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimeon Andreev2018-09-07 06:40:38 -0400
committerJonah Graham2018-09-14 06:06:28 -0400
commit094543644b409d3fd939df9202373028c9fdefe0 (patch)
treefb92d93a58c8cfba8ecf74002977a32a2eb68a10
parent74eb81b0bb4ea86202047a407d7b6c7080426a82 (diff)
downloadorg.eclipse.cdt-094543644b409d3fd939df9202373028c9fdefe0.tar.gz
org.eclipse.cdt-094543644b409d3fd939df9202373028c9fdefe0.tar.xz
org.eclipse.cdt-094543644b409d3fd939df9202373028c9fdefe0.zip
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>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/ProcessInfo.java17
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java13
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java9
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/IProcessExtendedInfo.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java18
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java17
7 files changed, 76 insertions, 7 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/ProcessInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/ProcessInfo.java
index 221de26341..baaee59094 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/ProcessInfo.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/ProcessInfo.java
@@ -19,6 +19,7 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
private final String name;
private final String[] cores;
private final String ownerId;
+ private final String description;
public ProcessInfo(int pid, String name) {
this(pid, name, null, null);
@@ -26,11 +27,20 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
/** @since 2.2 */
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.name = name;
this.cores = cores;
this.ownerId = owner;
+ this.description = description;
}
+
@Override
public String getName() {
@@ -51,7 +61,12 @@ public class ProcessInfo implements IProcessExtendedInfo, Comparable<ProcessInfo
public String getOwner() {
return ownerId;
}
-
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
/**
* Sort by name, then by pid.
* No need to sort any further since pids are unique.
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java
index 3a8c349dd5..c8a395d6d5 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java
@@ -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.IGDBProcesses;
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.mi.service.IMIProcessDMContext;
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
@@ -447,7 +448,11 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
cores = ((IGdbThreadDMData)processData).getCores();
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.
@@ -484,7 +489,11 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
cores = ((IGdbThreadDMData)processData).getCores();
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();
}
});
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java
index 05882b1450..62a8254afe 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java
@@ -133,6 +133,11 @@ public class ProcessPrompter implements IStatusHandler {
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();
}
@@ -145,6 +150,10 @@ public class ProcessPrompter implements IStatusHandler {
@Override
public String getText(Object element) {
IProcessExtendedInfo info = (IProcessExtendedInfo)element;
+ String description = info.getDescription();
+ if (description != null) {
+ return description;
+ }
return info.getName();
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
index c0a1a45382..d16860e152 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
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-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/IProcessExtendedInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/IProcessExtendedInfo.java
index 6005946ef3..9372c33d05 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/IProcessExtendedInfo.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/IProcessExtendedInfo.java
@@ -44,4 +44,11 @@ public interface IProcessExtendedInfo {
* information is not available.
*/
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();
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
index 1434dc3f87..d449a19173 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
@@ -477,18 +477,28 @@ public class GDBProcesses_7_0 extends AbstractDsfService
* @since 4.0
*/
@Immutable
- protected static class MIProcessDMCAndData extends MIProcessDMC implements IGdbThreadDMData {
+ protected static class MIProcessDMCAndData extends MIProcessDMC implements IGdbThreadDMData2 {
final String fName;
// Note that cores are only available from GDB 7.1.
final String[] fCores;
final String fOwner;
+ final String fDescription;
public MIProcessDMCAndData(String sessionId, ICommandControlDMContext controlDmc,
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);
fName = name;
fCores = cores;
fOwner = owner;
+ fDescription = description;
}
@Override
@@ -498,6 +508,9 @@ public class GDBProcesses_7_0 extends AbstractDsfService
public String getName() { return fName; }
@Override
+ public String getDescription() { return fDescription; }
+
+ @Override
public boolean isDebuggerAttached() {
return true;
}
@@ -1587,7 +1600,8 @@ public class GDBProcesses_7_0 extends AbstractDsfService
process.getGroupId(),
process.getName(),
process.getCores(),
- process.getUser());
+ process.getUser(),
+ process.getDesciption());
}
return procDmcs;
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java
index da6ddda56a..8091cb49ff 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java
@@ -54,7 +54,22 @@ public interface IGDBProcesses extends IMIProcesses {
*/
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.
*