[llvm] [symbolizer] Empty string is not an error (PR #92660)

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 09:01:36 PDT 2024


spavloff wrote:

> A simpler proposal: `ECHO` is only supported when not passing `--obj`, in which case it is unambiguous.

Is there a reason why users, who don't pass `--obj`, do not need this facility?

> An argument of just 'ECHO' is treated as a symbol.
As an optional extension, if possible and desired, we could have it treated as an ECHO command with no additional characters, if the symbol is not found, but I don't know how practical that would be to thread through the llvm-symbolizer architecture.

Meaning of a command should be definite and not depend on the content of inspected file.

> To be treated as a command, the argument must have at least one additional space after the ECHO

It would be a case of secret symbol, invisible but significant.

We need to be clear, what problem is being solved. Initially it was something like "llvm-symbolizer needs a method of checking its liveness, compatible with the previous versions". Adding a new command does not solve this problem, - if a user is can adapt their scripts for using the new command, they can adapt them for the reply `??:0`.

Now we have solutions for this problem:

- Existing implementation reacts for empty string with `??:0`. It however also produces some output on stderr, which is undesirable.
- The current patch. With it llvm-symbolizer also replies with `??:0` but does not put anything on stderr. It however is not compatible with the previous versions.
- A possible implementation, that echoes the input empty string. It aligns the behavior with the previous versions. The drawback is incompatibility with addr2line and empty line as reply, printing something visible would be better.

I would vote for this patch, - it is not invasive, as the specified behavior of llvm-symbolier does not change. However the the last variant is also reasonable.

https://github.com/llvm/llvm-project/pull/92660


More information about the llvm-commits mailing list