llvm-capstone/lldb/bindings/macros.swig
Alex Langford fc28560fd6 [lldb][NFCI] Remove unused swig macros
These should have been removed in 662548c826.
2023-04-25 16:47:00 -07:00

30 lines
819 B
Plaintext

%define STRING_EXTENSION_LEVEL_OUTSIDE(Class, Level)
%extend lldb:: ## Class ## {
std::string __repr__(){
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_OUTSIDE(Class)
%extend lldb:: ## Class ## {
std::string __repr__(){
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