I am trying to define a custom summary for Boosts static_string
class template. Example source file:
#include <boost/static_string/static_string.hpp>
const boost::static_string<5> s{"abc"};
Without any formatters, frame variable -R s
gives me
(boost::static_strings::static_string<5>) s = {
boost::static_strings::detail::static_string_base<5, char, std::__1::char_traits<char> > = {
size_ = '\x03'
data_ = {
[0] = 'a'
[1] = 'b'
[2] = 'c'
[3] = '\0'
[4] = '\0'
[5] = '\0'
}
}
}
I get very close with the builtin formatting for zero-terminated C-strings, i.e., frame variable -f s &s.data_
:
(boost::static_strings::detail::static_string_base<...>::value_type (*)[6]) &data_ = "abc"
but trying to automate that with
type summary add -x "^boost::static_strings::static_string<.+>$" --summary "${&var.data_%s}"
doesn't work (also tried "${var.&data_%s}"
) - the custom format string cannot be parsed. According to the docs, an indirection *var
works with the special var
placeholder, but &
doesn't seem to work (it's also not mentioned in the docs, so that was a wild guess).