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/org.eclipse.cdt.dsf.gdb.ui | |
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/org.eclipse.cdt.dsf.gdb.ui')
3 files changed, 36 insertions, 3 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(); } |