Skip to content

Revert "[symbolizer] Empty string is not an error" #94424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/test/tools/llvm-symbolizer/get-input-file.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# If binary input file is not specified, llvm-symbolizer assumes it is the first
# item in the command.

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

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

NOFILE: error: no input filename has been specified

NOADDR: error: 'foo': no module offset has been specified

NOTFOUND: error: 'foo': [[MSG]]
Expand Down
8 changes: 0 additions & 8 deletions llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,6 @@ static void symbolizeInput(const opt::InputArgList &Args,
object::BuildID BuildID(IncomingBuildID.begin(), IncomingBuildID.end());
uint64_t Offset = 0;
StringRef Symbol;

// An empty input string may be used to check if the process is alive and
// responding to input. Do not emit a message on stderr in this case but
// respond on stdout.
if (InputString.empty()) {
printUnknownLineInfo(ModuleName, Printer);
return;
}
if (Error E = parseCommand(Args.getLastArgValue(OPT_obj_EQ), IsAddr2Line,
StringRef(InputString), Cmd, ModuleName, BuildID,
Symbol, Offset)) {
Expand Down
Loading