mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-21 04:25:45 -04:00
![]() Summary: When built w/ `-funsigned-char`, `std::string` becomes equivalent to `std::basic_string<unsigned char>`, causing these formatters to not match. This patch adds overloads for both libstdc++ and libc++ string formatters that accepts unsigned char. Motivated by the following example: ``` $ cat pretty_print.cc template <typename T> void print_val(T s) { std::cerr << s << '\n'; // Set a breakpoint here! } int main() { std::string val = "hello"; print_val(val); return 0; } $ clang++ -stdlib=libc++ -funsigned-char -fstandalone-debug -g pretty_print.cc $ lldb ./a.out -b -o 'b pretty_print.cc:6' -o r -o 'fr v' ... (lldb) fr v (std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char> >) s = { __r_ = { std::__1::__compressed_pair_elem<std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char> >::__rep, 0, false> = { __value_ = { = { __l = (__cap_ = 122511465736202, __size_ = 0, __data_ = 0x0000000000000000) __s = { = (__size_ = '\n', __lx = '\n') __data_ = { [0] = 'h' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' [5] = '\0' ... ``` Reviewers: labath, JDevlieghere, shafik Subscribers: christof, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70517 |
||
---|---|---|
.. | ||
boolreference | ||
compactvectors | ||
data-formatter-advanced | ||
data-formatter-categories | ||
data-formatter-cpp | ||
data-formatter-disabling | ||
data-formatter-enum-format | ||
data-formatter-globals | ||
data-formatter-named-summaries | ||
data-formatter-objc | ||
data-formatter-proper-plurals | ||
data-formatter-ptr-to-array | ||
data-formatter-python-synth | ||
data-formatter-script | ||
data-formatter-skip-summary | ||
data-formatter-smart-array | ||
data-formatter-stl | ||
data-formatter-synth | ||
data-formatter-synthtype | ||
data-formatter-synthval | ||
dump_dynamic | ||
format-propagation | ||
frameformat_smallstruct | ||
hexcaps | ||
language_category_updates | ||
nsarraysynth | ||
nsdictionarysynth | ||
nssetsynth | ||
ostypeformatting | ||
parray | ||
poarray | ||
ptr_ref_typedef | ||
pyobjsynthprovider | ||
refpointer-recursion | ||
setvaluefromcstring | ||
stringprinter | ||
summary-string-onfail | ||
synthcapping | ||
synthupdate | ||
type_summary_list_arg | ||
type_summary_list_script | ||
typedef_array | ||
user-format-vs-summary | ||
var-in-aggregate-misuse | ||
varscript_formatting | ||
vector-types | ||
.categories |