mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Convert new Runnable to lambda.
Change-Id: I8b827013a29802a3f3ae6400ddce8d8753eb6399 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
51da3eb3a6
commit
1e42e5f0e1
113 changed files with 1723 additions and 2688 deletions
|
@ -88,14 +88,11 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
|||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
||||
for (IWorkbenchPage page : pages) {
|
||||
page.closeAllEditors(false);
|
||||
dispatch(0);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
||||
for (IWorkbenchPage page : pages) {
|
||||
page.closeAllEditors(false);
|
||||
dispatch(0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -141,19 +138,16 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
|||
}
|
||||
|
||||
public void doRunQuickFix() {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < markers.length; i++) {
|
||||
IMarker marker = markers[i];
|
||||
isApplicableMap.put(marker, quickFix.isApplicable(marker));
|
||||
if (quickFix.isApplicable(marker)) {
|
||||
quickFix.run(marker);
|
||||
dispatch(0);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
for (int i = 0; i < markers.length; i++) {
|
||||
IMarker marker = markers[i];
|
||||
isApplicableMap.put(marker, quickFix.isApplicable(marker));
|
||||
if (quickFix.isApplicable(marker)) {
|
||||
quickFix.run(marker);
|
||||
dispatch(0);
|
||||
}
|
||||
PlatformUI.getWorkbench().saveAllEditors(false);
|
||||
}
|
||||
PlatformUI.getWorkbench().saveAllEditors(false);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -50,17 +50,14 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -256,12 +253,7 @@ public class ControlFlowGraphView extends ViewPart {
|
|||
private void hookContextMenu() {
|
||||
MenuManager menuMgr = new MenuManager("#PopupMenu");
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
ControlFlowGraphView.this.fillContextMenu(manager);
|
||||
}
|
||||
});
|
||||
menuMgr.addMenuListener(manager -> ControlFlowGraphView.this.fillContextMenu(manager));
|
||||
Menu menu = menuMgr.createContextMenu(viewer.getControl());
|
||||
viewer.getControl().setMenu(menu);
|
||||
getSite().registerContextMenu(menuMgr, viewer);
|
||||
|
@ -334,13 +326,7 @@ public class ControlFlowGraphView extends ViewPart {
|
|||
}
|
||||
};
|
||||
ast.accept(visitor);
|
||||
viewer.getControl().getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
viewer.setInput(functions);
|
||||
}
|
||||
});
|
||||
viewer.getControl().getDisplay().asyncExec(() -> viewer.setInput(functions));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -406,11 +392,6 @@ public class ControlFlowGraphView extends ViewPart {
|
|||
}
|
||||
|
||||
private void hookSingleClickAction() {
|
||||
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
new ASTHighlighterAction(null).run();
|
||||
}
|
||||
});
|
||||
viewer.addSelectionChangedListener(event -> new ASTHighlighterAction(null).run());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: org.eclipse.cdt.codan.ui.cxx;singleton:=true
|
||||
Bundle-Version: 3.5.0.qualifier
|
||||
Bundle-Version: 3.5.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.codan.internal.ui.cxx.Activator
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -34,18 +34,15 @@ public class Startup implements IStartup {
|
|||
*/
|
||||
private void registerListeners() {
|
||||
final IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
workbench.getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Install a part listener on currenly open workbench windows.
|
||||
for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
|
||||
CodanPartListener.installOnWindow(window);
|
||||
}
|
||||
|
||||
// Install a window listener which will be notified of
|
||||
// new windows opening, and install a part listener on them.
|
||||
workbench.addWindowListener(new CodanWindowListener());
|
||||
workbench.getDisplay().asyncExec(() -> {
|
||||
// Install a part listener on currenly open workbench windows.
|
||||
for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
|
||||
CodanPartListener.installOnWindow(window);
|
||||
}
|
||||
|
||||
// Install a window listener which will be notified of
|
||||
// new windows opening, and install a part listener on them.
|
||||
workbench.addWindowListener(new CodanWindowListener());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -360,13 +360,10 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
|
|||
PreferenceManager manager = new PreferenceManager();
|
||||
manager.addToRoot(targetNode);
|
||||
final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager);
|
||||
BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dialog.create();
|
||||
dialog.setMessage(targetNode.getLabelText());
|
||||
dialog.open();
|
||||
}
|
||||
BusyIndicator.showWhile(getControl().getDisplay(), () -> {
|
||||
dialog.create();
|
||||
dialog.setMessage(targetNode.getLabelText());
|
||||
dialog.open();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,12 +206,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
addIndexerSetupParticipant(new WaitForRefreshJobs());
|
||||
fProjectDescriptionListener = new CProjectDescriptionListener(this);
|
||||
fJobChangeListener = new JobChangeListener(this);
|
||||
fPreferenceChangeListener = new IPreferenceChangeListener() {
|
||||
@Override
|
||||
public void preferenceChange(PreferenceChangeEvent event) {
|
||||
onPreferenceChange(event);
|
||||
}
|
||||
};
|
||||
fPreferenceChangeListener = event -> onPreferenceChange(event);
|
||||
fSetupJob = new PDOMSetupJob(this);
|
||||
fIndexerJob = new PDOMIndexerJob(this);
|
||||
fNotificationJob = createNotifyJob();
|
||||
|
@ -541,9 +536,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
registerIndexer(cproject, indexer);
|
||||
createPolicy(cproject).clearTUs();
|
||||
if (oldIndexer instanceof AbstractPDOMIndexer) {
|
||||
if (IndexerPreferences.preferDefaultLanguage(
|
||||
((AbstractPDOMIndexer) oldIndexer).getProperties()) != IndexerPreferences
|
||||
.preferDefaultLanguage(props)) {
|
||||
if (IndexerPreferences.preferDefaultLanguage(((AbstractPDOMIndexer) oldIndexer)
|
||||
.getProperties()) != IndexerPreferences.preferDefaultLanguage(props)) {
|
||||
enqueue(new NotifyCModelManagerTask(cproject.getProject()));
|
||||
}
|
||||
}
|
||||
|
@ -1089,25 +1083,22 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
if (fStateListeners.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Runnable notify = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fIndexerStateEvent.setState(state);
|
||||
Object[] listeners = fStateListeners.getListeners();
|
||||
for (Object listener2 : listeners) {
|
||||
final IIndexerStateListener listener = (IIndexerStateListener) listener2;
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
Runnable notify = () -> {
|
||||
fIndexerStateEvent.setState(state);
|
||||
Object[] listeners = fStateListeners.getListeners();
|
||||
for (Object listener2 : listeners) {
|
||||
final IIndexerStateListener listener = (IIndexerStateListener) listener2;
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
listener.indexChanged(fIndexerStateEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
listener.indexChanged(fIndexerStateEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
scheduleNotification(notify);
|
||||
|
@ -1127,25 +1118,22 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
|
||||
if (project != null) {
|
||||
final ICProject finalProject = project;
|
||||
Runnable notify = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fIndexChangeEvent.setAffectedProject(finalProject, e);
|
||||
Object[] listeners = fChangeListeners.getListeners();
|
||||
for (Object listener2 : listeners) {
|
||||
final IIndexChangeListener listener = (IIndexChangeListener) listener2;
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
Runnable notify = () -> {
|
||||
fIndexChangeEvent.setAffectedProject(finalProject, e);
|
||||
Object[] listeners = fChangeListeners.getListeners();
|
||||
for (Object listener2 : listeners) {
|
||||
final IIndexChangeListener listener = (IIndexChangeListener) listener2;
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
listener.indexChanged(fIndexChangeEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
listener.indexChanged(fIndexChangeEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
scheduleNotification(notify);
|
||||
|
@ -1528,22 +1516,19 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
fPostponedProjects.remove(cproject);
|
||||
final IndexerSetupParticipant[] participants = fSetupParticipants
|
||||
.toArray(new IndexerSetupParticipant[fSetupParticipants.size()]);
|
||||
Runnable notify = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (final IndexerSetupParticipant p : participants) {
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
Runnable notify = () -> {
|
||||
for (final IndexerSetupParticipant p : participants) {
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
CCorePlugin.log(exception);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
p.onIndexerSetup(cproject);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
p.onIndexerSetup(cproject);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
scheduleNotification(notify);
|
||||
|
|
|
@ -1008,20 +1008,17 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
|||
final ListOptions options = createListOptionsForLambdaCapturesParameters(node);
|
||||
ICPPASTCapture[] captures = node.getCaptures();
|
||||
formatList(Arrays.asList(captures), options, true, captures.length > 0 && captures[0].isPackExpansion(), null,
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (options.captureDefault == CaptureDefault.BY_COPY) {
|
||||
scribe.printNextToken(Token.tASSIGN, options.fSpaceAfterOpeningParen);
|
||||
} else if (options.captureDefault == CaptureDefault.BY_REFERENCE) {
|
||||
scribe.printNextToken(Token.tAMPER, options.fSpaceAfterOpeningParen);
|
||||
}
|
||||
() -> {
|
||||
if (options.captureDefault == CaptureDefault.BY_COPY) {
|
||||
scribe.printNextToken(Token.tASSIGN, options.fSpaceAfterOpeningParen);
|
||||
} else if (options.captureDefault == CaptureDefault.BY_REFERENCE) {
|
||||
scribe.printNextToken(Token.tAMPER, options.fSpaceAfterOpeningParen);
|
||||
}
|
||||
|
||||
if (options.captureDefault != CaptureDefault.UNSPECIFIED && node.getCaptures().length > 0) {
|
||||
scribe.printNextToken(Token.tCOMMA, options.fSpaceBeforeSeparator);
|
||||
if (options.fSpaceAfterSeparator)
|
||||
scribe.space();
|
||||
}
|
||||
if (options.captureDefault != CaptureDefault.UNSPECIFIED && node.getCaptures().length > 0) {
|
||||
scribe.printNextToken(Token.tCOMMA, options.fSpaceBeforeSeparator);
|
||||
if (options.fSpaceAfterSeparator)
|
||||
scribe.space();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -70,22 +70,18 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
|
|||
autoDisposeAddr2line = getAddr2line();
|
||||
if (autoDisposeAddr2line != null) {
|
||||
starttime = System.currentTimeMillis();
|
||||
Runnable worker = new Runnable() {
|
||||
Runnable worker = () -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
stopAddr2Line();
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
}
|
||||
stopAddr2Line();
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -67,22 +67,18 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
|
|||
autoDisposeAddr2line = getAddr2line();
|
||||
if (autoDisposeAddr2line != null) {
|
||||
starttime = System.currentTimeMillis();
|
||||
Runnable worker = new Runnable() {
|
||||
Runnable worker = () -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
stopAddr2Line();
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
}
|
||||
stopAddr2Line();
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -235,21 +235,17 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
|
|||
addr2line = getAddr2line();
|
||||
if (addr2line != null) {
|
||||
starttime = System.currentTimeMillis();
|
||||
Runnable worker = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
Runnable worker = () -> {
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
stopAddr2Line();
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
}
|
||||
stopAddr2Line();
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -237,21 +237,17 @@ public class XCOFFBinaryObject extends BinaryObjectAdapter {
|
|||
addr2line = getAddr2line();
|
||||
if (addr2line != null) {
|
||||
starttime = System.currentTimeMillis();
|
||||
Runnable worker = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
Runnable worker = () -> {
|
||||
long diff = System.currentTimeMillis() - starttime;
|
||||
while (diff < 10000) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
stopAddr2Line();
|
||||
diff = System.currentTimeMillis() - starttime;
|
||||
}
|
||||
stopAddr2Line();
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -109,12 +109,9 @@ public class Application implements IApplication {
|
|||
final IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
final Display display = workbench.getDisplay();
|
||||
fInstanceLoc.release();
|
||||
display.syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!display.isDisposed())
|
||||
workbench.close();
|
||||
}
|
||||
display.syncExec(() -> {
|
||||
if (!display.isDisposed())
|
||||
workbench.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -265,22 +265,18 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
final String executablePath = executable;
|
||||
final String coreFilePath = corefile;
|
||||
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
Display.getDefault().syncExec(() -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
CoreFileDialog dialog = new CoreFileDialog(getWindowConfigurer().getWindow().getShell(),
|
||||
0, executablePath, coreFilePath);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
CoreFileInfo info2 = dialog.getCoreFileInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setCoreFilePath(info2.getCoreFilePath());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
CoreFileDialog dialog = new CoreFileDialog(getWindowConfigurer().getWindow().getShell(), 0,
|
||||
executablePath, coreFilePath);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
CoreFileInfo info2 = dialog.getCoreFileInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setCoreFilePath(info2.getCoreFilePath());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
});
|
||||
// Check and see if we failed above and if so, quit
|
||||
|
@ -318,22 +314,18 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
final String buildLogPath = buildLog;
|
||||
final boolean attach = attachExecutable;
|
||||
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
Display.getDefault().syncExec(() -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
RemoteExecutableDialog dialog = new RemoteExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), executablePath, buildLogPath,
|
||||
addressStr, portStr, attach);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
info[0] = dialog.getExecutableInfo();
|
||||
} else {
|
||||
info[0] = null;
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
RemoteExecutableDialog dialog = new RemoteExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), executablePath, buildLogPath,
|
||||
addressStr, portStr, attach);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
info[0] = dialog.getExecutableInfo();
|
||||
} else {
|
||||
info[0] = null;
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
});
|
||||
// Check and see if we failed above and if so, quit
|
||||
|
@ -364,23 +356,19 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
final String executableArgs = arguments;
|
||||
final String buildLogPath = buildLog;
|
||||
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
Display.getDefault().syncExec(() -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
NewExecutableDialog dialog = new NewExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
|
||||
executableArgs);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
NewExecutableInfo info2 = dialog.getExecutableInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setArguments(info2.getArguments());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
NewExecutableDialog dialog = new NewExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
|
||||
executableArgs);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
NewExecutableInfo info2 = dialog.getExecutableInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setArguments(info2.getArguments());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
});
|
||||
// Check and see if we failed above and if so, quit
|
||||
|
@ -429,24 +417,20 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
final String buildLogPath = oldBuildLog;
|
||||
// Bring up New Executable dialog with values from
|
||||
// the last launch.
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
Display.getDefault().syncExec(() -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
NewExecutableDialog dialog = new NewExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
|
||||
executableArgs);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
NewExecutableInfo info2 = dialog.getExecutableInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setArguments(info2.getArguments());
|
||||
info.setBuildLog(info2.getBuildLog());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
NewExecutableDialog dialog = new NewExecutableDialog(
|
||||
getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
|
||||
executableArgs);
|
||||
dialog.setBlockOnOpen(true);
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
NewExecutableInfo info2 = dialog.getExecutableInfo();
|
||||
info.setHostPath(info2.getHostPath());
|
||||
info.setArguments(info2.getArguments());
|
||||
info.setBuildLog(info2.getBuildLog());
|
||||
} else {
|
||||
ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
|
||||
IStatus.ERROR | IStatus.WARNING);
|
||||
}
|
||||
});
|
||||
// Check and see if we failed above and if so, quit
|
||||
|
@ -488,13 +472,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
}
|
||||
});
|
||||
monitor.subTask(Messages.LaunchingConfig);
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
|
||||
if (LaunchJobs.getLaunchJob() != null) {
|
||||
try {
|
||||
LaunchJobs.getLaunchJob().join();
|
||||
|
@ -533,14 +511,11 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
|||
final MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, 1, Messages.ProblemSavingWorkbench, null);
|
||||
try {
|
||||
final ProgressMonitorDialog p = new ProgressMonitorDialog(null);
|
||||
IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) {
|
||||
try {
|
||||
status.merge(ResourcesPlugin.getWorkspace().save(true, monitor));
|
||||
} catch (CoreException e) {
|
||||
status.merge(e.getStatus());
|
||||
}
|
||||
IRunnableWithProgress runnable = monitor -> {
|
||||
try {
|
||||
status.merge(ResourcesPlugin.getWorkspace().save(true, monitor));
|
||||
} catch (CoreException e) {
|
||||
status.merge(e.getStatus());
|
||||
}
|
||||
};
|
||||
p.run(true, false, runnable);
|
||||
|
|
|
@ -34,13 +34,7 @@ public class DebugAttachedExecutableHandler extends AbstractHandler {
|
|||
final ILaunchConfiguration config = DebugAttachedExecutable.createLaunchConfig(new NullProgressMonitor(),
|
||||
null);
|
||||
if (config != null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -42,13 +42,7 @@ public class DebugCoreFileHandler extends AbstractHandler {
|
|||
final ILaunchConfiguration config = DebugCoreFile.createLaunchConfig(new NullProgressMonitor(), null,
|
||||
info.getHostPath(), info.getCoreFilePath());
|
||||
if (config != null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -68,13 +68,7 @@ public class DebugNewExecutableHandler extends AbstractHandler {
|
|||
public void done(IJobChangeEvent event) {
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
|
||||
if (LaunchJobs.getLaunchJob() != null) {
|
||||
try {
|
||||
LaunchJobs.getLaunchJob().join();
|
||||
|
|
|
@ -47,13 +47,7 @@ public class DebugRemoteExecutableHandler extends AbstractHandler {
|
|||
final ILaunchConfiguration config = DebugRemoteExecutable.createLaunchConfig(new NullProgressMonitor(),
|
||||
buildLog, executable, address, port, attach);
|
||||
if (config != null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
|
||||
}
|
||||
});
|
||||
Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -80,17 +80,7 @@ public class CDebugImageDescriptorRegistry {
|
|||
}
|
||||
|
||||
private void hookDisplay() {
|
||||
fDisplay.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getDisplay().disposeExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
fDisplay.asyncExec(() -> getDisplay().disposeExec(() -> dispose()));
|
||||
}
|
||||
|
||||
protected Display getDisplay() {
|
||||
|
|
|
@ -38,13 +38,8 @@ public class CValueDetailProvider {
|
|||
if (value instanceof ICValue) {
|
||||
final ICStackFrame frame = CDebugUIUtils.getCurrentStackFrame();
|
||||
if (frame != null) {
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
listener.detailComputed(value, ((ICValue) value).evaluateAsExpression(frame));
|
||||
}
|
||||
});
|
||||
DebugPlugin.getDefault()
|
||||
.asyncExec(() -> listener.detailComputed(value, ((ICValue) value).evaluateAsExpression(frame)));
|
||||
} else { // no valid stack frame, clear detail pane
|
||||
listener.detailComputed(value, ""); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -35,19 +35,16 @@ public class CWatchExpressionDelegate implements IWatchExpressionDelegate {
|
|||
return;
|
||||
}
|
||||
final ICStackFrame frame = (ICStackFrame) context;
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IValue value = null;
|
||||
DebugException de = null;
|
||||
try {
|
||||
value = frame.evaluateExpression(expression);
|
||||
} catch (DebugException e) {
|
||||
de = e;
|
||||
}
|
||||
IWatchExpressionResult result = evaluationComplete(expression, value, de);
|
||||
listener.watchEvaluationFinished(result);
|
||||
Runnable runnable = () -> {
|
||||
IValue value = null;
|
||||
DebugException de = null;
|
||||
try {
|
||||
value = frame.evaluateExpression(expression);
|
||||
} catch (DebugException e) {
|
||||
de = e;
|
||||
}
|
||||
IWatchExpressionResult result = evaluationComplete(expression, value, de);
|
||||
listener.watchEvaluationFinished(result);
|
||||
};
|
||||
DebugPlugin.getDefault().asyncExec(runnable);
|
||||
}
|
||||
|
|
|
@ -42,13 +42,8 @@ public class ErrorStatusHandler implements IStatusHandler {
|
|||
title = CDebugUIMessages.getString("ErrorStatusHandler.1"); //$NON-NLS-1$
|
||||
}
|
||||
final String title_f = title;
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ErrorDialog.openError(CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status);
|
||||
}
|
||||
});
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(
|
||||
() -> ErrorDialog.openError(CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -33,13 +33,8 @@ public class InfoStatusHandler implements IStatusHandler {
|
|||
if (status != null && source != null && source instanceof IDebugTarget) {
|
||||
final String title = ((IDebugTarget) source).getName();
|
||||
final String message = status.getMessage();
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openInformation(CDebugUIPlugin.getActiveWorkbenchShell(), title, message);
|
||||
}
|
||||
});
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(
|
||||
() -> MessageDialog.openInformation(CDebugUIPlugin.getActiveWorkbenchShell(), title, message));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -34,13 +34,8 @@ public class QuestionStatusHandler implements IStatusHandler {
|
|||
if (status != null && source != null && source instanceof IDebugTarget) {
|
||||
final String title = ((IDebugTarget) source).getName();
|
||||
final String message = status.getMessage();
|
||||
CDebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
result[0] = MessageDialog.openQuestion(CDebugUIPlugin.getActiveWorkbenchShell(), title, message);
|
||||
}
|
||||
});
|
||||
CDebugUIPlugin.getStandardDisplay().syncExec(() -> result[0] = MessageDialog
|
||||
.openQuestion(CDebugUIPlugin.getActiveWorkbenchShell(), title, message));
|
||||
}
|
||||
return Boolean.valueOf(result[0]);
|
||||
}
|
||||
|
|
|
@ -49,13 +49,10 @@ public abstract class AbstractListenerActionDelegate extends AbstractDebugAction
|
|||
if (shell == null || shell.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < events.length; i++) {
|
||||
if (events[i].getSource() != null) {
|
||||
doHandleDebugEvent(events[i]);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
for (int i = 0; i < events.length; i++) {
|
||||
if (events[i].getSource() != null) {
|
||||
doHandleDebugEvent(events[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -96,15 +96,11 @@ public abstract class AbstractViewActionDelegate extends ActionDelegate
|
|||
public void run(IAction action) {
|
||||
final MultiStatus ms = new MultiStatus(CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "", //$NON-NLS-1$
|
||||
null);
|
||||
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction();
|
||||
} catch (DebugException e) {
|
||||
ms.merge(e.getStatus());
|
||||
}
|
||||
BusyIndicator.showWhile(Display.getCurrent(), () -> {
|
||||
try {
|
||||
doAction();
|
||||
} catch (DebugException e) {
|
||||
ms.merge(e.getStatus());
|
||||
}
|
||||
});
|
||||
if (!ms.isOK()) {
|
||||
|
@ -162,14 +158,10 @@ public abstract class AbstractViewActionDelegate extends ActionDelegate
|
|||
if (shell == null || shell.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < events.length; i++) {
|
||||
if (events[i].getSource() != null) {
|
||||
doHandleDebugEvent(events[i]);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
for (int i = 0; i < events.length; i++) {
|
||||
if (events[i].getSource() != null) {
|
||||
doHandleDebugEvent(events[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -38,8 +38,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
|
|||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -153,23 +151,11 @@ public class CastToArrayActionHandler extends AbstractHandler {
|
|||
ActionMessages.getString("CastToArrayActionDelegate.1")); //$NON-NLS-1$
|
||||
((GridData) label.getLayoutData()).horizontalSpan = 3;
|
||||
fFirstIndexText = ControlFactory.createTextField(composite);
|
||||
fFirstIndexText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
validateInput();
|
||||
}
|
||||
});
|
||||
fFirstIndexText.addModifyListener(e -> validateInput());
|
||||
label = ControlFactory.createLabel(composite, ActionMessages.getString("CastToArrayActionDelegate.2")); //$NON-NLS-1$
|
||||
((GridData) label.getLayoutData()).horizontalSpan = 3;
|
||||
fLengthText = ControlFactory.createTextField(composite);
|
||||
fLengthText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
validateInput();
|
||||
}
|
||||
});
|
||||
fLengthText.addModifyListener(e -> validateInput());
|
||||
}
|
||||
|
||||
protected void validateInput() {
|
||||
|
@ -250,16 +236,12 @@ public class CastToArrayActionHandler extends AbstractHandler {
|
|||
if (getCastToArray() == null || getCastToArray().length == 0)
|
||||
return null;
|
||||
|
||||
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction(getCastToArray());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
BusyIndicator.showWhile(Display.getCurrent(), () -> {
|
||||
try {
|
||||
doAction(getCastToArray());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
});
|
||||
if (getStatus() != null && !getStatus().isOK()) {
|
||||
|
|
|
@ -99,16 +99,12 @@ public class CastToTypeActionHandler extends AbstractHandler {
|
|||
if (getCastToType() == null || getCastToType().length == 0)
|
||||
return null;
|
||||
|
||||
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction(getCastToType());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
BusyIndicator.showWhile(Display.getCurrent(), () -> {
|
||||
try {
|
||||
doAction(getCastToType());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
});
|
||||
if (getStatus() != null && !getStatus().isOK()) {
|
||||
|
|
|
@ -59,14 +59,11 @@ public class LoadModuleSymbolsActionDelegate extends ActionDelegate implements I
|
|||
final ICModule module = getModule();
|
||||
if (module != null) {
|
||||
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction(module);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
DebugPlugin.getDefault().asyncExec(() -> {
|
||||
try {
|
||||
doAction(module);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -119,23 +119,20 @@ public class MoveToLineActionDelegate implements IEditorActionDelegate, IActionD
|
|||
if (fAction == null) {
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean enabled = false;
|
||||
if (fPartTarget != null && fTargetElement != null) {
|
||||
IWorkbenchPartSite site = fActivePart.getSite();
|
||||
if (site != null) {
|
||||
ISelectionProvider selectionProvider = site.getSelectionProvider();
|
||||
if (selectionProvider != null) {
|
||||
ISelection selection = selectionProvider.getSelection();
|
||||
enabled = fTargetElement.isSuspended()
|
||||
&& fPartTarget.canMoveToLine(fActivePart, selection, fTargetElement);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
boolean enabled = false;
|
||||
if (fPartTarget != null && fTargetElement != null) {
|
||||
IWorkbenchPartSite site = fActivePart.getSite();
|
||||
if (site != null) {
|
||||
ISelectionProvider selectionProvider = site.getSelectionProvider();
|
||||
if (selectionProvider != null) {
|
||||
ISelection selection = selectionProvider.getSelection();
|
||||
enabled = fTargetElement.isSuspended()
|
||||
&& fPartTarget.canMoveToLine(fActivePart, selection, fTargetElement);
|
||||
}
|
||||
}
|
||||
fAction.setEnabled(enabled);
|
||||
}
|
||||
fAction.setEnabled(enabled);
|
||||
};
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(r);
|
||||
}
|
||||
|
|
|
@ -67,14 +67,11 @@ public class MoveToLineAdapter implements IMoveToLineTarget {
|
|||
final IPath path = new Path(fileName);
|
||||
final IMoveToLine moveToLine = ((IAdaptable) target).getAdapter(IMoveToLine.class);
|
||||
if (moveToLine != null && moveToLine.canMoveToLine(path.toPortableString(), lineNumber)) {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
moveToLine.moveToLine(path.toPortableString(), lineNumber);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
try {
|
||||
moveToLine.moveToLine(path.toPortableString(), lineNumber);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
};
|
||||
runInBackground(r);
|
||||
|
|
|
@ -312,12 +312,7 @@ public class PinDebugContextActionDelegate implements IViewActionDelegate, IActi
|
|||
if (fAction != null && !fAction.isChecked()) {
|
||||
final boolean pinnable = PinCloneUtils.isPinnable(fPart, event.getContext());
|
||||
if (pinnable != fAction.isEnabled()) {
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fAction.setEnabled(pinnable);
|
||||
}
|
||||
});
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(() -> fAction.setEnabled(pinnable));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,16 +55,12 @@ public class RestoreDefaultTypeActionHandler extends AbstractHandler {
|
|||
if (getCastToType() == null || getCastToType().length == 0)
|
||||
return null;
|
||||
|
||||
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction(getCastToType());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
BusyIndicator.showWhile(Display.getCurrent(), () -> {
|
||||
try {
|
||||
doAction(getCastToType());
|
||||
setStatus(null);
|
||||
} catch (DebugException e) {
|
||||
setStatus(e.getStatus());
|
||||
}
|
||||
});
|
||||
if (getStatus() != null && !getStatus().isOK()) {
|
||||
|
|
|
@ -119,23 +119,20 @@ public class ResumeAtLineActionDelegate implements IEditorActionDelegate, IActio
|
|||
if (fAction == null) {
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean enabled = false;
|
||||
if (fPartTarget != null && fTargetElement != null) {
|
||||
IWorkbenchPartSite site = fActivePart.getSite();
|
||||
if (site != null) {
|
||||
ISelectionProvider selectionProvider = site.getSelectionProvider();
|
||||
if (selectionProvider != null) {
|
||||
ISelection selection = selectionProvider.getSelection();
|
||||
enabled = fTargetElement.isSuspended()
|
||||
&& fPartTarget.canResumeAtLine(fActivePart, selection, fTargetElement);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
boolean enabled = false;
|
||||
if (fPartTarget != null && fTargetElement != null) {
|
||||
IWorkbenchPartSite site = fActivePart.getSite();
|
||||
if (site != null) {
|
||||
ISelectionProvider selectionProvider = site.getSelectionProvider();
|
||||
if (selectionProvider != null) {
|
||||
ISelection selection = selectionProvider.getSelection();
|
||||
enabled = fTargetElement.isSuspended()
|
||||
&& fPartTarget.canResumeAtLine(fActivePart, selection, fTargetElement);
|
||||
}
|
||||
}
|
||||
fAction.setEnabled(enabled);
|
||||
}
|
||||
fAction.setEnabled(enabled);
|
||||
};
|
||||
CDebugUIPlugin.getStandardDisplay().asyncExec(r);
|
||||
}
|
||||
|
|
|
@ -67,14 +67,11 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
|
|||
if (target instanceof IAdaptable) {
|
||||
final IResumeAtLine resumeAtLine = ((IAdaptable) target).getAdapter(IResumeAtLine.class);
|
||||
if (resumeAtLine != null && resumeAtLine.canResumeAtLine(path.toPortableString(), lineNumber)) {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
resumeAtLine.resumeAtLine(path.toPortableString(), lineNumber);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
try {
|
||||
resumeAtLine.resumeAtLine(path.toPortableString(), lineNumber);
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
};
|
||||
runInBackground(r);
|
||||
|
|
|
@ -70,17 +70,13 @@ public class RunToLineAdapter implements IRunToLineTarget {
|
|||
if (target instanceof IAdaptable) {
|
||||
final IRunToLine runToLine = ((IAdaptable) target).getAdapter(IRunToLine.class);
|
||||
if (runToLine != null && runToLine.canRunToLine(path.toPortableString(), lineNumber)) {
|
||||
Runnable r = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
runToLine.runToLine(path.toPortableString(), lineNumber,
|
||||
DebugUITools.getPreferenceStore().getBoolean(
|
||||
IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE));
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
Runnable r = () -> {
|
||||
try {
|
||||
runToLine.runToLine(path.toPortableString(), lineNumber,
|
||||
DebugUITools.getPreferenceStore().getBoolean(
|
||||
IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE));
|
||||
} catch (DebugException e) {
|
||||
failed(e);
|
||||
}
|
||||
};
|
||||
runInBackground(r);
|
||||
|
|
|
@ -68,17 +68,14 @@ public class ShowFullPathsAction extends ViewFilterAction {
|
|||
IDebugModelPresentation pres = view.getPresentation(CDIDebugModel.getPluginIdentifier());
|
||||
if (pres != null) {
|
||||
pres.setAttribute(CDebugModelPresentation.DISPLAY_FULL_PATHS, Boolean.valueOf(getValue()));
|
||||
BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
|
||||
getPreferenceStore().setValue(key, getValue());
|
||||
CDebugUIPlugin.getDefault().savePluginPreferences();
|
||||
BusyIndicator.showWhile(viewer.getControl().getDisplay(), () -> {
|
||||
String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
|
||||
getPreferenceStore().setValue(key, getValue());
|
||||
CDebugUIPlugin.getDefault().savePluginPreferences();
|
||||
|
||||
// Refresh the viewer after we've set the preference because
|
||||
// DSF-based debuggers trigger off this preference.
|
||||
viewer.refresh();
|
||||
}
|
||||
// Refresh the viewer after we've set the preference because
|
||||
// DSF-based debuggers trigger off this preference.
|
||||
viewer.refresh();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,15 +43,11 @@ public class SignalActionDelegate extends ActionDelegate implements IObjectActio
|
|||
if (getSignal() != null) {
|
||||
final MultiStatus ms = new MultiStatus(CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
|
||||
ActionMessages.getString("SignalActionDelegate.0"), null); //$NON-NLS-1$
|
||||
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doAction(getSignal());
|
||||
} catch (DebugException e) {
|
||||
ms.merge(e.getStatus());
|
||||
}
|
||||
BusyIndicator.showWhile(Display.getCurrent(), () -> {
|
||||
try {
|
||||
doAction(getSignal());
|
||||
} catch (DebugException e) {
|
||||
ms.merge(e.getStatus());
|
||||
}
|
||||
});
|
||||
if (!ms.isOK()) {
|
||||
|
|
|
@ -50,38 +50,30 @@ public class CBreakpointUpdater implements ICBreakpointListener {
|
|||
@Override
|
||||
public void breakpointChanged(IDebugTarget target, final IBreakpoint breakpoint,
|
||||
@SuppressWarnings("rawtypes") final Map attributes) {
|
||||
asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Boolean enabled = (Boolean) attributes.get(IBreakpoint.ENABLED);
|
||||
breakpoint.setEnabled((enabled != null) ? enabled.booleanValue() : false);
|
||||
Integer ignoreCount = (Integer) attributes.get(ICBreakpoint.IGNORE_COUNT);
|
||||
((ICBreakpoint) breakpoint).setIgnoreCount((ignoreCount != null) ? ignoreCount.intValue() : 0);
|
||||
String condition = (String) attributes.get(ICBreakpoint.CONDITION);
|
||||
((ICBreakpoint) breakpoint).setCondition((condition != null) ? condition : ""); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
CDebugUIPlugin.log(e.getStatus());
|
||||
}
|
||||
asyncExec(() -> {
|
||||
try {
|
||||
Boolean enabled = (Boolean) attributes.get(IBreakpoint.ENABLED);
|
||||
breakpoint.setEnabled((enabled != null) ? enabled.booleanValue() : false);
|
||||
Integer ignoreCount = (Integer) attributes.get(ICBreakpoint.IGNORE_COUNT);
|
||||
((ICBreakpoint) breakpoint).setIgnoreCount((ignoreCount != null) ? ignoreCount.intValue() : 0);
|
||||
String condition = (String) attributes.get(ICBreakpoint.CONDITION);
|
||||
((ICBreakpoint) breakpoint).setCondition((condition != null) ? condition : ""); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
CDebugUIPlugin.log(e.getStatus());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakpointsRemoved(IDebugTarget target, final IBreakpoint[] breakpoints) {
|
||||
asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < breakpoints.length; ++i) {
|
||||
try {
|
||||
if (((ICBreakpoint) breakpoints[i]).decrementInstallCount() == 0)
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(breakpoints[i]);
|
||||
} catch (CoreException e) {
|
||||
// ensureMarker throws this exception
|
||||
// if breakpoint has already been deleted
|
||||
}
|
||||
asyncExec(() -> {
|
||||
for (int i = 0; i < breakpoints.length; ++i) {
|
||||
try {
|
||||
if (((ICBreakpoint) breakpoints[i]).decrementInstallCount() == 0)
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(breakpoints[i]);
|
||||
} catch (CoreException e) {
|
||||
// ensureMarker throws this exception
|
||||
// if breakpoint has already been deleted
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -87,12 +87,7 @@ public class DialogField {
|
|||
*/
|
||||
public void postSetFocusOnDialogField(Display display) {
|
||||
if (display != null) {
|
||||
display.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setFocus();
|
||||
}
|
||||
});
|
||||
display.asyncExec(() -> setFocus());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -617,12 +617,9 @@ public class ListDialogField extends DialogField {
|
|||
public void postSetSelection(final ISelection selection) {
|
||||
if (isOkToUse(fTableControl)) {
|
||||
Display d = fTableControl.getDisplay();
|
||||
d.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isOkToUse(fTableControl)) {
|
||||
selectElements(selection);
|
||||
}
|
||||
d.asyncExec(() -> {
|
||||
if (isOkToUse(fTableControl)) {
|
||||
selectElements(selection);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -65,12 +65,7 @@ public abstract class AbstractDisassemblyBackend implements IDisassemblyBackend
|
|||
* @param status
|
||||
*/
|
||||
protected void handleError(final IStatus status) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, status); //$NON-NLS-1$
|
||||
}
|
||||
});
|
||||
fCallback.asyncExec(() -> ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, status)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -142,12 +142,9 @@ public class DebugContextPinProvider extends AbstractDebugContextProvider implem
|
|||
* @param event debug event
|
||||
*/
|
||||
public void delegateEvent(final DebugContextEvent event) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fActiveContext = event.getContext();
|
||||
fire(event);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
fActiveContext = event.getContext();
|
||||
fire(event);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -328,20 +328,16 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
|||
* affects these views.
|
||||
*/
|
||||
private void refreshViews() {
|
||||
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Refresh interested views
|
||||
IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
|
||||
IWorkbenchPage page = null;
|
||||
for (int i = 0; i < windows.length; i++) {
|
||||
page = windows[i].getActivePage();
|
||||
if (page != null) {
|
||||
refreshViews(page, IDebugUIConstants.ID_EXPRESSION_VIEW);
|
||||
refreshViews(page, IDebugUIConstants.ID_VARIABLE_VIEW);
|
||||
refreshViews(page, IDebugUIConstants.ID_REGISTER_VIEW);
|
||||
}
|
||||
BusyIndicator.showWhile(getShell().getDisplay(), () -> {
|
||||
// Refresh interested views
|
||||
IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
|
||||
IWorkbenchPage page = null;
|
||||
for (int i = 0; i < windows.length; i++) {
|
||||
page = windows[i].getActivePage();
|
||||
if (page != null) {
|
||||
refreshViews(page, IDebugUIConstants.ID_EXPRESSION_VIEW);
|
||||
refreshViews(page, IDebugUIConstants.ID_VARIABLE_VIEW);
|
||||
refreshViews(page, IDebugUIConstants.ID_REGISTER_VIEW);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -89,14 +89,11 @@ public class ModulePropertyPage extends PropertyPage {
|
|||
final ICModule module = getModule();
|
||||
if (module != null) {
|
||||
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
module.setSymbolsFileName(path);
|
||||
} catch (DebugException e) {
|
||||
failed(PropertyPageMessages.getString("ModulePropertyPage.15"), e); //$NON-NLS-1$
|
||||
}
|
||||
DebugPlugin.getDefault().asyncExec(() -> {
|
||||
try {
|
||||
module.setSymbolsFileName(path);
|
||||
} catch (DebugException e) {
|
||||
failed(PropertyPageMessages.getString("ModulePropertyPage.15"), e); //$NON-NLS-1$
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -114,24 +114,21 @@ public class SignalPropertyPage extends PropertyPage {
|
|||
public boolean performOk() {
|
||||
boolean result = super.performOk();
|
||||
if (result) {
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!getSignal().canModify())
|
||||
return;
|
||||
if (getPassButton() != null) {
|
||||
try {
|
||||
getSignal().setPassEnabled(getPassButton().isSelected());
|
||||
} catch (DebugException e) {
|
||||
failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e); //$NON-NLS-1$
|
||||
}
|
||||
DebugPlugin.getDefault().asyncExec(() -> {
|
||||
if (!getSignal().canModify())
|
||||
return;
|
||||
if (getPassButton() != null) {
|
||||
try {
|
||||
getSignal().setPassEnabled(getPassButton().isSelected());
|
||||
} catch (DebugException e1) {
|
||||
failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e1); //$NON-NLS-1$
|
||||
}
|
||||
if (getStopButton() != null) {
|
||||
try {
|
||||
getSignal().setStopEnabled(getStopButton().isSelected());
|
||||
} catch (DebugException e) {
|
||||
failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
if (getStopButton() != null) {
|
||||
try {
|
||||
getSignal().setStopEnabled(getStopButton().isSelected());
|
||||
} catch (DebugException e2) {
|
||||
failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e2); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -67,15 +67,12 @@ public abstract class AbstractDebugEventHandler implements IDebugEventSetListene
|
|||
if (!isAvailable()) {
|
||||
return;
|
||||
}
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isAvailable()) {
|
||||
if (isViewVisible()) {
|
||||
doHandleDebugEvents(events);
|
||||
}
|
||||
updateForDebugEvents(events);
|
||||
Runnable r = () -> {
|
||||
if (isAvailable()) {
|
||||
if (isViewVisible()) {
|
||||
doHandleDebugEvents(events);
|
||||
}
|
||||
updateForDebugEvents(events);
|
||||
}
|
||||
};
|
||||
getView().asyncExec(r);
|
||||
|
|
|
@ -123,26 +123,23 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
|
|||
msRetrieval.getMemorySpaces(context, new GetMemorySpacesRequest() {
|
||||
@Override
|
||||
public void done() {
|
||||
runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isSuccess()) {
|
||||
String[] memorySpaces = getMemorySpaces();
|
||||
runOnUIThread(() -> {
|
||||
if (isSuccess()) {
|
||||
String[] memorySpaces = getMemorySpaces();
|
||||
|
||||
// We shouldn't be using the custom dialog
|
||||
// if there are none or only one memory
|
||||
// spaces involved.
|
||||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
|
||||
if (memorySpaces.length >= 2) {
|
||||
doAddMemoryBlocks(renderingSite, context, msRetrieval, memorySpaces);
|
||||
return;
|
||||
}
|
||||
// We shouldn't be using the custom dialog
|
||||
// if there are none or only one memory
|
||||
// spaces involved.
|
||||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
|
||||
if (memorySpaces.length >= 2) {
|
||||
doAddMemoryBlocks(renderingSite, context, msRetrieval, memorySpaces);
|
||||
return;
|
||||
}
|
||||
|
||||
// If we get here, then the custom dialog isn't
|
||||
// necessary. Use the standard (platform) one
|
||||
invokePlatformAction(renderingSite);
|
||||
}
|
||||
|
||||
// If we get here, then the custom dialog isn't
|
||||
// necessary. Use the standard (platform) one
|
||||
invokePlatformAction(renderingSite);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %pluginName
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui;singleton:=true
|
||||
Bundle-Version: 1.1.1.qualifier
|
||||
Bundle-Version: 1.1.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.MulticoreVisualizerUIPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -100,8 +100,6 @@ import org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandAction;
|
|||
import org.eclipse.debug.internal.ui.commands.actions.SuspendCommandAction;
|
||||
import org.eclipse.debug.internal.ui.commands.actions.TerminateCommandAction;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
|
||||
import org.eclipse.debug.internal.ui.views.launch.LaunchView;
|
||||
import org.eclipse.debug.ui.DebugUITools;
|
||||
|
@ -833,32 +831,10 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
|
|||
if (m_debugViewer == null) {
|
||||
m_debugViewer = DebugViewUtils.getDebugViewer();
|
||||
if (m_debugViewer != null) {
|
||||
m_modelChangedListener = new IModelChangedListener() {
|
||||
@Override
|
||||
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
|
||||
// Execute a refresh after any pending UI updates.
|
||||
GUIUtils.exec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// check if we need to update the debug context
|
||||
updateDebugContext();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
m_debugViewSelectionChangedListener = new ISelectionChangedListener() {
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
// Execute a refresh after any pending UI updates.
|
||||
GUIUtils.exec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Update canvas selection to match to dbg view selection
|
||||
updateCanvasSelectionFromDebugView();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
// Execute a refresh after any pending UI updates.
|
||||
m_modelChangedListener = (delta, proxy) -> GUIUtils.exec(() -> updateDebugContext());
|
||||
m_debugViewSelectionChangedListener = event -> GUIUtils
|
||||
.exec(() -> updateCanvasSelectionFromDebugView());
|
||||
m_debugViewer.addModelChangedListener(m_modelChangedListener);
|
||||
m_debugViewer.addSelectionChangedListener(m_debugViewSelectionChangedListener);
|
||||
}
|
||||
|
@ -1128,27 +1104,18 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
|
|||
/** Sets canvas model. (Also updates canvas selection.) */
|
||||
protected void setCanvasModel(VisualizerModel model) {
|
||||
final VisualizerModel model_f = model;
|
||||
GUIUtils.exec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (m_canvas != null) {
|
||||
m_canvas.setModel(model_f);
|
||||
// Update the canvas's selection from the current workbench selection.
|
||||
updateCanvasSelectionInternal();
|
||||
}
|
||||
GUIUtils.exec(() -> {
|
||||
if (m_canvas != null) {
|
||||
m_canvas.setModel(model_f);
|
||||
// Update the canvas's selection from the current workbench selection.
|
||||
updateCanvasSelectionInternal();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Updates canvas selection from current workbench selection. */
|
||||
protected void updateCanvasSelection() {
|
||||
GUIUtils.exec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Update the canvas's selection from the current workbench selection.
|
||||
updateCanvasSelectionInternal();
|
||||
}
|
||||
});
|
||||
GUIUtils.exec(() -> updateCanvasSelectionInternal());
|
||||
}
|
||||
|
||||
/** Updates canvas selection from current workbench selection.
|
||||
|
@ -1481,12 +1448,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
|
|||
if (session != null) {
|
||||
DsfExecutor executor = session.getExecutor();
|
||||
if (executor != null) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateLoads(fDataModel);
|
||||
}
|
||||
});
|
||||
executor.execute(() -> updateLoads(fDataModel));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -335,12 +335,9 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti
|
|||
* multiple update requests on same tick are batched.
|
||||
*/
|
||||
public void requestUpdate() {
|
||||
GUIUtils.exec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (m_updateTimer != null) {
|
||||
m_updateTimer.start();
|
||||
}
|
||||
GUIUtils.exec(() -> {
|
||||
if (m_updateTimer != null) {
|
||||
m_updateTimer.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -95,12 +95,7 @@ public class GdbPinProvider implements IPinProvider {
|
|||
public GdbPinProvider(DsfSession session) {
|
||||
fSession = session;
|
||||
|
||||
session.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fSession.addServiceEventListener(GdbPinProvider.this, null);
|
||||
}
|
||||
});
|
||||
session.getExecutor().execute(() -> fSession.addServiceEventListener(GdbPinProvider.this, null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -108,12 +103,7 @@ public class GdbPinProvider implements IPinProvider {
|
|||
*/
|
||||
public void dispose() {
|
||||
try {
|
||||
fSession.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fSession.removeServiceEventListener(GdbPinProvider.this);
|
||||
}
|
||||
});
|
||||
fSession.getExecutor().execute(() -> fSession.removeServiceEventListener(GdbPinProvider.this));
|
||||
} catch (RejectedExecutionException e) {
|
||||
// Session already gone.
|
||||
}
|
||||
|
|
|
@ -30,35 +30,22 @@ public class GdbStatusHandler implements IStatusHandler {
|
|||
public Object handleStatus(final IStatus status, Object source) throws CoreException {
|
||||
Runnable runnable = null;
|
||||
if (status.getSeverity() == IStatus.ERROR) {
|
||||
runnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openError(parent, Messages.GdbStatusHandler_Error, status.getMessage());
|
||||
}
|
||||
runnable = () -> {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openError(parent, Messages.GdbStatusHandler_Error, status.getMessage());
|
||||
};
|
||||
} else if (status.getSeverity() == IStatus.WARNING) {
|
||||
runnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openWarning(parent, Messages.GdbStatusHandler_Warning, status.getMessage());
|
||||
}
|
||||
runnable = () -> {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openWarning(parent, Messages.GdbStatusHandler_Warning, status.getMessage());
|
||||
};
|
||||
} else if (status.getSeverity() == IStatus.INFO) {
|
||||
runnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openInformation(parent, Messages.GdbStatusHandler_Information,
|
||||
status.getMessage());
|
||||
}
|
||||
runnable = () -> {
|
||||
Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null)
|
||||
MessageDialog.openInformation(parent, Messages.GdbStatusHandler_Information, status.getMessage());
|
||||
};
|
||||
}
|
||||
if (runnable != null)
|
||||
|
|
|
@ -212,23 +212,20 @@ public class DsfTerminateCommand implements ITerminateHandler {
|
|||
// session is also terminated before the timeout).
|
||||
// We haven't found a problem with delaying the completion
|
||||
// of the request that way.
|
||||
fFutureWrapper.fFuture = fExecutor.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Check that the session is still active when the timeout hits.
|
||||
// If it is not, then everything has been cleaned up already.
|
||||
if (DsfSession.isSessionActive(fSession.getId())) {
|
||||
DsfSession.removeSessionEndedListener(endedListener);
|
||||
fFutureWrapper.fFuture = fExecutor.schedule(() -> {
|
||||
// Check that the session is still active when the timeout hits.
|
||||
// If it is not, then everything has been cleaned up already.
|
||||
if (DsfSession.isSessionActive(fSession.getId())) {
|
||||
DsfSession.removeSessionEndedListener(endedListener);
|
||||
|
||||
// Marking the request as cancelled will prevent the removal of
|
||||
// the launch from the Debug view in case of "Terminate and Remove".
|
||||
// This is important for multi-process sessions when "Terminate and Remove"
|
||||
// is applied to one of the running processes. In this case the selected
|
||||
// process will be terminated but the associated launch will not be removed
|
||||
// from the Debug view.
|
||||
request.setStatus(Status.CANCEL_STATUS);
|
||||
request.done();
|
||||
}
|
||||
// Marking the request as cancelled will prevent the removal of
|
||||
// the launch from the Debug view in case of "Terminate and Remove".
|
||||
// This is important for multi-process sessions when "Terminate and Remove"
|
||||
// is applied to one of the running processes. In this case the selected
|
||||
// process will be terminated but the associated launch will not be removed
|
||||
// from the Debug view.
|
||||
request.setStatus(Status.CANCEL_STATUS);
|
||||
request.done();
|
||||
}
|
||||
}, 1, TimeUnit.MINUTES);
|
||||
}
|
||||
|
|
|
@ -161,23 +161,20 @@ public class GdbDisconnectCommand implements IDisconnectHandler {
|
|||
// need it anymore, once the session has terminated;
|
||||
// instead, we let it timeout and ignore it if the session
|
||||
// is already terminated.
|
||||
fExecutor.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Check that the session is still active when the timeout hits.
|
||||
// If it is not, then everything has been cleaned up already.
|
||||
if (DsfSession.isSessionActive(fSession.getId())) {
|
||||
DsfSession.removeSessionEndedListener(endedListener);
|
||||
fExecutor.schedule(() -> {
|
||||
// Check that the session is still active when the timeout hits.
|
||||
// If it is not, then everything has been cleaned up already.
|
||||
if (DsfSession.isSessionActive(fSession.getId())) {
|
||||
DsfSession.removeSessionEndedListener(endedListener);
|
||||
|
||||
// Marking the request as cancelled will prevent the removal of
|
||||
// the launch from the Debug view in case of "Terminate and Remove".
|
||||
// This is important for multi-process sessions when "Terminate and Remove"
|
||||
// is applied to one of the running processes. In this case the selected
|
||||
// process will be terminated but the associated launch will not be removed
|
||||
// from the Debug view.
|
||||
request.setStatus(Status.CANCEL_STATUS);
|
||||
request.done();
|
||||
}
|
||||
// Marking the request as cancelled will prevent the removal of
|
||||
// the launch from the Debug view in case of "Terminate and Remove".
|
||||
// This is important for multi-process sessions when "Terminate and Remove"
|
||||
// is applied to one of the running processes. In this case the selected
|
||||
// process will be terminated but the associated launch will not be removed
|
||||
// from the Debug view.
|
||||
request.setStatus(Status.CANCEL_STATUS);
|
||||
request.done();
|
||||
}
|
||||
}, 1, TimeUnit.MINUTES);
|
||||
}
|
||||
|
|
|
@ -71,12 +71,7 @@ public class GdbSaveTraceDataCommand extends AbstractDebugCommand implements ISa
|
|||
}
|
||||
|
||||
final String[] fileName = new String[1];
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fileName[0] = promptForFileName();
|
||||
}
|
||||
});
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(() -> fileName[0] = promptForFileName());
|
||||
|
||||
if (fileName[0] != null) {
|
||||
Query<Object> saveTraceDataQuery = new Query<Object>() {
|
||||
|
|
|
@ -175,17 +175,14 @@ public class GdbFullCliConsolePage extends Page implements IDebugContextListener
|
|||
|
||||
// Must use syncExec because the logic within must complete before the rest
|
||||
// of the class methods (specifically getProcess()) is called
|
||||
fMainComposite.getDisplay().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (fTerminalControl != null && !fTerminalControl.isDisposed()) {
|
||||
fTerminalControl.clearTerminal();
|
||||
fTerminalControl.connectTerminal();
|
||||
fMainComposite.getDisplay().syncExec(() -> {
|
||||
if (fTerminalControl != null && !fTerminalControl.isDisposed()) {
|
||||
fTerminalControl.clearTerminal();
|
||||
fTerminalControl.connectTerminal();
|
||||
|
||||
// The actual terminal widget initializes its defaults in the line above,
|
||||
// lets override them with our application defaults right after.
|
||||
setDefaults();
|
||||
}
|
||||
// The actual terminal widget initializes its defaults in the line above,
|
||||
// lets override them with our application defaults right after.
|
||||
setDefaults();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -42,15 +42,12 @@ public interface IGDBDebuggerConsole extends IDebuggerConsole {
|
|||
}
|
||||
}
|
||||
|
||||
session.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
|
||||
IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
|
||||
tracker.dispose();
|
||||
if (gdbSync != null) {
|
||||
gdbSync.sessionSelected();
|
||||
}
|
||||
session.getExecutor().execute(() -> {
|
||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
|
||||
IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
|
||||
tracker.dispose();
|
||||
if (gdbSync != null) {
|
||||
gdbSync.sessionSelected();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -53,12 +53,7 @@ public class ConsoleSaveAction extends Action {
|
|||
return;
|
||||
}
|
||||
|
||||
Runnable saveJob = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
saveContent(fileName);
|
||||
}
|
||||
};
|
||||
Runnable saveJob = () -> saveContent(fileName);
|
||||
BusyIndicator.showWhile(Display.getCurrent(), saveJob);
|
||||
}
|
||||
|
||||
|
|
|
@ -241,14 +241,10 @@ public class SessionOSData {
|
|||
// async/job runnables, like perspective switch runnable using during debug launch,
|
||||
// causing launch to be stuck at random point.
|
||||
//
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (!c.isDisposed())
|
||||
fUIListener.update();
|
||||
}
|
||||
if (!c.isDisposed())
|
||||
fUIListener.update();
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -64,23 +64,19 @@ public class GdbDebugContextSyncManager implements IDebugContextListener {
|
|||
DsfSession session = DsfSession.getSession(eventSessionId);
|
||||
|
||||
// order GDB to switch thread
|
||||
session.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(),
|
||||
eventSessionId);
|
||||
IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
|
||||
tracker.dispose();
|
||||
session.getExecutor().execute(() -> {
|
||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), eventSessionId);
|
||||
IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
|
||||
tracker.dispose();
|
||||
|
||||
if (gdbSync != null) {
|
||||
gdbSync.setFocus(new IDMContext[] { dmc }, new ImmediateRequestMonitor() {
|
||||
@Override
|
||||
protected void handleFailure() {
|
||||
// do not set error - it's normal in some cases to fail to switch thread
|
||||
// for example in a remote session with the inferior running and in all-stop mode
|
||||
}
|
||||
});
|
||||
}
|
||||
if (gdbSync != null) {
|
||||
gdbSync.setFocus(new IDMContext[] { dmc }, new ImmediateRequestMonitor() {
|
||||
@Override
|
||||
protected void handleFailure() {
|
||||
// do not set error - it's normal in some cases to fail to switch thread
|
||||
// for example in a remote session with the inferior running and in all-stop mode
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -72,12 +72,9 @@ public class TraceControlModel {
|
|||
private volatile ITraceTargetDMContext fTargetContext;
|
||||
private TraceControlView fTraceControlView;
|
||||
|
||||
private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
|
||||
@Override
|
||||
public void debugContextChanged(DebugContextEvent event) {
|
||||
if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
|
||||
updateDebugContext();
|
||||
}
|
||||
private IDebugContextListener fDebugContextListener = event -> {
|
||||
if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
|
||||
updateDebugContext();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -461,13 +458,10 @@ public class TraceControlModel {
|
|||
private void notifyUI(final ITraceStatusDMData2 data) {
|
||||
final TraceControlView v = fTraceControlView;
|
||||
if (v != null) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (v != null) {
|
||||
v.fLastRefreshTime = System.currentTimeMillis();
|
||||
v.updateUI(data);
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
if (v != null) {
|
||||
v.fLastRefreshTime = System.currentTimeMillis();
|
||||
v.updateUI(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -476,12 +470,9 @@ public class TraceControlModel {
|
|||
private void notifyUI(final String message) {
|
||||
final TraceControlView v = fTraceControlView;
|
||||
if (v != null) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (v != null) {
|
||||
v.updateUI(message);
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
if (v != null) {
|
||||
v.updateUI(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -119,28 +119,25 @@ public class GdbVariableVMNode extends VariableVMNode {
|
|||
final IExpressionDMContext exprDmc = DMContexts.getAncestorOfType(getDMContext(),
|
||||
IExpressionDMContext.class);
|
||||
if (exprDmc != null) {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
|
||||
getSession().getExecutor(), null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
request.setSize(getData().getSize());
|
||||
}
|
||||
request.setStatus(getStatus());
|
||||
request.done();
|
||||
getSession().getExecutor().execute(() -> {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
|
||||
getSession().getExecutor(), null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
request.setSize(getData().getSize());
|
||||
}
|
||||
};
|
||||
request.setStatus(getStatus());
|
||||
request.done();
|
||||
}
|
||||
};
|
||||
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
} else {
|
||||
request.setStatus(internalError());
|
||||
request.done();
|
||||
}
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
} else {
|
||||
request.setStatus(internalError());
|
||||
request.done();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -161,28 +158,25 @@ public class GdbVariableVMNode extends VariableVMNode {
|
|||
final IExpressionDMContext exprDmc = DMContexts.getAncestorOfType(getDMContext(),
|
||||
IExpressionDMContext.class);
|
||||
if (exprDmc != null) {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
|
||||
getSession().getExecutor(), null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
request.setCanCreate(getData().getSize() > 0);
|
||||
}
|
||||
request.setStatus(getStatus());
|
||||
request.done();
|
||||
getSession().getExecutor().execute(() -> {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
|
||||
getSession().getExecutor(), null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
request.setCanCreate(getData().getSize() > 0);
|
||||
}
|
||||
};
|
||||
request.setStatus(getStatus());
|
||||
request.done();
|
||||
}
|
||||
};
|
||||
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
} else {
|
||||
request.setStatus(internalError());
|
||||
request.done();
|
||||
}
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
} else {
|
||||
request.setStatus(internalError());
|
||||
request.done();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -53,65 +53,60 @@ public class GdbStackFramesVMNode extends StackFramesVMNode {
|
|||
}
|
||||
|
||||
private void buildDeltaForFocusChangedEvent(IGDBFocusChangedEvent event, VMDelta parentDelta, RequestMonitor rm) {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IDMContext ctx = event.getDMContext();
|
||||
getSession().getExecutor().execute(() -> {
|
||||
IDMContext ctx = event.getDMContext();
|
||||
|
||||
// Is IGDBFocusChangedEvent pertinent for this VMNode?
|
||||
if (ctx instanceof IFrameDMContext) {
|
||||
IFrameDMContext newFrameFocus = (IFrameDMContext) ctx;
|
||||
IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(newFrameFocus,
|
||||
IMIExecutionDMContext.class);
|
||||
if (execDmc == null) {
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
// Is IGDBFocusChangedEvent pertinent for this VMNode?
|
||||
if (ctx instanceof IFrameDMContext) {
|
||||
IFrameDMContext newFrameFocus = (IFrameDMContext) ctx;
|
||||
IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(newFrameFocus,
|
||||
IMIExecutionDMContext.class);
|
||||
if (execDmc == null) {
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
|
||||
IRunControl runControl = getServicesTracker().getService(IRunControl.class);
|
||||
if (runControl == null) {
|
||||
// Required services have not initialized yet. Ignore the event.
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
IRunControl runControl = getServicesTracker().getService(IRunControl.class);
|
||||
if (runControl == null) {
|
||||
// Required services have not initialized yet. Ignore the event.
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
|
||||
if (runControl.isSuspended(execDmc) || runControl.isStepping(execDmc)) {
|
||||
// find the VMC index for the frame that switched, so we can select it correctly.
|
||||
getVMCIndexForDmc(GdbStackFramesVMNode.this, newFrameFocus, parentDelta,
|
||||
new DataRequestMonitor<Integer>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
// change to frameOffset
|
||||
final int frameOffset = getData();
|
||||
if (runControl.isSuspended(execDmc) || runControl.isStepping(execDmc)) {
|
||||
// find the VMC index for the frame that switched, so we can select it correctly.
|
||||
getVMCIndexForDmc(GdbStackFramesVMNode.this, newFrameFocus, parentDelta,
|
||||
new DataRequestMonitor<Integer>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
// change to frameOffset
|
||||
final int frameOffset = getData();
|
||||
|
||||
// Retrieve the list of stack frames
|
||||
getVMProvider().updateNode(GdbStackFramesVMNode.this,
|
||||
new VMChildrenUpdate(parentDelta,
|
||||
getVMProvider().getPresentationContext(), -1, -1,
|
||||
new DataRequestMonitor<List<Object>>(getExecutor(), rm) {
|
||||
@Override
|
||||
public void handleSuccess() {
|
||||
final List<Object> data = getData();
|
||||
if (data != null && data.size() != 0) {
|
||||
// create the delta to select the
|
||||
// current stack frame
|
||||
parentDelta.addNode(data.get(frameOffset),
|
||||
frameOffset,
|
||||
IModelDelta.SELECT | IModelDelta.FORCE);
|
||||
}
|
||||
rm.done();
|
||||
// Retrieve the list of stack frames
|
||||
getVMProvider().updateNode(GdbStackFramesVMNode.this,
|
||||
new VMChildrenUpdate(parentDelta, getVMProvider().getPresentationContext(),
|
||||
-1, -1, new DataRequestMonitor<List<Object>>(getExecutor(), rm) {
|
||||
@Override
|
||||
public void handleSuccess() {
|
||||
final List<Object> data = getData();
|
||||
if (data != null && data.size() != 0) {
|
||||
// create the delta to select the
|
||||
// current stack frame
|
||||
parentDelta.addNode(data.get(frameOffset), frameOffset,
|
||||
IModelDelta.SELECT | IModelDelta.FORCE);
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// thread is running - no delta to produce for the stack frame node
|
||||
rm.done();
|
||||
}
|
||||
rm.done();
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// context not a frame - nothing to do here
|
||||
// thread is running - no delta to produce for the stack frame node
|
||||
rm.done();
|
||||
}
|
||||
} else {
|
||||
// context not a frame - nothing to do here
|
||||
rm.done();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -613,24 +613,21 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
|||
};
|
||||
startGdbJob.schedule();
|
||||
|
||||
fGDBLaunchMonitor.fTimeoutFuture = getExecutor().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Only process the event if we have not finished yet (hit
|
||||
// the breakpoint).
|
||||
if (!fGDBLaunchMonitor.fLaunched) {
|
||||
fGDBLaunchMonitor.fTimedOut = true;
|
||||
Thread jobThread = startGdbJob.getThread();
|
||||
if (jobThread != null) {
|
||||
jobThread.interrupt();
|
||||
}
|
||||
|
||||
destroy();
|
||||
|
||||
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
DebugException.TARGET_REQUEST_FAILED, "Timed out trying to launch GDB.", null)); //$NON-NLS-1$
|
||||
requestMonitor.done();
|
||||
fGDBLaunchMonitor.fTimeoutFuture = getExecutor().schedule(() -> {
|
||||
// Only process the event if we have not finished yet (hit
|
||||
// the breakpoint).
|
||||
if (!fGDBLaunchMonitor.fLaunched) {
|
||||
fGDBLaunchMonitor.fTimedOut = true;
|
||||
Thread jobThread = startGdbJob.getThread();
|
||||
if (jobThread != null) {
|
||||
jobThread.interrupt();
|
||||
}
|
||||
|
||||
destroy();
|
||||
|
||||
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
DebugException.TARGET_REQUEST_FAILED, "Timed out trying to launch GDB.", null)); //$NON-NLS-1$
|
||||
requestMonitor.done();
|
||||
}
|
||||
}, fGDBLaunchTimeout, TimeUnit.SECONDS);
|
||||
}
|
||||
|
|
|
@ -482,12 +482,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
|
|||
public <V extends ICommandResult> ICommandToken queueCommand(final ICommand<V> command,
|
||||
DataRequestMonitor<V> rm) {
|
||||
|
||||
final ICommandToken token = new ICommandToken() {
|
||||
@Override
|
||||
public ICommand<? extends ICommandResult> getCommand() {
|
||||
return command;
|
||||
}
|
||||
};
|
||||
final ICommandToken token = () -> command;
|
||||
|
||||
// The class does not buffer commands itself, but sends them directly to the real
|
||||
// MICommandControl service. Therefore, we must immediately tell our calling cache that the command
|
||||
|
@ -723,49 +718,44 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
|
|||
// delete temp file
|
||||
new File(localFile).delete();
|
||||
|
||||
getExecutor().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCommandControl.queueCommand(
|
||||
fCommandFactory.createCLIRemoteGet(dmc, statFile, localFile),
|
||||
new ImmediateDataRequestMonitor<MIInfo>(rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!isSuccess()) {
|
||||
fLoadRequestOngoing = false;
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
INTERNAL_ERROR, "Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
return;
|
||||
}
|
||||
getExecutor().schedule(() -> fCommandControl.queueCommand(
|
||||
fCommandFactory.createCLIRemoteGet(dmc, statFile, localFile),
|
||||
new ImmediateDataRequestMonitor<MIInfo>(rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!isSuccess()) {
|
||||
fLoadRequestOngoing = false;
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
|
||||
"Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
return;
|
||||
}
|
||||
|
||||
// Success - parse the second set of stat counters and compute loads
|
||||
try {
|
||||
procStatParser.parseStatFile(localFile);
|
||||
} catch (Exception e) {
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
INTERNAL_ERROR, "Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
fLoadRequestOngoing = false;
|
||||
return;
|
||||
}
|
||||
// delete temp file
|
||||
new File(localFile).delete();
|
||||
// Success - parse the second set of stat counters and compute loads
|
||||
try {
|
||||
procStatParser.parseStatFile(localFile);
|
||||
} catch (Exception e) {
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
|
||||
"Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
fLoadRequestOngoing = false;
|
||||
return;
|
||||
}
|
||||
// delete temp file
|
||||
new File(localFile).delete();
|
||||
|
||||
// Compute load
|
||||
fCachedLoads = procStatParser.getCpuLoad();
|
||||
processLoads(context, rm, fCachedLoads);
|
||||
// Compute load
|
||||
fCachedLoads = procStatParser.getCpuLoad();
|
||||
processLoads(context, rm, fCachedLoads);
|
||||
|
||||
// done with request
|
||||
fLoadRequestOngoing = false;
|
||||
// process any queued request
|
||||
for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache
|
||||
.entrySet()) {
|
||||
processLoads(e.getKey(), e.getValue(), fCachedLoads);
|
||||
}
|
||||
fLoadInfoRequestCache.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
}, LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
|
||||
// done with request
|
||||
fLoadRequestOngoing = false;
|
||||
// process any queued request
|
||||
for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache
|
||||
.entrySet()) {
|
||||
processLoads(e.getKey(), e.getValue(), fCachedLoads);
|
||||
}
|
||||
fLoadInfoRequestCache.clear();
|
||||
}
|
||||
}), LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
});
|
||||
// Local debugging? Then we can read /proc/stat directly
|
||||
|
@ -781,29 +771,26 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
|
|||
}
|
||||
|
||||
// Read /proc/stat file again after a delay
|
||||
getExecutor().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
procStatParser.parseStatFile(statFile);
|
||||
} catch (Exception e) {
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
|
||||
"Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
fLoadRequestOngoing = false;
|
||||
return;
|
||||
}
|
||||
// compute load
|
||||
fCachedLoads = procStatParser.getCpuLoad();
|
||||
processLoads(context, rm, fCachedLoads);
|
||||
|
||||
// done with request
|
||||
getExecutor().schedule(() -> {
|
||||
try {
|
||||
procStatParser.parseStatFile(statFile);
|
||||
} catch (Exception e1) {
|
||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
|
||||
"Can't get load info for CPU", null)); //$NON-NLS-1$
|
||||
fLoadRequestOngoing = false;
|
||||
// process any queued request
|
||||
for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache.entrySet()) {
|
||||
processLoads(e.getKey(), e.getValue(), fCachedLoads);
|
||||
}
|
||||
fLoadInfoRequestCache.clear();
|
||||
return;
|
||||
}
|
||||
// compute load
|
||||
fCachedLoads = procStatParser.getCpuLoad();
|
||||
processLoads(context, rm, fCachedLoads);
|
||||
|
||||
// done with request
|
||||
fLoadRequestOngoing = false;
|
||||
// process any queued request
|
||||
for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e2 : fLoadInfoRequestCache.entrySet()) {
|
||||
processLoads(e2.getKey(), e2.getValue(), fCachedLoads);
|
||||
}
|
||||
fLoadInfoRequestCache.clear();
|
||||
}, LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -553,36 +553,32 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
|
|||
|
||||
// Add the inferior to the launch.
|
||||
// This cannot be done on the executor or things deadlock.
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (restart) {
|
||||
// For a restart, remove the old inferior
|
||||
IProcess[] launchProcesses = launch.getProcesses();
|
||||
for (IProcess p : launchProcesses) {
|
||||
// We know there is only one inferior, so just find it.
|
||||
if (p instanceof InferiorRuntimeProcess) {
|
||||
launch.removeProcess(p);
|
||||
break;
|
||||
}
|
||||
DebugPlugin.getDefault().asyncExec(() -> {
|
||||
if (restart) {
|
||||
// For a restart, remove the old inferior
|
||||
IProcess[] launchProcesses = launch.getProcesses();
|
||||
for (IProcess p : launchProcesses) {
|
||||
// We know there is only one inferior, so just find it.
|
||||
if (p instanceof InferiorRuntimeProcess) {
|
||||
launch.removeProcess(p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the inferior
|
||||
// Need to go through DebugPlugin.newProcess so that we can use
|
||||
// the overrideable process factory to allow others to override.
|
||||
// First set attribute to specify we want to create an inferior process.
|
||||
// Bug 210366
|
||||
Map<String, String> attributes = new HashMap<>();
|
||||
attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
|
||||
IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
|
||||
IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label, attributes);
|
||||
// Now set the inferior groupId
|
||||
runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR,
|
||||
MIProcesses.UNIQUE_GROUP_ID);
|
||||
|
||||
rm.done();
|
||||
}
|
||||
|
||||
// Add the inferior
|
||||
// Need to go through DebugPlugin.newProcess so that we can use
|
||||
// the overrideable process factory to allow others to override.
|
||||
// First set attribute to specify we want to create an inferior process.
|
||||
// Bug 210366
|
||||
Map<String, String> attributes = new HashMap<>();
|
||||
attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
|
||||
IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
|
||||
IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label, attributes);
|
||||
// Now set the inferior groupId
|
||||
runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, MIProcesses.UNIQUE_GROUP_ID);
|
||||
|
||||
rm.done();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1849,23 +1849,20 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse
|
|||
private void addProcessToLaunch(Process inferior, String groupId, String label) {
|
||||
// Add the inferior to the launch.
|
||||
// This cannot be done on the executor or things deadlock.
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Add the inferior
|
||||
// Need to go through DebugPlugin.newProcess so that we can use
|
||||
// the overrideable process factory to allow others to override.
|
||||
// First set attribute to specify we want to create an inferior process.
|
||||
// Bug 210366
|
||||
ILaunch launch = (ILaunch) getSession().getModelAdapter(ILaunch.class);
|
||||
Map<String, String> attributes = new HashMap<>();
|
||||
attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
|
||||
IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
|
||||
IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label != null ? label : "", //$NON-NLS-1$
|
||||
attributes);
|
||||
// Now set the inferior groupId
|
||||
runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, groupId);
|
||||
}
|
||||
DebugPlugin.getDefault().asyncExec(() -> {
|
||||
// Add the inferior
|
||||
// Need to go through DebugPlugin.newProcess so that we can use
|
||||
// the overrideable process factory to allow others to override.
|
||||
// First set attribute to specify we want to create an inferior process.
|
||||
// Bug 210366
|
||||
ILaunch launch = (ILaunch) getSession().getModelAdapter(ILaunch.class);
|
||||
Map<String, String> attributes = new HashMap<>();
|
||||
attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
|
||||
IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
|
||||
IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label != null ? label : "", //$NON-NLS-1$
|
||||
attributes);
|
||||
// Now set the inferior groupId
|
||||
runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, groupId);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -804,12 +804,7 @@ public class GDBTraceControl_7_2 extends AbstractDsfService implements IGDBTrace
|
|||
// the number of frames collected. Having a small interval of
|
||||
// stale data is currently not a big deal, and not user-visible.
|
||||
// Bug 353034
|
||||
getExecutor().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fTraceStatusCache.reset(context);
|
||||
}
|
||||
}, 300, TimeUnit.MILLISECONDS);
|
||||
getExecutor().schedule(() -> fTraceStatusCache.reset(context), 300, TimeUnit.MILLISECONDS);
|
||||
|
||||
fTraceStatusCache.execute(fCommandFactory.createMITraceStatus(context),
|
||||
new DataRequestMonitor<MITraceStatusInfo>(getExecutor(), rm) {
|
||||
|
|
|
@ -453,10 +453,8 @@ public class MIBreakpointsManager extends AbstractDsfService
|
|||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
// Submit the runnable to plant the breakpoints on dispatch thread.
|
||||
getExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
installInitialBreakpoints(dmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) {
|
||||
getExecutor().submit(
|
||||
() -> installInitialBreakpoints(dmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
// Notify breakpoints tracking listeners that the tracking is started.
|
||||
|
@ -465,9 +463,7 @@ public class MIBreakpointsManager extends AbstractDsfService
|
|||
}
|
||||
rm.done();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
@ -1765,19 +1761,16 @@ public class MIBreakpointsManager extends AbstractDsfService
|
|||
* @param bps
|
||||
*/
|
||||
private void clearBreakpointStatus(final ICBreakpoint[] bps, final IBreakpointsTargetDMContext ctx) {
|
||||
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
// For every platform breakpoint that has at least one target breakpoint installed
|
||||
// we must decrement the install count, for every target breakpoint.
|
||||
// Note that we cannot simply call resetInstallCount() because another
|
||||
// launch may be using the same platform breakpoint.
|
||||
Map<ICBreakpoint, Vector<IBreakpointDMContext>> breakpoints = fPlatformToBPsMaps.get(ctx);
|
||||
for (ICBreakpoint breakpoint : breakpoints.keySet()) {
|
||||
Vector<IBreakpointDMContext> targetBps = breakpoints.get(breakpoint);
|
||||
for (IBreakpointDMContext targetBp : targetBps) {
|
||||
decrementInstallCount(targetBp, breakpoint, new RequestMonitor(getExecutor(), null));
|
||||
}
|
||||
IWorkspaceRunnable wr = monitor -> {
|
||||
// For every platform breakpoint that has at least one target breakpoint installed
|
||||
// we must decrement the install count, for every target breakpoint.
|
||||
// Note that we cannot simply call resetInstallCount() because another
|
||||
// launch may be using the same platform breakpoint.
|
||||
Map<ICBreakpoint, Vector<IBreakpointDMContext>> breakpoints = fPlatformToBPsMaps.get(ctx);
|
||||
for (ICBreakpoint breakpoint : breakpoints.keySet()) {
|
||||
Vector<IBreakpointDMContext> targetBps = breakpoints.get(breakpoint);
|
||||
for (IBreakpointDMContext targetBp : targetBps) {
|
||||
decrementInstallCount(targetBp, breakpoint, new RequestMonitor(getExecutor(), null));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -52,24 +52,20 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
|
|||
}
|
||||
|
||||
public static void startup() {
|
||||
Runnable r = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (fgManager == null) {
|
||||
// FindBugs reported that it is unsafe to set s_resources
|
||||
// before we finish to initialize the object, because of
|
||||
// multi-threading. This is why we use a temporary variable.
|
||||
EvaluationContextManager manager = new EvaluationContextManager();
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
|
||||
for (int i = 0; i < windows.length; i++) {
|
||||
manager.windowOpened(windows[i]);
|
||||
}
|
||||
workbench.addWindowListener(manager);
|
||||
|
||||
fgManager = manager;
|
||||
Runnable r = () -> {
|
||||
if (fgManager == null) {
|
||||
// FindBugs reported that it is unsafe to set s_resources
|
||||
// before we finish to initialize the object, because of
|
||||
// multi-threading. This is why we use a temporary variable.
|
||||
EvaluationContextManager manager = new EvaluationContextManager();
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
|
||||
for (int i = 0; i < windows.length; i++) {
|
||||
manager.windowOpened(windows[i]);
|
||||
}
|
||||
workbench.addWindowListener(manager);
|
||||
|
||||
fgManager = manager;
|
||||
}
|
||||
};
|
||||
Display display = Display.getCurrent();
|
||||
|
|
|
@ -400,18 +400,15 @@ public class ExpressionInformationControlCreator implements IInformationControlC
|
|||
fViewerUpdateListener = new IViewerUpdateListener() {
|
||||
@Override
|
||||
public void viewerUpdatesComplete() {
|
||||
fViewer.getDisplay().timerExec(100, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fViewer.getTree().isDisposed()) {
|
||||
TreeSelection selection = (TreeSelection) fViewer.getSelection();
|
||||
if (selection.isEmpty()) {
|
||||
selection = new TreeSelection(fViewer.getTopElementPath());
|
||||
}
|
||||
fViewer.setSelection(selection);
|
||||
if (fDetailPane != null) {
|
||||
fDetailPane.display(selection);
|
||||
}
|
||||
fViewer.getDisplay().timerExec(100, () -> {
|
||||
if (!fViewer.getTree().isDisposed()) {
|
||||
TreeSelection selection = (TreeSelection) fViewer.getSelection();
|
||||
if (selection.isEmpty()) {
|
||||
selection = new TreeSelection(fViewer.getTopElementPath());
|
||||
}
|
||||
fViewer.setSelection(selection);
|
||||
if (fDetailPane != null) {
|
||||
fDetailPane.display(selection);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -963,14 +963,11 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
|
|||
|
||||
private void notifyUser(final String message) {
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null) {
|
||||
MessageDialog.openInformation(parent, Messages.Information,
|
||||
Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
|
||||
}
|
||||
Runnable runnable = () -> {
|
||||
Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
|
||||
if (parent != null) {
|
||||
MessageDialog.openInformation(parent, Messages.Information,
|
||||
Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -353,12 +353,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
if (canDisassemble()) {
|
||||
final BigInteger address = getLastKnownAddress();
|
||||
if (address != null && !UNKNOWN_ADDRESS.equals(address)) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.updatePC(address);
|
||||
}
|
||||
});
|
||||
fCallback.asyncExec(() -> fCallback.updatePC(address));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -387,17 +382,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
if (DEBUG)
|
||||
System.out
|
||||
.println("retrieveFrameAddress done " + DisassemblyUtils.getAddressText(addressValue)); //$NON-NLS-1$
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (address.getSize() * 8 != fCallback.getAddressSize()) {
|
||||
fCallback.addressSizeChanged(address.getSize() * 8);
|
||||
}
|
||||
if (frame == 0) {
|
||||
fCallback.updatePC(addressValue);
|
||||
} else {
|
||||
fCallback.gotoFrame(frame, addressValue);
|
||||
}
|
||||
fCallback.asyncExec(() -> {
|
||||
if (address.getSize() * 8 != fCallback.getAddressSize()) {
|
||||
fCallback.addressSizeChanged(address.getSize() * 8);
|
||||
}
|
||||
if (frame == 0) {
|
||||
fCallback.updatePC(addressValue);
|
||||
} else {
|
||||
fCallback.gotoFrame(frame, addressValue);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -474,12 +466,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
}
|
||||
final IExecutionDMContext context = event.getDMContext();
|
||||
if (context.equals(fTargetContext) || DMContexts.isAncestorOf(fTargetContext, context)) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.handleTargetEnded();
|
||||
}
|
||||
});
|
||||
fCallback.asyncExec(() -> fCallback.handleTargetEnded());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,152 +558,98 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
|
||||
|
||||
// align the start address first (bug 328168)
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
alignOpCodeAddress(startAddress, new DataRequestMonitor<BigInteger>(executor, null) {
|
||||
executor.execute(() -> alignOpCodeAddress(startAddress, new DataRequestMonitor<BigInteger>(executor, null) {
|
||||
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
final BigInteger finalStartAddress = getData();
|
||||
if (mixed) {
|
||||
final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
|
||||
executor, null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
final IMixedInstruction[] data = getData();
|
||||
if (!isCanceled() && data != null) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!insertDisassembly(finalStartAddress, finalEndAddress, data,
|
||||
showSymbols, showDisassembly)) {
|
||||
// retry in non-mixed mode
|
||||
fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress,
|
||||
linesHint, false, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
final IStatus status = getStatus();
|
||||
if (status != null && !status.isOK()) {
|
||||
if (file != null) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.retrieveDisassembly(finalStartAddress,
|
||||
finalEndAddress, linesHint, true, true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.doScrollLocked(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.insertError(finalStartAddress,
|
||||
status.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (file != null) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IDisassembly disassembly = fServicesTracker
|
||||
.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, file, lineNumber, lines * 2,
|
||||
disassemblyRequest);
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
final BigInteger finalStartAddress = getData();
|
||||
if (mixed) {
|
||||
final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
|
||||
executor, null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
final IMixedInstruction[] data = getData();
|
||||
if (!isCanceled() && data != null) {
|
||||
fCallback.asyncExec(() -> {
|
||||
if (!insertDisassembly(finalStartAddress, finalEndAddress, data, showSymbols,
|
||||
showDisassembly)) {
|
||||
// retry in non-mixed mode
|
||||
fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress, linesHint,
|
||||
false, true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IDisassembly disassembly = fServicesTracker
|
||||
.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress,
|
||||
disassemblyRequest);
|
||||
final IStatus status = getStatus();
|
||||
if (status != null && !status.isOK()) {
|
||||
if (file != null) {
|
||||
fCallback.asyncExec(() -> fCallback.retrieveDisassembly(finalStartAddress,
|
||||
finalEndAddress, linesHint, true, true));
|
||||
} else {
|
||||
fCallback.asyncExec(() -> fCallback.doScrollLocked(
|
||||
() -> fCallback.insertError(finalStartAddress, status.getMessage())));
|
||||
}
|
||||
}
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (file != null) {
|
||||
executor.execute(() -> {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, file, lineNumber, lines * 2, disassemblyRequest);
|
||||
});
|
||||
} else {
|
||||
executor.execute(() -> {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress,
|
||||
disassemblyRequest);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
final DataRequestMonitor<IInstruction[]> disassemblyRequest = new DataRequestMonitor<IInstruction[]>(
|
||||
executor, null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (!isCanceled() && getData() != null) {
|
||||
fCallback.asyncExec(() -> {
|
||||
if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(), showSymbols,
|
||||
showDisassembly)) {
|
||||
fCallback.doScrollLocked(() -> fCallback.insertError(finalStartAddress,
|
||||
DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
final IStatus status = getStatus();
|
||||
if (status != null && !status.isOK()) {
|
||||
fCallback.asyncExec(() -> fCallback.doScrollLocked(
|
||||
() -> fCallback.insertError(finalStartAddress, status.getMessage())));
|
||||
}
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
} else {
|
||||
final DataRequestMonitor<IInstruction[]> disassemblyRequest = new DataRequestMonitor<IInstruction[]>(
|
||||
executor, null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
if (!isCanceled() && getData() != null) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(),
|
||||
showSymbols, showDisassembly)) {
|
||||
fCallback.doScrollLocked(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.insertError(finalStartAddress,
|
||||
DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
final IStatus status = getStatus();
|
||||
if (status != null && !status.isOK()) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.doScrollLocked(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.insertError(finalStartAddress,
|
||||
status.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getInstructions(context, finalStartAddress, finalEndAddress,
|
||||
disassemblyRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
executor.execute(() -> {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getInstructions(context, finalStartAddress, finalEndAddress, disassemblyRequest);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IInstruction[] instructions,
|
||||
|
@ -1039,12 +972,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
protected void handleSuccess() {
|
||||
final BigInteger address = getData();
|
||||
if (address != null) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.gotoAddress(address);
|
||||
}
|
||||
});
|
||||
fCallback.asyncExec(() -> fCallback.gotoAddress(address));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1090,12 +1018,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
final IAddress address = data.getAddress();
|
||||
if (address != null && address != IExpressionDMLocation.INVALID_ADDRESS) {
|
||||
final BigInteger addressValue = address.getValue();
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fCallback.gotoAddress(addressValue);
|
||||
}
|
||||
});
|
||||
fCallback.asyncExec(() -> fCallback.gotoAddress(addressValue));
|
||||
rm.setData(addressValue);
|
||||
rm.done();
|
||||
} else {
|
||||
|
@ -1191,13 +1114,10 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
public void handleCompleted() {
|
||||
final IMixedInstruction[] data = getData();
|
||||
if (!isCanceled() && data != null) {
|
||||
fCallback.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!insertDisassembly(null, endAddress, data, showSymbols, showDisassembly)) {
|
||||
// retry in non-mixed mode
|
||||
retrieveDisassembly(file, lines, endAddress, false, showSymbols, showDisassembly);
|
||||
}
|
||||
fCallback.asyncExec(() -> {
|
||||
if (!insertDisassembly(null, endAddress, data, showSymbols, showDisassembly)) {
|
||||
// retry in non-mixed mode
|
||||
retrieveDisassembly(file, lines, endAddress, false, showSymbols, showDisassembly);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -1211,17 +1131,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
|
|||
};
|
||||
assert !fCallback.getUpdatePending();
|
||||
fCallback.setUpdatePending(true);
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, finalFile, 1, lines, disassemblyRequest);
|
||||
executor.execute(() -> {
|
||||
final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
|
||||
if (disassembly == null) {
|
||||
disassemblyRequest.cancel();
|
||||
disassemblyRequest.done();
|
||||
return;
|
||||
}
|
||||
disassembly.getMixedInstructions(context, finalFile, 1, lines, disassemblyRequest);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -136,12 +136,9 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
|
|||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.util.SafeRunnable;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyleRange;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.custom.VerifyKeyListener;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.DragSource;
|
||||
import org.eclipse.swt.dnd.DropTarget;
|
||||
|
@ -150,7 +147,6 @@ import org.eclipse.swt.dnd.TextTransfer;
|
|||
import org.eclipse.swt.dnd.Transfer;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.VerifyEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.FontData;
|
||||
|
@ -580,12 +576,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
} else if (Control.class.equals(required)) {
|
||||
return fViewer != null ? (T) fViewer.getTextWidget() : null;
|
||||
} else if (IGotoMarker.class.equals(required)) {
|
||||
return (T) new IGotoMarker() {
|
||||
@Override
|
||||
public void gotoMarker(IMarker marker) {
|
||||
DisassemblyPart.this.gotoMarker(marker);
|
||||
}
|
||||
};
|
||||
return (T) (IGotoMarker) marker -> DisassemblyPart.this.gotoMarker(marker);
|
||||
} else if (IColumnSupport.class.equals(required)) {
|
||||
if (fColumnSupport == null)
|
||||
fColumnSupport = createColumnSupport();
|
||||
|
@ -780,25 +771,17 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
hookContextMenu();
|
||||
contributeToActionBars();
|
||||
|
||||
fViewer.getTextWidget().addVerifyKeyListener(new VerifyKeyListener() {
|
||||
@Override
|
||||
public void verifyKey(VerifyEvent event) {
|
||||
switch (event.keyCode) {
|
||||
case SWT.PAGE_UP:
|
||||
case SWT.PAGE_DOWN:
|
||||
case SWT.ARROW_UP:
|
||||
case SWT.ARROW_DOWN:
|
||||
event.doit = !keyScroll(event.keyCode);
|
||||
}
|
||||
fViewer.getTextWidget().addVerifyKeyListener(event -> {
|
||||
switch (event.keyCode) {
|
||||
case SWT.PAGE_UP:
|
||||
case SWT.PAGE_DOWN:
|
||||
case SWT.ARROW_UP:
|
||||
case SWT.ARROW_DOWN:
|
||||
event.doit = !keyScroll(event.keyCode);
|
||||
}
|
||||
});
|
||||
|
||||
fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
updateSelectionDependentActions();
|
||||
}
|
||||
});
|
||||
fViewer.addSelectionChangedListener(event -> updateSelectionDependentActions());
|
||||
|
||||
fErrorColor = EditorsUI.getSharedTextColors().getColor(
|
||||
PreferenceConverter.getColor(getPreferenceStore(), DisassemblyPreferenceConstants.ERROR_COLOR));
|
||||
|
@ -834,12 +817,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
protected void setSite(IWorkbenchPartSite site) {
|
||||
super.setSite(site);
|
||||
site.getPage().addPartListener(fPartListener);
|
||||
fDebugContextListener = new IDebugContextListener() {
|
||||
@Override
|
||||
public void debugContextChanged(DebugContextEvent event) {
|
||||
if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
|
||||
updateDebugContext();
|
||||
}
|
||||
fDebugContextListener = event -> {
|
||||
if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
|
||||
updateDebugContext();
|
||||
}
|
||||
};
|
||||
DebugUITools.addPartDebugContextListener(site, fDebugContextListener);
|
||||
|
@ -1198,12 +1178,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
String id = "#DisassemblyPartContext"; //$NON-NLS-1$
|
||||
MenuManager menuMgr = new MenuManager(id, id);
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
DisassemblyPart.this.fillContextMenu(manager);
|
||||
}
|
||||
});
|
||||
menuMgr.addMenuListener(manager -> DisassemblyPart.this.fillContextMenu(manager));
|
||||
Menu menu = menuMgr.createContextMenu(fViewer.getTextWidget());
|
||||
fViewer.getTextWidget().setMenu(menu);
|
||||
getSite().registerContextMenu(id, menuMgr, fViewer);
|
||||
|
@ -1213,12 +1188,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
String id = "#DisassemblyPartRulerContext"; //$NON-NLS-1$
|
||||
MenuManager menuMgr = new MenuManager(id, id);
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
DisassemblyPart.this.fillRulerContextMenu(manager);
|
||||
}
|
||||
});
|
||||
menuMgr.addMenuListener(manager -> DisassemblyPart.this.fillRulerContextMenu(manager));
|
||||
Menu menu = menuMgr.createContextMenu(fVerticalRuler.getControl());
|
||||
fVerticalRuler.getControl().setMenu(menu);
|
||||
getSite().registerContextMenu(id, menuMgr, fViewer);
|
||||
|
@ -1442,13 +1412,10 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
assert isGuiThread();
|
||||
if (address != null) {
|
||||
final BigInteger addr = address.getValue();
|
||||
startUpdate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fGotoFramePending = false;
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
gotoAddress(addr);
|
||||
}
|
||||
startUpdate(() -> {
|
||||
fGotoFramePending = false;
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
gotoAddress(addr);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1560,15 +1527,12 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
&& !fRefreshViewPending && fFocusAddress != PC_UNKNOWN) {
|
||||
fUpdatePending = true;
|
||||
final int updateCount = fUpdateCount;
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (updateCount == fUpdateCount) {
|
||||
assert fUpdatePending;
|
||||
if (fUpdatePending) {
|
||||
fUpdatePending = false;
|
||||
updateVisibleArea();
|
||||
}
|
||||
invokeLater(() -> {
|
||||
if (updateCount == fUpdateCount) {
|
||||
assert fUpdatePending;
|
||||
if (fUpdatePending) {
|
||||
fUpdatePending = false;
|
||||
updateVisibleArea();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1767,13 +1731,10 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
if (fDebugSessionId == null) {
|
||||
return;
|
||||
}
|
||||
startUpdate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (DEBUG)
|
||||
System.out.println("retrieveDisassembly " + file); //$NON-NLS-1$
|
||||
fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
|
||||
}
|
||||
startUpdate(() -> {
|
||||
if (DEBUG)
|
||||
System.out.println("retrieveDisassembly " + file); //$NON-NLS-1$
|
||||
fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2002,12 +1963,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
prevBackend.dispose();
|
||||
}
|
||||
if (needUpdate && fViewer != null) {
|
||||
startUpdate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
debugContextChanged();
|
||||
}
|
||||
});
|
||||
startUpdate(() -> debugContextChanged());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2107,45 +2063,37 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
fRunnableQueue.clear();
|
||||
fRefreshViewPending = true;
|
||||
final long refreshViewScheduled = System.currentTimeMillis() + delay;
|
||||
final Runnable refresh = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fRefreshViewPending = false;
|
||||
long now = System.currentTimeMillis();
|
||||
if (now >= refreshViewScheduled) {
|
||||
if (DEBUG)
|
||||
System.err.println("*** refreshing view ***"); //$NON-NLS-1$
|
||||
final Runnable refresh = () -> {
|
||||
fRefreshViewPending = false;
|
||||
long now = System.currentTimeMillis();
|
||||
if (now >= refreshViewScheduled) {
|
||||
if (DEBUG)
|
||||
System.err.println("*** refreshing view ***"); //$NON-NLS-1$
|
||||
|
||||
// save viewport position and frame info
|
||||
BigInteger topAddress = getTopAddress();
|
||||
int targetFrame = fTargetFrame;
|
||||
BigInteger frameAddress = fFrameAddress;
|
||||
BigInteger pcAddress = fPCAddress;
|
||||
// save viewport position and frame info
|
||||
BigInteger topAddress = getTopAddress();
|
||||
int targetFrame = fTargetFrame;
|
||||
BigInteger frameAddress = fFrameAddress;
|
||||
BigInteger pcAddress = fPCAddress;
|
||||
|
||||
// clear viewer
|
||||
resetViewer();
|
||||
if (fScrollPos != null) {
|
||||
fScrollPos.isDeleted = true;
|
||||
}
|
||||
|
||||
// restore frame info and viewport
|
||||
fPCAnnotationUpdatePending = true;
|
||||
fTargetFrame = targetFrame;
|
||||
fFrameAddress = frameAddress;
|
||||
fPCAddress = pcAddress;
|
||||
gotoAddress(topAddress);
|
||||
} else {
|
||||
refreshView((int) (refreshViewScheduled - now));
|
||||
// clear viewer
|
||||
resetViewer();
|
||||
if (fScrollPos != null) {
|
||||
fScrollPos.isDeleted = true;
|
||||
}
|
||||
|
||||
// restore frame info and viewport
|
||||
fPCAnnotationUpdatePending = true;
|
||||
fTargetFrame = targetFrame;
|
||||
fFrameAddress = frameAddress;
|
||||
fPCAddress = pcAddress;
|
||||
gotoAddress(topAddress);
|
||||
} else {
|
||||
refreshView((int) (refreshViewScheduled - now));
|
||||
}
|
||||
};
|
||||
if (delay > 0) {
|
||||
invokeLater(delay, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doScrollLocked(refresh);
|
||||
}
|
||||
});
|
||||
invokeLater(delay, () -> doScrollLocked(refresh));
|
||||
} else {
|
||||
doScrollLocked(refresh);
|
||||
}
|
||||
|
@ -2610,12 +2558,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
private void scheduleDoPending() {
|
||||
if (!fUpdatePending && !fDoPendingPosted) {
|
||||
fDoPendingPosted = true;
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doPending();
|
||||
fDoPendingPosted = false;
|
||||
}
|
||||
invokeLater(() -> {
|
||||
doPending();
|
||||
fDoPendingPosted = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -2678,12 +2623,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
final int updateCount = fUpdateCount;
|
||||
if (fUpdatePending) {
|
||||
if (fRunnableQueue.size() == 1) {
|
||||
Runnable doitlater = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (updateCount == fUpdateCount) {
|
||||
doScrollLocked(null);
|
||||
}
|
||||
Runnable doitlater = () -> {
|
||||
if (updateCount == fUpdateCount) {
|
||||
doScrollLocked(null);
|
||||
}
|
||||
};
|
||||
invokeLater(doitlater);
|
||||
|
@ -3113,12 +3055,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
*/
|
||||
@Override
|
||||
public void handleTargetSuspended() {
|
||||
asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updatePC(PC_UNKNOWN);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
asyncExec(() -> {
|
||||
updatePC(PC_UNKNOWN);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3127,12 +3066,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
*/
|
||||
@Override
|
||||
public void handleTargetResumed() {
|
||||
asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updatePC(PC_RUNNING);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
asyncExec(() -> {
|
||||
updatePC(PC_RUNNING);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3141,17 +3077,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
*/
|
||||
@Override
|
||||
public void handleTargetEnded() {
|
||||
asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fDebugSessionId = null;
|
||||
startUpdate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
debugContextChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
asyncExec(() -> {
|
||||
fDebugSessionId = null;
|
||||
startUpdate(() -> debugContextChanged());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -266,12 +266,7 @@ public class CSourcePresentationCreator extends PresentationReconciler
|
|||
fDamagerRepairer = new SourceTagDamagerRepairer(scanner, fSourceTagProvider, colorManager, store);
|
||||
if (fSourceTagProvider != null) {
|
||||
if (fSourceTagListener == null) {
|
||||
fSourceTagListener = new ISourceTagListener() {
|
||||
@Override
|
||||
public void sourceTagsChanged(ISourceTagProvider provider) {
|
||||
handleSourceTagsChanged();
|
||||
}
|
||||
};
|
||||
fSourceTagListener = provider -> handleSourceTagsChanged();
|
||||
}
|
||||
fSourceTagProvider.addSourceTagListener(fSourceTagListener);
|
||||
}
|
||||
|
@ -341,12 +336,9 @@ public class CSourcePresentationCreator extends PresentationReconciler
|
|||
if (fViewer != null) {
|
||||
Display display = fViewer.getTextWidget().getDisplay();
|
||||
if (display.getThread() != Thread.currentThread()) {
|
||||
display.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (fViewer != null) {
|
||||
fViewer.invalidateTextPresentation();
|
||||
}
|
||||
display.asyncExec(() -> {
|
||||
if (fViewer != null) {
|
||||
fViewer.invalidateTextPresentation();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -40,14 +40,10 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyleRange;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.MouseMoveListener;
|
||||
import org.eclipse.swt.events.MouseTrackListener;
|
||||
import org.eclipse.swt.events.PaintEvent;
|
||||
import org.eclipse.swt.events.PaintListener;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.FontMetrics;
|
||||
|
@ -393,14 +389,11 @@ public class DisassemblyRulerColumn extends AbstractContributedRulerColumn imple
|
|||
/**
|
||||
* Redraw runnable
|
||||
*/
|
||||
private Runnable fRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (fRunnableLock) {
|
||||
fIsRunnablePosted = false;
|
||||
}
|
||||
redraw();
|
||||
private Runnable fRunnable = () -> {
|
||||
synchronized (fRunnableLock) {
|
||||
fIsRunnablePosted = false;
|
||||
}
|
||||
redraw();
|
||||
};
|
||||
private boolean fAlignRight;
|
||||
private boolean fPaintStyleBackground;
|
||||
|
@ -608,21 +601,15 @@ public class DisassemblyRulerColumn extends AbstractContributedRulerColumn imple
|
|||
fCanvas.setBackground(getBackground(fCanvas.getDisplay()));
|
||||
fCanvas.setForeground(fForeground);
|
||||
|
||||
fCanvas.addPaintListener(new PaintListener() {
|
||||
@Override
|
||||
public void paintControl(PaintEvent event) {
|
||||
if (fCachedTextViewer != null)
|
||||
doubleBufferPaint(event.gc);
|
||||
}
|
||||
fCanvas.addPaintListener(event -> {
|
||||
if (fCachedTextViewer != null)
|
||||
doubleBufferPaint(event.gc);
|
||||
});
|
||||
|
||||
fCanvas.addDisposeListener(new DisposeListener() {
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
handleDispose();
|
||||
fCachedTextViewer = null;
|
||||
fCachedTextWidget = null;
|
||||
}
|
||||
fCanvas.addDisposeListener(e -> {
|
||||
handleDispose();
|
||||
fCachedTextViewer = null;
|
||||
fCachedTextWidget = null;
|
||||
});
|
||||
|
||||
fCanvas.addMouseListener(new MouseHandler());
|
||||
|
|
|
@ -756,12 +756,9 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
|||
// Need to remove annotations in UI thread.
|
||||
Display display = PlatformUI.getWorkbench().getDisplay();
|
||||
if (display != null && !display.isDisposed()) {
|
||||
display.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
enableLineBackgroundPainter();
|
||||
fIPManager.removeAllAnnotations();
|
||||
}
|
||||
display.asyncExec(() -> {
|
||||
enableLineBackgroundPainter();
|
||||
fIPManager.removeAllAnnotations();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -997,20 +994,17 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
|||
System.out.println("[DsfSourceDisplayAdapter] eventDispatched e=" + e); //$NON-NLS-1$
|
||||
}
|
||||
// trigger source display immediately (should be optional?)
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
doneStepping(e.getDMContext());
|
||||
}
|
||||
doneStepping(e.getDMContext());
|
||||
});
|
||||
} else {
|
||||
doneStepping(e.getDMContext());
|
||||
|
|
|
@ -83,12 +83,7 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
store.getInt(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT));
|
||||
}
|
||||
|
||||
fPreferencesListener = new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(final PropertyChangeEvent event) {
|
||||
handlePropertyChanged(store, event);
|
||||
}
|
||||
};
|
||||
fPreferencesListener = event -> handlePropertyChanged(store, event);
|
||||
store.addPropertyChangeListener(fPreferencesListener);
|
||||
|
||||
final IPreferenceStore cStore = CDebugUIPlugin.getDefault().getPreferenceStore();
|
||||
|
@ -116,15 +111,12 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
// We're in session's executor thread. Re-dispatch to our executor thread
|
||||
// and then call root layout node.
|
||||
try {
|
||||
getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isDisposed())
|
||||
return;
|
||||
getExecutor().execute(() -> {
|
||||
if (isDisposed())
|
||||
return;
|
||||
|
||||
for (final DebugEvent event : events) {
|
||||
handleEvent(event);
|
||||
}
|
||||
for (final DebugEvent event : events) {
|
||||
handleEvent(event);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
@ -175,15 +167,12 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
@Override
|
||||
public void run() {
|
||||
if (getSession().isActive()) {
|
||||
getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// trigger full stack frame update
|
||||
ScheduledFuture<?> future = fRefreshStackFramesFutures.get(exeContext);
|
||||
if (future != null && !isDisposed()) {
|
||||
fRefreshStackFramesFutures.remove(exeContext);
|
||||
handleEvent(new FullStackRefreshEvent(exeContext, suspendEvent), null);
|
||||
}
|
||||
getExecutor().execute(() -> {
|
||||
// trigger full stack frame update
|
||||
ScheduledFuture<?> future = fRefreshStackFramesFutures.get(exeContext);
|
||||
if (future != null && !isDisposed()) {
|
||||
fRefreshStackFramesFutures.remove(exeContext);
|
||||
handleEvent(new FullStackRefreshEvent(exeContext, suspendEvent), null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -259,16 +248,13 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
// We're in session's executor thread. Re-dispach to our executor thread
|
||||
// and then call root layout node.
|
||||
try {
|
||||
getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isDisposed())
|
||||
return;
|
||||
getExecutor().execute(() -> {
|
||||
if (isDisposed())
|
||||
return;
|
||||
|
||||
IRootVMNode rootLayoutNode = getRootVMNode();
|
||||
if (rootLayoutNode != null && rootLayoutNode.getDeltaFlags(event) != IModelDelta.NO_CHANGE) {
|
||||
handleEvent(event);
|
||||
}
|
||||
IRootVMNode rootLayoutNode = getRootVMNode();
|
||||
if (rootLayoutNode != null && rootLayoutNode.getDeltaFlags(event) != IModelDelta.NO_CHANGE) {
|
||||
handleEvent(event);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
|
|
@ -418,15 +418,12 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
|||
DebugUITools.getPreferenceStore().removePropertyChangeListener(fPreferenceChangeListener);
|
||||
}
|
||||
|
||||
fPreferenceChangeListener = new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND)) {
|
||||
columnIdValueBackground.setBackground(
|
||||
DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
|
||||
columnNoColumnsBackground.setBackground(
|
||||
DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
|
||||
}
|
||||
fPreferenceChangeListener = event -> {
|
||||
if (event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND)) {
|
||||
columnIdValueBackground.setBackground(
|
||||
DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
|
||||
columnNoColumnsBackground.setBackground(
|
||||
DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -865,22 +862,19 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
|||
@Override
|
||||
public void update(final IExpressionUpdate update) {
|
||||
try {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
IExpressionDMContext expressionDMC = createExpression(expressionService,
|
||||
createCompositeDMVMContext(update), update.getExpression().getExpressionText());
|
||||
getSession().getExecutor().execute(() -> {
|
||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||
if (expressionService != null) {
|
||||
IExpressionDMContext expressionDMC = createExpression(expressionService,
|
||||
createCompositeDMVMContext(update), update.getExpression().getExpressionText());
|
||||
|
||||
VariableExpressionVMC variableVmc = (VariableExpressionVMC) createVMContext(expressionDMC);
|
||||
variableVmc.setExpression(update.getExpression());
|
||||
VariableExpressionVMC variableVmc = (VariableExpressionVMC) createVMContext(expressionDMC);
|
||||
variableVmc.setExpression(update.getExpression());
|
||||
|
||||
update.setExpressionElement(variableVmc);
|
||||
update.done();
|
||||
} else {
|
||||
handleFailedUpdate(update);
|
||||
}
|
||||
update.setExpressionElement(variableVmc);
|
||||
update.done();
|
||||
} else {
|
||||
handleFailedUpdate(update);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
|
|
@ -29,8 +29,6 @@ import org.eclipse.cdt.dsf.concurrent.DsfExecutable;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.SWTException;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
|
||||
/**
|
||||
* DSF executor which uses the display thread to run the submitted runnables
|
||||
|
@ -78,12 +76,9 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
|
|||
private DisplayDsfExecutor(Display display) {
|
||||
super("Display DSF Executor"); //$NON-NLS-1$
|
||||
fDisplay = display;
|
||||
fDisplay.addListener(SWT.Dispose, new Listener() {
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
if (event.type == SWT.Dispose) {
|
||||
DisplayDsfExecutor.super.shutdownNow();
|
||||
}
|
||||
fDisplay.addListener(SWT.Dispose, event -> {
|
||||
if (event.type == SWT.Dispose) {
|
||||
DisplayDsfExecutor.super.shutdownNow();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -120,14 +115,11 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
|
|||
final Throwable[] e = new Throwable[1];
|
||||
|
||||
try {
|
||||
fDisplay.syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
v[0] = callable.call();
|
||||
} catch (Throwable exception) {
|
||||
e[0] = exception;
|
||||
}
|
||||
fDisplay.syncExec(() -> {
|
||||
try {
|
||||
v[0] = callable.call();
|
||||
} catch (Throwable exception) {
|
||||
e[0] = exception;
|
||||
}
|
||||
});
|
||||
} catch (SWTException swtException) {
|
||||
|
@ -164,20 +156,12 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
|
|||
((DsfExecutable) runnable).setSubmitted();
|
||||
}
|
||||
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
fDisplay.syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runnable.run();
|
||||
}
|
||||
});
|
||||
} catch (SWTException swtException) {
|
||||
if (swtException.code == SWT.ERROR_DEVICE_DISPOSED) {
|
||||
DisplayDsfExecutor.super.shutdownNow();
|
||||
}
|
||||
return () -> {
|
||||
try {
|
||||
fDisplay.syncExec(() -> runnable.run());
|
||||
} catch (SWTException swtException) {
|
||||
if (swtException.code == SWT.ERROR_DEVICE_DISPOSED) {
|
||||
DisplayDsfExecutor.super.shutdownNow();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -78,12 +78,7 @@ public class SimpleDisplayExecutor implements Executor {
|
|||
final boolean needsPosting = enqueue(command);
|
||||
if (needsPosting) {
|
||||
try {
|
||||
fDisplay.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runInSwtThread();
|
||||
}
|
||||
});
|
||||
fDisplay.asyncExec(() -> runInSwtThread());
|
||||
} catch (final SWTException e) {
|
||||
if (e.code == SWT.ERROR_DEVICE_DISPOSED) {
|
||||
throw new RejectedExecutionException("Display " + fDisplay + " is disposed", e); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
|
|
@ -104,12 +104,7 @@ abstract public class AbstractVMAdapter implements IVMAdapter {
|
|||
|
||||
for (final IVMProvider provider : providers) {
|
||||
try {
|
||||
provider.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
provider.dispose();
|
||||
}
|
||||
});
|
||||
provider.getExecutor().execute(() -> provider.dispose());
|
||||
} catch (RejectedExecutionException e) {
|
||||
// Not much we can do at this point.
|
||||
}
|
||||
|
@ -155,16 +150,13 @@ abstract public class AbstractVMAdapter implements IVMAdapter {
|
|||
|
||||
private void updateProvider(final IVMProvider provider, final IViewerUpdate[] updates) {
|
||||
try {
|
||||
provider.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (updates instanceof IHasChildrenUpdate[]) {
|
||||
provider.update((IHasChildrenUpdate[]) updates);
|
||||
} else if (updates instanceof IChildrenCountUpdate[]) {
|
||||
provider.update((IChildrenCountUpdate[]) updates);
|
||||
} else if (updates instanceof IChildrenUpdate[]) {
|
||||
provider.update((IChildrenUpdate[]) updates);
|
||||
}
|
||||
provider.getExecutor().execute(() -> {
|
||||
if (updates instanceof IHasChildrenUpdate[]) {
|
||||
provider.update((IHasChildrenUpdate[]) updates);
|
||||
} else if (updates instanceof IChildrenCountUpdate[]) {
|
||||
provider.update((IChildrenCountUpdate[]) updates);
|
||||
} else if (updates instanceof IChildrenUpdate[]) {
|
||||
provider.update((IChildrenUpdate[]) updates);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
|
|
@ -50,13 +50,10 @@ abstract public class AbstractDMVMAdapter extends AbstractVMAdapter {
|
|||
fSession = session;
|
||||
// Add ourselves as listener for DM events events.
|
||||
try {
|
||||
session.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (DsfSession.isSessionActive(getSession().getId())) {
|
||||
getSession().addServiceEventListener(AbstractDMVMAdapter.this, null);
|
||||
fRegisteredAsEventListener = true;
|
||||
}
|
||||
session.getExecutor().execute(() -> {
|
||||
if (DsfSession.isSessionActive(getSession().getId())) {
|
||||
getSession().addServiceEventListener(AbstractDMVMAdapter.this, null);
|
||||
fRegisteredAsEventListener = true;
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
@ -67,12 +64,9 @@ abstract public class AbstractDMVMAdapter extends AbstractVMAdapter {
|
|||
@Override
|
||||
public void dispose() {
|
||||
try {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (fRegisteredAsEventListener && getSession().isActive()) {
|
||||
fSession.removeServiceEventListener(AbstractDMVMAdapter.this);
|
||||
}
|
||||
getSession().getExecutor().execute(() -> {
|
||||
if (fRegisteredAsEventListener && getSession().isActive()) {
|
||||
fSession.removeServiceEventListener(AbstractDMVMAdapter.this);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %pluginName
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.dsf;singleton:=true
|
||||
Bundle-Version: 2.8.1.qualifier
|
||||
Bundle-Version: 2.8.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.dsf.internal.DsfPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -41,12 +41,7 @@ public abstract class AbstractCache<V> implements ICache<V> {
|
|||
private class RequestCanceledListener implements RequestMonitor.ICanceledListener {
|
||||
@Override
|
||||
public void requestCanceled(final RequestMonitor canceledRm) {
|
||||
fExecutor.getDsfExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
handleCanceledRm(canceledRm);
|
||||
}
|
||||
});
|
||||
fExecutor.getDsfExecutor().execute(() -> handleCanceledRm(canceledRm));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,21 +39,11 @@ public class DsfLaunch extends Launch {
|
|||
|
||||
@Override
|
||||
protected void fireChanged() {
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DsfLaunch.super.fireChanged();
|
||||
}
|
||||
});
|
||||
DebugPlugin.getDefault().asyncExec(() -> DsfLaunch.super.fireChanged());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fireTerminate() {
|
||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DsfLaunch.super.fireTerminate();
|
||||
}
|
||||
});
|
||||
DebugPlugin.getDefault().asyncExec(() -> DsfLaunch.super.fireTerminate());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,12 +109,8 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
|
|||
fBlock = null;
|
||||
|
||||
try {
|
||||
fRetrieval.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fRetrieval.getSession().addServiceEventListener(DsfMemoryBlock.this, null);
|
||||
}
|
||||
});
|
||||
fRetrieval.getExecutor()
|
||||
.execute(() -> fRetrieval.getSession().addServiceEventListener(DsfMemoryBlock.this, null));
|
||||
} catch (RejectedExecutionException e) {
|
||||
// Session is shut down.
|
||||
}
|
||||
|
@ -565,12 +561,8 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
|
|||
@Override
|
||||
public void dispose() throws DebugException {
|
||||
try {
|
||||
fRetrieval.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fRetrieval.getSession().removeServiceEventListener(DsfMemoryBlock.this);
|
||||
}
|
||||
});
|
||||
fRetrieval.getExecutor()
|
||||
.execute(() -> fRetrieval.getSession().removeServiceEventListener(DsfMemoryBlock.this));
|
||||
} catch (RejectedExecutionException e) {
|
||||
// Session is down.
|
||||
}
|
||||
|
|
|
@ -217,14 +217,11 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl
|
|||
DEFAULT_ATTR_DEBUGGER_MEMORY_BLOCKS_VALUE);
|
||||
if (memento != null && memento.trim().length() != 0) {
|
||||
// Submit the runnable to install the monitors on dispatch thread.
|
||||
getExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
createBlocksFromConfiguration(memoryCtx, memento);
|
||||
} catch (CoreException e) {
|
||||
DsfPlugin.getDefault().getLog().log(e.getStatus());
|
||||
}
|
||||
getExecutor().submit(() -> {
|
||||
try {
|
||||
createBlocksFromConfiguration(memoryCtx, memento);
|
||||
} catch (CoreException e) {
|
||||
DsfPlugin.getDefault().getLog().log(e.getStatus());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -296,12 +296,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi
|
|||
}
|
||||
|
||||
// Submit the runnable to plant the breakpoints on dispatch thread.
|
||||
getExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
installInitialBreakpoints(breakpointsDmc, initialPlatformBPs, rm);
|
||||
}
|
||||
});
|
||||
getExecutor().submit(() -> installInitialBreakpoints(breakpointsDmc, initialPlatformBPs, rm));
|
||||
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
|
|
@ -977,26 +977,22 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
|
|||
public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
|
||||
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
|
||||
if (c.getName().equals(connection.getName())) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
connection.removeImageListener(containerTab);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
displayedImages = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
displayedImages.add(image);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
connection.removeImageListener(containerTab);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
displayedImages = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
displayedImages.add(image);
|
||||
}
|
||||
}
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(containerTab);
|
||||
}
|
||||
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(containerTab);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -736,24 +736,20 @@ public class ContainerTab extends AbstractLaunchConfigurationTab
|
|||
setErrorMessage(Messages.ContainerTab_Error_No_Images);
|
||||
}
|
||||
if (c.getName().equals(connection.getName())) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
connection.removeImageListener(containerTab);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
connection.removeImageListener(containerTab);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
}
|
||||
}
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(containerTab);
|
||||
}
|
||||
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(containerTab);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -467,15 +467,8 @@ public class LaunchShortcut implements ILaunchShortcut {
|
|||
}
|
||||
// issue error message if no connections exist
|
||||
if (connection == null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openError(Display.getCurrent().getActiveShell(),
|
||||
Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections);
|
||||
}
|
||||
|
||||
});
|
||||
Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
|
||||
Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -495,15 +488,8 @@ public class LaunchShortcut implements ILaunchShortcut {
|
|||
|
||||
// issue error msg if no images exist
|
||||
if (image == null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openError(Display.getCurrent().getActiveShell(),
|
||||
Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images);
|
||||
}
|
||||
|
||||
});
|
||||
Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
|
||||
Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -273,24 +273,20 @@ public class NewContainerTargetWizardPage extends WizardPage
|
|||
setErrorMessage(Messages.NewContainerTargetWizardPage_no_images);
|
||||
}
|
||||
if (c.getName().equals(connection.getName())) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
connection.removeImageListener(wizardPage);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
}
|
||||
Display.getDefault().syncExec(() -> {
|
||||
connection.removeImageListener(wizardPage);
|
||||
ArrayList<String> imageNames = new ArrayList<>();
|
||||
for (IDockerImage image : finalList) {
|
||||
java.util.List<String> tags = image.repoTags();
|
||||
if (tags != null) {
|
||||
for (String tag : tags) {
|
||||
imageNames.add(tag);
|
||||
}
|
||||
}
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(wizardPage);
|
||||
}
|
||||
|
||||
if (!imageCombo.isDisposed())
|
||||
imageCombo.setItems(imageNames.toArray(new String[0]));
|
||||
connection.addImageListener(wizardPage);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.floatingpoint;singleton:=true
|
||||
Bundle-Version: 1.0.1.qualifier
|
||||
Bundle-Version: 1.0.100.qualifier
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.debug.core;bundle-version="3.7.100",
|
||||
org.eclipse.debug.ui;bundle-version="3.8.1",
|
||||
|
|
|
@ -53,17 +53,13 @@ import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
|
|||
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.dialogs.IInputValidator;
|
||||
import org.eclipse.jface.dialogs.InputDialog;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.viewers.IBasicPropertyConstants;
|
||||
import org.eclipse.jface.window.Window;
|
||||
|
@ -121,49 +117,37 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
public FPRendering(String id) {
|
||||
super(id);
|
||||
|
||||
JFaceResources.getFontRegistry().addListener(new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
|
||||
FPRendering.this.fRendering
|
||||
.handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
|
||||
}
|
||||
JFaceResources.getFontRegistry().addListener(event -> {
|
||||
if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
|
||||
FPRendering.this.fRendering
|
||||
.handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
|
||||
}
|
||||
});
|
||||
|
||||
this.addPropertyChangeListener(new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
|
||||
if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
|
||||
return;
|
||||
this.addPropertyChangeListener(event -> {
|
||||
IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
|
||||
if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
|
||||
return;
|
||||
|
||||
Object address = event.getNewValue();
|
||||
Object address = event.getNewValue();
|
||||
|
||||
if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
|
||||
&& address instanceof BigInteger) {
|
||||
FPRendering.this.fRendering.ensureVisible((BigInteger) address);
|
||||
}
|
||||
if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
|
||||
&& address instanceof BigInteger) {
|
||||
FPRendering.this.fRendering.ensureVisible((BigInteger) address);
|
||||
}
|
||||
});
|
||||
|
||||
FPRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
disposeColors();
|
||||
allocateColors();
|
||||
applyPreferences();
|
||||
}
|
||||
FPRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
|
||||
disposeColors();
|
||||
allocateColors();
|
||||
applyPreferences();
|
||||
});
|
||||
|
||||
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
|
||||
if (FPRendering.this.fRendering != null) {
|
||||
setRenderingPadding((String) event.getNewValue());
|
||||
FPRendering.this.fRendering.redrawPanes();
|
||||
}
|
||||
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
|
||||
if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
|
||||
if (FPRendering.this.fRendering != null) {
|
||||
setRenderingPadding((String) event.getNewValue());
|
||||
FPRendering.this.fRendering.redrawPanes();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -221,13 +205,10 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
* We use the UI dispatch thread to protect the proxy information. Even though I believe the
|
||||
* dispose routine is always called in the UI dispatch thread. I am going to make sure.
|
||||
*/
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (fModel != null) {
|
||||
fModel.removeModelChangedListener(FPRendering.this);
|
||||
fModel.dispose();
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
if (fModel != null) {
|
||||
fModel.removeModelChangedListener(FPRendering.this);
|
||||
fModel.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -246,29 +227,26 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
*/
|
||||
final IModelProxyFactory factory = (IModelProxyFactory) DebugPlugin.getAdapter(block, IModelProxyFactory.class);
|
||||
if (factory != null) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
|
||||
/*
|
||||
* The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
|
||||
* to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
|
||||
*/
|
||||
IMemoryRenderingSite site = container.getMemoryRenderingSite();
|
||||
MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
|
||||
FPRendering.this);
|
||||
|
||||
/*
|
||||
* Get a new proxy and perform the initialization sequence so we are known the
|
||||
* the model provider.
|
||||
*/
|
||||
fModel = factory.createModelProxy(block, context);
|
||||
if (fModel != null) {
|
||||
fModel.installed(null);
|
||||
fModel.addModelChangedListener(FPRendering.this);
|
||||
}
|
||||
/*
|
||||
* The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
|
||||
* to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
|
||||
*/
|
||||
IMemoryRenderingSite site = container.getMemoryRenderingSite();
|
||||
MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
|
||||
FPRendering.this);
|
||||
|
||||
/*
|
||||
* Get a new proxy and perform the initialization sequence so we are known the
|
||||
* the model provider.
|
||||
*/
|
||||
fModel = factory.createModelProxy(block, context);
|
||||
if (fModel != null) {
|
||||
fModel.installed(null);
|
||||
fModel.addModelChangedListener(FPRendering.this);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -605,12 +583,7 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
{
|
||||
@Override
|
||||
public void run() {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FPRendering.this.fRendering.copyAddressToClipboard();
|
||||
}
|
||||
});
|
||||
Display.getDefault().asyncExec(() -> FPRendering.this.fRendering.copyAddressToClipboard());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -621,12 +594,8 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
{
|
||||
@Override
|
||||
public void run() {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FPRendering.this.fRendering.gotoAddress(FPRendering.this.fRendering.fBaseAddress);
|
||||
}
|
||||
});
|
||||
Display.getDefault().asyncExec(
|
||||
() -> FPRendering.this.fRendering.gotoAddress(FPRendering.this.fRendering.fBaseAddress));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -636,21 +605,18 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
{
|
||||
@Override
|
||||
public void run() {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// For compatibility with DSF update modes (hopefully this will either be replaced
|
||||
// by an enhanced platform interface or the caching will move out of the data layer)
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
// For compatibility with DSF update modes (hopefully this will either be replaced
|
||||
// by an enhanced platform interface or the caching will move out of the data layer)
|
||||
|
||||
try {
|
||||
Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
|
||||
if (m != null)
|
||||
m.invoke(fRendering.getMemoryBlock(), new Object[0]);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
FPRendering.this.fRendering.refresh();
|
||||
try {
|
||||
Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
|
||||
if (m != null)
|
||||
m.invoke(fRendering.getMemoryBlock(), new Object[0]);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
FPRendering.this.fRendering.refresh();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -826,24 +792,20 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
@Override
|
||||
public void run() {
|
||||
InputDialog inputDialog = new InputDialog(fRendering.getShell(), "Set Column Count", //$NON-NLS-1$
|
||||
"Please enter column count", "", new IInputValidator() //$NON-NLS-1$ //$NON-NLS-2$
|
||||
{
|
||||
@Override
|
||||
public String isValid(String input) {
|
||||
try {
|
||||
int index = Integer.parseInt(input);
|
||||
"Please enter column count", "", input -> {
|
||||
try {
|
||||
int index = Integer.parseInt(input);
|
||||
|
||||
if (index <= 0)
|
||||
return "Please enter a positive integer"; //$NON-NLS-1$
|
||||
|
||||
if (index > 200)
|
||||
return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
|
||||
} catch (NumberFormatException x) {
|
||||
if (index <= 0)
|
||||
return "Please enter a positive integer"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return null;
|
||||
if (index > 200)
|
||||
return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
|
||||
} catch (NumberFormatException x) {
|
||||
return "Please enter a positive integer"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
if (inputDialog.open() != Window.OK) {
|
||||
|
@ -927,104 +889,101 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
|
||||
// Add the right-mouse-click (RMC) context menu items
|
||||
|
||||
getPopupMenuManager().addMenuListener(new IMenuListener() {
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
manager.add(new Separator());
|
||||
getPopupMenuManager().addMenuListener(manager -> {
|
||||
manager.add(new Separator());
|
||||
|
||||
MenuManager sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PANES")); //$NON-NLS-1$
|
||||
MenuManager sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PANES")); //$NON-NLS-1$
|
||||
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.ENDIAN")); //$NON-NLS-1$
|
||||
sub.add(actionDisplayBigEndian);
|
||||
sub.add(actionDisplayLittleEndian);
|
||||
manager.add(sub);
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.ENDIAN")); //$NON-NLS-1$
|
||||
sub.add(actionDisplayBigEndian);
|
||||
sub.add(actionDisplayLittleEndian);
|
||||
manager.add(sub);
|
||||
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.NUMBER_TYPE")); //$NON-NLS-1$
|
||||
sub.add(actionFloatingPoint32);
|
||||
sub.add(actionFloatingPoint64);
|
||||
manager.add(sub);
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.NUMBER_TYPE")); //$NON-NLS-1$
|
||||
sub.add(actionFloatingPoint32);
|
||||
sub.add(actionFloatingPoint64);
|
||||
manager.add(sub);
|
||||
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PRECISION")); //$NON-NLS-1$
|
||||
sub.add(actionDisplay4Digits);
|
||||
sub.add(actionDisplay8Digits);
|
||||
sub.add(actionDisplay16Digits);
|
||||
manager.add(sub);
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PRECISION")); //$NON-NLS-1$
|
||||
sub.add(actionDisplay4Digits);
|
||||
sub.add(actionDisplay8Digits);
|
||||
sub.add(actionDisplay16Digits);
|
||||
manager.add(sub);
|
||||
|
||||
// TODO: Add separator for FP group here: manager.add(new Separator());
|
||||
// TODO: Add separator for FP group here: manager.add(new Separator());
|
||||
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.COLUMN_COUNT")); //$NON-NLS-1$
|
||||
sub.add(displayColumnCountAuto);
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.COLUMN_COUNT")); //$NON-NLS-1$
|
||||
sub.add(displayColumnCountAuto);
|
||||
|
||||
for (int index = 0; index < displayColumnCounts.length; index++)
|
||||
sub.add(displayColumnCounts[index]);
|
||||
for (int index1 = 0; index1 < displayColumnCounts.length; index1++)
|
||||
sub.add(displayColumnCounts[index1]);
|
||||
|
||||
boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
|
||||
boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
|
||||
|
||||
for (int index = 0, j = 1; index < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; index++, j *= 2)
|
||||
currentCountIsCustom = (j != fRendering.getColumnsSetting());
|
||||
for (int index2 = 0, j = 1; index2 < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; index2++, j *= 2)
|
||||
currentCountIsCustom = (j != fRendering.getColumnsSetting());
|
||||
|
||||
if (currentCountIsCustom)
|
||||
sub.add(displayColumnCountCustomValue);
|
||||
if (currentCountIsCustom)
|
||||
sub.add(displayColumnCountCustomValue);
|
||||
|
||||
sub.add(displayColumnCountCustom);
|
||||
manager.add(sub);
|
||||
sub.add(displayColumnCountCustom);
|
||||
manager.add(sub);
|
||||
|
||||
// Update modes
|
||||
// Update modes
|
||||
|
||||
int updateMode = getRMCvalue(IFPRConstants.UPDATEMODE_KEY);
|
||||
int updateMode = getRMCvalue(IFPRConstants.UPDATEMODE_KEY);
|
||||
|
||||
final Action updateAlwaysAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
|
||||
IAction.AS_RADIO_BUTTON) {
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ALWAYS);
|
||||
}
|
||||
};
|
||||
updateAlwaysAction.setChecked(updateMode == Rendering.UPDATE_ALWAYS);
|
||||
final Action updateAlwaysAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
|
||||
IAction.AS_RADIO_BUTTON) {
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ALWAYS);
|
||||
}
|
||||
};
|
||||
updateAlwaysAction.setChecked(updateMode == Rendering.UPDATE_ALWAYS);
|
||||
|
||||
final Action updateOnBreakpointAction = new Action(
|
||||
FPRenderingMessages.getString("FPRendering.UPDATE_ON_BREAKPOINT"), IAction.AS_RADIO_BUTTON) //$NON-NLS-1$
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ON_BREAKPOINT);
|
||||
}
|
||||
};
|
||||
updateOnBreakpointAction.setChecked(updateMode == Rendering.UPDATE_ON_BREAKPOINT);
|
||||
final Action updateOnBreakpointAction = new Action(
|
||||
FPRenderingMessages.getString("FPRendering.UPDATE_ON_BREAKPOINT"), IAction.AS_RADIO_BUTTON) //$NON-NLS-1$
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ON_BREAKPOINT);
|
||||
}
|
||||
};
|
||||
updateOnBreakpointAction.setChecked(updateMode == Rendering.UPDATE_ON_BREAKPOINT);
|
||||
|
||||
final Action updateManualAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_MANUAL"), //$NON-NLS-1$
|
||||
IAction.AS_RADIO_BUTTON) {
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_MANUAL);
|
||||
}
|
||||
};
|
||||
updateManualAction.setChecked(updateMode == Rendering.UPDATE_MANUAL);
|
||||
final Action updateManualAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_MANUAL"), //$NON-NLS-1$
|
||||
IAction.AS_RADIO_BUTTON) {
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
|
||||
setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_MANUAL);
|
||||
}
|
||||
};
|
||||
updateManualAction.setChecked(updateMode == Rendering.UPDATE_MANUAL);
|
||||
|
||||
// Add menu
|
||||
// Add menu
|
||||
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.UPDATEMODE")); //$NON-NLS-1$
|
||||
sub.add(updateAlwaysAction);
|
||||
sub.add(updateOnBreakpointAction);
|
||||
sub.add(updateManualAction);
|
||||
manager.add(sub);
|
||||
manager.add(new Separator());
|
||||
sub = new MenuManager(FPRenderingMessages.getString("FPRendering.UPDATEMODE")); //$NON-NLS-1$
|
||||
sub.add(updateAlwaysAction);
|
||||
sub.add(updateOnBreakpointAction);
|
||||
sub.add(updateManualAction);
|
||||
manager.add(sub);
|
||||
manager.add(new Separator());
|
||||
|
||||
BigInteger start = fRendering.getSelection().getStart();
|
||||
BigInteger end = fRendering.getSelection().getEnd();
|
||||
copyAction.setEnabled(start != null && end != null);
|
||||
BigInteger start = fRendering.getSelection().getStart();
|
||||
BigInteger end = fRendering.getSelection().getEnd();
|
||||
copyAction.setEnabled(start != null && end != null);
|
||||
|
||||
manager.add(copyAction);
|
||||
manager.add(copyAddressAction);
|
||||
manager.add(copyAction);
|
||||
manager.add(copyAddressAction);
|
||||
|
||||
manager.add(gotoBaseAddressAction);
|
||||
manager.add(refreshAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
}
|
||||
manager.add(gotoBaseAddressAction);
|
||||
manager.add(refreshAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1097,12 +1056,7 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
|
||||
@Override
|
||||
public void goToAddress(final BigInteger address) throws DebugException {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fRendering.gotoAddress(address);
|
||||
}
|
||||
});
|
||||
Display.getDefault().asyncExec(() -> fRendering.gotoAddress(address));
|
||||
}
|
||||
|
||||
protected void setTargetMemoryLittleEndian(boolean littleEndian) {
|
||||
|
@ -1145,27 +1099,19 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
|
|||
|
||||
if (adapter == IMemoryBlockConnection.class) {
|
||||
if (fConnection == null) {
|
||||
fConnection = new IMemoryBlockConnection() {
|
||||
@Override
|
||||
public void update() {
|
||||
// update UI asynchronously
|
||||
Display display = FPRenderingPlugin.getDefault().getWorkbench().getDisplay();
|
||||
display.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (fBigBaseAddress != FPRendering.this.fRendering.getMemoryBlock()
|
||||
.getBigBaseAddress()) {
|
||||
fBigBaseAddress = FPRendering.this.fRendering.getMemoryBlock()
|
||||
.getBigBaseAddress();
|
||||
FPRendering.this.fRendering.gotoAddress(fBigBaseAddress);
|
||||
}
|
||||
FPRendering.this.fRendering.refresh();
|
||||
} catch (DebugException e) {
|
||||
}
|
||||
fConnection = () -> {
|
||||
// update UI asynchronously
|
||||
Display display = FPRenderingPlugin.getDefault().getWorkbench().getDisplay();
|
||||
display.asyncExec(() -> {
|
||||
try {
|
||||
if (fBigBaseAddress != FPRendering.this.fRendering.getMemoryBlock().getBigBaseAddress()) {
|
||||
fBigBaseAddress = FPRendering.this.fRendering.getMemoryBlock().getBigBaseAddress();
|
||||
FPRendering.this.fRendering.gotoAddress(fBigBaseAddress);
|
||||
}
|
||||
});
|
||||
}
|
||||
FPRendering.this.fRendering.refresh();
|
||||
} catch (DebugException e) {
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -36,12 +36,7 @@ public class FPRenderingPreferenceAction extends ActionDelegate implements IView
|
|||
}
|
||||
|
||||
protected void showPreferencePage(String id, IPreferencePage page) {
|
||||
BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PreferencesUtil.createPreferenceDialogOn(FPRenderingPlugin.getShell(), id, new String[] { id }, null)
|
||||
.open();
|
||||
}
|
||||
});
|
||||
BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), () -> PreferencesUtil
|
||||
.createPreferenceDialogOn(FPRenderingPlugin.getShell(), id, new String[] { id }, null).open());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,6 @@ import org.eclipse.swt.events.ControlEvent;
|
|||
import org.eclipse.swt.events.ControlListener;
|
||||
import org.eclipse.swt.events.KeyAdapter;
|
||||
import org.eclipse.swt.events.KeyEvent;
|
||||
import org.eclipse.swt.events.PaintEvent;
|
||||
import org.eclipse.swt.events.PaintListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
|
@ -238,12 +236,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
getHorizontalBar().addSelectionListener(createHorizontalBarSelectionListener());
|
||||
getVerticalBar().addSelectionListener(createVerticalBarSelectinListener());
|
||||
|
||||
this.addPaintListener(new PaintListener() {
|
||||
@Override
|
||||
public void paintControl(PaintEvent pe) {
|
||||
pe.gc.setBackground(Rendering.this.getFPRendering().getColorBackground());
|
||||
pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
|
||||
}
|
||||
this.addPaintListener(pe -> {
|
||||
pe.gc.setBackground(Rendering.this.getFPRendering().getColorBackground());
|
||||
pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
|
||||
});
|
||||
|
||||
setLayout();
|
||||
|
@ -560,24 +555,16 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
|
||||
protected void handleSuspend(boolean isBreakpointHit) {
|
||||
if (getUpdateMode() == UPDATE_ALWAYS || (getUpdateMode() == UPDATE_ON_BREAKPOINT && isBreakpointHit)) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
archiveDeltas();
|
||||
refresh();
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
archiveDeltas();
|
||||
refresh();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleChange() {
|
||||
if (getUpdateMode() == UPDATE_ALWAYS) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
Display.getDefault().asyncExec(() -> refresh());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -859,205 +846,202 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
fCache.end = endAddress;
|
||||
fCache.bytes = cachedBytesFinal;
|
||||
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Generate deltas
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
// Generate deltas
|
||||
|
||||
for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
|
||||
if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
|
||||
BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
|
||||
BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
|
||||
.subtract(BigInteger.ONE);
|
||||
for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
|
||||
if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
|
||||
BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
|
||||
BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
|
||||
.subtract(BigInteger.ONE);
|
||||
|
||||
BigInteger overlapLength = minEnd.subtract(maxStart);
|
||||
if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
|
||||
// there is overlap
|
||||
BigInteger overlapLength = minEnd.subtract(maxStart);
|
||||
if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
|
||||
// there is overlap
|
||||
|
||||
int offsetIntoOld = maxStart.subtract(fHistoryCache[historyIndex].start).intValue();
|
||||
int offsetIntoNew = maxStart.subtract(startAddress).intValue();
|
||||
int offsetIntoOld = maxStart.subtract(fHistoryCache[historyIndex].start).intValue();
|
||||
int offsetIntoNew = maxStart.subtract(startAddress).intValue();
|
||||
|
||||
for (int i = overlapLength.intValue(); i >= 0; i--) {
|
||||
cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
|
||||
cachedBytesFinal[offsetIntoNew + i]
|
||||
.getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld
|
||||
+ i].getValue());
|
||||
}
|
||||
for (int i = overlapLength.intValue(); i >= 0; i--) {
|
||||
cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
|
||||
cachedBytesFinal[offsetIntoNew + i]
|
||||
.getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld + i]
|
||||
.getValue());
|
||||
}
|
||||
|
||||
// There are several scenarios where the history cache must be updated from the data cache, so that when a
|
||||
// cell is edited the font color changes appropriately. The following code deals with the different cases.
|
||||
// There are several scenarios where the history cache must be updated from the data cache, so that when a
|
||||
// cell is edited the font color changes appropriately. The following code deals with the different cases.
|
||||
|
||||
if (historyIndex != 0)
|
||||
continue;
|
||||
if (historyIndex != 0)
|
||||
continue;
|
||||
|
||||
int dataStart = fCache.start.intValue();
|
||||
int dataEnd = fCache.end.intValue();
|
||||
int dataLength = fCache.bytes.length;
|
||||
int dataStart = fCache.start.intValue();
|
||||
int dataEnd = fCache.end.intValue();
|
||||
int dataLength = fCache.bytes.length;
|
||||
|
||||
int historyStart = fHistoryCache[0].start.intValue();
|
||||
int historyEnd = fHistoryCache[0].end.intValue();
|
||||
int historyLength = fHistoryCache[0].bytes.length;
|
||||
int historyStart = fHistoryCache[0].start.intValue();
|
||||
int historyEnd = fHistoryCache[0].end.intValue();
|
||||
int historyLength = fHistoryCache[0].bytes.length;
|
||||
|
||||
// Case 1: The data cache is smaller than the history cache; the data cache's
|
||||
// address range is fully covered by the history cache. Do nothing.
|
||||
// Case 1: The data cache is smaller than the history cache; the data cache's
|
||||
// address range is fully covered by the history cache. Do nothing.
|
||||
|
||||
if ((dataStart >= historyStart) && (dataEnd <= historyEnd))
|
||||
continue;
|
||||
if ((dataStart >= historyStart) && (dataEnd <= historyEnd))
|
||||
continue;
|
||||
|
||||
// Case 2: The data and history cache's do not overlap at all
|
||||
// Case 2: The data and history cache's do not overlap at all
|
||||
|
||||
if (((dataStart < historyStart) && (dataEnd < historyStart))
|
||||
|| (dataStart > historyEnd)) {
|
||||
// Create a new history cache: Copy the data cache bytes to the history cache
|
||||
if (((dataStart < historyStart) && (dataEnd < historyStart))
|
||||
|| (dataStart > historyEnd)) {
|
||||
// Create a new history cache: Copy the data cache bytes to the history cache
|
||||
|
||||
MemoryUnit newHistoryCache = new MemoryUnit();
|
||||
MemoryUnit newHistoryCache1 = new MemoryUnit();
|
||||
|
||||
newHistoryCache.start = fCache.start;
|
||||
newHistoryCache.end = fCache.end;
|
||||
int newHistoryCacheSize = fCache.bytes.length;
|
||||
newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
|
||||
newHistoryCache1.start = fCache.start;
|
||||
newHistoryCache1.end = fCache.end;
|
||||
int newHistoryCacheSize1 = fCache.bytes.length;
|
||||
newHistoryCache1.bytes = new FPMemoryByte[newHistoryCacheSize1];
|
||||
|
||||
for (int index = 0; index < newHistoryCacheSize; index++)
|
||||
newHistoryCache.bytes[index] = new FPMemoryByte(
|
||||
fCache.bytes[index].getValue());
|
||||
for (int index1 = 0; index1 < newHistoryCacheSize1; index1++)
|
||||
newHistoryCache1.bytes[index1] = new FPMemoryByte(
|
||||
fCache.bytes[index1].getValue());
|
||||
|
||||
fHistoryCache[0] = newHistoryCache;
|
||||
fHistoryCache[0] = newHistoryCache1;
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Case 3: The data cache starts at a lower address than the history cache, but overlaps the history cache
|
||||
// Case 3: The data cache starts at a lower address than the history cache, but overlaps the history cache
|
||||
|
||||
if ((dataStart < historyStart)
|
||||
&& ((dataEnd >= historyStart) && (dataEnd <= historyEnd))) {
|
||||
// Create a new history cache with the missing data from the main cache and append the old history to it.
|
||||
if ((dataStart < historyStart)
|
||||
&& ((dataEnd >= historyStart) && (dataEnd <= historyEnd))) {
|
||||
// Create a new history cache with the missing data from the main cache and append the old history to it.
|
||||
|
||||
int missingDataByteCount = historyStart - dataStart;
|
||||
int historyCacheSize = historyLength;
|
||||
int newHistoryCacheSize = missingDataByteCount + historyLength;
|
||||
int missingDataByteCount1 = historyStart - dataStart;
|
||||
int historyCacheSize1 = historyLength;
|
||||
int newHistoryCacheSize2 = missingDataByteCount1 + historyLength;
|
||||
|
||||
if (missingDataByteCount <= 0 && historyCacheSize <= 0)
|
||||
break;
|
||||
if (missingDataByteCount1 <= 0 && historyCacheSize1 <= 0)
|
||||
break;
|
||||
|
||||
MemoryUnit newHistoryCache = new MemoryUnit();
|
||||
MemoryUnit newHistoryCache2 = new MemoryUnit();
|
||||
|
||||
newHistoryCache.start = fCache.start;
|
||||
newHistoryCache.end = fHistoryCache[0].end;
|
||||
newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
|
||||
newHistoryCache2.start = fCache.start;
|
||||
newHistoryCache2.end = fHistoryCache[0].end;
|
||||
newHistoryCache2.bytes = new FPMemoryByte[newHistoryCacheSize2];
|
||||
|
||||
// Copy the missing bytes from the beginning of the main cache to the history cache.
|
||||
// Copy the missing bytes from the beginning of the main cache to the history cache.
|
||||
|
||||
for (int index = 0; index < missingDataByteCount; index++)
|
||||
newHistoryCache.bytes[index] = new FPMemoryByte(
|
||||
fCache.bytes[index].getValue());
|
||||
for (int index2 = 0; index2 < missingDataByteCount1; index2++)
|
||||
newHistoryCache2.bytes[index2] = new FPMemoryByte(
|
||||
fCache.bytes[index2].getValue());
|
||||
|
||||
// Copy the remaining bytes from the old history cache to the new history cache
|
||||
// Copy the remaining bytes from the old history cache to the new history cache
|
||||
|
||||
for (int index = 0; index < historyCacheSize; index++)
|
||||
newHistoryCache.bytes[index + missingDataByteCount] = new FPMemoryByte(
|
||||
fHistoryCache[0].bytes[index].getValue());
|
||||
for (int index3 = 0; index3 < historyCacheSize1; index3++)
|
||||
newHistoryCache2.bytes[index3 + missingDataByteCount1] = new FPMemoryByte(
|
||||
fHistoryCache[0].bytes[index3].getValue());
|
||||
|
||||
fHistoryCache[0] = newHistoryCache;
|
||||
fHistoryCache[0] = newHistoryCache2;
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Case 4: The data cache starts at a higher address than the history cache
|
||||
// Case 4: The data cache starts at a higher address than the history cache
|
||||
|
||||
if (((dataStart >= historyStart) && (dataStart <= historyEnd))
|
||||
&& (dataEnd > historyEnd)) {
|
||||
// Append the missing main cache bytes to the history cache.
|
||||
if (((dataStart >= historyStart) && (dataStart <= historyEnd))
|
||||
&& (dataEnd > historyEnd)) {
|
||||
// Append the missing main cache bytes to the history cache.
|
||||
|
||||
int missingDataByteCount = dataEnd - historyEnd;
|
||||
int historyCacheSize = historyEnd - historyStart;
|
||||
int newHistoryCacheSize = missingDataByteCount + historyLength;
|
||||
int missingDataByteCount2 = dataEnd - historyEnd;
|
||||
int historyCacheSize2 = historyEnd - historyStart;
|
||||
int newHistoryCacheSize3 = missingDataByteCount2 + historyLength;
|
||||
|
||||
if (missingDataByteCount > 0 && historyCacheSize > 0) {
|
||||
MemoryUnit newHistoryCache = new MemoryUnit();
|
||||
if (missingDataByteCount2 > 0 && historyCacheSize2 > 0) {
|
||||
MemoryUnit newHistoryCache3 = new MemoryUnit();
|
||||
|
||||
newHistoryCache.start = fHistoryCache[0].start;
|
||||
newHistoryCache.end = fCache.end;
|
||||
newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
|
||||
newHistoryCache3.start = fHistoryCache[0].start;
|
||||
newHistoryCache3.end = fCache.end;
|
||||
newHistoryCache3.bytes = new FPMemoryByte[newHistoryCacheSize3];
|
||||
|
||||
// Copy the old history bytes to the new history cache
|
||||
// Copy the old history bytes to the new history cache
|
||||
|
||||
System.arraycopy(fHistoryCache[0].bytes, 0, newHistoryCache.bytes, 0,
|
||||
historyLength);
|
||||
System.arraycopy(fHistoryCache[0].bytes, 0, newHistoryCache3.bytes, 0,
|
||||
historyLength);
|
||||
|
||||
// Copy the bytes from the main cache that are not in the history cache to the end of the new history cache.
|
||||
// Copy the bytes from the main cache that are not in the history cache to the end of the new history cache.
|
||||
|
||||
for (int index = 0; index < missingDataByteCount; index++) {
|
||||
int srcIndex = dataLength - missingDataByteCount + index;
|
||||
int dstIndex = historyLength + index;
|
||||
newHistoryCache.bytes[dstIndex] = new FPMemoryByte(
|
||||
fCache.bytes[srcIndex].getValue());
|
||||
}
|
||||
|
||||
fHistoryCache[0] = newHistoryCache;
|
||||
|
||||
continue;
|
||||
for (int index4 = 0; index4 < missingDataByteCount2; index4++) {
|
||||
int srcIndex = dataLength - missingDataByteCount2 + index4;
|
||||
int dstIndex = historyLength + index4;
|
||||
newHistoryCache3.bytes[dstIndex] = new FPMemoryByte(
|
||||
fCache.bytes[srcIndex].getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// Case 5 - The data cache is greater than the history cache and fully covers it
|
||||
|
||||
if (dataStart < historyStart && dataEnd > historyEnd) {
|
||||
int start = 0;
|
||||
int end = 0;
|
||||
|
||||
// Create a new history cache to reflect the entire data cache
|
||||
|
||||
MemoryUnit newHistoryCache = new MemoryUnit();
|
||||
|
||||
newHistoryCache.start = fCache.start;
|
||||
newHistoryCache.end = fCache.end;
|
||||
int newHistoryCacheSize = fCache.bytes.length;
|
||||
newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
|
||||
|
||||
int topByteCount = historyStart - dataStart;
|
||||
int bottomByteCount = dataEnd - historyEnd;
|
||||
|
||||
// Copy the bytes from the beginning of the data cache to the new history cache
|
||||
|
||||
for (int index = 0; index < topByteCount; index++)
|
||||
newHistoryCache.bytes[index] = new FPMemoryByte(
|
||||
fCache.bytes[index].getValue());
|
||||
|
||||
// Copy the old history cache bytes to the new history cache
|
||||
|
||||
start = topByteCount;
|
||||
end = topByteCount + historyLength;
|
||||
|
||||
for (int index = start; index < end; index++)
|
||||
newHistoryCache.bytes[index] = new FPMemoryByte(
|
||||
fCache.bytes[index].getValue());
|
||||
|
||||
// Copy the bytes from the end of the data cache to the new history cache
|
||||
|
||||
start = topByteCount + historyLength;
|
||||
end = topByteCount + historyLength + bottomByteCount;
|
||||
|
||||
for (int index = start; index < end; index++)
|
||||
newHistoryCache.bytes[index] = new FPMemoryByte(
|
||||
fCache.bytes[index].getValue());
|
||||
|
||||
fHistoryCache[0] = newHistoryCache;
|
||||
fHistoryCache[0] = newHistoryCache3;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Case 5 - The data cache is greater than the history cache and fully covers it
|
||||
|
||||
if (dataStart < historyStart && dataEnd > historyEnd) {
|
||||
int start = 0;
|
||||
int end = 0;
|
||||
|
||||
// Create a new history cache to reflect the entire data cache
|
||||
|
||||
MemoryUnit newHistoryCache4 = new MemoryUnit();
|
||||
|
||||
newHistoryCache4.start = fCache.start;
|
||||
newHistoryCache4.end = fCache.end;
|
||||
int newHistoryCacheSize4 = fCache.bytes.length;
|
||||
newHistoryCache4.bytes = new FPMemoryByte[newHistoryCacheSize4];
|
||||
|
||||
int topByteCount = historyStart - dataStart;
|
||||
int bottomByteCount = dataEnd - historyEnd;
|
||||
|
||||
// Copy the bytes from the beginning of the data cache to the new history cache
|
||||
|
||||
for (int index5 = 0; index5 < topByteCount; index5++)
|
||||
newHistoryCache4.bytes[index5] = new FPMemoryByte(
|
||||
fCache.bytes[index5].getValue());
|
||||
|
||||
// Copy the old history cache bytes to the new history cache
|
||||
|
||||
start = topByteCount;
|
||||
end = topByteCount + historyLength;
|
||||
|
||||
for (int index6 = start; index6 < end; index6++)
|
||||
newHistoryCache4.bytes[index6] = new FPMemoryByte(
|
||||
fCache.bytes[index6].getValue());
|
||||
|
||||
// Copy the bytes from the end of the data cache to the new history cache
|
||||
|
||||
start = topByteCount + historyLength;
|
||||
end = topByteCount + historyLength + bottomByteCount;
|
||||
|
||||
for (int index7 = start; index7 < end; index7++)
|
||||
newHistoryCache4.bytes[index7] = new FPMemoryByte(
|
||||
fCache.bytes[index7].getValue());
|
||||
|
||||
fHistoryCache[0] = newHistoryCache4;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If the history does not exist, populate the history with the just populated
|
||||
// cache. This solves the use case of (1) connect to target; (2) edit memory
|
||||
// before the first suspend debug event; (3) paint differences in changed color.
|
||||
|
||||
if (fHistoryCache[0] == null)
|
||||
fHistoryCache[0] = fCache.clone();
|
||||
|
||||
Rendering.this.redrawPanes();
|
||||
}
|
||||
|
||||
// If the history does not exist, populate the history with the just populated
|
||||
// cache. This solves the use case of (1) connect to target; (2) edit memory
|
||||
// before the first suspend debug event; (3) paint differences in changed color.
|
||||
|
||||
if (fHistoryCache[0] == null)
|
||||
fHistoryCache[0] = fCache.clone();
|
||||
|
||||
Rendering.this.redrawPanes();
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -1728,12 +1712,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
fParent.setTargetMemoryLittleEndian(littleEndian);
|
||||
fIsTargetLittleEndian = littleEndian;
|
||||
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fireSettingsChanged();
|
||||
layoutPanes();
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
fireSettingsChanged();
|
||||
layoutPanes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1747,12 +1728,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
fIsDisplayLittleEndian = isLittleEndian;
|
||||
fireSettingsChanged();
|
||||
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layoutPanes();
|
||||
}
|
||||
});
|
||||
Display.getDefault().asyncExec(() -> layoutPanes());
|
||||
}
|
||||
|
||||
public int getCharsPerColumn() {
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.memorybrowser;singleton:=true
|
||||
Bundle-Version: 1.3.1.qualifier
|
||||
Bundle-Version: 1.3.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.ui.memory.memorybrowser.MemoryBrowserPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -59,7 +59,6 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType;
|
|||
import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
|
@ -575,26 +574,18 @@ public class MemoryBrowser extends ViewPart
|
|||
renderingFinal.goToAddress(newBase);
|
||||
}
|
||||
|
||||
runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CTabItem selection = activeFolder.getSelection();
|
||||
selection.setData(KEY_EXPRESSION, expression);
|
||||
selection.setData(KEY_EXPRESSION_ADDRESS, newBase);
|
||||
fGotoAddressBar.handleExpressionStatus(Status.OK_STATUS);
|
||||
updateLabel(selection, renderingFinal);
|
||||
}
|
||||
runOnUIThread(() -> {
|
||||
CTabItem selection = activeFolder.getSelection();
|
||||
selection.setData(KEY_EXPRESSION, expression);
|
||||
selection.setData(KEY_EXPRESSION_ADDRESS, newBase);
|
||||
fGotoAddressBar.handleExpressionStatus(Status.OK_STATUS);
|
||||
updateLabel(selection, renderingFinal);
|
||||
});
|
||||
} catch (final DebugException e1) {
|
||||
// widgets update require Display
|
||||
runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fGotoAddressBar.handleExpressionStatus(
|
||||
new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
|
||||
Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)); //$NON-NLS-1$
|
||||
}
|
||||
});
|
||||
runOnUIThread(() -> fGotoAddressBar
|
||||
.handleExpressionStatus(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
|
||||
Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)));
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
@ -769,12 +760,7 @@ public class MemoryBrowser extends ViewPart
|
|||
private void hookContextMenu() {
|
||||
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
MemoryBrowser.this.fillContextMenu(manager);
|
||||
}
|
||||
});
|
||||
menuMgr.addMenuListener(manager -> MemoryBrowser.this.fillContextMenu(manager));
|
||||
Menu menu = menuMgr.createContextMenu(getControl());
|
||||
getControl().setMenu(menu);
|
||||
}
|
||||
|
@ -1097,86 +1083,82 @@ public class MemoryBrowser extends ViewPart
|
|||
*/
|
||||
private void updateTab(final IMemoryBlockRetrieval retrieval, final Object context, final String[] memorySpaces) {
|
||||
// GUI activity must be on the main thread
|
||||
runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (fGotoAddressBarControl.isDisposed() || fGotoMemorySpaceControl.isDisposed()) {
|
||||
return;
|
||||
runOnUIThread(() -> {
|
||||
if (fGotoAddressBarControl.isDisposed() || fGotoMemorySpaceControl.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
fGotoAddressBarControl.setVisible(true);
|
||||
|
||||
// If we've already created a tab folder for this retrieval
|
||||
// object, bring it to the forefront. Otherwise create the
|
||||
// folder.
|
||||
CTabFolder tabFolder = fContextFolders.get(retrieval);
|
||||
if (tabFolder != null) {
|
||||
fStackLayout.topControl = tabFolder;
|
||||
CTabItem tabItem = tabFolder.getSelection();
|
||||
if (tabItem != null) {
|
||||
getSite().getSelectionProvider()
|
||||
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
|
||||
}
|
||||
handleTabActivated(tabItem);
|
||||
} else {
|
||||
tabFolder = createTabFolder(fRenderingsComposite);
|
||||
tabFolder.addSelectionListener(new SelectionListener() {
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
}
|
||||
|
||||
fGotoAddressBarControl.setVisible(true);
|
||||
|
||||
// If we've already created a tab folder for this retrieval
|
||||
// object, bring it to the forefront. Otherwise create the
|
||||
// folder.
|
||||
CTabFolder tabFolder = fContextFolders.get(retrieval);
|
||||
if (tabFolder != null) {
|
||||
fStackLayout.topControl = tabFolder;
|
||||
CTabItem tabItem = tabFolder.getSelection();
|
||||
if (tabItem != null) {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
CTabItem tabItem = (CTabItem) e.item;
|
||||
updateMemorySpaceControlSelection(tabItem);
|
||||
fGotoAddressBar.loadSavedExpressions(context,
|
||||
fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
|
||||
getSite().getSelectionProvider()
|
||||
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
|
||||
handleTabActivated(tabItem);
|
||||
}
|
||||
handleTabActivated(tabItem);
|
||||
} else {
|
||||
tabFolder = createTabFolder(fRenderingsComposite);
|
||||
tabFolder.addSelectionListener(new SelectionListener() {
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
CTabItem tabItem = (CTabItem) e.item;
|
||||
updateMemorySpaceControlSelection(tabItem);
|
||||
fGotoAddressBar.loadSavedExpressions(context,
|
||||
fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
|
||||
getSite().getSelectionProvider()
|
||||
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
|
||||
handleTabActivated(tabItem);
|
||||
}
|
||||
});
|
||||
|
||||
tabFolder.setData(KEY_RETRIEVAL, retrieval);
|
||||
fContextFolders.put(retrieval, tabFolder);
|
||||
fStackLayout.topControl = tabFolder;
|
||||
}
|
||||
// update debug context to the new selection
|
||||
tabFolder.setData(KEY_CONTEXT, context);
|
||||
|
||||
final CTabFolder activeFolder = tabFolder;
|
||||
if (!activeFolder.equals(tabFolder)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't expose the memory spaces widget if there are none or
|
||||
// only one memory space involved.
|
||||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
|
||||
if (memorySpaces.length >= 2) {
|
||||
fGotoMemorySpaceControl.setItems(memorySpaces);
|
||||
|
||||
// Add the '----' (N/A) entry unless the retrieval object
|
||||
// says it requires a memory space ID in all cases
|
||||
boolean addNA = true;
|
||||
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
|
||||
addNA = !((IMemorySpaceAwareMemoryBlockRetrieval) retrieval)
|
||||
.creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
if (addNA) {
|
||||
fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0);
|
||||
}
|
||||
setMemorySpaceControlVisible(true);
|
||||
} else {
|
||||
fGotoMemorySpaceControl.setItems(new String[0]);
|
||||
setMemorySpaceControlVisible(false);
|
||||
}
|
||||
|
||||
updateMemorySpaceControlSelection(activeFolder.getSelection());
|
||||
fGotoAddressBar.loadSavedExpressions(context,
|
||||
fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
|
||||
|
||||
fStackLayout.topControl.getParent().layout(true);
|
||||
tabFolder.setData(KEY_RETRIEVAL, retrieval);
|
||||
fContextFolders.put(retrieval, tabFolder);
|
||||
fStackLayout.topControl = tabFolder;
|
||||
}
|
||||
// update debug context to the new selection
|
||||
tabFolder.setData(KEY_CONTEXT, context);
|
||||
|
||||
final CTabFolder activeFolder = tabFolder;
|
||||
if (!activeFolder.equals(tabFolder)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't expose the memory spaces widget if there are none or
|
||||
// only one memory space involved.
|
||||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
|
||||
if (memorySpaces.length >= 2) {
|
||||
fGotoMemorySpaceControl.setItems(memorySpaces);
|
||||
|
||||
// Add the '----' (N/A) entry unless the retrieval object
|
||||
// says it requires a memory space ID in all cases
|
||||
boolean addNA = true;
|
||||
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
|
||||
addNA = !((IMemorySpaceAwareMemoryBlockRetrieval) retrieval).creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
if (addNA) {
|
||||
fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0);
|
||||
}
|
||||
setMemorySpaceControlVisible(true);
|
||||
} else {
|
||||
fGotoMemorySpaceControl.setItems(new String[0]);
|
||||
setMemorySpaceControlVisible(false);
|
||||
}
|
||||
|
||||
updateMemorySpaceControlSelection(activeFolder.getSelection());
|
||||
fGotoAddressBar.loadSavedExpressions(context,
|
||||
fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
|
||||
|
||||
fStackLayout.topControl.getParent().layout(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1337,18 +1319,15 @@ public class MemoryBrowser extends ViewPart
|
|||
private void releaseTabFolder(final IMemoryBlockRetrieval retrieval) {
|
||||
final CTabFolder folder = fContextFolders.get(retrieval);
|
||||
if (folder != null) {
|
||||
Runnable run = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (CTabItem tab : folder.getItems()) {
|
||||
disposeTab(tab);
|
||||
}
|
||||
fContextFolders.remove(retrieval);
|
||||
folder.dispose();
|
||||
Runnable run = () -> {
|
||||
for (CTabItem tab : folder.getItems()) {
|
||||
disposeTab(tab);
|
||||
}
|
||||
fContextFolders.remove(retrieval);
|
||||
folder.dispose();
|
||||
|
||||
if (fStackLayout.topControl.equals(folder)) {
|
||||
handleUnsupportedSelection();
|
||||
}
|
||||
if (fStackLayout.topControl.equals(folder)) {
|
||||
handleUnsupportedSelection();
|
||||
}
|
||||
};
|
||||
runOnUIThread(run);
|
||||
|
|
|
@ -40,8 +40,6 @@ import org.eclipse.search.ui.ISearchQuery;
|
|||
import org.eclipse.search.ui.ISearchResult;
|
||||
import org.eclipse.search.ui.NewSearchUI;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.FormAttachment;
|
||||
|
@ -729,52 +727,34 @@ public class FindReplaceDialog extends SelectionDialog {
|
|||
fFormatDecimalButton.addSelectionListener(nonAsciiListener);
|
||||
fFormatByteSequenceButton.addSelectionListener(nonAsciiListener);
|
||||
|
||||
fStartText.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
boolean valid = true;
|
||||
try {
|
||||
getStartAddress();
|
||||
} catch (Exception ex) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
fStartText.setForeground(valid ? Display.getDefault().getSystemColor(SWT.COLOR_BLACK)
|
||||
: Display.getDefault().getSystemColor(SWT.COLOR_RED));
|
||||
|
||||
validate();
|
||||
fStartText.addModifyListener(e -> {
|
||||
boolean valid = true;
|
||||
try {
|
||||
getStartAddress();
|
||||
} catch (Exception ex) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
fStartText.setForeground(valid ? Display.getDefault().getSystemColor(SWT.COLOR_BLACK)
|
||||
: Display.getDefault().getSystemColor(SWT.COLOR_RED));
|
||||
|
||||
validate();
|
||||
});
|
||||
|
||||
fEndText.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
try {
|
||||
getEndAddress();
|
||||
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||
} catch (Exception ex) {
|
||||
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
|
||||
}
|
||||
|
||||
validate();
|
||||
fEndText.addModifyListener(e -> {
|
||||
try {
|
||||
getEndAddress();
|
||||
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||
} catch (Exception ex) {
|
||||
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
|
||||
}
|
||||
|
||||
validate();
|
||||
});
|
||||
|
||||
fFindText.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
fFindText.addModifyListener(e -> validate());
|
||||
|
||||
fReplaceText.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
fReplaceText.addModifyListener(e -> validate());
|
||||
|
||||
composite.setTabList(
|
||||
new Control[] { fFindText, fReplaceText, directionGroup, rangeGroup, formatGroup, optionsGroup, });
|
||||
|
@ -1137,40 +1117,35 @@ public class FindReplaceDialog extends SelectionDialog {
|
|||
final BigInteger finalCurrentPosition = currentPosition;
|
||||
final BigInteger finalStart = start;
|
||||
final BigInteger finalEnd = end;
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IMemoryRenderingContainer containers[] = getMemoryView()
|
||||
.getMemoryRenderingContainers();
|
||||
for (int i = 0; i < containers.length; i++) {
|
||||
IMemoryRendering rendering = containers[i].getActiveRendering();
|
||||
if (rendering instanceof IRepositionableMemoryRendering) {
|
||||
try {
|
||||
((IRepositionableMemoryRendering) rendering)
|
||||
.goToAddress(finalCurrentPosition);
|
||||
} catch (DebugException e) {
|
||||
MemorySearchPlugin.logError(
|
||||
Messages.getString(
|
||||
"FindReplaceDialog.RepositioningMemoryViewFailed"), //$NON-NLS-1$
|
||||
e);
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
IMemoryRenderingContainer containers[] = getMemoryView()
|
||||
.getMemoryRenderingContainers();
|
||||
for (int i = 0; i < containers.length; i++) {
|
||||
IMemoryRendering rendering = containers[i].getActiveRendering();
|
||||
if (rendering instanceof IRepositionableMemoryRendering) {
|
||||
try {
|
||||
((IRepositionableMemoryRendering) rendering)
|
||||
.goToAddress(finalCurrentPosition);
|
||||
} catch (DebugException e1) {
|
||||
MemorySearchPlugin.logError(
|
||||
Messages.getString(
|
||||
"FindReplaceDialog.RepositioningMemoryViewFailed"), //$NON-NLS-1$
|
||||
e1);
|
||||
}
|
||||
if (rendering != null) {
|
||||
// Temporary, until platform accepts/adds new interface for setting the selection
|
||||
try {
|
||||
Method m = rendering.getClass().getMethod("setSelection", //$NON-NLS-1$
|
||||
new Class[] { BigInteger.class, BigInteger.class });
|
||||
if (m != null)
|
||||
m.invoke(rendering, finalCurrentPosition,
|
||||
finalCurrentPosition.add(searchPhraseLength));
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
if (rendering != null) {
|
||||
// Temporary, until platform accepts/adds new interface for setting the selection
|
||||
try {
|
||||
Method m = rendering.getClass().getMethod("setSelection", //$NON-NLS-1$
|
||||
new Class[] { BigInteger.class, BigInteger.class });
|
||||
if (m != null)
|
||||
m.invoke(rendering, finalCurrentPosition,
|
||||
finalCurrentPosition.add(searchPhraseLength));
|
||||
} catch (Exception e2) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, Boolean.TRUE.toString());
|
||||
|
@ -1222,12 +1197,9 @@ public class FindReplaceDialog extends SelectionDialog {
|
|||
};
|
||||
|
||||
if (all && replaceData == null) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
NewSearchUI.activateSearchResultView();
|
||||
NewSearchUI.runQueryInBackground(query);
|
||||
}
|
||||
Display.getDefault().asyncExec(() -> {
|
||||
NewSearchUI.activateSearchResultView();
|
||||
NewSearchUI.runQueryInBackground(query);
|
||||
});
|
||||
} else {
|
||||
Job job = new Job("Searching memory for " + searchPhrase) { //$NON-NLS-1$
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue