[LLDB] eFormatBytesWithASCII output is unintuitive and confusing
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Specifically the "ascii" part. I would expect the latter half to be identical to the output of `eFormatChar`, but it is not. It instead seems to follow `eFormatCharPrintable`, which has the same unintuitive behavior. There are 2 issues:
1. characters are not delimited, making the space character (0x20) "invisible"
2. non-printable characters are printed as a period, presumably due to [this](https://github.com/llvm/llvm-project/blob/22257e8d6ed5600d9c689fecbd17ea68e9d08a6f/lldb/source/Core/DumpDataExtractor.cpp#L51), which can easily be confused with an *actual* period character.
With delimiters (e.g. `eFormatChar` which prints with single quotes: `'a'`) non-printable chars could just be empty single-quotes `''`, and printable periods would no longer be ambiguous. Also, known escape sequences ([these](https://github.com/llvm/llvm-project/blob/22257e8d6ed5600d9c689fecbd17ea68e9d08a6f/lldb/source/Core/DumpDataExtractor.cpp#L173)) should be printed instead of the fallback "non-printable" value.
Contributor guide
Research direction
Start in lldb/source/Core/DumpDataExtractor.cpp at the linked formatting logic and compare the eFormatBytesWithASCII, eFormatChar, and eFormatCharPrintable entry points. Confirm that the ASCII output uses delimiters, represents non-printable characters with empty quotes, and uses the known escape sequences instead of periods; verify the resulting formatting behavior with the relevant LLDB tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100