This is an archive of the discontinued LLVM Phabricator instance.

[docs][llvm-strings] Write llvm-strings documentation
ClosedPublic

Authored by jhenderson on Sep 13 2019, 7:51 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Sep 13 2019, 7:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2019, 7:51 AM
jhenderson edited reviewers, added: mmpozulp; removed: mmasten.Sep 13 2019, 7:51 AM
MaskRay added inline comments.Sep 13 2019, 7:56 PM
llvm/docs/CommandGuide/llvm-strings.rst
14 ↗(On Diff #220102)

POSIX.1-2017 has a brief description.

The strings utility shall look for printable strings in regular files and shall write those strings to standard output. A printable string is any sequence of four (by default) or more printable characters ...

If we follow its wording, we can merge this sentence with the sentence below:

A series of bytes is considered to be a string if it consists of printable ASCII characters and is at least 4 characters long, or another length as specified by the :option:--bytes option

16 ↗(On Diff #220102)

although there are some differences.

I assume you mean -a. Other binary utilities have differences with their GNU binutils counterparts, I am just wondering why you raise this point specifically for llvm-strings.

PS: Our behavior (always -a) conforms to POSIX:

-a Scan files in their entirety. If -a is not specified, it is implementation-defined what portion of each file is scanned for strings.

107 ↗(On Diff #220102)

Probably give an -t x example here.

jhenderson marked 2 inline comments as done.Sep 16 2019, 6:05 AM
jhenderson added inline comments.
llvm/docs/CommandGuide/llvm-strings.rst
16 ↗(On Diff #220102)

It's related to -a, but more generally, llvm-strings dumps all strings in all files, regardless of file format. I guess this sentence isn't really necessary.

107 ↗(On Diff #220102)

Instead of or in addition to --radix=x?

jhenderson marked 3 inline comments as done.

Address review comments:

  • Reword introduction to be a bit more concise, and more closely match the POSIX description.
  • Remove redundant comment about there being differences to GNU.
  • Change --radix=x example to use -t x.
MaskRay accepted this revision.Sep 16 2019, 6:38 AM
This revision is now accepted and ready to land.Sep 16 2019, 6:38 AM
This revision was automatically updated to reflect the committed changes.