forwarding compilation output with exception
This commit is contained in:
parent
afcbbac7b7
commit
86f50ae5ce
1 changed files with 13 additions and 6 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ContikiMoteType.java,v 1.11 2007/04/03 16:18:05 fros4943 Exp $
|
* $Id: ContikiMoteType.java,v 1.12 2007/05/10 17:01:02 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
|
@ -42,6 +42,8 @@ import org.apache.log4j.Logger;
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
|
||||||
import se.sics.cooja.*;
|
import se.sics.cooja.*;
|
||||||
|
import se.sics.cooja.MoteType.MoteTypeCreationException;
|
||||||
|
import se.sics.cooja.dialogs.MessageList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Contiki mote type holds the native library used to communicate with an
|
* The Contiki mote type holds the native library used to communicate with an
|
||||||
|
@ -195,22 +197,26 @@ public class ContikiMoteType implements MoteType {
|
||||||
try {
|
try {
|
||||||
ContikiMoteTypeDialog.generateSourceFile(identifier, sensors, coreInterfaces, processes);
|
ContikiMoteTypeDialog.generateSourceFile(identifier, sensors, coreInterfaces, processes);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new MoteTypeCreationException("Error during main source file generation: " + e.getMessage());
|
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
||||||
|
"Error during main source file generation: " + e.getMessage()).initCause(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile library
|
// Compile library
|
||||||
|
MessageList taskOutput = new MessageList();
|
||||||
boolean compilationSucceded = ContikiMoteTypeDialog.compileLibrary(
|
boolean compilationSucceded = ContikiMoteTypeDialog.compileLibrary(
|
||||||
identifier,
|
identifier,
|
||||||
new File(contikiBaseDir),
|
new File(contikiBaseDir),
|
||||||
compilationFiles,
|
compilationFiles,
|
||||||
hasSystemSymbols,
|
hasSystemSymbols,
|
||||||
null,
|
taskOutput.getInputStream(MessageList.NORMAL),
|
||||||
null);
|
taskOutput.getInputStream(MessageList.ERROR));
|
||||||
if (!libFile.exists() || !depFile.exists() || !mapFile.exists())
|
if (!libFile.exists() || !depFile.exists() || !mapFile.exists())
|
||||||
compilationSucceded = false;
|
compilationSucceded = false;
|
||||||
|
|
||||||
if (!compilationSucceded) {
|
if (!compilationSucceded) {
|
||||||
throw new MoteTypeCreationException("Error during compilation");
|
MoteTypeCreationException ex = new MoteTypeCreationException("Compilation error");
|
||||||
|
ex.setCompilationOutput(taskOutput);
|
||||||
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load compiled library
|
// Load compiled library
|
||||||
|
@ -285,7 +291,8 @@ public class ContikiMoteType implements MoteType {
|
||||||
offsetRelToAbs = getReferenceAbsAddr()
|
offsetRelToAbs = getReferenceAbsAddr()
|
||||||
- getRelVarAddr(mapFileData, "referenceVar");
|
- getRelVarAddr(mapFileData, "referenceVar");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new MoteTypeCreationException("JNI call error: " + e.getMessage());
|
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
||||||
|
"JNI call error: " + e.getMessage()).initCause(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse addresses of data and BSS memory sections
|
// Parse addresses of data and BSS memory sections
|
||||||
|
|
Loading…
Add table
Reference in a new issue