@@ -216,6 +216,7 @@ def generate_uf2(target, source, env):
216
216
CXX = "%s-g++" % toolchain_tripple ,
217
217
GDB = "%s-gdb" % toolchain_tripple ,
218
218
OBJCOPY = "%s-objcopy" % toolchain_tripple ,
219
+ OBJDUMP = "%s-objdump" % toolchain_tripple ,
219
220
RANLIB = "%s-ranlib" % toolchain_tripple ,
220
221
SIZETOOL = "%s-size" % toolchain_tripple ,
221
222
@@ -281,6 +282,20 @@ def new_check_size(target, source, env):
281
282
print ("PSRAM: " + _format_available_bytes (used_psram , psram_len ))
282
283
env .CheckUploadSize = new_check_size
283
284
285
+ def gen_debug_listings (env ):
286
+ for opt , name in [("" , "" ), ("-S" , ".debug" )]:
287
+ env .AddPostAction (
288
+ "$BUILD_DIR/${PROGNAME}.elf" ,
289
+ env .VerboseAction (" " .join ([
290
+ "$OBJDUMP" ,
291
+ opt ,
292
+ "-d" ,
293
+ '"%s"' % "$BUILD_DIR/${PROGNAME}.elf" ,
294
+ ">" ,
295
+ '"%s"' % ("$BUILD_DIR/${PROGNAME}" + name + ".lst" )
296
+ ]), "Building $BUILD_DIR/${PROGNAME}" + name + ".lst" )
297
+ )
298
+
284
299
# Allow user to override via pre:script
285
300
if env .get ("PROGNAME" , "program" ) == "program" :
286
301
env .Replace (PROGNAME = "firmware" )
@@ -387,6 +402,7 @@ def new_check_size(target, source, env):
387
402
target_signed_bin = env .BinToSignedBin (join ("$BUILD_DIR" , "${PROGNAME}" ), target_firm )
388
403
env .Depends (target_signed_bin , "checkprogsize" )
389
404
env .Depends (target_firm , "checkprogsize" )
405
+ gen_debug_listings (env )
390
406
391
407
env .AddPlatformTarget ("buildfs" , target_firm , target_firm , "Build Filesystem Image" )
392
408
AlwaysBuild (env .Alias ("nobuild" , target_firm ))
0 commit comments