From fa5f1f73ab82f9f582ea54af8cc4fd7dccd8f044 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 21 Jan 2010 18:02:54 +0000 Subject: [PATCH] avoid java expection when debug pointer doesn't exist --- .../se/sics/cooja/mspmote/interfaces/MspDebugOutput.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/MspDebugOutput.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/MspDebugOutput.java index 48958d827..a8173f8a6 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/MspDebugOutput.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/MspDebugOutput.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MspDebugOutput.java,v 1.1 2010/01/21 17:43:59 fros4943 Exp $ + * $Id: MspDebugOutput.java,v 1.2 2010/01/21 18:02:54 fros4943 Exp $ */ package se.sics.cooja.mspmote.interfaces; @@ -72,6 +72,10 @@ public class MspDebugOutput extends Log { this.mote = (MspMote) mote; this.mem = (MspMoteMemory) this.mote.getMemory(); + if (!mem.variableExists(CONTIKI_POINTER)) { + /* Disabled */ + return; + } this.mote.getCPU().setBreakPoint(mem.getVariableAddress(CONTIKI_POINTER), new CPUMonitor() { public void cpuAction(int type, int adr, int data) { @@ -87,7 +91,6 @@ public class MspDebugOutput extends Log { } } }); - } private String extractString(MspMoteMemory mem, int address) {