diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java index 5351e506ced..d2c9f815c51 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java @@ -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.IFrameDMContext; 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.ui.viewmodel.SteppingController; import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController.ISteppingControlParticipant; @@ -986,6 +987,28 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl 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 public void eventDispatched(final IRunControl.ISuspendedDMEvent e) { updateStepTiming();