Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to obtain the current thread status from Launch view.

Hi,
 
You can get the status of the thread by using the IRunControl service.
You can look at an example in AbstractThreadVMNode.updatePropertiesInSessionThread()
in the org.eclipse.cdt.dsf.ui plugin.
 
Also, I'm not sure what your exact scenario is, so just in case, besides using
IDebugContextListener which tells you when the active context changes, you could
use DebugUITools.getDebugContext() to get the current context.
 
Marc
 


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Malu Sasi
Sent: Friday, April 27, 2012 8:27 AM
To: CDT General developers list.
Subject: [cdt-dev] How to obtain the current thread status from Launch view.

 

Hi,

 

I would like to know if it is  possible to get the status of thread currently selected (Resume/Suspend/Terminate)  from Launch view?

 

I tried out by registering to IDebugContextListener.  In case where multiple threads are listed, while switching between the threads, debugContextChanged(DebugContextEvent event) , gets invoked.

 

 

From the event we get the TreeSelection, and I managed to get the thread id from it as below:

 

 

if(event.getContext() instanceof IStructuredSeletion){

IStructuredSelection selection = (IStructuredSelection) event.getContext();

Object obj = selection.getFirstElement();

if (obj instanceof IDMVMContext) {

IDMContext dmContext = = ((IDMVMContext) obj).getDMContext();

if (dmContext instanceof IMIExecutionDMContext) {

IMIExecutionDMContext execContext = (IMIExecutionDMContext) dmContext;

execContext.getThreadId()); // returns the currently selected thread id of stackframe

}

}

}

 

Kindly let me know if it is possible to get the status of thread (running/suspended/terminated)

 

Or if there is any other better method?

     

 

Thanks in advance,

Malu

 
***** Confidentiality Statement/Disclaimer *****

This message and any attachments is intended for the sole use of the intended recipient. It may contain confidential information. Any unauthorized use, dissemination or modification is strictly prohibited. If you are not the intended recipient, please notify the sender immediately then delete it from all your systems, and do not copy, use or print. Internet communications are not secure and it is the responsibility of the recipient to make sure that it is virus/malicious code exempt.
The company/sender cannot be responsible for any unauthorized alterations or modifications made to the contents. If you require any form of confirmation of the contents, please contact the company/sender. The company/sender is not liable for any errors or omissions in the content of this message.

Back to the top