blob: 6793a11c5bd9ca93a799e53c4e56980ee82deb3f [file] [log] [blame]
%define STRING_EXTENSION_LEVEL(Class, Level)
%extend {
std::string lldb:: ## Class ## ::__str__(){
lldb::SBStream stream;
$self->GetDescription (stream, Level);
const char *desc = stream.GetData();
size_t desc_len = stream.GetSize();
if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
--desc_len;
}
return std::string(desc, desc_len);
}
}
%enddef
%define STRING_EXTENSION(Class)
%extend {
std::string lldb:: ## Class ## ::__str__(){
lldb::SBStream stream;
$self->GetDescription (stream);
const char *desc = stream.GetData();
size_t desc_len = stream.GetSize();
if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
--desc_len;
}
return std::string(desc, desc_len);
}
}
%enddef