]> granicus.if.org Git - esp-idf/commitdiff
ldgen: add traceback in case of exception
authorRenz Christian Bagaporo <renz@espressif.com>
Tue, 27 Nov 2018 01:45:21 +0000 (09:45 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Wed, 28 Nov 2018 06:14:54 +0000 (14:14 +0800)
tools/ldgen/ldgen.py

index ca12fe8e87e87c65b9964a93201305df2d383741..25ce86e3c1cac23ef1f1f4b2a6c857ef0f5ea80b 100755 (executable)
@@ -17,6 +17,8 @@
 
 import argparse
 import os
+import traceback
+import sys
 
 from fragments import FragmentFileModel
 from sdkconfig import SDKConfig
@@ -95,6 +97,9 @@ def main():
         print("linker script generation failed for %s\nERROR: %s" % (input_file.name, e.message))
         # Delete the file so the entire build will fail; and not use an outdated script.
         os.remove(output_file.name)
+        # Print traceback and exit
+        traceback.print_exc()
+        sys.exit(1)
 
 if __name__ == "__main__":
     main()
\ No newline at end of file