Skip to content

Commit 2e23185

Browse files
author
Me No Dev
committed
fix case where elf might have cpp prefix
1 parent 287e0ce commit 2e23185

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/EspExceptionDecoder.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ private void createAndUpload(){
150150
editor.statusError("Not Supported on "+PreferencesData.get("target_platform"));
151151
return;
152152
}
153-
153+
154154
String tc = "esp108";
155155
if(PreferencesData.get("target_platform").contentEquals("esp8266")){
156156
tc = "lx106";
157157
}
158-
158+
159159
TargetPlatform platform = BaseNoGui.getTargetPlatform();
160-
160+
161161
String gccPath = PreferencesData.get("runtime.tools.xtensa-"+tc+"-elf-gcc.path");
162162
if(gccPath == null){
163163
gccPath = platform.getFolder() + "/tools/xtensa-"+tc+"-elf";
164164
}
165-
165+
166166
String addr2line;
167167
if(PreferencesData.get("runtime.os").contentEquals("windows"))
168168
addr2line = "xtensa-"+tc+"-elf-addr2line.exe";
@@ -178,9 +178,12 @@ private void createAndUpload(){
178178

179179
elf = new File(getBuildFolderPath(editor.getSketch()), editor.getSketch().getName() + ".ino.elf");
180180
if (!elf.exists() || !elf.isFile()) {
181-
editor.statusError("ERROR: "+editor.getSketch().getName() + ".ino.elf not found!");
182-
System.err.println("Did you forget to compile the sketch?");
183-
return;
181+
elf = new File(getBuildFolderPath(editor.getSketch()), editor.getSketch().getName() + ".cpp.elf");
182+
if (!elf.exists() || !elf.isFile()){
183+
editor.statusError("ERROR: neither "+editor.getSketch().getName() + ".ino.elf or "+editor.getSketch().getName() + ".cpp.elf were found!");
184+
System.err.println("Did you forget to compile the sketch?");
185+
return;
186+
}
184187
}
185188

186189
JFrame.setDefaultLookAndFeelDecorated(true);

0 commit comments

Comments
 (0)