[Lldb-commits] [lldb] [lldb] Support custom printf formatting for variables (PR #81196)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 8 16:17:23 PST 2024


jimingham wrote:

The way the current FormatEntity strings work, the first `%` says "formatter coming next" then say `S` is "the kind of formatter" (in this case "return summary instead of value".  So in your case, like:

    ${var%%1x}

The "kind of formatter" is "%" which seems like a reasonable name for "printf format string following".  To be entirely strict, if the data following the "kind" is the format string, this should be:

    ${var%%%1x}

but that's kind of silly.  I think it's fine to say the format kind `%` means `printf formatting string`, and then the data is everything after the % in a printf formatting string.

If you didn't like the two percents, you could do this by having `p` be the format kind that meant `printf formatting string` but I'm not sure that would gain much.

This seems fine to me.



https://github.com/llvm/llvm-project/pull/81196


More information about the lldb-commits mailing list