From 71db7fdfe2fe2096a9628007d1952575459e68fb Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 22 Aug 2006 15:04:41 +0000 Subject: [PATCH] Optimized stepping performance. --- .../eclipse/dd/dsf/debug/IBackEndProcess.java | 10 ++++++ .../eclipse/dd/dsf/debug/IExpressions.java | 10 ++++++ .../src/org/eclipse/dd/dsf/debug/IMemory.java | 10 ++++++ .../org/eclipse/dd/dsf/debug/IModules.java | 10 ++++++ .../dd/dsf/debug/INativeProcesses.java | 10 ++++++ .../src/org/eclipse/dd/dsf/debug/IOS.java | 10 ++++++ .../org/eclipse/dd/dsf/debug/IRegisters.java | 10 ++++++ .../org/eclipse/dd/dsf/debug/IRunControl.java | 25 ++++++-------- .../eclipse/dd/dsf/debug/ISourceLookup.java | 10 ++++++ .../src/org/eclipse/dd/dsf/debug/IStack.java | 10 ++++++ .../dd/dsf/debug/IStepQueueManager.java | 34 +++++++++++++++++-- .../org/eclipse/dd/dsf/debug/ISymbols.java | 10 ++++++ .../org/eclipse/dd/dsf/debug/ITargets.java | 10 ++++++ .../eclipse/dd/dsf/service/DsfSession.java | 4 +-- .../eclipse/dd/dsf/service/IDsfService.java | 9 +++++ 15 files changed, 163 insertions(+), 19 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IBackEndProcess.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IBackEndProcess.java index 094e63d0d2c..d255acbff0a 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IBackEndProcess.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IBackEndProcess.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.service.IDsfService; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IExpressions.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IExpressions.java index 228912b498c..6d32378f8b9 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IExpressions.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IExpressions.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import java.util.Map; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IMemory.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IMemory.java index eff0c6f1b14..c87fe7ccec0 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IMemory.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IMemory.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.Done; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IModules.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IModules.java index d15b2939322..9d30a3e7f46 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IModules.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IModules.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import java.math.BigInteger; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/INativeProcesses.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/INativeProcesses.java index e2eae52fca2..22476de3980 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/INativeProcesses.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/INativeProcesses.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.Done; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IOS.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IOS.java index 21c153ab2d7..2e3af9bd707 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IOS.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IOS.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.Done; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRegisters.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRegisters.java index ab41ad41ecc..586add23540 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRegisters.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRegisters.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.GetDataDone; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRunControl.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRunControl.java index 25fc30a7926..48b78e8783a 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRunControl.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IRunControl.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.Done; @@ -17,13 +27,6 @@ import org.eclipse.dd.dsf.model.IDataModelService; */ public interface IRunControl extends IDataModelService { - /** - * Amount of time in seconds, that it takes the ISteppingTimedOutEvent event to - * be issued after a step is started. - * @see ISteppingTimedOutEvent - */ - public final static int STEPPING_TIMEOUT = 5; - /** * Execution context is the object on which run control operations can be * performed. A lot of higher-level services reference this context to build @@ -73,13 +76,6 @@ public interface IRunControl extends IDataModelService IExecutionDMC getExecutionContext(); } - /** - * Indicates that the given context has been stepping for some time, - * and the UI (views and actions) may need to be updated accordingly. - */ - public interface ISteppingTimedOutEvent extends IDataModelEvent { - } - /** * Display information for an execution context. */ @@ -103,7 +99,6 @@ public interface IRunControl extends IDataModelService void suspend(IExecutionDMC context, Done done); public enum StepType { STEP_OVER, STEP_INTO, STEP_RETURN }; boolean isStepping(IExecutionDMC context); - boolean isSteppingTimedOut(IExecutionDMC context); boolean canStep(IExecutionDMC context); void step(IExecutionDMC context, StepType stepType, Done done); boolean canInstructionStep(IExecutionDMC context); diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISourceLookup.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISourceLookup.java index 8e37f7b4767..54f1341a1e5 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISourceLookup.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISourceLookup.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.GetDataDone; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStack.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStack.java index faf8933c487..7d26f13928f 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStack.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStack.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.GetDataDone; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStepQueueManager.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStepQueueManager.java index 5c5f04e4ddf..aa92242269f 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStepQueueManager.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IStepQueueManager.java @@ -1,5 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; +import org.eclipse.dd.dsf.debug.IRunControl.IExecutionDMC; +import org.eclipse.dd.dsf.model.IDataModelEvent; import org.eclipse.dd.dsf.service.IDsfService; /** @@ -11,7 +23,21 @@ import org.eclipse.dd.dsf.service.IDsfService; * about to be executed. */ public interface IStepQueueManager extends IDsfService { + /** + * Amount of time in miliseconds, that it takes the ISteppingTimedOutEvent + * event to be issued after a step is started. + * @see ISteppingTimedOutEvent + */ + public final static int STEPPING_TIMEOUT = 500; + /** + * Indicates that the given context has been stepping for some time, + * and the UI (views and actions) may need to be updated accordingly. + */ + public interface ISteppingTimedOutEvent extends IDataModelEvent { + } + + void setStepQueueDepth(int depth); int getStepQueueDepth(); @@ -24,8 +50,10 @@ public interface IStepQueueManager extends IDsfService { /** * Checks whether a step command can be queued up for given context. */ - void canEnqueueStep(IRunControl.IExecutionDMC execCtx); - + boolean canEnqueueStep(IRunControl.IExecutionDMC execCtx); + + boolean canEnqueueInstructionStep(IRunControl.IExecutionDMC execCtx); + /** * Adds a step command to the execution queue for given context. * @param execCtx Execution context that should perform the step. @@ -40,4 +68,6 @@ public interface IStepQueueManager extends IDsfService { * @param stepType Type of step to execute. */ void enqueueInstructionStep(IRunControl.IExecutionDMC execCtx, IRunControl.StepType stepType); + + boolean isSteppingTimedOut(IExecutionDMC context); } diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISymbols.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISymbols.java index c3863dd259a..95c82ca6e06 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISymbols.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ISymbols.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.GetDataDone; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ITargets.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ITargets.java index a90c2f68fbc..f142efe9393 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ITargets.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/ITargets.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2006 Wind River Systems 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 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ package org.eclipse.dd.dsf.debug; import org.eclipse.dd.dsf.concurrent.Done; diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/DsfSession.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/DsfSession.java index 33820e7114b..019cb5b8b2e 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/DsfSession.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/DsfSession.java @@ -305,9 +305,9 @@ public class DsfSession if (o1.fListener == o2.fListener) { return 0; } if (o1.fListener instanceof IDsfService && !(o2.fListener instanceof IDsfService)) { - return Integer.MAX_VALUE; - } else if (o2.fListener instanceof IDsfService && !(o1.fListener instanceof IDsfService)) { return Integer.MIN_VALUE; + } else if (o2.fListener instanceof IDsfService && !(o1.fListener instanceof IDsfService)) { + return Integer.MAX_VALUE; } else if ( (o1.fListener instanceof IDsfService) && (o2.fListener instanceof IDsfService) ) { return ((IDsfService)o1.fListener).getStartupNumber() - ((IDsfService)o2.fListener).getStartupNumber(); } diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/IDsfService.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/IDsfService.java index 26f72fec26e..b834d757dba 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/IDsfService.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/service/IDsfService.java @@ -50,6 +50,15 @@ public interface IDsfService { */ DsfExecutor getExecutor(); + /** + * Returns the map of properties that this service was registered with. + *
+ * TODO: is returning the properties and service filter redundant? Should + * getServiceFilter() be removed from the interface since it can be generated + * from the properties? + */ + Dictionary getProperties(); + /** * Returns a filter string that can be used to uniquely identify this * service. This filter string should be based on the properties and class