@@ -261,23 +261,41 @@ private void createAndUpload(){
261
261
return ;
262
262
}
263
263
264
- String tc = "esp32" ;
265
- if (PreferencesData .get ("target_platform" ).contentEquals ("esp8266" )){
266
- tc = "lx106" ;
264
+ String core = PreferencesData .get ("target_platform" );
265
+ String tarch = "xtensa" ;
266
+ String target = "lx106" ;
267
+
268
+ if (core .contentEquals ("esp32" )){
269
+ try {
270
+ tarch = BaseNoGui .getBoardPreferences ().get ("build.tarch" );
271
+ if (tarch == null || tarch .contentEquals ("" )){
272
+ editor .statusError ("Arch Not Found for " +BaseNoGui .getBoardPreferences ().get ("name" ));
273
+ return ;
274
+ }
275
+ target = BaseNoGui .getBoardPreferences ().get ("build.target" );
276
+ if (target == null || target .contentEquals ("" )){
277
+ editor .statusError ("Target Not Found for " +BaseNoGui .getBoardPreferences ().get ("name" ));
278
+ return ;
279
+ }
280
+ } catch (Exception e ){
281
+ editor .statusError (e );
282
+ return ;
283
+ }
267
284
}
268
285
269
286
TargetPlatform platform = BaseNoGui .getTargetPlatform ();
287
+ String tc = tarch +"-" +target +"-elf" ;
270
288
271
- String gccPath = PreferencesData .get ("runtime.tools.xtensa- " +tc +"-elf -gcc.path" );
289
+ String gccPath = PreferencesData .get ("runtime.tools." +tc +"-gcc.path" );
272
290
if (gccPath == null ){
273
- gccPath = platform .getFolder () + "/tools/xtensa- " +tc + "-elf" ;
291
+ gccPath = platform .getFolder () + "/tools/" +tc ;
274
292
}
275
293
276
294
String gdb ;
277
295
if (PreferencesData .get ("runtime.os" ).contentEquals ("windows" ))
278
- gdb = "xtensa-" + tc +"-elf -gdb.exe" ;
296
+ gdb = tc +"-gdb.exe" ;
279
297
else
280
- gdb = "xtensa-" + tc +"-elf -gdb" ;
298
+ gdb = tc +"-gdb" ;
281
299
282
300
tool = new File (gccPath + "/bin" , gdb );
283
301
if (!tool .exists () || !tool .isFile ()) {
@@ -422,7 +440,7 @@ private void parseStackOrBacktrace(String regexp, boolean multiLine, String stri
422
440
}
423
441
424
442
// Anything looking like an instruction address, dump!
425
- Pattern p = Pattern .compile ("40 [0-2 ](\\ d|[a-f]|[A-F]){5 }\\ b" );
443
+ Pattern p = Pattern .compile ("4 [0-3 ](\\ d|[a-f]|[A-F]){6 }\\ b" );
426
444
int count = 0 ;
427
445
Matcher m = p .matcher (content );
428
446
while (m .find ()) {
@@ -486,11 +504,11 @@ private String decodeFunctionAtAddress( String addr ) {
486
504
// Scan and report the last failed memory allocation attempt, if present on the ESP8266
487
505
private void parseAlloc () {
488
506
String content = inputArea .getText ();
489
- Pattern p = Pattern .compile ("last failed alloc call: 40 [0-2 ](\\ d|[a-f]|[A-F]){5 }\\ ((\\ d)+\\ )" );
507
+ Pattern p = Pattern .compile ("last failed alloc call: 4 [0-3 ](\\ d|[a-f]|[A-F]){6 }\\ ((\\ d)+\\ )" );
490
508
Matcher m = p .matcher (content );
491
509
if (m .find ()) {
492
510
String fs = content .substring (m .start (), m .end ());
493
- Pattern p2 = Pattern .compile ("40 [0-2 ](\\ d|[a-f]|[A-F]){5 }\\ b" );
511
+ Pattern p2 = Pattern .compile ("4 [0-3 ](\\ d|[a-f]|[A-F]){6 }\\ b" );
494
512
Matcher m2 = p2 .matcher (fs );
495
513
if (m2 .find ()) {
496
514
String addr = fs .substring (m2 .start (), m2 .end ());
0 commit comments