You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch adds another frame-format variable (currently only implemented in the CPlusPlus language plugin) that represents the "suffix" of a function. The name is derived from the DotSuffix node of LLVM's Itanium demangler.
For a function name such as `int foo() (.cold)`, the suffix would be `(.cold)`.
Copy file name to clipboardExpand all lines: lldb/docs/use/formatting.rst
+7-4
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,8 @@ A complete list of currently supported format string variables is listed below:
106
106
| ``function.return-right`` | The return type to the right of the demangled function name of the current function. This depends on the frame's language. In ``void ns::foo(int)`` there is no ``function.return-right`` so this would correspond to an empty string. However, in some cases, particularly for functions |
107
107
|| returning function pointers, part of the return type is to the right of the function name. E.g., for ``void (*ns::func(float))(int)`` the ``function.return-left`` would be ``void (*`` and the ``function.return-right`` would be ``)(int)``. |
| ``function.suffix`` | Any suffix added to the demangled function name of the current function. This depends on the frame's language. E.g., for C++ the suffix for ``void ns::foo(int) (.cold)`` is '(.cold). |
| ``function.pc-offset`` | The program counter offset within the current function or symbol |
@@ -329,26 +331,27 @@ The function names displayed in backtraces/``frame info``/``thread info`` are th
329
331
- ``${function.formatted-arguments}``
330
332
- ``${function.qualifiers}``
331
333
- ``${function.return-right}``
334
+
- ``${function.suffix}``
332
335
333
336
Each language plugin decides how to handle these variables. For C++, LLDB uses these variables to dictate how function names are formatted. This can be customized using the ``plugin.cplusplus.display.function-name-format`` LLDB setting.
334
337
335
338
E.g., the following setting would reconstruct the entire function name (and is LLDB's default):
336
339
337
340
::
338
341
339
-
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.return-left}${function.scope}${function.basename}${function.template-arguments}${function.formatted-arguments}${function.qualifiers}${function.return-right}"
342
+
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.return-left}${function.scope}${function.basename}${function.template-arguments}${function.formatted-arguments}${function.qualifiers}${function.return-right}${function.suffix}"
340
343
341
-
If a user wanted to omit the return type and template arguments of C++ function names one could do:
344
+
If a user wanted to only print the name and arguments of a C++ function one could do:
342
345
343
346
::
344
347
345
-
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.scope}${function.basename}${function.formatted-arguments}${function.qualifiers}"
348
+
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.scope}${function.basename}${function.formatted-arguments}"
346
349
347
350
348
351
Then the following would highlight just the basename in green:
349
352
350
353
::
351
354
352
-
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.scope}${ansi.fg.yellow}${function.basename}${ansi.normal}${function.formatted-arguments}${function.qualifiers}"
355
+
(lldb) settings set plugin.cplusplus.dislpay.function-name-format "${function.scope}${ansi.fg.yellow}${function.basename}${ansi.normal}${function.formatted-arguments}"
353
356
354
357
The ``${function.name-with-args}`` by default asks the language plugin whether it supports a language-specific ``function-name-format`` (e.g., the ``plugin.cplusplus.display.function-name-format`` for C++), and if it does, uses it. Otherwise it will display the demangled function name.
0 commit comments