Revision: 18170
          http://sourceforge.net/p/edk2/code/18170
Author:   yingke
Date:     2015-08-06 08:05:59 +0000 (Thu, 06 Aug 2015)
Log Message:
-----------
BaseTools/Trim: Fixed a bug that cannot trim long values

The long value substitution must move to the front of
HEX substitution, and updated build_rule to add --trim-long

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Conf/build_rule.template
    trunk/edk2/BaseTools/Source/Python/Trim/Trim.py

Modified: trunk/edk2/BaseTools/Conf/build_rule.template
===================================================================
--- trunk/edk2/BaseTools/Conf/build_rule.template       2015-08-06 07:13:16 UTC 
(rev 18169)
+++ trunk/edk2/BaseTools/Conf/build_rule.template       2015-08-06 08:05:59 UTC 
(rev 18170)
@@ -185,7 +185,7 @@
 
     <Command.MSFT, Command.INTEL>
         "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
-        Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii 
${d_path}(+)${s_base}.i
+        Trim --source-code --convert-hex --trim-long -o 
${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
         "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) 
${d_path}(+)${s_base}.iii
 
     <Command.GCC, Command.RVCT>
@@ -460,7 +460,7 @@
 
     <Command.MSFT, Command.INTEL>
         "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
-        Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii 
${d_path}(+)${s_base}.i
+        Trim --source-code --convert-hex --trim-long -o 
${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
         cd $(OUTPUT_DIR)(+)${s_dir}
         "$(ASM16)" /nologo /c /omf $(INC) 
/Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
         "$(ASMLINK)" $(ASMLINK_FLAGS) 
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,

Modified: trunk/edk2/BaseTools/Source/Python/Trim/Trim.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/Trim/Trim.py     2015-08-06 07:13:16 UTC 
(rev 18169)
+++ trunk/edk2/BaseTools/Source/Python/Trim/Trim.py     2015-08-06 08:05:59 UTC 
(rev 18170)
@@ -177,13 +177,13 @@
             EdkLogger.verbose("Found original file content starting from line 
%d"
                               % (LineIndexOfOriginalFile + 1))
 
+        if TrimLong:
+            Line = gLongNumberPattern.sub(r"\1", Line)
         # convert HEX number format if indicated
         if ConvertHex:
             Line = gHexNumberPattern.sub(r"0\2h", Line)
         else:
             Line = gHexNumberPattern.sub(r"\1\2", Line)
-        if TrimLong:
-            Line = gLongNumberPattern.sub(r"\1", Line)
 
         # convert Decimal number format
         Line = gDecNumberPattern.sub(r"\1", Line)


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to