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




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,


***** 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.