From: Niclas F. <ni...@us...> - 2011-11-30 18:26:34
|
The branch "master" has been updated via 59ec3a960192592e3168fe6b5fcebfc44cfc7950 (commit) from d9d36d4f953dd0107a7be8484f23f2ce7d7cb1b2 (commit) Changed paths: M se/sics/mspsim/debug/DwarfReader.java - Log ----------------------------------------------------------------- commit 59ec3a960192592e3168fe6b5fcebfc44cfc7950 Author: Paolo Pettinato <pa...@si...> Date: Fri Oct 28 13:42:22 2011 +0200 Fixed bug giving NullPointerException in Cooja MSPCodeWatcher diff --git a/se/sics/mspsim/debug/DwarfReader.java b/se/sics/mspsim/debug/DwarfReader.java index ab34949..be49df5 100644 --- a/se/sics/mspsim/debug/DwarfReader.java +++ b/se/sics/mspsim/debug/DwarfReader.java @@ -376,7 +376,7 @@ public DebugInfo getDebugInfo(int address) { if (address <= end && address >= start) { for (int j = 0; j < data.lineEntries.length; j++) { if (data.lineEntries[j].address >= address) { - return new DebugInfo(data.lineEntries[j].line, ".", data.sourceFiles[0], "* not available"); + return new DebugInfo(data.lineEntries[j].line, "", data.sourceFiles[0], "* not available"); } } } @@ -385,10 +385,21 @@ public DebugInfo getDebugInfo(int address) { } public ArrayList<Integer> getExecutableAddresses() { - return null; + ArrayList<Integer> executableAddresses = new ArrayList<Integer>(); + for (LineData data: lineInfo) { + for (LineEntry entry: data.lineEntries) { + executableAddresses.add(entry.address); + } + } + return executableAddresses; } public String[] getSourceFiles() { - return null; + String[] sourceFilesArray = new String[lineInfo.size()]; + for (int i = 0; i < lineInfo.size(); i++) { + sourceFilesArray[i] = lineInfo.get(i).sourceFiles[0]; + } + + return sourceFilesArray; } } ----------------------------------------------------------------------- Summary of changes: se/sics/mspsim/debug/DwarfReader.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) hooks/post-receive -- mspsim |