|
Lines 43-49
Link Here
|
| 43 |
import org.eclipse.dd.dsf.service.AbstractDsfService; |
43 |
import org.eclipse.dd.dsf.service.AbstractDsfService; |
| 44 |
import org.eclipse.dd.dsf.service.DsfSession; |
44 |
import org.eclipse.dd.dsf.service.DsfSession; |
| 45 |
import org.eclipse.dd.mi.internal.MIPlugin; |
45 |
import org.eclipse.dd.mi.internal.MIPlugin; |
|
|
46 |
import org.eclipse.dd.mi.service.IMIContainerDMContext; |
| 46 |
import org.eclipse.dd.mi.service.IMIExecutionDMContext; |
47 |
import org.eclipse.dd.mi.service.IMIExecutionDMContext; |
|
|
48 |
import org.eclipse.dd.mi.service.IMIProcesses; |
| 47 |
import org.eclipse.dd.mi.service.command.commands.MICommand; |
49 |
import org.eclipse.dd.mi.service.command.commands.MICommand; |
| 48 |
import org.eclipse.dd.mi.service.command.commands.MIStackSelectFrame; |
50 |
import org.eclipse.dd.mi.service.command.commands.MIStackSelectFrame; |
| 49 |
import org.eclipse.dd.mi.service.command.commands.MIThreadSelect; |
51 |
import org.eclipse.dd.mi.service.command.commands.MIThreadSelect; |
|
Lines 461-468
Link Here
|
| 461 |
|
463 |
|
| 462 |
public String getThreadId() { |
464 |
public String getThreadId() { |
| 463 |
IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class); |
465 |
IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class); |
| 464 |
if(execCtx != null) |
466 |
if (execCtx != null) { |
| 465 |
return Integer.toString(execCtx.getThreadId()); |
467 |
return Integer.toString(execCtx.getThreadId()); |
|
|
468 |
} |
| 469 |
|
| 470 |
// If we don't have an execution context, try to see if we have a container context. |
| 471 |
// If we do, then we should specify this container to MI; however, the only way to do this |
| 472 |
// is to specify some thread within the container. |
| 473 |
IMIContainerDMContext containerCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIContainerDMContext.class); |
| 474 |
if(containerCtx != null) { |
| 475 |
IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class); |
| 476 |
|
| 477 |
if (procService != null) { |
| 478 |
IMIExecutionDMContext[] execCtxs = procService.getExecutionContexts(containerCtx); |
| 479 |
// Return any thread... let's take the first one. |
| 480 |
if (execCtxs != null && execCtxs.length > 0) { |
| 481 |
return Integer.toString(execCtxs[0].getThreadId()); |
| 482 |
} |
| 483 |
} |
| 484 |
} |
| 485 |
|
| 466 |
return null; |
486 |
return null; |
| 467 |
} |
487 |
} |
| 468 |
|
488 |
|