If binary file specified as input with option --obj or -e is absent,
now llvm-addr2line exits immediately. This patch extends this behavior to
llvm-symbolizer. Previously llvm-symbolizer waited addresses from input
stream or command line in this case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
No strong feelings from me - doesn't seem like a super important thing to diverge from addr2line on, so probably god to be consistent?
LGTM. llvm-symbolizer --obj=unexisting's previous behavior of waiting on stdin seems a bit weird. Perhaps it's that way to mimic
% cat non-existent - cat: non-existent: No such file or directory <wait on stdin>
but I not sure that is a useful/desirable behavior...
There is a time-of-check-to-time-of-use issue, but probably not important.
LGTM.
llvm/test/tools/llvm-symbolizer/errors.test | ||
---|---|---|
1 ↗ | (On Diff #532450) | Note: I've moved this to input-file-err.test as the new name seems more specific about we use this test file. |
llvm/test/tools/llvm-symbolizer/output-style-json-code.test | ||
7 | If we want to keep the test but make it more useful, we can specify two addresses on the command line and see how the error is presented. With the changes, the output is one JSON object with Error. |
If binary file specified as input with option --obj or -e was absent, [...]
The paragraph can be changed to say that now llvm-addr2line exits immediately. This patch extends the behavior to llvm-symbolizer.
Consider mentioning the behavior change for --output-style=JSON as well.
llvm-symbolizer --output-style=JSON -e nonexistent
llvm/test/tools/llvm-symbolizer/output-style-json-code.test | ||
---|---|---|
7 | Both variants (old and new) are valid JSON files. When llvm-symbolizer processes address specified in command line, it also produces such JSON. I think this change in output could be considered as minor. |
llvm/test/tools/llvm-symbolizer/output-style-inlined.test | ||
---|---|---|
34–40 |
| |
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test | ||
1–3 | I think the point of this test was (in part) to show llvm-symbolizer's stdout output too. If that is now empty, you should check that explicitly. |
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test | ||
---|---|---|
1–3 | Previously the error message went to stderr, and the result of recognition to stdout. Now only error message presents. Attempt to feed empty stream to FileCheck results in error: FileCheck error: '<stdin>' is empty. |
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test | ||
---|---|---|
1–3 | If we want to explicitly test that stdout output is empty, we can use: not llvm-symbolizer ... 2> %t.err | count 0 FileCheck --input-file=%t.err |
llvm/test/tools/llvm-symbolizer/output-style-inlined.test | ||
---|---|---|
34–40 | Super-nit: delete the extra spacing between NOT-EXIST and llvm-symbolizer as per my previous inline edit. | |
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test | ||
4–5 | This comment looks stale? | |
6 | Rather than checking that some arbitrary error message is not emitted, better would be to make sure nothing is printed beyond what you expect, with --implicit-check-not={{.}}. (This would have the added benefit of not needing the count 0 call, if you wanted, although I think @MaskRay's suggestion is cleaner for checking that stdout is empty.) |
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test | ||
---|---|---|
3 | As @MaskRay suggested, please use --input-file rather than stdin redirection: it is easier to manually run this command using the suggested syntax. | |
6 | You misunderstand me. I meant adding --implicit-check-not in the FileCheck line that checked the combined stderr and stdout (which of necessity wouldn't be empty). However, I don't think it's necessary given you've adopted @MaskRay's suggestion. |