Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Obtaining IExecutionDMContext object in DSF

Hi,

Yes. The missing was variable was done intentionally. Eclipse would have errored out in that case.
I intend to use IExecutionDMContext object with IRunControl methods like suspend, resume, canSuspend etc. Also IStack methods like getTopFrame etc. Generally speaking many methods in the DSF debug plugin require IExecutionDMContext.
Hence my questions.

Thanks,
Rohit

On Wed, Jul 21, 2010 at 5:39 PM, Pawel Piech <pawel.piech@xxxxxxxxxxxxx> wrote:
The statement below would not compile because there seems a variable name missing from the second declaration.  But if I understand its intent correctly, it's equivalent to:

IExecutionDMContext dmc = (event.getDMContext() instanceof IContainerDMContext) ? event.getDMContext() : null;

Without understanding what you want to do with the context, i can't really answer your questions.

Cheers,
Pawel

On 07/21/2010 02:30 PM, Rohit Girme wrote:
Hi,

I am trying to use/call DSF services for some time now. For many of these services related to "run control" we need an IExecutionContext object. The way I do it is as follows :

          IContainerDMContext  abc =  DMContexts.getAncestorOfType(  event.getDMContext(),   IContainerDMContext.class   )
           
           if (abc != null)
            {

              IExecutionDMContext  = !event.getDMContext().equals( abc ) ? event.getDMContext() : null

            }

This piece of code is inside an event listener, which listenes for an MIStopped event. So basically, I get  " IExecutionDMContext " from MIStopped event object. I tried using ISuspendedDMEvent instead, to make it generic. However it does not give the same result. I found the above piece of code in some DSF file. So I know some DSF class uses it. I have been looking through the source code for a while now. But this is the only way I found that works.

My questions are :

Is the process I described above, the right one ?
Is there any better way to get the IExecutionDMContext object ? Something more generic.


--
Thanks & Regards,
Rohit Girme

_______________________________________________ cdt-dev mailing list


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




--
Thanks & Regards,
Rohit Girme


Back to the top