diff options
author | Simeon Andreev | 2018-09-07 10:40:38 +0000 |
---|---|---|
committer | Jonah Graham | 2018-09-14 10:06:28 +0000 |
commit | 094543644b409d3fd939df9202373028c9fdefe0 (patch) | |
tree | fb92d93a58c8cfba8ecf74002977a32a2eb68a10 /dsf-gdb | |
parent | 74eb81b0bb4ea86202047a407d7b6c7080426a82 (diff) | |
download | org.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>
Diffstat (limited to 'dsf-gdb')
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 221de263411..baaee590949 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 3a8c349dd5b..c8a395d6d55 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 05882b14502..62a8254afe5 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 c0a1a453823..d16860e152e 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 6005946ef39..9372c33d05a 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 1434dc3f877..d449a191737 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 da6ddda56ac..8091cb49ffa 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. * |