Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2012-03-22 13:24:14 -0400
committerMikhail Khodjaiants2012-03-22 13:24:14 -0400
commit9e7c69f28952f708bfc1997c318043eee112a4c3 (patch)
tree9aa2f7bf0d573d518d22dbec8c7ef63cc2f00ede /dsf-gdb
parentce2f595139c58965d065802fe35a1c00dfabbc29 (diff)
parentf9f991fa3fa8bd4b50b626c571820d166614833e (diff)
downloadorg.eclipse.cdt-9e7c69f28952f708bfc1997c318043eee112a4c3.tar.gz
org.eclipse.cdt-9e7c69f28952f708bfc1997c318043eee112a4c3.tar.xz
org.eclipse.cdt-9e7c69f28952f708bfc1997c318043eee112a4c3.zip
Merge branch 'master' of ssh://mkhodjai@git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
Diffstat (limited to 'dsf-gdb')
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java4
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModel.java12
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModelListener.java4
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/ProcessPrompter.java6
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java45
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java4
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java (renamed from dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardware.java)10
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java8
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardwareAndOS.java (renamed from dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardware.java)2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java2
10 files changed, 53 insertions, 44 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
index 0b9d218881..2aca3f6ad3 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
@@ -33,8 +33,8 @@ import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils.DSFDebugModel;
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils.DSFDebugModelListener;
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils.DSFSessionState;
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils.DebugViewUtils;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICPUDMContext;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICoreDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICPUDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICoreDMContext;
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext;
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModel.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModel.java
index 101673d3b9..d7b65a1020 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModel.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModel.java
@@ -30,10 +30,10 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.model.VisualizerExecutionState;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICPUDMContext;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICoreDMContext;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.IHardwareTargetDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICPUDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICoreDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.IHardwareTargetDMContext;
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData;
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
@@ -61,7 +61,7 @@ public class DSFDebugModel {
final Object arg)
{
ICommandControlService controlService = sessionState.getService(ICommandControlService.class);
- IGDBHardware hwService = sessionState.getService(IGDBHardware.class);
+ IGDBHardwareAndOS hwService = sessionState.getService(IGDBHardwareAndOS.class);
if (controlService == null || hwService == null) {
listener.getCPUsDone(null, arg);
return;
@@ -99,7 +99,7 @@ public class DSFDebugModel {
final DSFDebugModelListener listener,
final Object arg)
{
- IGDBHardware hwService = sessionState.getService(IGDBHardware.class);
+ IGDBHardwareAndOS hwService = sessionState.getService(IGDBHardwareAndOS.class);
if (hwService == null) {
listener.getCoresDone(cpuContext, null, arg);
return;
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModelListener.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModelListener.java
index ccc0eed5fb..f55a2594d9 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModelListener.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DSFDebugModelListener.java
@@ -15,8 +15,8 @@ package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils;
import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData;
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.model.VisualizerExecutionState;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICPUDMContext;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.ICoreDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICPUDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.ICoreDMContext;
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
/** Interface for classes that interact with DSFDebugModel.
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 764b2409a0..8df673aa10 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
@@ -97,6 +97,12 @@ public class ProcessPrompter implements IStatusHandler {
// we will get confused when using path.lastSegment(), so,
// let's only keep the name to be sure
String name = info.getName();
+ if (name == null || name.isEmpty()) {
+ // Skip elements that have no name
+ // Bug 374823
+ return null;
+ }
+
name = name.split("\\s", 2)[0]; //$NON-NLS-1$
IPath path = new Path(name);
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java
index 55007d29bb..0b2f5dfdbc 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/CoreList.java
@@ -51,40 +51,43 @@ public class CoreList {
Vector<ICoreInfo> coreInfo = new Vector<ICoreInfo>();
BufferedReader reader = null;
try {
+ String processorId = null;
String physicalId = null;
- String coreId = null;
- String cpuCores = null;
Reader r = new InputStreamReader(new FileInputStream(cpuInfo));
reader = new BufferedReader(r);
String line;
while ((line = reader.readLine()) != null) {
line = line.trim();
- if (line.startsWith("physical id")) { //$NON-NLS-1$
+ if (line.startsWith("processor")) { //$NON-NLS-1$
+ if (processorId != null) {
+ // We are already at the next 'processor' entry, without
+ // having found the 'physical id' entry. This means
+ // there is a single physical CPU.
+ physicalId = "0"; //$NON-NLS-1$
+
+ coreInfo.add(new CoreInfo(processorId, physicalId));
+ processorId = null;
+ }
+ // Found the processor id of this core, so store it temporarily
+ processorId = line.split(":")[1].trim(); //$NON-NLS-1$
+ } else if (line.startsWith("physical id")) { //$NON-NLS-1$
// Found the physical id of this core, so store it temporarily
+
+ assert physicalId == null;
physicalId = line.split(":")[1].trim(); //$NON-NLS-1$
- } else if (line.startsWith("core id")) { //$NON-NLS-1$
- // Found core id of this core which come after the entry
- // for physical id, so we have both now.
- coreId = line.split(":")[1].trim(); //$NON-NLS-1$
- } else if (line.startsWith("cpu cores")) { //$NON-NLS-1$
- // Found CPU core count which comes after the entry
- // for core id, so we have all three by now.
- cpuCores = line.split(":")[1].trim(); //$NON-NLS-1$
-
- int cid = Integer.parseInt(coreId);
- int pid = Integer.parseInt(physicalId);
- int cores_per_pid = Integer.parseInt(cpuCores);
- String absoluteCoreID = Integer.toString(cid + pid * cores_per_pid);
-
- coreInfo.add(new CoreInfo(absoluteCoreID, physicalId));
+
+ coreInfo.add(new CoreInfo(processorId, physicalId));
// Get ready to look for the next core.
+ processorId = null;
physicalId = null;
- coreId = null;
- cpuCores = null;
}
- }
+ }
+ if (processorId != null) {
+ // This will happen when there is no 'physical id' field
+ coreInfo.add(new CoreInfo(processorId, "0")); //$NON-NLS-1$
+ }
} catch (IOException e) {
} finally {
try {
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java
index 22ffdf57f9..ad15fc6064 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java
@@ -29,7 +29,7 @@ import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS;
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl;
import org.eclipse.cdt.dsf.mi.service.CSourceLookup;
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
@@ -62,7 +62,7 @@ public class ServicesLaunchSequence extends Sequence {
},
new Step() { @Override
public void execute(RequestMonitor requestMonitor) {
- IGDBHardware hwService = fLaunch.getServiceFactory().createService(IGDBHardware.class, fSession, fLaunch.getLaunchConfiguration());
+ IGDBHardwareAndOS hwService = fLaunch.getServiceFactory().createService(IGDBHardwareAndOS.class, fSession, fLaunch.getLaunchConfiguration());
hwService.initialize(requestMonitor);
}},
new Step() { @Override
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardware.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java
index 48d0a69d9c..fb84812662 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardware.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java
@@ -60,13 +60,13 @@ import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
/**
- * This class implements the IGDBHardware interface which gives access
+ * This class implements the {@link IGDBHardwareAndOS} interface which gives access
* to hardware information about the target.
*
* @since 4.1
*/
@SuppressWarnings("restriction")
-public class GDBHardware extends AbstractDsfService implements IGDBHardware, ICachingService {
+public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardwareAndOS, ICachingService {
@Immutable
protected static class GDBCPUDMC extends AbstractDMContext
@@ -171,7 +171,7 @@ public class GDBHardware extends AbstractDsfService implements IGDBHardware, ICa
// Bug 374293
private boolean fSessionInitializationComplete;
- public GDBHardware(DsfSession session) {
+ public GDBHardwareAndOS(DsfSession session) {
super(session);
}
@@ -216,8 +216,8 @@ public class GDBHardware extends AbstractDsfService implements IGDBHardware, ICa
getSession().addServiceEventListener(this, null);
// Register this service.
- register(new String[] { IGDBHardware.class.getName(),
- GDBHardware.class.getName() },
+ register(new String[] { IGDBHardwareAndOS.class.getName(),
+ GDBHardwareAndOS.class.getName() },
new Hashtable<String, String>());
requestMonitor.done();
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java
index 7d6c78fcee..a419748ed6 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java
@@ -96,10 +96,10 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
return (V)createTraceControlService(session, (ILaunchConfiguration)arg);
}
}
- } else if (IGDBHardware.class.isAssignableFrom(clazz)) {
+ } else if (IGDBHardwareAndOS.class.isAssignableFrom(clazz)) {
for (Object arg : optionalArguments) {
if (arg instanceof ILaunchConfiguration) {
- return (V)createHardwareService(session, (ILaunchConfiguration)arg);
+ return (V)createHardwareAndOSService(session, (ILaunchConfiguration)arg);
}
}
}
@@ -223,7 +223,7 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
}
/** @since 4.1 */
- protected IGDBHardware createHardwareService(DsfSession session, ILaunchConfiguration config) {
- return new GDBHardware(session);
+ protected IGDBHardwareAndOS createHardwareAndOSService(DsfSession session, ILaunchConfiguration config) {
+ return new GDBHardwareAndOS(session);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardware.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardwareAndOS.java
index 205d38ebad..b3035e8e59 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardware.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBHardwareAndOS.java
@@ -25,7 +25,7 @@ import org.eclipse.cdt.dsf.service.IDsfService;
*
* @since 4.1
*/
-public interface IGDBHardware extends IDsfService {
+public interface IGDBHardwareAndOS extends IDsfService {
/**
* The physical target that has CPUs and Cores.
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java
index 546e1a094d..bd1b0f3ba0 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java
@@ -15,7 +15,7 @@ package org.eclipse.cdt.dsf.gdb.service.command;
import org.eclipse.cdt.dsf.debug.service.IModules.ISymbolDMContext;
import org.eclipse.cdt.dsf.debug.service.ISignals.ISignalsDMContext;
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
-import org.eclipse.cdt.dsf.gdb.service.IGDBHardware.IHardwareTargetDMContext;
+import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS.IHardwareTargetDMContext;
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceTargetDMContext;
import org.eclipse.cdt.dsf.mi.service.command.MIControlDMContext;

Back to the top