Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] Implementing View in Debugger

Hi Igor,
 
As far as I understand your ModelManager class implements the ICDIEventListener interface. Being registered as a listener of an ICDISession it receives ICDIEvent objects as notifications. The source of ICDIEvent is always an implementation of the ICDIObject interface. To notify UI components you should use the DebugEvent mechanism provided by the Eclipse Debug framework. This means that ModelManager is responsible of creation of DebugEvent objects. Create a DebugEvent object when you need it, set your ModelManager as it's source and fire this event using the fireDebugEventSet method of DebugPlugin. To receive debug events ModelViewEventHandler should be registered as a listener to DebugPlugin.
 
Mikhail Khodjaiants
----- Original Message -----
Sent: Thursday, November 14, 2002 9:25 AM
Subject: [cdt-debug-dev] Implementing View in Debugger


Hi all!!!!

I have a task to create a view in CDT Debugger Model. This view should behave itself like Memory or Register View - for example, it must be always refreshed  after step action. I almost understood technology of implementing views to Debugger Model but one thing I can't understand.  

So, I created class ModelViewEventHandler where I situated such fragment


        protected void doHandleDebugEvents( DebugEvent[] events )
        {
                for( int i = 0; i < events.length; i++ )
                {
                        DebugEvent event = events[i];
                        switch( event.getKind() )
                        {
                                case DebugEvent.CHANGE :
                                        if ( event.getDetail() == DebugEvent.STATE )
                                        {
                                                // only process variable state changes
                                                if ( event.getSource() instanceof ModelManager )
                                                {
//                                                        refresh( event.getSource() );
                            ((ModelViewer)getViewer()).setInput(event.getSource());                                                        
                                                }
                                        }
                        }
                }
        }

There I want to catch debug event with source equals "ModelManager". Earlier  I  defined this class like
       
     public ModelManager( CDebugTarget target )
     {
                super( target );
                getCDISession().getEventManager().addEventListener( this );        
     }

So, I decided that it is enough actions in order to get debug events with source I need. But I was wrong because usually I catch events with source equals "CStackFrame" or "CFormattedMemoryBlock" and not "ModelManager".

Where did I make a mistake? What should I do in order to make Debugger model to send events with source I need?



Thanks in advance,
 Igor S. Zamyatin

 Interstron Ltd.
----------------------------------------
email:  isz@xxxxxxxxxxxxx
tel:    +7 (095) 269-4713
cell:   +7 (902) 659-5838
www:    http://www.interstron.ru

Back to the top