forked from qt-creator/qt-creator
Debugger: always hex encode the value of assignments in cdbext
Fixes assigning negative values to locals Change-Id: Ief6e7f47e8e6f0a5d38458396164dfcd24e408a5 Fixes: QTCREATORBUG-17269 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <codecvt>
|
||||
#include <iomanip>
|
||||
|
||||
static const char whiteSpace[] = " \t\r\n";
|
||||
@@ -149,6 +150,11 @@ std::string wStringToString(const std::wstring &w)
|
||||
return rc;
|
||||
}
|
||||
|
||||
std::wstring utf8ToUtf16(const std::string &s)
|
||||
{
|
||||
return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().from_bytes(s.data());
|
||||
}
|
||||
|
||||
// Convert an ASCII hex digit to its value 'A'->10
|
||||
static inline unsigned hexDigit(char c)
|
||||
{
|
||||
@@ -210,6 +216,11 @@ std::string stringFromHex(const char *p, const char *end)
|
||||
return rc;
|
||||
}
|
||||
|
||||
std::string stringFromHex(const std::string &hexEncoded)
|
||||
{
|
||||
return stringFromHex(hexEncoded.c_str(), hexEncoded.c_str() + hexEncoded.size());
|
||||
}
|
||||
|
||||
// Helper for dumping memory
|
||||
std::string dumpMemory(const unsigned char *p, size_t size,
|
||||
bool wantQuotes)
|
||||
|
||||
Reference in New Issue
Block a user