Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2015-07-06 03:56:49 -0400
committerAnton Leherbauer2015-07-06 08:55:45 -0400
commit1c5c417a53fd3a5b2e7408cdc7bafb3fd016ce8a (patch)
treef5519a4fe8544cd266c3a0f28872733d7817bad1 /target_explorer
parent9f56b09ddc0cd98fc3d560e129f41eb01fd5e1b6 (diff)
downloadorg.eclipse.tcf-1c5c417a53fd3a5b2e7408cdc7bafb3fd016ce8a.tar.gz
org.eclipse.tcf-1c5c417a53fd3a5b2e7408cdc7bafb3fd016ce8a.tar.xz
org.eclipse.tcf-1c5c417a53fd3a5b2e7408cdc7bafb3fd016ce8a.zip
Target Explorer: Minor gdbserver attach improvements
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/plugin.xml14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbAbstractLaunchDelegate.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/filters/SingleThreadFilter.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java21
7 files changed, 67 insertions, 20 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/plugin.xml
index 97eb54bfe..a50feed5e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/plugin.xml
@@ -106,20 +106,20 @@ Anna Dushistova (MontaVista) - adapted from org.eclipse.cdt.launch.remote
<placement after="org.eclipse.tcf.te.remotecdt.debug.debuggerTab"/>
</tab>
<tab
- id="org.eclipse.tcf.te.remotecdt.debug.commonTab"
+ id="org.eclipse.tcf.te.remotecdt.debug.environmentTab"
group="org.eclipse.cdt.launch.remoteApplicationLaunchTabGroup"
- name="Common"
- class="org.eclipse.debug.ui.CommonTab">
+ name="Environment"
+ class="org.eclipse.tcf.te.tcf.launch.cdt.tabs.TEEnvironmentTab">
<associatedDelegate delegate="org.eclipse.tcf.te.remotecdt.debug"/>
<placement after="org.eclipse.debug.ui.sourceLookupTab"/>
</tab>
<tab
- id="org.eclipse.tcf.te.remotecdt.debug.environmentTab"
+ id="org.eclipse.tcf.te.remotecdt.debug.commonTab"
group="org.eclipse.cdt.launch.remoteApplicationLaunchTabGroup"
- name="Environment"
- class="org.eclipse.tcf.te.tcf.launch.cdt.tabs.TEEnvironmentTab">
+ name="Common"
+ class="org.eclipse.debug.ui.CommonTab">
<associatedDelegate delegate="org.eclipse.tcf.te.remotecdt.debug"/>
- <placement after="org.eclipse.debug.ui.sourceLookupTab"/>
+ <placement after="org.eclipse.debug.ui.environmentTab"/>
</tab>
<!-- Attach Launch -->
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbAbstractLaunchDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbAbstractLaunchDelegate.java
index 8e1a89fbe..0cdc4f562 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbAbstractLaunchDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbAbstractLaunchDelegate.java
@@ -69,6 +69,8 @@ import org.eclipse.tcf.te.tcf.processes.core.launcher.ProcessLauncher;
@SuppressWarnings("restriction")
public abstract class TEGdbAbstractLaunchDelegate extends GdbLaunchDelegate {
+ private String fCurrentGdbServerPort;
+
/**
* Constructor
*/
@@ -168,6 +170,7 @@ public abstract class TEGdbAbstractLaunchDelegate extends GdbLaunchDelegate {
final AtomicInteger indexAlternatives = new AtomicInteger(0);
do {
+ fCurrentGdbServerPort = gdbserverPortNumber.get();
gdbserverLaunchRetry.set(false);
final AtomicBoolean gdbServerStarted = new AtomicBoolean(false);
@@ -465,7 +468,7 @@ public abstract class TEGdbAbstractLaunchDelegate extends GdbLaunchDelegate {
if (d.contains("Address already in use.")) { //$NON-NLS-1$
// Get host and port
String host = lc.getAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, (String)null);
- String port = lc.getAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, (String)null);
+ String port = fCurrentGdbServerPort;
String address = host + (port != null ? ":" + port : ""); //$NON-NLS-1$ //$NON-NLS-2$
d = NLS.bind(Messages.TEGdbAbstractLaunchDelegate_error_addressInUse, address);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
index 0f9db2070..5e4900024 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
@@ -80,6 +80,13 @@ public class ProcessContextNode extends ContainerModelNode implements IProcessCo
name = null;
}
+ if (name != null && sContext != null && sContext.getProperties().containsKey(ISysMonitor.PROP_EXETYPE)) {
+ // in case of a kernel thread, use process context name
+ Object exeType = sContext.getProperties().get(ISysMonitor.PROP_EXETYPE);
+ if (Integer.valueOf(ISysMonitor.EXETYPE_KERNEL).equals(exeType))
+ return name;
+ }
+
// Take the last part of the image name if available
String file = sContext != null ? sContext.getFile() : null;
if (file != null && !"".equals(file)) { //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
index c4ebdf711..7aa25e717 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
@@ -13,6 +13,9 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IProcesses.ProcessContext;
+import org.eclipse.tcf.services.ISysMonitor;
+import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNodeProperties;
@@ -33,9 +36,14 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
Runnable runnable = new Runnable() {
@Override
public void run() {
- if (node.getProcessContext() != null) {
- isAttached.set(node.getProcessContext().isAttached());
- }
+ ProcessContext pc = node.getProcessContext();
+ SysMonitorContext sc = node.getSysMonitorContext();
+ boolean attached = false;
+ if (pc != null)
+ attached = pc.isAttached();
+ if (!attached && sc != null)
+ attached = sc.getTracerPID() > 0 || "t".equals(sc.getState()); //$NON-NLS-1$
+ isAttached.set(attached);
}
};
if (Protocol.isDispatchThread()) runnable.run();
@@ -54,7 +62,13 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
Boolean value = (Boolean)node.getProcessContext().getProperties().get("CanAttach"); //$NON-NLS-1$
canAttach.set(value != null && value.booleanValue());
} else {
- canAttach.set(true);
+ SysMonitorContext sc = node.getSysMonitorContext();
+ if (sc != null && sc.getProperties().containsKey(ISysMonitor.PROP_EXETYPE)) {
+ Object exeType = sc.getProperties().get(ISysMonitor.PROP_EXETYPE);
+ canAttach.set(!Integer.valueOf(ISysMonitor.EXETYPE_KERNEL).equals(exeType));
+ } else {
+ canAttach.set(true);
+ }
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/filters/SingleThreadFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/filters/SingleThreadFilter.java
index 3fbb18dbb..e33be6379 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/filters/SingleThreadFilter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/filters/SingleThreadFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2015 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -16,6 +16,8 @@ import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.ISysMonitor;
+import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
/**
@@ -45,7 +47,10 @@ public class SingleThreadFilter extends ViewerFilter {
if (parent.getChildren().length == 1) {
if (parent.getSysMonitorContext() != null && child.getSysMonitorContext() != null &&
parent.getSysMonitorContext().getPID() == child.getSysMonitorContext().getPID()) {
- if (parent.getName() != null) {
+ SysMonitorContext smc = parent.getSysMonitorContext();
+ if (Integer.valueOf(ISysMonitor.EXETYPE_KERNEL).equals(smc.getProperties().get(ISysMonitor.PROP_EXETYPE))) {
+ selected.set(false);
+ } else if (parent.getName() != null) {
selected.set(!parent.getName().equals(child.getName()));
}
else if (child.getName() != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
index 52711c360..0730310ef 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2014 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2015 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -21,6 +21,8 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.ISysMonitor;
+import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.events.ChangeEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
@@ -260,7 +262,10 @@ public class ContentProvider implements ITreeContentProvider {
IProcessContextNode child = (IProcessContextNode)children[0];
if (child != null && context.getSysMonitorContext() != null && child.getSysMonitorContext() != null &&
context.getSysMonitorContext().getPID() == child.getSysMonitorContext().getPID()) {
- if (context.getName() != null) {
+ SysMonitorContext smc = context.getSysMonitorContext();
+ if (Integer.valueOf(ISysMonitor.EXETYPE_KERNEL).equals(smc.getProperties().get(ISysMonitor.PROP_EXETYPE))) {
+ selected.set(false);
+ } else if (context.getName() != null) {
selected.set(!context.getName().equals(child.getName()));
}
else if (child.getName() != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java
index ce2edc454..950504ec4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2014 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2015 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -9,11 +9,14 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.ISysMonitor;
+import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.runtime.services.interfaces.delegates.ILabelProviderDelegate;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
@@ -84,19 +87,29 @@ public class LabelProviderDelegate extends AbstractLabelProviderDelegate impleme
} else if (element instanceof IProcessContextNode) {
Image image = null;
- final AtomicReference<IModelNode> parent = new AtomicReference<IModelNode>();
+ final AtomicBoolean isThread = new AtomicBoolean();
Runnable runnable = new Runnable() {
@Override
public void run() {
IProcessContextNode node = ((IProcessContextNode)element);
- parent.set(node.getParent());
+ boolean thread = false;
+ if (node.getParent() instanceof IRuntimeModel) {
+ // test for kernel thread
+ SysMonitorContext smc = node.getSysMonitorContext();
+ if (smc != null && Integer.valueOf(ISysMonitor.EXETYPE_KERNEL).equals(smc.getProperties().get(ISysMonitor.PROP_EXETYPE))) {
+ thread = true;
+ }
+ } else {
+ thread = true;
+ }
+ isThread.set(thread);
}
};
if (Protocol.isDispatchThread()) runnable.run();
else Protocol.invokeAndWait(runnable);
- image = UIPlugin.getImage(parent.get() instanceof IRuntimeModel ? ImageConsts.OBJ_Process : ImageConsts.OBJ_Thread);
+ image = UIPlugin.getImage(isThread.get()? ImageConsts.OBJ_Thread : ImageConsts.OBJ_Process);
return image;
}

Back to the top