llvm-addr2line
时间: 2023-07-21 17:06:52 浏览: 314
`llvm-addr2line` is a command-line tool that is part of the LLVM toolchain. It is used to translate program addresses into file names and line numbers. When a program is compiled with debug information (not stripped), it contains additional metadata that can be used for debugging purposes.
By using `llvm-addr2line`, you can provide an address from a program's executable or shared library and get information about the corresponding source file name and line number where that address is located in the source code.
Here's an example usage of `llvm-addr2line`:
```
llvm-addr2line -f -e program_executable 0x12345678
```
In this example, `-f` is used to display the source file name and line number, and `-e` is used to specify the program executable. `0x12345678` is the address you want to translate.
Please note that `llvm-addr2line` is just one of the tools available for this purpose. There are other similar tools like `addr2line` (part of the GNU Binutils) that serve the same purpose on different platforms.
阅读全文