mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Changes to get some performances. The array of
events is passed instead of one at a time.
This commit is contained in:
parent
8cf78bf7d7
commit
b3f004b2a3
19 changed files with 274 additions and 244 deletions
|
@ -1,3 +1,11 @@
|
|||
2004-03-17 Alain Magloire
|
||||
|
||||
Changes to get some performances. The array of
|
||||
events is passed instead of one at a time.
|
||||
|
||||
Affected files all the implement ICDIEventListener
|
||||
to many to enumerate.
|
||||
|
||||
2004-03-16 Alain Magloire
|
||||
|
||||
Make this class extends ICDIEventListener
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
package org.eclipse.cdt.debug.core;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
|
@ -17,6 +16,7 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
|
|||
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
|
||||
|
@ -194,7 +194,9 @@ public class CDebugModel
|
|||
throw new DebugException( e.getStatus() );
|
||||
}
|
||||
|
||||
((CDebugTarget)target[0]).handleDebugEvent( new ICDISuspendedEvent()
|
||||
ICDIEvent[] events = new ICDIEvent[]
|
||||
{
|
||||
new ICDISuspendedEvent()
|
||||
{
|
||||
public ICDISessionObject getReason()
|
||||
{
|
||||
|
@ -206,8 +208,9 @@ public class CDebugModel
|
|||
return cdiTarget;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
};
|
||||
((CDebugTarget)target[0]).handleDebugEvents( events );
|
||||
return target[0];
|
||||
}
|
||||
|
||||
|
@ -240,7 +243,9 @@ public class CDebugModel
|
|||
throw new DebugException( e.getStatus() );
|
||||
}
|
||||
|
||||
((CDebugTarget)target[0]).handleDebugEvent( new ICDISuspendedEvent()
|
||||
ICDIEvent[] events = new ICDIEvent[]
|
||||
{
|
||||
new ICDISuspendedEvent()
|
||||
{
|
||||
public ICDISessionObject getReason()
|
||||
{
|
||||
|
@ -252,7 +257,9 @@ public class CDebugModel
|
|||
return cdiTarget;
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
};
|
||||
((CDebugTarget)target[0]).handleDebugEvents( events );
|
||||
|
||||
return target[0];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package org.eclipse.cdt.debug.core;
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
|
||||
/*
|
||||
* (c) Copyright QNX Software System 2002.
|
||||
|
|
|
@ -19,5 +19,5 @@ public interface ICDIEventListener {
|
|||
*
|
||||
* @param event - the event
|
||||
*/
|
||||
void handleDebugEvent( ICDIEvent event );
|
||||
void handleDebugEvents(ICDIEvent[] event);
|
||||
}
|
||||
|
|
|
@ -187,10 +187,13 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if ( source != null && source.getTarget().equals( getDebugTarget().getCDITarget() ) )
|
||||
{
|
||||
|
@ -211,6 +214,7 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isTargetBreakpoint( ICBreakpoint breakpoint )
|
||||
{
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.eclipse.cdt.debug.core.ICDebugger;
|
|||
import org.eclipse.core.boot.BootLoader;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
|
||||
public class DebugConfiguration implements ICDebugConfiguration {
|
||||
/**
|
||||
|
|
|
@ -85,9 +85,9 @@ public class CArrayPartition extends CVariable
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -675,9 +675,10 @@ public class CDebugTarget extends CDebugElement
|
|||
protected void suspendThreads( ICDISuspendedEvent event )
|
||||
{
|
||||
Iterator it = getThreadList().iterator();
|
||||
ICDIEvent[] events = new ICDIEvent[] {event};
|
||||
while( it.hasNext() )
|
||||
{
|
||||
((CThread)it.next()).handleDebugEvent( event );
|
||||
((CThread)it.next()).handleDebugEvents( events );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1002,10 +1003,13 @@ public class CDebugTarget extends CDebugElement
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if ( source == null && event instanceof ICDIDestroyedEvent )
|
||||
{
|
||||
|
@ -1087,6 +1091,7 @@ public class CDebugTarget extends CDebugElement
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.IRestart#canRestart()
|
||||
|
@ -1318,7 +1323,8 @@ public class CDebugTarget extends CDebugElement
|
|||
CThread thread = findThread( (ICDIThread)event.getSource() );
|
||||
if ( thread != null && newThreads.contains( thread ) )
|
||||
{
|
||||
thread.handleDebugEvent( event );
|
||||
ICDIEvent[] evts = new ICDIEvent[]{event};
|
||||
thread.handleDebugEvents( evts );
|
||||
}
|
||||
}
|
||||
if ( reason instanceof ICDIEndSteppingRange )
|
||||
|
|
|
@ -89,10 +89,13 @@ public class CExpression extends CModificationVariable
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
if ( event instanceof ICDIResumedEvent )
|
||||
{
|
||||
if ( event.getSource() instanceof ICDITarget && getCDITarget().equals( event.getSource() ) )
|
||||
|
@ -106,8 +109,10 @@ public class CExpression extends CModificationVariable
|
|||
CDebugCorePlugin.log( e );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
super.handleDebugEvent(event);
|
||||
}
|
||||
super.handleDebugEvents(events);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -422,13 +422,16 @@ public class CFormattedMemoryBlock extends CDebugElement
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if (source == null)
|
||||
return;
|
||||
continue;
|
||||
|
||||
if ( source.getTarget().equals( getCDITarget() ) )
|
||||
{
|
||||
|
@ -462,6 +465,7 @@ public class CFormattedMemoryBlock extends CDebugElement
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ICDIMemoryBlock getCDIMemoryBlock()
|
||||
{
|
||||
|
|
|
@ -62,15 +62,17 @@ public class CGlobalVariable extends CModificationVariable
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
super.handleDebugEvent( event );
|
||||
|
||||
super.handleDebugEvents( events );
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if (source == null)
|
||||
return;
|
||||
continue;
|
||||
|
||||
if ( source.getTarget().equals( getCDITarget() ) )
|
||||
{
|
||||
|
@ -87,4 +89,5 @@ public class CGlobalVariable extends CModificationVariable
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,9 +104,9 @@ public class CSharedLibrary extends CDebugElement
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,9 +81,9 @@ public class CSignal extends CDebugElement implements ICSignal, ICDIEventListene
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -245,9 +245,9 @@ public class CStackFrame extends CDebugElement
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -418,15 +418,18 @@ public class CThread extends CDebugElement
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
if ( isDisposed() )
|
||||
return;
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if ( source == null )
|
||||
return;
|
||||
continue;
|
||||
if ( source.getTarget().equals( getCDITarget() ) )
|
||||
{
|
||||
if ( event instanceof ICDISuspendedEvent )
|
||||
|
@ -468,6 +471,7 @@ public class CThread extends CDebugElement
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
package org.eclipse.cdt.debug.internal.core.model;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
|
@ -581,13 +580,16 @@ public abstract class CVariable extends CDebugElement
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent( ICDIEvent event )
|
||||
public void handleDebugEvents( ICDIEvent[] events )
|
||||
{
|
||||
for (int i = 0; i < events.length; i++)
|
||||
{
|
||||
ICDIEvent event = events[i];
|
||||
ICDIObject source = event.getSource();
|
||||
if (source == null)
|
||||
return;
|
||||
continue;
|
||||
|
||||
if ( source.getTarget().equals( getCDITarget() ) )
|
||||
{
|
||||
|
@ -611,6 +613,7 @@ public abstract class CVariable extends CDebugElement
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleResumedEvent( ICDIResumedEvent event )
|
||||
{
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2004-03-17 Alain Magloire
|
||||
|
||||
Changes pass the array of events instead
|
||||
of one at a time
|
||||
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/Manager.java
|
||||
|
||||
2004-03-16 Tanya Wolff
|
||||
|
||||
Marked strings in src as non-translatable
|
||||
|
|
|
@ -234,22 +234,10 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
|||
* Send ICDIEvent to the listeners.
|
||||
*/
|
||||
private void fireEvents(ICDIEvent[] cdiEvents) {
|
||||
if (cdiEvents != null) {
|
||||
for (int i = 0; i < cdiEvents.length; i++) {
|
||||
fireEvent(cdiEvents[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send ICDIEvent to the listeners.
|
||||
*/
|
||||
private void fireEvent(ICDIEvent cdiEvent) {
|
||||
if (cdiEvent != null) {
|
||||
ICDIEventListener[] listeners =
|
||||
(ICDIEventListener[])list.toArray(new ICDIEventListener[0]);
|
||||
if (cdiEvents != null && cdiEvents.length > 0) {
|
||||
ICDIEventListener[] listeners = (ICDIEventListener[])list.toArray(new ICDIEventListener[0]);
|
||||
for (int i = 0; i < listeners.length; i++) {
|
||||
listeners[i].handleDebugEvent(cdiEvent);
|
||||
listeners[i].handleDebugEvents(cdiEvents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,17 +48,9 @@ public abstract class Manager extends SessionObject implements ICDIManager {
|
|||
public abstract void update() throws CDIException;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[])
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[])
|
||||
*/
|
||||
public void handleDebugEvent(ICDIEvent[] events) {
|
||||
for (int i = 0; i < events.length; i++) {
|
||||
handleDebugEvent(events[i]);
|
||||
}
|
||||
public void handleDebugEvents(ICDIEvent[] events) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent)
|
||||
*/
|
||||
public void handleDebugEvent(ICDIEvent event) {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue