llvm.org GIT mirror llvm / 5544011
[docs][llvm-strings] Write llvm-strings documentation Previously we only had a stub document. Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D67554 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371984 91177308-0d34-0410-b5e6-96231b3b80d8 James Henderson a month ago
1 changed file(s) with 118 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
55 SYNOPSIS
66 --------
77
8 :program:`llvm-strings` [*options*]
8 :program:`llvm-strings` [*options*] [*input...*]
99
1010 DESCRIPTION
1111 -----------
1212
13 :program:`llvm-strings` is a tool that prints strings in files. The goal is to
14 make it a drop-in replacement for GNU's :program:`strings`.
13 :program:`llvm-strings` is a tool intended as a drop-in replacement for GNU's
14 :program:`strings`, which looks for printable strings in files and writes them
15 to the standard output stream. A printable string is any sequence of four (by
16 default) or more printable characters. The end of the file, or any other byte
17 terminates the current sequence.
18
19 :program:`llvm-strings` looks for strings in each ``input`` file specified.
20 Unlike GNU :program:`strings` it looks in the entire input file, regardless of
21 file format, rather than restricting the search to certain sections of object
22 files. If "``-``" is specified as an ``input``, or no ``input`` is specified,
23 the program reads from the standard input stream.
24
25 EXAMPLE
26 -------
27
28 .. code-block:: console
29
30 $ cat input.txt
31 bars
32 foo
33 wibble blob
34 $ llvm-strings input.txt
35 bars
36 wibble blob
37
38 OPTIONS
39 -------
40
41 .. option:: --all, -a
42
43 Silently ignored. Present for GNU :program:`strings` compatibility.
44
45 .. option:: --bytes=, -n
46
47 Set the minimum number of printable ASCII characters required for a sequence of
48 bytes to be considered a string. The default value is 4.
49
50 .. option:: --help, -h
51
52 Display a summary of command line options.
53
54 .. option:: --help-list
55
56 Display an uncategorized summary of command line options.
57
58 .. option:: --print-file-name, -f
59
60 Display the name of the containing file before each string.
61
62 Example:
63
64 .. code-block:: console
65
66 $ llvm-strings --print-file-name test.o test.elf
67 test.o: _Z5hellov
68 test.o: some_bss
69 test.o: test.cpp
70 test.o: main
71 test.elf: test.cpp
72 test.elf: test2.cpp
73 test.elf: _Z5hellov
74 test.elf: main
75 test.elf: some_bss
76
77 .. option:: --radix=, -t
78
79 Display the offset within the file of each string, before the string and using
80 the specified radix. Valid ```` values are ``o``, ``d`` and ``x`` for
81 octal, decimal and hexadecimal respectively.
82
83 Example:
84
85 .. code-block:: console
86
87 $ llvm-strings --radix=o test.o
88 1054 _Z5hellov
89 1066 .rela.text
90 1101 .comment
91 1112 some_bss
92 1123 .bss
93 1130 test.cpp
94 1141 main
95 $ llvm-strings --radix=d test.o
96 556 _Z5hellov
97 566 .rela.text
98 577 .comment
99 586 some_bss
100 595 .bss
101 600 test.cpp
102 609 main
103 $ llvm-strings -t x test.o
104 22c _Z5hellov
105 236 .rela.text
106 241 .comment
107 24a some_bss
108 253 .bss
109 258 test.cpp
110 261 main
111
112 .. option:: --version
113
114 Display the version of the :program:`llvm-strings` executable.
115
116 .. option:: @
117
118 Read command-line options from response file ````.
119
120 EXIT STATUS
121 -----------
122
123 :program:`llvm-strings` exits with a non-zero exit code if there is an error.
124 Otherwise, it exits with code 0.
125
126 BUGS
127 ----
128
129 To report bugs, please visit .