]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/UserManuals/Trim_Utility_Man_Page.rtf
Fixed memory leak and buffer overrun for string op-code.
[mirror_edk2.git] / BaseTools / UserManuals / Trim_Utility_Man_Page.rtf
1 {\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052\deftab360{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fmodern\fprq1\fcharset0 Courier New;}{\f3\fswiss\fprq2\fcharset0 Arial;}}
2 {\colortbl ;\red8\green96\blue168;\red0\green0\blue0;}
3 {\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}}
4 {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Name\par
5 \pard\nowidctlpar\sb200\cf2\b0\fs18 Trim.exe or Trim.py \endash Convert the preprocessed source files by C compiler to the expected style file to be processed further by EDKII tool.\f1\par
6 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\tx1440\cf1\b\f0\fs28 Synopsis\par
7 \pard\nowidctlpar\sb200\cf2\fs18 trim [-s|-r|-a|-8] [-c] [-v|-d <debug_level>|-q] [-o <output_file>] <input_file>\f1\par
8 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\f0\fs28 Description\par
9 \pard\nowidctlpar\sb200\cf2\b0\fs18 Trim tool is used to process the preprocessed file by Compiler to remove the unused content to generate the file to be processed further by EDKII tools.\f1\par
10 \f0 Trim tool can also be used to process the source file to generate the expected source file to work with EDKII build system and EDKII core code. \f1\par
11 \f0 Trim tool is a usual tool to process the source file to generate the file that can be used in EDKII build system. It extends EDKII build system to support more source file type.\f1\par
12 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Options\par
13 \pard\nowidctlpar\sb200\cf2\fs18 input_file\par
14 \tab\b0 The input file may be the preprocessed source code, the preprocessed VFR file, ASL file or R8 framework source file.\f1\par
15 \b\f0 -s, --source-code \par
16 \pard\li360\b0 The input file is preprocessed source code, including C or assembly code. All generated codes from the include header files are remove all. Only content in source file is kept.\f1\par
17 \pard\nowidctlpar\sb200\b\f0 -r, --vfr-file \par
18 \pard\li360\b0 The input file is preprocessed VFR file. All generated codes from the include header files are remove except for the typedef structure.\f1\par
19 \pard\nowidctlpar\sb200\b\f0 -a, --asl-file \par
20 \pard\fi360\b0 The input file is ASL file. The asl source include style Include(*.asi) will be changed to C style #include *.asi. The preprocessed asl file can be preprocessed by C compiler. \f1\par
21 \pard\nowidctlpar\sb200\b\f0 -8, --r8-source-code \par
22 \pard\li360\b0 The input file is the EDK style source code to be trimmed for ECP platform. Some EDK framework source file will be modified to work with EDKII thunk and core drivers. A window script tool \ldblquote ImportTool.bat\rdblquote is created to process a group of EDK framework source files in the same file directory. \cf0\f2\fs20\par
23 \pard\nowidctlpar\sb200\cf2\b\f0\fs18 -c, --convert-hex \par
24 \pard\fi360\b0 Convert standard hex format (0xabcd) to MASM format (abcdh).\f1\par
25 \pard\nowidctlpar\sb200\b\f0 -o OUTPUTFILE, --output=OUTPUTFILE\par
26 \pard\fi360\b0 The output file is to store the trimmed content.\f1\par
27 \pard\nowidctlpar\sb200\b\f0 -v, --verbose\f1\par
28 \b0\f0 \tab Run with verbose information.\f1\par
29 \b\f0 -d LOGLEVEL, --debug=LOGLEVEL [0-9]\f1\par
30 \pard\nowidctlpar\fi360\sb200\b0\f0 Enable debug messages at specified level.\par
31 \pard\nowidctlpar\sb200\b -q, --quiet\f1\par
32 \pard\nowidctlpar\fi360\sb200\b0\f0 Run with little information in quiet mode.\f1\par
33 \pard\nowidctlpar\sb200\b\f0 --version\f1\par
34 \pard\nowidctlpar\fi360\sb200\b0\f0 Show program's version number and exit\par
35 \pard\nowidctlpar\sb200\b -h, -?, --help\par
36 \pard\nowidctlpar\li360\sb200\b0 Show this help message and exit\f1\par
37 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Example\par
38 \pard\nowidctlpar\sb200\cf2\b0\fs18 1. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.s) to the output file test.iii, which only contains the content in this source file (test.s).\f1\par
39 \b\f0 Trim --source-code -o test.iii test.i\f1\par
40 \b0\f0 2. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.asm) and convert standard hex format (0xabcd) to MASM format (abcdh) to the output file test.iii, which only contains the content in this source file (test.s).\par
41 \b Trim --source-code --convert-hex -o test.iii test.i\f1\par
42 \b0\f0 3. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.vfr) except for the typedef structures to the output file (test.iii).\f1\par
43 \b\f0 Trim --vfr-file -o test.iii test.i\f1\par
44 \b0\f0 4. Trim ASL source file (test.asl) to convert the ASL style Include(*.asi) to the C style #include *.asi. The update ASL will output to test.i.\f1\par
45 \b\f0 Trim --asl-file -o test.i test.asl\f1\par
46 \b0\f0 5. Modify an EDK style framework source file to work with EDKII thunk and core drivers.\f1\par
47 \b\f0 Trim --r8-source-code -o test.c test.c\f1\par
48 \b0\f0 5. Modify all EDK style framework source files (*.c and *.h) in current directory to work with EDKII thunk and core drivers by the script \ldblquote ImportTool.bat\rdblquote .\f1\par
49 \b\f0 ImportTool *.c\f1\par
50 \f0 ImportTool *.h\par
51 \f1\par
52 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\f0\fs28 Bugs\par
53 \pard\nowidctlpar\sb200\cf2\b0\fs18 No known bugs.\par
54 Report bugs to edk2-buildtools-devel@lists.sourceforge.net\f1\par
55 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Files\par
56 \pard\nowidctlpar\sb200\cf2\b0\fs18 None\par
57 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\fs28 See also\par
58 \pard\nowidctlpar\sb200\cf2\b0\fs18 None\par
59 \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\fs28 License\par
60 \pard\nowidctlpar\cf2\b0\fs18 Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\par
61 This program and the accompanying materials are licensed and made available \par
62 under the terms and conditions of the BSD License which accompanies this \par
63 distribution. The full text of the license may be found at\par
64 http://opensource.org/licenses/bsd-license.php\par
65 \par
66 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\par
67 \pard\nowidctlpar\sb200 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\par
68 \cf0\f1\par
69 \pard\nowidctlpar\f3\fs20\par
70 }
71