> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man1/llvm-addr2line.1.md).

# addr2line.1

`llvm-addr2line` — a drop-in replacement for addr2line

## 名称

`llvm-addr2line`

## 概要

`llvm-addr2line [options]`

## 描述

`llvm-addr2line` 是 [llvm-symbolizer(1)](https://github.com/FreeBSD-Ask/freebsd-man-sc/blob/main/man1/llvm-symbolizer.1.md) 工具的别名，但使用了不同的默认值。其目标是成为 GNU 的 addr2line 的直接替代品。

下面列出部分差异：

* `llvm-addr2line` 将所有地址解释为十六进制，并忽略可选的 `0x` 前缀；而 `llvm-symbolizer` 会尝试根据字面量的前缀来确定进制，在没有前缀时默认按十进制处理。
* `llvm-addr2line` 默认不打印函数名。使用 `-f` 可启用该功能。
* `llvm-addr2line` 默认不对函数名进行解符号化（demangle）。使用 `-C` 可开启解符号化。
* `llvm-addr2line` 默认不打印内联帧。使用 `-i` 可显示内联函数中某个源代码位置的内联帧。
* `llvm-addr2line` 默认使用 `--output-style=GNU`。
* `llvm-addr2line` 从环境变量 `LLVM_ADDR2LINE_OPTS` 而非 `LLVM_SYMBOLIZER_OPTS` 解析选项。

## 参见

[llvm-symbolizer(1)](https://github.com/FreeBSD-Ask/freebsd-man-sc/blob/main/man1/llvm-symbolizer.1.md)

## 作者

由 LLVM Team (<https://llvm.org/>) 维护。

## 版权

2003-2023, LLVM Project


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man1/llvm-addr2line.1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
