Skip to content

Commit c0bb16e

Browse files
authored
Revert "[symbolizer] Empty string is not an error" (#94424)
Reverts #92660 It needs more discussion.
1 parent 7db4e6c commit c0bb16e

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

llvm/test/tools/llvm-symbolizer/get-input-file.test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# If binary input file is not specified, llvm-symbolizer assumes it is the first
22
# item in the command.
33

4-
# No input items at all. Report an unknown line, but do not produce any output on stderr.
4+
# No input items at all, complain about missing input file.
55
RUN: echo | llvm-symbolizer 2>%t.1.err | FileCheck %s --check-prefix=NOSOURCE
6-
RUN: FileCheck --input-file=%t.1.err --implicit-check-not={{.}} --allow-empty %s
6+
RUN: FileCheck --input-file=%t.1.err --check-prefix=NOFILE %s
77

88
# Only one input item, complain about missing addresses.
99
RUN: llvm-symbolizer "foo" 2>%t.2.err | FileCheck %s --check-prefix=NOSOURCE
@@ -32,6 +32,8 @@ RUN: FileCheck --input-file=%t.7.err --check-prefix=BAD-QUOTE %s
3232
NOSOURCE: ??
3333
NOSOURCE-NEXT: ??:0:0
3434

35+
NOFILE: error: no input filename has been specified
36+
3537
NOADDR: error: 'foo': no module offset has been specified
3638

3739
NOTFOUND: error: 'foo': [[MSG]]

llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,6 @@ static void symbolizeInput(const opt::InputArgList &Args,
337337
object::BuildID BuildID(IncomingBuildID.begin(), IncomingBuildID.end());
338338
uint64_t Offset = 0;
339339
StringRef Symbol;
340-
341-
// An empty input string may be used to check if the process is alive and
342-
// responding to input. Do not emit a message on stderr in this case but
343-
// respond on stdout.
344-
if (InputString.empty()) {
345-
printUnknownLineInfo(ModuleName, Printer);
346-
return;
347-
}
348340
if (Error E = parseCommand(Args.getLastArgValue(OPT_obj_EQ), IsAddr2Line,
349341
StringRef(InputString), Cmd, ModuleName, BuildID,
350342
Symbol, Offset)) {

0 commit comments

Comments
 (0)