Update README to use GitHub Actions Build Status
[Mograsim.git] / plugins / net.mograsim.plugin.core / src / net / mograsim / plugin / launch / MachineLaunchConfigType.java
index 9e94454..5622ca6 100644 (file)
@@ -11,8 +11,10 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IMemoryBlock;
 import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
 import org.eclipse.ui.statushandlers.StatusManager;
 
@@ -120,10 +122,15 @@ public class MachineLaunchConfigType extends LaunchConfigurationDelegate
                        memFile = Optional.of(project.getFile(initialRAMFileName));
                }
                MachineDebugTarget debugTarget = new MachineDebugTarget(launch, mpmFile, memFile, machineDefinition);
+               // TODO make selectable whether the machine starts paused or not
                debugTarget.suspend();
                debugTarget.setExecutionSpeed(1);
                machine = debugTarget.getMachine();
                machine.reset();
+
+               // Add the default Mograsim memory block to make it less confusing and more comfortable.
+               DebugPlugin.getDefault().getMemoryBlockManager()
+                               .addMemoryBlocks(new IMemoryBlock[] { new MainMemoryBlockExtension(debugTarget, "0", null) });
        }
 
 }
\ No newline at end of file