Skip to content

Commit 6b56a89

Browse files
committed
Display error message when wasm binary does not have an associated sourcemap
1 parent 59c7082 commit 6b56a89

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/kotlin/be/ugent/topl/mio/ui/StartScreen.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ open class StartScreen(config: DebuggerConfig) : AboutScreen(config) {
6464
recentProperties.setProperty("lastDir", chooser.selectedFile.parent)
6565
recentProperties.store(FileWriter(recentConfig), null)
6666
if(!startDebugger(chooser.selectedFile, emulatorCheckbox.isSelected, portComboBox.selectedItem as String?)) {
67-
JOptionPane.showMessageDialog(this, "Please select a port!", "Invalid port", JOptionPane.ERROR_MESSAGE)
6867
return@addActionListener
6968
}
7069
isVisible = false
@@ -80,10 +79,16 @@ open class StartScreen(config: DebuggerConfig) : AboutScreen(config) {
8079
}
8180
else {
8281
if (comPort == null) {
82+
JOptionPane.showMessageDialog(this, "Please select a port!", "Invalid port", JOptionPane.ERROR_MESSAGE)
8383
return false
8484
}
8585
SerialConnection(comPort)
8686
}
87+
val sourceMapFile = File(binary.path + ".map")
88+
if (!sourceMapFile.exists()) {
89+
JOptionPane.showMessageDialog(this, "File does not have an associated sourcemap (.map) file!", "Missing sourcemaps", JOptionPane.ERROR_MESSAGE)
90+
return false
91+
}
8792
val sourceMapping = AsSourceMapping(File(binary.path + ".map").readText())
8893
InteractiveDebugger(connection, config.symbolicWdcliPath, sourceMapping, binary.path, config = config)
8994
return true

0 commit comments

Comments
 (0)