mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
bugfix: rescheduling mspsim-based after breakpoint stops simulation + disabled automatic CLI "trace" at exceptions
This commit is contained in:
parent
fa5f1f73ab
commit
bdda5f1c29
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: MspMote.java,v 1.37 2009/12/14 13:22:57 fros4943 Exp $
|
||||
* $Id: MspMote.java,v 1.38 2010/01/21 22:32:32 fros4943 Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.mspmote;
|
||||
@ -258,6 +258,7 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
|
||||
|
||||
this.myCpu = node.getCPU();
|
||||
this.myCpu.setMonitorExec(true);
|
||||
this.myCpu.setTrace(0); /* TODO Enable */
|
||||
|
||||
int[] memory = myCpu.getMemory();
|
||||
logger.info("Loading ELF from: " + fileELF.getAbsolutePath());
|
||||
@ -322,7 +323,8 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
|
||||
|
||||
if (stopNextInstruction) {
|
||||
stopNextInstruction = false;
|
||||
sendCLICommandAndPrint("trace 1000");
|
||||
/*sendCLICommandAndPrint("trace 1000");*/ /* TODO Enable */
|
||||
scheduleNextWakeup(t);
|
||||
throw new RuntimeException("MSPSim requested simulation stop");
|
||||
}
|
||||
|
||||
@ -334,8 +336,6 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
|
||||
throw new RuntimeException("Bad event ordering: " + lastExecute + " < " + t);
|
||||
}
|
||||
|
||||
/* TODO Poll mote interfaces? */
|
||||
|
||||
/* Execute MSPSim-based mote */
|
||||
/* TODO Try-catch overhead */
|
||||
try {
|
||||
@ -346,15 +346,13 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
|
||||
} catch (EmulationException e) {
|
||||
if (e.getMessage().startsWith("Bad operation")) {
|
||||
/* Experimental: print program counter history */
|
||||
sendCLICommandAndPrint("trace 1000");
|
||||
/*sendCLICommandAndPrint("trace 1000");*/ /* TODO Enable */
|
||||
}
|
||||
|
||||
throw (RuntimeException)
|
||||
new RuntimeException("Emulated exception: " + e.getMessage()).initCause(e);
|
||||
}
|
||||
|
||||
/* TODO Poll mote interfaces? */
|
||||
|
||||
/* Schedule wakeup */
|
||||
if (nextExecute <= t) {
|
||||
throw new RuntimeException(t + ": MSPSim requested early wakeup: " + nextExecute);
|
||||
|
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: MspBreakpointContainer.java,v 1.2 2009/06/17 13:06:55 fros4943 Exp $
|
||||
* $Id: MspBreakpointContainer.java,v 1.3 2010/01/21 22:32:32 fros4943 Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.mspmote.plugins;
|
||||
@ -187,7 +187,6 @@ public class MspBreakpointContainer implements WatchpointMote {
|
||||
protected void signalBreakpointTrigger(MspBreakpoint b) {
|
||||
if (b.stopsSimulation() && mspMote.getSimulation().isRunning()) {
|
||||
/* Stop simulation immediately */
|
||||
mspMote.getSimulation().stopSimulation();
|
||||
mspMote.stopNextInstruction();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user