forked from qt-creator/qt-creator
Debugger[New CDB]: Add SymbolGroupValue for simple dumping.
This commit is contained in:
@@ -97,6 +97,15 @@ void replace(std::wstring &s, wchar_t before, wchar_t after)
|
||||
s[i] = after;
|
||||
}
|
||||
|
||||
bool endsWith(const std::string &haystack, const char *needle)
|
||||
{
|
||||
const size_t needleLen = strlen(needle);
|
||||
const size_t haystackLen = haystack.size();
|
||||
if (needleLen > haystackLen)
|
||||
return false;
|
||||
return haystack.compare(haystackLen - needleLen, needleLen, needle) == 0;
|
||||
}
|
||||
|
||||
static inline void formatGdbmiChar(std::ostream &str, wchar_t c)
|
||||
{
|
||||
switch (c) {
|
||||
@@ -164,6 +173,18 @@ std::string wStringToString(const std::wstring &w)
|
||||
return rc;
|
||||
}
|
||||
|
||||
std::wstring stringToWString(const std::string &w)
|
||||
{
|
||||
if (w.empty())
|
||||
return std::wstring();
|
||||
const std::wstring::size_type size = w.size();
|
||||
std::wstring rc;
|
||||
rc.reserve(size);
|
||||
for (std::wstring::size_type i = 0; i < size; i++)
|
||||
rc.push_back(w.at(i));
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Format a map as a GDBMI hash {key="value",..}
|
||||
void formatGdbmiHash(std::ostream &os, const std::map<std::string, std::string> &m)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user