📄 mtree.1
字号:
.TH MTREE 1 "3 April 1995".SH NAMEmtree \- call-graph printer for Standard (ANSI/ISO) C.SH SYNOPSIS.B mtree[.BI \-c indention] [.B \-C] [.BI \-D name =.cc +... ]+cc ..if n .ti +5[.BI \-D name = def.cc +... ] [+cc ..B \-g] [.B \-l] [.BI \-m file-margin].if n .ti +5.if t .ti +.5i[.B \-n] [.BI \-o output-file] [.BI \-r root-function].if n .ti +5[.BI \-S subst-file.cc +... ] [+cc ..B \-t] [.B \-w].if t .ti +.5i[.I input-file.cc +... ]+cc ..RE.LP.B mtree.BI \-f resp-file.TP.B mtree \-h.SH DESCRIPTION.LP.B mtreeaccepts.I Standard Cas input and prints one or more call graphs and an optional table ofcontents. Each call graph is printed as an annotated, indented tree offunction names. Once the tree for the root-function has been printed,.B mtreeprints call trees for functions that have not yet taken part in a calltree. This is especially useful for function libraries, where there isnot just one root function..LPInput is taken from the list of.IR input-file sthat are named on the command line. If no.IR input-file sare specified, input is taken from standard input. Output is written tostandard output or, if the.B \-ooption is used, to the.IR output-file ..SH OPTIONSOptions may appear in any order and may be interspersed with.IR input-file s.There are no spaces between an option and its argument. Options cannot becombined into a single argument..TP.BI \-c indentionNumber of columns to indent each call level. For example,.B \-c8causes.B mtreeto indent each level by eight columns. The default is by four columns..TP.B \-CCauses the input stream to be interspersed with the output stream..TP.BI \-D name =Remove all occurences of.I namefrom the input stream. Can be repeated any number of times..TP.BI \-D name = defReplace all occurences of.I namein the input stream with.IR def .Can be repeated any number of times. The.B \-Doption may be enough to convert any compiler-specific extensions you areusing to something that.B mtreeunderstands as Standard C syntax. For example, since Borland uses.B cdeclin its.B stdio.hfile, I have to use the following command to get.B mtreeto accept it:.RS.IP.B mtree \-Dcdecl= trerules.i.RE.IPThis defines cdecl as a null string, effectively removing alloccurrences from the input stream. There may also be a situation where alexeme used in a declaration could be converted to another, as in thefollowing:.RS.IP.B mtree \-Dselector=int foo.i.RE.IPThe lexeme,.BR selector ,is a type specifier recognized by Intel's iRMX C compiler..IPDepending on which command-line interpreter, or shell, you are using,quoting a definition option may allow you to specify expansion textthat contains imbedded spaces, such as.B"\-Dulong=unsigned long".cc +.+cc ..TP.BI \-f resp-fileRead all command-line options from a.IR "response file" .For example,.BR \-fmtree.cmd ,causes.B mtreeto ignore any other arguments on the command line and use whateverarguments are in the file,.BR mtree.cmd .The arguments in this file can be specified on one or more lines. Any inputor output redirection must be specified on the command line,however. A response file is especially useful when.B mtreeis executed repeatedly with a large number of command-line arguments,such as file names or.B \-Doptions..TP.B \-gUse graphic characters for tree. The tree graphically connects callingfunctions with called functions. By default,.B mtreeuses ASCII characters to draw the tree lines so that its output isdisplayable on virtually all output devices. The.B \-goption overrides this behavior and causes.B mtreeto use line-draw characters from the.IR "IBM graphic character set" .Trees drawn with these characters look much nicer. Many printers,including laser printers, have a font that contains these characters.Use the.B \-noption if you do not want.B mtreeto draw the tree at all..TP.B \-hDisplay help..TP.B \-lIgnore calls to functions in the Standard C library, such as.BR printf() .This is useful if you want to consider these functions as part of thelanguage and do not want the call-graph cluttered with their calls..TP.BI \-m file-marginWidth of the left margin within which.B mtreeprints file names..B mtreeright-justifies the file name within this margin and truncates anyextras characters to the left so that some path information may be lost.This assures that at least the file name can be seen. The default.I file-marginis 12 columns. As an example,.B \-m20allows for a margin for potentially longer UNIX file names. Specify.B \-m0if you do not want the file name in the output..TP.B \-nDo not draw the calling-hierarchy tree. See the.B \-goption..TP.BI \-o output-fileRedirect output to a file, e.g.,.BR \-oout.txt .This is provided for environments such as VMS that do not havecommand-line redirection..TP.BI \-r root-functionIf a.I root-functionis specified, e.g.,.BR \-rlog_transaction ,.B mtreestarts the first tree with that function as its root. If not specified,.B mtreestarts with the function named.BI main .If there is no.B mainfunction,.B mtreestarts with the first function it encounters..TP.BI \-S subst-fileSubstitute.I input-filename. Since.B mtreereports the name of the.I input-fileand this may not be the name of theoriginal source file (for example, you ran the preprocessor on it butthe preprocessor did not generate line directives which would containthe name of the original file), the.B \-Soption can be used to specify the name of the original file, e.g.,.BR \-Smyfile.c .This option can be repeated so that each instance specifies a.I subst-filename for each.IR input-file ,respectively. If you entered this line:.RS.IP.B mtree \-Sa.c \-Sb.c a.i b.i.RE.IPthe.B mtreeoutput would use the name,.BR a.c ,for the first file.RB ( a.i )and.B b.cfor the second file.RB ( b.i )..TP.B \-tPrint table of contents after the call tree(s). This lists all functionsby file name along with the line number on which they are defined..BR mtree "'s"file, function, and line are analogous to a book's part, chapter, and page..TP.B \-wSuppress warning diagnostics..SH NOTES.LPThis is the man page for the.B mtreecall-graph printer that is part of the Metre source-code distribution..LP.B mtreerefers to lines by number in an.I input-fileunless it encounters a line directive, for example,.IP.B#line 5 "startup.c".LPor.IP.B# 503 "main.c" 2.LPIt replaces the current line number and file name with whatever is specifiedin the line directive. Some preprocessors can place line directives in theoutput file that relate back to the original source file. If yours can, youprobably want to instruct it to do so..LP.B mtreeignores preprocessor directives (from.B #to end-of-line) other than linedirectives, so if your preprocessor passes any through, such as.BR #pragmas ,everything should be okay. This could also be useful if youonly rely on the preprocessor for simple substitution. If so, you mightbe able to get away with running your C source file directly into.B mtreewithout being preprocessed..LPWhile this is a UNIX man page,.B mtreeis portable across operating systems. This explains references that may seemout of place or redundant for the UNIX environment, such as the.B \-ooption..SH "SEE ALSO"The man page or other documentation for your Standard C compiler orpreprocessor..LPThe documentation file,.BR metre.doc ,which accompanies the Metre source-code distribution..SH BUGSFor the name of a called function,.B mtreeuses the identifier immediately before the call's.RB "'" ( "'."This may give misleading results if a function is called through anexpression that yields a function pointer..LP.B mtreeignores duplicate function names. This only causes a problem if you haveidentically named functions in different files with interal linkage,e.g,.BR "static foo() {" ... } ..B mtreeignores the second and subsequent definitions of functions with the samename..LPWhile.B mtreerecognizes C comments, for example,.BR "/* a comment */" ,it does not recognizeC++ comments\-those that begin with.BR // ..LPThe.B \-Coption only works if.B mtreewas built with an MKS or AT&T lexer and not a flex or pclex lexer. Thelexer distributed with.B mtreeis an MKS lexer. If built with a flex or pclex lexer, this option is ignored..LP.B mtreedoes not perform preprocessing, so you should typically run your sourcethrough a preprocessor first and then run the output of the preprocessorinto.BR mtree ..LPAll typedefs are treated as if they have file scope..LPStructure members cannot have the same name as a visible typedef.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -