From da61e6d2fb0421f02c1205649e9ceacf0312f355 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike Date: Thu, 5 Jun 2025 12:58:59 +0100 Subject: [PATCH 1/3] [symbolizer] Update Release notes. Also add post-commit changes from commit #71ba852 --- llvm/docs/CommandGuide/llvm-addr2line.rst | 3 +++ llvm/docs/ReleaseNotes.md | 1 + llvm/test/tools/llvm-symbolizer/symbol-search.test | 2 +- llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/docs/CommandGuide/llvm-addr2line.rst b/llvm/docs/CommandGuide/llvm-addr2line.rst index 646a159cd24a6..49faa3c5e811e 100644 --- a/llvm/docs/CommandGuide/llvm-addr2line.rst +++ b/llvm/docs/CommandGuide/llvm-addr2line.rst @@ -36,6 +36,9 @@ Here are some of those differences: - ``llvm-addr2line`` parses options from the environment variable ``LLVM_ADDR2LINE_OPTS`` instead of from ``LLVM_SYMBOLIZER_OPTS``. +- ``llvm-addr2line`` accepts an address with a '+' prefix ie `+0x00777fff` + this is not valid in ``llvm-symbolizer`` + SEE ALSO -------- diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md index 7d734f2e258e6..280744aaf780f 100644 --- a/llvm/docs/ReleaseNotes.md +++ b/llvm/docs/ReleaseNotes.md @@ -265,6 +265,7 @@ Changes to the LLVM tools * llvm-strip now supports continuing to process files on encountering an error. * In llvm-objcopy/llvm-strip's ELF port, `--discard-locals` and `--discard-all` now allow and preserve symbols referenced by relocations. ([#47468](https://github.com/llvm/llvm-project/issues/47468)) +* llvm-addr2line now supports a `+` prefix when specifying an address. Changes to LLDB --------------------------------- diff --git a/llvm/test/tools/llvm-symbolizer/symbol-search.test b/llvm/test/tools/llvm-symbolizer/symbol-search.test index b785cf1596fad..bb07c54e100b5 100644 --- a/llvm/test/tools/llvm-symbolizer/symbol-search.test +++ b/llvm/test/tools/llvm-symbolizer/symbol-search.test @@ -66,7 +66,7 @@ RUN: llvm-addr2line --obj=%p/Inputs/symbols.so func_01+0A | FileCheck --check-pr # If '+' is not preceded by a symbol, it is part of a symbol name, not an offset separator. RUN: llvm-symbolizer --obj=%p/Inputs/symbols.so +0x1138 | FileCheck --check-prefix=NONEXISTENT %s -# in addr2line address starting with a `+` sign is a valid address +# In addr2line address starting with a `+` sign is a valid address. RUN: llvm-addr2line --obj=%p/Inputs/symbols.so +0x1138 | FileCheck --check-prefix=CODE-CMD %s # Show that C++ mangled names may be specified. diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp index a682a0762c393..4784dafeb2948 100644 --- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp +++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp @@ -238,7 +238,7 @@ static Error parseCommand(StringRef BinaryName, bool IsAddr2Line, bool StartsWithDigit = std::isdigit(AddrSpec.front()); // GNU addr2line assumes the address is hexadecimal and allows a redundant - // "0x" or "0X" prefix or with an optional `+` sign; do the same for + // "0x", "0X" prefix or an optional `+` sign; do the same for // compatibility. if (IsAddr2Line) { AddrSpec.consume_front_insensitive("0x") || From e1e2d8d11ecfd11644e2dcd47888adc0c699bf06 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike Date: Fri, 6 Jun 2025 11:43:26 +0100 Subject: [PATCH 2/3] [symbolizer] Add review changes. --- llvm/docs/CommandGuide/llvm-addr2line.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/docs/CommandGuide/llvm-addr2line.rst b/llvm/docs/CommandGuide/llvm-addr2line.rst index 49faa3c5e811e..f076b959c3ab9 100644 --- a/llvm/docs/CommandGuide/llvm-addr2line.rst +++ b/llvm/docs/CommandGuide/llvm-addr2line.rst @@ -36,8 +36,8 @@ Here are some of those differences: - ``llvm-addr2line`` parses options from the environment variable ``LLVM_ADDR2LINE_OPTS`` instead of from ``LLVM_SYMBOLIZER_OPTS``. -- ``llvm-addr2line`` accepts an address with a '+' prefix ie `+0x00777fff` - this is not valid in ``llvm-symbolizer`` +- ``llvm-addr2line`` accepts an address with a '+' prefix e.g. `+0x00777fff`. + this is treated as a symbol name by ``llvm-symbolizer`` SEE ALSO -------- From eaa733c6a1de35a192d5dfc3d13d02ed2689b19b Mon Sep 17 00:00:00 2001 From: Ebuka Ezike Date: Fri, 6 Jun 2025 11:51:25 +0100 Subject: [PATCH 3/3] Update llvm/docs/CommandGuide/llvm-addr2line.rst Co-authored-by: James Henderson --- llvm/docs/CommandGuide/llvm-addr2line.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/docs/CommandGuide/llvm-addr2line.rst b/llvm/docs/CommandGuide/llvm-addr2line.rst index f076b959c3ab9..999b3e0d7e6aa 100644 --- a/llvm/docs/CommandGuide/llvm-addr2line.rst +++ b/llvm/docs/CommandGuide/llvm-addr2line.rst @@ -36,8 +36,8 @@ Here are some of those differences: - ``llvm-addr2line`` parses options from the environment variable ``LLVM_ADDR2LINE_OPTS`` instead of from ``LLVM_SYMBOLIZER_OPTS``. -- ``llvm-addr2line`` accepts an address with a '+' prefix e.g. `+0x00777fff`. - this is treated as a symbol name by ``llvm-symbolizer`` +- ``llvm-addr2line`` accepts an address with a '+' prefix, e.g. `+0x00777fff`. + This is treated as a symbol name by ``llvm-symbolizer``. SEE ALSO --------