<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64362>64362</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [llvm-symbolizer] Regression when reading object from standard input
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bzEq
      </td>
    </tr>
</table>

<pre>
    For program
```
// foo.c
int main() {
  return 0;
}
```
Compiled with `clang -g foo.c`.
For `llvm-symbolizer` at version 15.0.4, it succeeds to print file name and line number
```
cat a.out | llvm-symbolizer --obj - 0x0000000000400560
main
foo.c:1:0
```
For `llvm-symbolizer` at trunk, it fails
```
cat a.out | /build/llvm-dev/build/default/bin/llvm-symbolizer --obj - 0x0000000000400560
llvm-symbolizer: /build/llvm-dev/llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:1450: bool llvm::DWARFDebugLine::Prologue::getFileNameByIndex(uint64_t, llvm::StringRef, FileLineInfoKind, std::string &, sys::path::Style) const: Assertion `(Kind == FileLineInfoKind::AbsoluteFilePath || Kind == FileLineInfoKind::RelativeFilePath) && "invalid FileLineInfo Kind"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /build/llvm-dev/build/default/bin/llvm-symbolizer --obj - 0x0000000000400560
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVMSupport.so.17git 0x00007f09a5e98be7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  libLLVMSupport.so.17git        0x00007f09a5e96a9e llvm::sys::RunSignalHandlers() + 238
2  libLLVMSupport.so.17git 0x00007f09a5e9927f
3  libpthread.so.0 0x00007f09a60c9cf0
4  libc.so.6                      0x00007f09a4ff4acf gsignal + 271
5  libc.so.6                      0x00007f09a4fc7ea5 abort + 295
6  libc.so.6                      0x00007f09a4fc7d79
7  libc.so.6 0x00007f09a4fed426
8  libLLVMDebugInfoDWARF.so.17git 0x00007f09a63e4848 llvm::DWARFDebugLine::Prologue::getFileNameByIndex(unsigned long, llvm::StringRef, llvm::DILineInfoSpecifier::FileLineInfoKind, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, llvm::sys::path::Style) const + 1128
9 libLLVMDebugInfoDWARF.so.17git 0x00007f09a63fc419 llvm::DWARFFormValue::getAsFile[abi:cxx11](llvm::DILineInfoSpecifier::FileLineInfoKind) const + 201
10 libLLVMDebugInfoDWARF.so.17git 0x00007f09a63f07ff llvm::DWARFDie::getDeclFile[abi:cxx11](llvm::DILineInfoSpecifier::FileLineInfoKind) const + 63
11 libLLVMDebugInfoDWARF.so.17git 0x00007f09a63b8b51 llvm::DWARFContext::getInliningInfoForAddress(llvm::object::SectionedAddress, llvm::DILineInfoSpecifier) + 561
12 libLLVMSymbolize.so.17git 0x00007f09a64a9517 llvm::symbolize::SymbolizableObjectFile::symbolizeInlinedCode(llvm::object::SectionedAddress, llvm::DILineInfoSpecifier, bool) const + 71
13 libLLVMSymbolize.so.17git 0x00007f09a64ae0db llvm::Expected<llvm::DIInliningInfo> llvm::symbolize::LLVMSymbolizer::symbolizeInlinedCodeCommon<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, llvm::object::SectionedAddress) + 171
14 libLLVMSymbolize.so.17git 0x00007f09a64ae029 llvm::symbolize::LLVMSymbolizer::symbolizeInlinedCode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, llvm::object::SectionedAddress) + 9
15 llvm-symbolizer 0x000000000020ba93
16 llvm-symbolizer 0x000000000020a627
17 llvm-symbolizer 0x00000000002092e4
18 libc.so.6                      0x00007f09a4fe0d85 __libc_start_main + 229
19 llvm-symbolizer 0x000000000020696e
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUWFtv47gV_jX0CzEGRd0f_ODYMTZothskiy3aF4Mij2TuUKRLUplkf31BSnbsTDIZt9MF1ggQizqX71z48dDMOdlpgAXKr1C-nrHB74xdNH9c_3vWGPG82BiL99Z0lvWIrBFZooJMf-Mj3SC6wa0xcz6uSO1xz6RGtEK0xqi8GtcxtuAHqzFB6bSEyvWbRlem30sFAn-RfodRQbhiusOfuslPQeajYECHCqLUY__JPfeNUfIPsKggmHn8CNZJo3GSz8k8Q3SFpcdu4BxAOOwN3tuAtZUKsGY9YKYFVlID1kPfgH0TGmces7kZPEblCr9yjD99Ms3v-BMmT-T4yQjJD9oxL_HbGEi6TFC6JG96-mZs3g768xRSy6Ry3wEW0U0zSCUQ3USjAh5PlgS0bFA-rITabS4N7TXOdPmOw_h1b83vwP30GP7JBtHNGpqhu9GtCd__sbzfHP7HF7dSw5zv9yFtWU6Ci8YYFauA0iVKl-ey49qdNcp0w_TUgd9IBX9nPVw932gBT4hWg9S-yLY-JPTF2IO3Unf30IbloBRsBnB_k1qENefFKOmiJEa0iMvPblzeM787mHpWEHYDN9r5AHzpHFgf2jNUi1bBJkbpGqXrr31FG8vGGTV4CG_vWNgX5SqU9WPNe1DMy8ejZtyWAWuBEaVSPzIlxZkuHkOkiJaxvUBMG-7u9nr5cI3d0PTSY4abocMW9sb6sKF23u9j7JEUOul3QzPnpj8p83nxpXMDuEAgYe9JzdUgAPsdYG6Z2-GG8c_eMg6T-wfP-Gcshj70wLgUqKC-GxkKM9sNPWjv3m-_H9XvL1AiS4VNNmpHLnEY0Qq0GyzgZzPgHXuEr9hC6vDO4rvlrz9hY7EDH2MH_Sit0SEQ_MgiC9ze_vbz9uGfP1_9cnvzr-v7bVAJVBBYzAQW8wZLj2j9kheMlWyC3sOwDwWaOzNPyk76KaSyJTXLoa4aKE-6_ti9d4EdY5S_hgogWr0IWfZla5y3wPqp6aX2Y1td4bQe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