Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] ICDIThreadGroup.getCurrentThread()

I am working on implementing a CDI debugger that is not GDB based and I
was wandering how to implement ICDIThreadGroup.getCurrentThread(). 

I checked the references in CDT and I found three of them. 

1. CDebugTarget.initializeThreads 
....
if ( cdiThreads[i].equals( getCDITarget().getCurrentThread() ) &&
thread.isSuspended() ) {
	// Use BREAKPOINT as a detail to force perspective switch
	suspendEvent = thread.createSuspendEvent( DebugEvent.BREAKPOINT
);
...
I commented this code and I still got a perspective switch. 
Is this code really needed and if so, what can I do to see the
difference? 

2. CDebugTarget.refreshThreads() and CDebugTarget.suspendThreads(). I
traced the call stack and I noticed that if my CDI debugger's
configuration implements ICDITargetConfiguration2 and returns
supportsThreadControl() == true - getCurrentThread() will be ignored. 

A: the call to getCurrentThread() in suspendThreads is bypassed because
of ....
if (!(this.getConfiguration() instanceof ICDITargetConfiguration2) ||
!((ICDITargetConfiguration2)this.getConfiguration()).supportsThreadContr
ol())
				suspendThreads(event);

B: the call to getCurrentThread() in refreshThreads() is not bypassed
but then CThread.setCurrent is setting every thread to current. 

Is it a fair statement to say that if my debugger returns true in
supportsThreadControl() this function is ignored? 

Thanks and Regards
Dobrin


Back to the top