mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 578400: Handle refresh event to show right source code
When the ICommandControlRefreshAllDMEvent is sent, open the coresponding source file to the new stack frame. It could be the same or a completly different file as before the event. Contributed by STMicroelectronics Also-By: Jonah Graham <jonah@kichwacoders.com> Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com> Change-Id: Ib99f19f444a5bae1d99072ec9ed07e5666732bb6
This commit is contained in:
parent
72efb17cda
commit
fcf416ab6d
1 changed files with 23 additions and 0 deletions
|
@ -43,6 +43,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IStack;
|
import org.eclipse.cdt.dsf.debug.service.IStack;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
|
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
||||||
import org.eclipse.cdt.dsf.debug.sourcelookup.DsfSourceLookupParticipant;
|
import org.eclipse.cdt.dsf.debug.sourcelookup.DsfSourceLookupParticipant;
|
||||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController;
|
import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController;
|
||||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController.ISteppingControlParticipant;
|
import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController.ISteppingControlParticipant;
|
||||||
|
@ -986,6 +987,28 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
||||||
startAnnotationClearingJob(e.getDMContext());
|
startAnnotationClearingJob(e.getDMContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
|
@DsfServiceEventHandler
|
||||||
|
public void eventDispatched(final ICommandControlService.ICommandControlRefreshAllDMEvent e) {
|
||||||
|
if (DEBUG) {
|
||||||
|
System.out.println("[DsfSourceDisplayAdapter] eventDispatched e=" + e); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
// trigger source display immediately (should be optional?)
|
||||||
|
Display.getDefault().asyncExec(() -> {
|
||||||
|
Object context = DebugUITools.getDebugContext();
|
||||||
|
if (context instanceof IDMVMContext) {
|
||||||
|
final IDMContext dmc = ((IDMVMContext) context).getDMContext();
|
||||||
|
if (dmc instanceof IFrameDMContext && DMContexts.isAncestorOf(dmc, e.getDMContext())) {
|
||||||
|
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
|
||||||
|
doDisplaySource((IFrameDMContext) dmc, page, false, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final IRunControl.ISuspendedDMEvent e) {
|
public void eventDispatched(final IRunControl.ISuspendedDMEvent e) {
|
||||||
updateStepTiming();
|
updateStepTiming();
|
||||||
|
|
Loading…
Add table
Reference in a new issue