[all-commits] [llvm/llvm-project] cebf86: [lldb][Format] Make function name frame-format var...

Michael Buch via All-commits all-commits at lists.llvm.org
Mon Apr 28 02:46:25 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cebf86eb1de163faaf5f9781f6bbded70dc1f9f0
      https://github.com/llvm/llvm-project/commit/cebf86eb1de163faaf5f9781f6bbded70dc1f9f0
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  Changed paths:
    M lldb/source/Core/FormatEntity.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
    M lldb/test/Shell/Settings/TestFrameFormatFunctionBasename.test
    M lldb/test/Shell/Settings/TestFrameFormatFunctionFormattedArguments.test
    M lldb/test/Shell/Settings/TestFrameFormatFunctionQualifiers.test
    M lldb/test/Shell/Settings/TestFrameFormatFunctionReturn.test
    M lldb/test/Shell/Settings/TestFrameFormatFunctionScope.test
    M lldb/test/Shell/Settings/TestFrameFormatFunctionTemplateArguments.test

  Log Message:
  -----------
  [lldb][Format] Make function name frame-format variables work without debug-info (#137408)

This patch makes the frame-format variables introduced in
https://github.com/llvm/llvm-project/pull/131836 also work when no
debug-info is available. Previously, we assumed `sc.function` was
available, but without debug-info we might only have `sc.symbol`. We
don't really need the `sc.function` apart from when formatting
arguments.

For the function arguments case I added a fallback that will just print
the arguments we get from the demangler (which is what LLDB does for
stacktraces with no debug-info anyway). Ideally we'd have a separate
`FormatEntity::Entry::Type::FunctionArguments` that will just print the
arguments from the demangler and have something like the following in
the `plugin.cplusplus.display.function-name-format`:
```
{ ${function.formatted-arguments} || ${function.arguments} }
```
I.e., when we can't format the arguments, print the ones from the
demangler. But we currently don't have the `||` operator in the
frame-format language yet.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list